Advertisement

Resource synchronization

Started by October 03, 2017 06:51 PM
3 comments, last by _void_ 7 years, 4 months ago

Hi guys!

 

I have to run custom pixel shader to clear RTV (draw call 1).

After that I run another pixel shader on that RTV to render objects (draw call 2).

Do I need to insert resource barrier between two draw calls provided that RTV is already in render target state?

 

The same thing with UAV. I run custom compute shader to clear UAV and then run another compute shader to do actual calculations.

Do I need resource barrier between these two draw calls?

 

Thanks!

 

I might be wrong here but no resource barrier for the RTV and yes to a UAV barrier for the UAV's in consecutive compute shader invocations.

Someone correct me if I'm wrong.

Oh and the only reason I think its no to the RTV is because your using the graphic pipeline.

@MJP  Could you describe the ordering constraints on the regular graphic pipeline?  I remember you mentioning them once.

-potential energy is easily made kinetic-

Advertisement

The only guaranteed synchronization points in the graphics pipeline are that stream output and the output merger (RTV/DSV writes) are guaranteed to happen in sequence (per pixel for OM) from draw to draw. So writing to an RTV in draw 1, and then again in draw 2, those render target writes are guaranteed to happen in order. But within the pixel shader itself, there's no guarantee of ordering - unless you use ROVs instead of UAVs.

To enforce ordering of UAVs from draw to draw, you can use a UAV barrier. This ensures ALL UAV writes from draw/dispatch 1 are done before draw/dispatch 2 can start, which is more heavyweight than ROVs.

@Infinisearch@SoldierOfLight

Great! Thank you for clarifying the things!

This topic is closed to new replies.

Advertisement