ID3D11ShaderReflection

Started by
1 comment, last by MJP 11 years, 3 months ago

Hi,

My question is still simple.

I'm on the way to find a good solution to have shader class who works on all side (OpenGL/D3D11).

I have found an article on msdn who speak about ID3D11ShaderReflection.

I would use it to find uniform block by name to have ID, like that on openGL, same process.

Is ID3D11ShaderReflection slow ?

Thanks

Advertisement

I don't know how fast it is, but I'm sure it wasn't designed with speed in mind. It's more the kind of thing you want to run once over your shader to get the information you need, then store that in your own data for use at runtime as necessary. I wouldn't use it in your render loop, it's more of a tooling library for inspecting the shader code.

I can tell you from personal experience that obtaining the reflection interface for a shader is not a particularly quick operation. I don't think accessing it is unusually slow once you've obtained it, but I agree with rdragon that the best practice is to only access it once and store the data you need in whatever format makes sense for your game or app. You can even do it in an offline process if you want, which is actually how you have to do it if you want to target non-desktop platforms.

This topic is closed to new replies.

Advertisement