I have an shader (in .fx
file) that has parts like that (which are using SAS):
cbuffer UpdatePerObject : register(b1)
{
float4x4 worldViewIT : WorldViewInverseTranspose < string UIWidget = "MyName"; >;
float4x4 world : World < string UIWidget = "None"; >;
};
I am using DirectX 11 and my program is in C++.
Different shaders will need different matrices, textures, etc. I want to set them to those shaders based on their semantics & annotations.
I can do it by simply parsing the .fx
file by hand and looking for : ... <...>
pattern. Or maybe DirectX 11 API has some dedicated methods or approach for that.
Additional reading of all shaders by hand to look for semantics & annotations looks like a little over-kill.