Friday, July 17, 2015

c++ - DirectX 11 Constant Buffers vs Effect Framework


I'm having some trouble understanding the differences between using constant buffers or using the effect framework of DirectX11 for updating shader constants.


From what I understand they both do exactly the same thing, although from reading the documentation it appears as if using effects is meant to be 'easier'. However they seem the same to me, one uses VSSetConstantBuffers and the other GetConstantBufferByName.


Is there something I'm missing here?



Answer




Effect interface has always been the highest level shader-related interface. Most probably the Effect interface simply abstracts away some of the problems in dealing with constant buffers but it also uses them under the hood.


Whether the API is actually easier could probably be a question of requirements. If you want to build a very simple application, the effect interface might prove itself useful. However, if a more sophisticated engine is what you actually need then the Effect interface could probably even slow down the development and impose restrictions on some of the required optimizations.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...