Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Does buffer number matter in ID3D11DeviceContext::PSSetConstantBuffers()?

$
0
0
Does buffer number matter in ID3D11DeviceContext::PSSetConstantBuffers()? I added 5 or six constant buffers to my framework, and later realized I had set the buffer number parameter to either 0 or 1 in all of them - but they still all worked! Curious why that is, and should they be set up to correspond to the number of constant buffers? Similarly, inside the buffer structs used to pass info into the hlsl shader, I added padding inside the c++ struct to make a struct containing a float3 be 16 bytes, but in the declaration of the same struct inside the hlsl shader file, it was missing the padding value - and it still worked! Do they need to be consistent or not? Thanks. struct CameraBufferType { XMFLOAT3 cameraPosition; float padding; };

Viewing all articles
Browse latest Browse all 17825

Trending Articles