mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-14 13:51:04 +00:00
8ffc36aecc
- Add new queries: TProgram::getUniformTType and getUniformBlockTType, which return a const TType*, or nullptr on a bad index. These are valid for any source language. - Interface name for HLSL cbuffers is taken from the (only) available declaration name, whereas before it was always an empty string, which caused some troubles with reflection mapping them all to the same index slot. This also makes it appear in the SPIR-V binary instead of an empty string. - Print the binding as part of the reflection textual dump. - TType::clone becomes const. Needed to call it from a const method, and anyway it doesn't change the object it's called on. - Because the TObjectReflection constructor is called with a TType *reference* (not pointer) so that it's guaranteed to pass in a type, and the "badReflection" value should use a nullptr there, that now has a dedicated static method to obtain the bad value. It uses a private constructor, so external users can't create one with a nullptr type.
35 lines
640 B
GLSL
35 lines
640 B
GLSL
|
|
uniform float u1 : register(b2);
|
|
|
|
uniform SamplerState s1 : register(s5);
|
|
uniform SamplerState s1a[3] : register(s6);
|
|
|
|
uniform Texture1D t1 : register(t15);
|
|
uniform Texture1D t1a[3] : register(t16);
|
|
|
|
cbuffer cbuff1 : register(b2) {
|
|
float4 c1_a;
|
|
int c1_b;
|
|
float c1_c;
|
|
};
|
|
|
|
cbuffer cbuff2 : register(b3) {
|
|
float4 c2_a;
|
|
int c2_b;
|
|
float c2_c;
|
|
};
|
|
|
|
struct PS_OUTPUT
|
|
{
|
|
float4 Color : Sv_Target0;
|
|
};
|
|
|
|
void main(out PS_OUTPUT psout)
|
|
{
|
|
psout.Color =
|
|
t1.Sample(s1, 0.3) +
|
|
t1a[0].Sample(s1a[0], 0.3) +
|
|
c1_a + c1_b + c1_c +
|
|
c2_a + c2_b + c2_c;
|
|
}
|