Aulaulz
Aulaulz

Reputation: 469

c++ DirectX 11 glGetUniformLocation equivalent

Is there an equivalent to glGetUniformLocation equivalent in DirectX 11?

If no, how do you handle shaders in your code? Setting every layouts manually is not funny, and can cause mistakes easily. To handle this I created a class to parse shader files, and create the appropriate layout with this. But this sounds wild.

Upvotes: 2

Views: 492

Answers (1)

JarkkoL
JarkkoL

Reputation: 1918

You use D3DReflect() to get reflection interface (ID3D11ShaderReflection) for given shader byte code. Check ID3D11ShaderReflection::GetResourceBindingDescByName() for querying specific uniform binding point.

Upvotes: 3

Related Questions