I would like to know if there's any way I can attach application-specific metadata to my global variables in HLSL shaders. I know that HLSL supports annotations on global variables, but I can't find any way of reading those annotations (presumably via the reflection API) without using the Effects Framework, which my application doesn't use. Is there any way of attaching application-specific metadata to global variables in HLSL? (Preferably without inferring special meaning from the variables' names.)
Use case: I want my application to be able to detect whether a float4
global is being used as a color or as a simple 4-float vector. In the case where it's a color, the application would display the variable using a color-picker in the UI.