XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

RAW hazard detection handled automatically in DX10?

Last post 5/25/2007 12:37 PM by digitalcrius. 2 replies.
  • 5/25/2007 11:24 AM

    RAW hazard detection handled automatically in DX10?

    Hi,

    Is there any explicit mechanism in DX 10 to prevent a resource read-after-write hazard?

    For instance I am rendering a first batch of primitives specifying a texture render target, then I am using the texture as a shader resource to draw another bunch of primitives that are using the texture in the pixel shader. It seems that my application works irrespective of me binding the texture as a shader resource before the first batch is drawn or binding it just before drawing batch 2. Thinking that the HW pipeline is at least tenths of stages deep and can be a degree of overlap between the two drawings, my question is if the hazard detection happens automatically or do I have to do something about (flush the pipeline) and I am just lucky to have my app working?

    Any answer will be appreciated (as any pointer in the DX10 documentation to shed some light on this issue),

    Dan

  • 5/25/2007 11:48 AM In reply to

    Re: RAW hazard detection handled automatically in DX10?

    Well the hardware is responsible to make sure that it doesn’t already read data that have still unwritten changes from a prior batch. So you don’t need to care about this but you could help the hardware if you give it some other work after you have written to a texture before you read from it.

    But there is another thing you have to take care. Direct3D 10 doesn’t allow it to use the same resource as read source and write target at the same time. Therefore it will not bind a resource as Input as long as it is bind as an output. To use a current target as input for the next batch you first need to bind another target and then set it as input. If you do it the other way it will not work.

  • 5/25/2007 12:37 PM In reply to

    Re: RAW hazard detection handled automatically in DX10?

    Thanks
Page 1 of 1 (3 items) Previous Next