Question

What is the difference between using SetRawValue() to change values in the shader code, and just updating constant buffers? The example code in my book updates each variable of a constant buffer using SetRawValue(), but I don't see why the author didn't just update the constant buffer with UpdateSubresource().

Was it helpful?

Solution

SetRawValue is part of the effects (.fx) support that since DX11 now sits outside of the main code and is supplied as source wrappers that can be used instead of coding directly to constant buffers etc. It offers some degree of backward compatibility with older code and gives a higher level of abstraction but, underneath it all, it is updating constant buffers anyway.

There is a discussion under a similar question on GameDev that gives more details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top