HLSL: Have loose uniforms also go through the makeTypeNonIo() path.

This commit is contained in:
John Kessenich
2017-02-03 14:06:36 -07:00
parent 2c5ab9c8fc
commit 88c4464df5
6 changed files with 21 additions and 14 deletions

View File

@@ -87,7 +87,7 @@ gl_FragCoord origin is upper left
0:35 move second child to first child (temp 4-element array of float)
0:35 'local_float_array' (temp 4-element array of float)
0:35 g_floats: direct index for structure (layout(offset=384 ) uniform 4-element array of float)
0:35 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-element array of 3X3 matrix of float g_mats, layout(binding=10 offset=192 ) uniform 4-element array of 3X3 matrix of float g_mats_explicit, layout(offset=384 ) uniform 4-element array of float g_floats})
0:35 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-element array of 3X3 matrix of float g_mats, layout(offset=192 ) uniform 4-element array of 3X3 matrix of float g_mats_explicit, layout(offset=384 ) uniform 4-element array of float g_floats})
0:35 Constant:
0:35 2 (const uint)
0:37 move second child to first child (temp 4-component vector of float)
@@ -165,7 +165,7 @@ gl_FragCoord origin is upper left
0:? 'g_samp_explicit[0]' (layout(binding=5 ) uniform sampler)
0:? 'g_samp_explicit[1]' (layout(binding=6 ) uniform sampler)
0:? 'g_samp_explicit[2]' (layout(binding=7 ) uniform sampler)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-element array of 3X3 matrix of float g_mats, layout(binding=10 offset=192 ) uniform 4-element array of 3X3 matrix of float g_mats_explicit, layout(offset=384 ) uniform 4-element array of float g_floats})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-element array of 3X3 matrix of float g_mats, layout(offset=192 ) uniform 4-element array of 3X3 matrix of float g_mats_explicit, layout(offset=384 ) uniform 4-element array of float g_floats})
0:? 'not_flattened_a' (global 5-element array of int)
0:? 'color' (layout(location=0 ) out 4-component vector of float)
@@ -261,7 +261,7 @@ gl_FragCoord origin is upper left
0:35 move second child to first child (temp 4-element array of float)
0:35 'local_float_array' (temp 4-element array of float)
0:35 g_floats: direct index for structure (layout(offset=384 ) uniform 4-element array of float)
0:35 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-element array of 3X3 matrix of float g_mats, layout(binding=10 offset=192 ) uniform 4-element array of 3X3 matrix of float g_mats_explicit, layout(offset=384 ) uniform 4-element array of float g_floats})
0:35 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-element array of 3X3 matrix of float g_mats, layout(offset=192 ) uniform 4-element array of 3X3 matrix of float g_mats_explicit, layout(offset=384 ) uniform 4-element array of float g_floats})
0:35 Constant:
0:35 2 (const uint)
0:37 move second child to first child (temp 4-component vector of float)
@@ -339,7 +339,7 @@ gl_FragCoord origin is upper left
0:? 'g_samp_explicit[0]' (layout(binding=5 ) uniform sampler)
0:? 'g_samp_explicit[1]' (layout(binding=6 ) uniform sampler)
0:? 'g_samp_explicit[2]' (layout(binding=7 ) uniform sampler)
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-element array of 3X3 matrix of float g_mats, layout(binding=10 offset=192 ) uniform 4-element array of 3X3 matrix of float g_mats_explicit, layout(offset=384 ) uniform 4-element array of float g_floats})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-element array of 3X3 matrix of float g_mats, layout(offset=192 ) uniform 4-element array of 3X3 matrix of float g_mats_explicit, layout(offset=384 ) uniform 4-element array of float g_floats})
0:? 'not_flattened_a' (global 5-element array of int)
0:? 'color' (layout(location=0 ) out 4-component vector of float)

View File

@@ -13,11 +13,11 @@ gl_FragCoord origin is upper left
0:10 component-wise multiply (temp 4-component vector of float)
0:10 'input' (in 4-component vector of float)
0:10 AmbientColor: direct index for structure (layout(offset=0 ) uniform 4-component vector of float)
0:10 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float AmbientColor, layout(offset=16 ) uniform bool Face ff1, layout(offset=20 ) uniform float ff2, layout(binding=0 offset=32 ) uniform 4-component vector of float ff3, layout(binding=1 offset=48 ) uniform 4-component vector of float ff4})
0:10 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float AmbientColor, layout(offset=16 ) uniform bool ff1, layout(offset=20 ) uniform float ff2, layout(offset=32 ) uniform 4-component vector of float ff3, layout(offset=48 ) uniform 4-component vector of float ff4})
0:10 Constant:
0:10 0 (const uint)
0:? Linker Objects
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float AmbientColor, layout(offset=16 ) uniform bool Face ff1, layout(offset=20 ) uniform float ff2, layout(binding=0 offset=32 ) uniform 4-component vector of float ff3, layout(binding=1 offset=48 ) uniform 4-component vector of float ff4})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float AmbientColor, layout(offset=16 ) uniform bool ff1, layout(offset=20 ) uniform float ff2, layout(offset=32 ) uniform 4-component vector of float ff3, layout(offset=48 ) uniform 4-component vector of float ff4})
Linked fragment stage:
@@ -35,11 +35,11 @@ gl_FragCoord origin is upper left
0:10 component-wise multiply (temp 4-component vector of float)
0:10 'input' (in 4-component vector of float)
0:10 AmbientColor: direct index for structure (layout(offset=0 ) uniform 4-component vector of float)
0:10 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float AmbientColor, layout(offset=16 ) uniform bool Face ff1, layout(offset=20 ) uniform float ff2, layout(binding=0 offset=32 ) uniform 4-component vector of float ff3, layout(binding=1 offset=48 ) uniform 4-component vector of float ff4})
0:10 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float AmbientColor, layout(offset=16 ) uniform bool ff1, layout(offset=20 ) uniform float ff2, layout(offset=32 ) uniform 4-component vector of float ff3, layout(offset=48 ) uniform 4-component vector of float ff4})
0:10 Constant:
0:10 0 (const uint)
0:? Linker Objects
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float AmbientColor, layout(offset=16 ) uniform bool Face ff1, layout(offset=20 ) uniform float ff2, layout(binding=0 offset=32 ) uniform 4-component vector of float ff3, layout(binding=1 offset=48 ) uniform 4-component vector of float ff4})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform 4-component vector of float AmbientColor, layout(offset=16 ) uniform bool ff1, layout(offset=20 ) uniform float ff2, layout(offset=32 ) uniform 4-component vector of float ff3, layout(offset=48 ) uniform 4-component vector of float ff4})
// Module Version 10000
// Generated by (magic number): 80001
@@ -62,7 +62,6 @@ gl_FragCoord origin is upper left
Name 17 ""
MemberDecorate 15($Global) 0 Offset 0
MemberDecorate 15($Global) 1 Offset 16
MemberDecorate 15($Global) 1 BuiltIn FrontFacing
MemberDecorate 15($Global) 2 Offset 20
MemberDecorate 15($Global) 3 Offset 32
MemberDecorate 15($Global) 4 Offset 48

View File

@@ -111,7 +111,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:? 'input' (layout(location=0 ) in 4-component vector of float)
0:? 's' (layout(location=1 ) in structure{smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, layout(offset=4 ) temp bool ff2, layout(binding=0 offset=4 ) temp bool ff3, layout(binding=0 offset=4 ) temp 4-component vector of float ff4})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d} s1, layout(binding=5 offset=1620 ) uniform float ff5, layout(binding=8 offset=1636 ) uniform float ff6})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d} s1, layout(offset=48 ) uniform float ff5, layout(offset=52 ) uniform float ff6})
0:? 's_ff1' (in bool Face)
@@ -226,7 +226,7 @@ gl_FragCoord origin is upper left
0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float)
0:? 'input' (layout(location=0 ) in 4-component vector of float)
0:? 's' (layout(location=1 ) in structure{smooth temp 4-component vector of float a, flat temp bool b, centroid noperspective temp 1-component vector of float c, centroid sample temp 2-component vector of float d, layout(offset=4 ) temp bool ff2, layout(binding=0 offset=4 ) temp bool ff3, layout(binding=0 offset=4 ) temp 4-component vector of float ff4})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d} s1, layout(binding=5 offset=1620 ) uniform float ff5, layout(binding=8 offset=1636 ) uniform float ff6})
0:? 'anon@0' (layout(row_major std140 ) uniform block{layout(offset=0 ) uniform structure{temp bool b, temp bool c, temp 4-component vector of float a, temp 4-component vector of float d} s1, layout(offset=48 ) uniform float ff5, layout(offset=52 ) uniform float ff6})
0:? 's_ff1' (in bool Face)
// Module Version 10000
@@ -292,8 +292,8 @@ gl_FragCoord origin is upper left
MemberDecorate 93(myS) 2 Offset 16
MemberDecorate 93(myS) 3 Offset 32
MemberDecorate 94($Global) 0 Offset 0
MemberDecorate 94($Global) 1 Offset 1620
MemberDecorate 94($Global) 2 Offset 1636
MemberDecorate 94($Global) 1 Offset 48
MemberDecorate 94($Global) 2 Offset 52
Decorate 94($Global) Block
Decorate 96 DescriptorSet 0
2: TypeVoid

View File

@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.1786"
#define GLSLANG_REVISION "Overload400-PrecQual.1787"
#define GLSLANG_DATE "03-Feb-2017"

View File

@@ -159,6 +159,12 @@ bool HlslParseContext::shouldConvertLValue(const TIntermNode* node) const
return false;
}
void HlslParseContext::growGlobalUniformBlock(TSourceLoc& loc, TType& memberType, TString& memberName)
{
makeTypeNonIo(&memberType); //?? losing offsets is okay?
TParseContextBase::growGlobalUniformBlock(loc, memberType, memberName);
}
//
// Return a TLayoutFormat corresponding to the given texture type.
//

View File

@@ -160,6 +160,8 @@ public:
void pushSwitchSequence(TIntermSequence* sequence) { switchSequenceStack.push_back(sequence); }
void popSwitchSequence() { switchSequenceStack.pop_back(); }
virtual void growGlobalUniformBlock(TSourceLoc&, TType&, TString& memberName) override;
// Apply L-value conversions. E.g, turning a write to a RWTexture into an ImageStore.
TIntermTyped* handleLvalue(const TSourceLoc&, const char* op, TIntermTyped* node);
bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override;