Changing Direct3D state

Started by
4 comments, last by ajithk 8 years, 1 month ago
Hello guys,

immediateContext->OMSetRenderTargets(1,&renderTargetView,dsv);
immediateContext->UpdateSubresource(buffer,0,NULL,data,0,0);

The above code works, but if I reverse those statements it draws blank. I don't know even what to ask. All right, I will do my best.

Is there a particular sequence in which I need to change state in D3D11. Like for example, if I am setting buffers, shader resources etc should I do all those after shaders are attached to pipeline? Or before? If only I know what the driver is doing inside. Does the question make any sense :(
Advertisement
Most, if not all, state changes can be called in arbitrary order.

Niko Suni

Does "buffer" have any connection to the resources used by your RTV or DSV?

Hi Hodgman,

No, they are unrelated. But I myself feel that the question is too vague for you guys to help me without looking at the code. Anyway, I will observe this issue further in my code and see if I can zero in it exactly.

@Nik02. Yeah. I hope so.

Thanks, guys

But I myself feel that the question is too vague for you guys to help me without looking at the code. Anyway, I will observe this issue further in my code and see if I can zero in it exactly.

Try this:

1. Add D3D11_CREATE_DEVICE_DEBUG flag on device creation (D3D11CreateDevice)

2. In debug mode, hit F5 (debugging)

Probably you will see errors in Visual Studio output window.

@Hodgeman

Sorry friend, What I said earlier is wrong. That 'buffer' did have a connection. Maybe that's the reason.

@Happy SDE

I did that. There are several lines like 'Loaded 'C\Windows\SysWoW64\blahblah.dll,' Cannot find or open the PDB file' .But other than that everything is fine though. They did not affect my output.

This topic is closed to new replies.

Advertisement