Hello once again,
I'm performing a bunch of Dispatch() calls but I'm not getting the correct result out of them. I used the VS GraphicsDebuffer , and for some reason, the compute shader of each of the Dispatch call is the same!
So If I have:
// mat1, mat2 and mat3 have different PSO and RootSignatures
renderPlarform->ApplyMaterial(mat1);
renderPlatform->Dispath(...);
renderPlarform->ApplyMaterial(mat2);
renderPlatform->Dispath(...); // <- using mat1 compute shader!
renderPlarform->ApplyMaterial(mat3);
renderPlatform->Dispath(...); // <- using mat1 compute shader!
Could anyone shed some light on this problem?
I wan't to add a question that may be related with this problem. I'm using this "problematic dispatches" to write to a Resource. So each Dispatch will take a few SRV as inputs and will write to an UAV. Following Dispatches will take the resultant UAV as input (SRV).
Texture FooTex1, FooTex2;
Texture Mat1Out,Mat2Out;
// mat1
Inputs: (SRV)FooTex1, (SRV)FooTex2
Outputs: (UAV) Mat1Out
// mat2
Inputs: (SRV)FooTex1, (SRV)FooTex2, (SRV) Mat1Out
Outputs: (UAV) Mat2Out
// etc.
Currently I'm adding (transition) barriers between UAV<->SRV.
Should I add (uav) barriers to make sure writing to the UAV is done? As far as I understand from the MSDN Doc , "all unordered access view (UAV) accesses (reads or writes) must complete before any future UAV accesses (read or write) can begin" I don't need it as I'm not doing further UAV read/write.
Thanks