hi,
i have read very much about the binding of a constantbuffer to a shader but something is still unclear to me.
e.g. when performing : vertexshader.setConstantbuffer ( buffer, slot )
is the buffer bound
a. to the VertexShaderStage
or
b. to the VertexShader that is currently set as the active VertexShader
Is it possible to bind a constantBuffer to a VertexShader e.g. VS_A and keep this binding even after the active VertexShader has changed ?
I mean i want to bind constantbuffer_A to VS_A, an Constantbuffer_B to VS_B and only use updateSubresource without using setConstantBuffer command every time.
Look at this example:
SetVertexShader ( VS_A )
updateSubresource(buffer_A)
vertexshader.setConstantbuffer ( buffer_A, slot_A )
perform drawcall ( buffer_A is used )
SetVertexShader ( VS_B )
updateSubresource(buffer_B)
vertexshader.setConstantbuffer ( buffer_B, slot_A )
perform drawcall ( buffer_B is used )
SetVertexShader ( VS_A )
perform drawcall (now which buffer is used ??? )
I ask this question because i have made a custom render engine an want to optimize to
the minimum updateSubresource, and setConstantbuffer calls