Directx 11 With C++: Difference between using constant buffers and SetRawValue()?

StackOverflow https://stackoverflow.com/questions/23534564

  •  17-07-2023
  •  | 
  •  

سؤال

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().

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top