GLSL output: Removed fixed-size buffer; fixes #769.

Makes some white-space differences in most output, plus a few cases
where more could have been put out but was cut short by the previous
fix-sized buffer.
This commit is contained in:
John Kessenich
2017-03-14 19:43:13 -06:00
parent c08fb8ab9c
commit 71c100d7c0
332 changed files with 62136 additions and 62097 deletions

View File

@@ -64,7 +64,7 @@ ERROR: node is still EOpNull!
0:47 3.000000
0:49 move second child to first child ( temp 4-component vector of float)
0:49 gl_Position: direct index for structure ( invariant gl_Position 4-component vector of float Position)
0:49 'anon@0' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, ...})
0:49 'anon@0' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
0:49 Constant:
0:49 0 (const uint)
0:49 Construct vec4 ( temp 4-component vector of float)

View File

@@ -25,7 +25,7 @@ gl_FragCoord origin is upper left
0:31 Constant:
0:31 0 (const uint)
0:31 v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
0:31 'anon@3' (layout(binding=8 row_major std430 ) buffer block{layout(row_major std430 offset=16 ) buffer 4-component vector of float v4, layout(row_major std430 offset=48 ) buffer int i4, layout(row_major std430 offset=60 ) buffer float f1, layout(row_major std430 offset=64 ) buffer float f3, layout(row_major std430 offset=68 ) buffer float f4, layout(row_major std430 offset=72 ) buffer float f5, layout(row_major std430 ) buffer float f6, layout(row_major std430 ) buffer float f7, layout(row_major std430 ) buffer 3X4 matrix of float m1, layout(column_major std430 ) buffer 3X4 matrix of float m2, layout(row_major std430 ) buffer 3X4 matrix of float m3, ...})
0:31 'anon@3' (layout( binding=8 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
0:31 Constant:
0:31 0 (const uint)
0:30 Function Definition: PixelShaderFunction( ( temp void)
@@ -42,7 +42,7 @@ gl_FragCoord origin is upper left
0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
0:? 'anon@1' (layout( row_major std430) buffer block{layout( row_major std430) buffer 4-component vector of float v2})
0:? 'anon@2' (layout( set=10 binding=2 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
0:? 'anon@3' (layout(binding=8 row_major std430 ) buffer block{layout(row_major std430 offset=16 ) buffer 4-component vector of float v4, layout(row_major std430 offset=48 ) buffer int i4, layout(row_major std430 offset=60 ) buffer float f1, layout(row_major std430 offset=64 ) buffer float f3, layout(row_major std430 offset=68 ) buffer float f4, layout(row_major std430 offset=72 ) buffer float f5, layout(row_major std430 ) buffer float f6, layout(row_major std430 ) buffer float f7, layout(row_major std430 ) buffer 3X4 matrix of float m1, layout(column_major std430 ) buffer 3X4 matrix of float m2, layout(row_major std430 ) buffer 3X4 matrix of float m3, ...})
0:? 'anon@3' (layout( binding=8 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)
@@ -76,7 +76,7 @@ gl_FragCoord origin is upper left
0:31 Constant:
0:31 0 (const uint)
0:31 v4: direct index for structure (layout( row_major std430 offset=16) buffer 4-component vector of float)
0:31 'anon@3' (layout(binding=8 row_major std430 ) buffer block{layout(row_major std430 offset=16 ) buffer 4-component vector of float v4, layout(row_major std430 offset=48 ) buffer int i4, layout(row_major std430 offset=60 ) buffer float f1, layout(row_major std430 offset=64 ) buffer float f3, layout(row_major std430 offset=68 ) buffer float f4, layout(row_major std430 offset=72 ) buffer float f5, layout(row_major std430 ) buffer float f6, layout(row_major std430 ) buffer float f7, layout(row_major std430 ) buffer 3X4 matrix of float m1, layout(column_major std430 ) buffer 3X4 matrix of float m2, layout(row_major std430 ) buffer 3X4 matrix of float m3, ...})
0:31 'anon@3' (layout( binding=8 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
0:31 Constant:
0:31 0 (const uint)
0:30 Function Definition: PixelShaderFunction( ( temp void)
@@ -93,7 +93,7 @@ gl_FragCoord origin is upper left
0:? 'anon@0' (layout( row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v1})
0:? 'anon@1' (layout( row_major std430) buffer block{layout( row_major std430) buffer 4-component vector of float v2})
0:? 'anon@2' (layout( set=10 binding=2 row_major std140) uniform block{layout( row_major std140) uniform 4-component vector of float v3, layout( row_major std140 offset=20) uniform int i3})
0:? 'anon@3' (layout(binding=8 row_major std430 ) buffer block{layout(row_major std430 offset=16 ) buffer 4-component vector of float v4, layout(row_major std430 offset=48 ) buffer int i4, layout(row_major std430 offset=60 ) buffer float f1, layout(row_major std430 offset=64 ) buffer float f3, layout(row_major std430 offset=68 ) buffer float f4, layout(row_major std430 offset=72 ) buffer float f5, layout(row_major std430 ) buffer float f6, layout(row_major std430 ) buffer float f7, layout(row_major std430 ) buffer 3X4 matrix of float m1, layout(column_major std430 ) buffer 3X4 matrix of float m2, layout(row_major std430 ) buffer 3X4 matrix of float m3, ...})
0:? 'anon@3' (layout( binding=8 row_major std430) buffer block{layout( row_major std430 offset=16) buffer 4-component vector of float v4, layout( row_major std430 offset=48) buffer int i4, layout( row_major std430 offset=60) buffer float f1, layout( row_major std430 offset=64) buffer float f3, layout( row_major std430 offset=68) buffer float f4, layout( row_major std430 offset=72) buffer float f5, layout( row_major std430) buffer float f6, layout( row_major std430) buffer float f7, layout( row_major std430) buffer 3X4 matrix of float m1, layout( column_major std430) buffer 3X4 matrix of float m2, layout( row_major std430) buffer 3X4 matrix of float m3, layout( row_major std430) buffer 3X4 matrix of float m4})
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float)

View File

@@ -297,7 +297,7 @@ ERROR: node is still EOpNull!
0:? 'b2' (layout( binding=2) uniform atomic_uint)
0:? 'c2' (layout( binding=3) uniform atomic_uint)
0:? 'd2' (layout( binding=2) uniform atomic_uint)
0:? 'anon@5' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, ...})
0:? 'anon@5' ( out block{ invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord})
0:? 'ColorInv' ( smooth out 3-component vector of float)
0:? 'Color4' ( invariant centroid smooth out 3-component vector of float)
0:? 'position' ( noContraction smooth out 4-component vector of float)

View File

@@ -1582,10 +1582,11 @@ public:
TString getCompleteString() const
{
const int maxSize = GlslangMaxTypeLength;
char buf[maxSize];
char* p = &buf[0];
char* end = &buf[maxSize];
TString typeString;
const auto appendStr = [&](const char* s) { typeString.append(s); };
const auto appendUint = [&](unsigned int u) { typeString.append(std::to_string(u).c_str()); };
const auto appendInt = [&](int i) { typeString.append(std::to_string(i).c_str()); };
if (qualifier.hasLayout()) {
// To reduce noise, skip this if the only layout is an xfb_buffer
@@ -1593,137 +1594,175 @@ public:
TQualifier noXfbBuffer = qualifier;
noXfbBuffer.layoutXfbBuffer = TQualifier::layoutXfbBufferEnd;
if (noXfbBuffer.hasLayout()) {
p += snprintf(p, end - p, "layout(");
appendStr("layout(");
if (qualifier.hasAnyLocation()) {
p += snprintf(p, end - p, "location=%d ", qualifier.layoutLocation);
if (qualifier.hasComponent())
p += snprintf(p, end - p, "component=%d ", qualifier.layoutComponent);
if (qualifier.hasIndex())
p += snprintf(p, end - p, "index=%d ", qualifier.layoutIndex);
appendStr(" location=");
appendUint(qualifier.layoutLocation);
if (qualifier.hasComponent()) {
appendStr(" component=");
appendUint(qualifier.layoutComponent);
}
if (qualifier.hasIndex()) {
appendStr(" index=");
appendUint(qualifier.layoutIndex);
}
}
if (qualifier.hasSet()) {
appendStr(" set=");
appendUint(qualifier.layoutSet);
}
if (qualifier.hasBinding()) {
appendStr(" binding=");
appendUint(qualifier.layoutBinding);
}
if (qualifier.hasStream()) {
appendStr(" stream=");
appendUint(qualifier.layoutStream);
}
if (qualifier.hasMatrix()) {
appendStr(" ");
appendStr(TQualifier::getLayoutMatrixString(qualifier.layoutMatrix));
}
if (qualifier.hasPacking()) {
appendStr(" ");
appendStr(TQualifier::getLayoutPackingString(qualifier.layoutPacking));
}
if (qualifier.hasOffset()) {
appendStr(" offset=");
appendInt(qualifier.layoutOffset);
}
if (qualifier.hasAlign()) {
appendStr(" align=");
appendInt(qualifier.layoutAlign);
}
if (qualifier.hasFormat()) {
appendStr(" ");
appendStr(TQualifier::getLayoutFormatString(qualifier.layoutFormat));
}
if (qualifier.hasXfbBuffer() && qualifier.hasXfbOffset()) {
appendStr(" xfb_buffer=");
appendUint(qualifier.layoutXfbBuffer);
}
if (qualifier.hasXfbOffset()) {
appendStr(" xfb_offset=");
appendUint(qualifier.layoutXfbOffset);
}
if (qualifier.hasXfbStride()) {
appendStr(" xfb_stride=");
appendUint(qualifier.layoutXfbStride);
}
if (qualifier.hasAttachment()) {
appendStr(" input_attachment_index=");
appendUint(qualifier.layoutAttachment);
}
if (qualifier.hasSpecConstantId()) {
appendStr(" constant_id=");
appendUint(qualifier.layoutSpecConstantId);
}
if (qualifier.hasSet())
p += snprintf(p, end - p, "set=%d ", qualifier.layoutSet);
if (qualifier.hasBinding())
p += snprintf(p, end - p, "binding=%d ", qualifier.layoutBinding);
if (qualifier.hasStream())
p += snprintf(p, end - p, "stream=%d ", qualifier.layoutStream);
if (qualifier.hasMatrix())
p += snprintf(p, end - p, "%s ", TQualifier::getLayoutMatrixString(qualifier.layoutMatrix));
if (qualifier.hasPacking())
p += snprintf(p, end - p, "%s ", TQualifier::getLayoutPackingString(qualifier.layoutPacking));
if (qualifier.hasOffset())
p += snprintf(p, end - p, "offset=%d ", qualifier.layoutOffset);
if (qualifier.hasAlign())
p += snprintf(p, end - p, "align=%d ", qualifier.layoutAlign);
if (qualifier.hasFormat())
p += snprintf(p, end - p, "%s ", TQualifier::getLayoutFormatString(qualifier.layoutFormat));
if (qualifier.hasXfbBuffer() && qualifier.hasXfbOffset())
p += snprintf(p, end - p, "xfb_buffer=%d ", qualifier.layoutXfbBuffer);
if (qualifier.hasXfbOffset())
p += snprintf(p, end - p, "xfb_offset=%d ", qualifier.layoutXfbOffset);
if (qualifier.hasXfbStride())
p += snprintf(p, end - p, "xfb_stride=%d ", qualifier.layoutXfbStride);
if (qualifier.hasAttachment())
p += snprintf(p, end - p, "input_attachment_index=%d ", qualifier.layoutAttachment);
if (qualifier.hasSpecConstantId())
p += snprintf(p, end - p, "constant_id=%d ", qualifier.layoutSpecConstantId);
if (qualifier.layoutPushConstant)
p += snprintf(p, end - p, "push_constant ");
appendStr(" push_constant");
#ifdef NV_EXTENSIONS
if (qualifier.layoutPassthrough)
p += snprintf(p, end - p, "passthrough ");
appendStr(" passthrough");
if (qualifier.layoutViewportRelative)
p += snprintf(p, end - p, "layoutViewportRelative ");
if (qualifier.layoutSecondaryViewportRelativeOffset != -2048)
p += snprintf(p, end - p, "layoutSecondaryViewportRelativeOffset=%d ", qualifier.layoutSecondaryViewportRelativeOffset);
appendStr(" layoutViewportRelative");
if (qualifier.layoutSecondaryViewportRelativeOffset != -2048) {
appendStr(" layoutSecondaryViewportRelativeOffset=");
appendInt(qualifier.layoutSecondaryViewportRelativeOffset);
}
#endif
p += snprintf(p, end - p, ") ");
appendStr(")");
}
}
if (qualifier.invariant)
p += snprintf(p, end - p, "invariant ");
appendStr(" invariant");
if (qualifier.noContraction)
p += snprintf(p, end - p, "noContraction ");
appendStr(" noContraction");
if (qualifier.centroid)
p += snprintf(p, end - p, "centroid ");
appendStr(" centroid");
if (qualifier.smooth)
p += snprintf(p, end - p, "smooth ");
appendStr(" smooth");
if (qualifier.flat)
p += snprintf(p, end - p, "flat ");
appendStr(" flat");
if (qualifier.nopersp)
p += snprintf(p, end - p, "noperspective ");
appendStr(" noperspective");
#ifdef AMD_EXTENSIONS
if (qualifier.explicitInterp)
p += snprintf(p, end - p, "__explicitInterpAMD ");
appendStr(" __explicitInterpAMD");
#endif
if (qualifier.patch)
p += snprintf(p, end - p, "patch ");
appendStr(" patch");
if (qualifier.sample)
p += snprintf(p, end - p, "sample ");
appendStr(" sample");
if (qualifier.coherent)
p += snprintf(p, end - p, "coherent ");
appendStr(" coherent");
if (qualifier.volatil)
p += snprintf(p, end - p, "volatile ");
appendStr(" volatile");
if (qualifier.restrict)
p += snprintf(p, end - p, "restrict ");
appendStr(" restrict");
if (qualifier.readonly)
p += snprintf(p, end - p, "readonly ");
appendStr(" readonly");
if (qualifier.writeonly)
p += snprintf(p, end - p, "writeonly ");
appendStr(" writeonly");
if (qualifier.specConstant)
p += snprintf(p, end - p, "specialization-constant ");
p += snprintf(p, end - p, "%s ", getStorageQualifierString());
appendStr(" specialization-constant");
appendStr(" ");
appendStr(getStorageQualifierString());
if (isArray()) {
for(int i = 0; i < (int)arraySizes->getNumDims(); ++i) {
int size = arraySizes->getDimSize(i);
if (size == 0)
p += snprintf(p, end - p, "implicitly-sized array of ");
else
p += snprintf(p, end - p, "%d-element array of ", arraySizes->getDimSize(i));
appendStr(" implicitly-sized array of");
else {
appendStr(" ");
appendInt(arraySizes->getDimSize(i));
appendStr("-element array of");
}
}
if (qualifier.precision != EpqNone)
p += snprintf(p, end - p, "%s ", getPrecisionQualifierString());
if (isMatrix())
p += snprintf(p, end - p, "%dX%d matrix of ", matrixCols, matrixRows);
else if (isVector())
p += snprintf(p, end - p, "%d-component vector of ", vectorSize);
}
if (qualifier.precision != EpqNone) {
appendStr(" ");
appendStr(getPrecisionQualifierString());
}
if (isMatrix()) {
appendStr(" ");
appendInt(matrixCols);
appendStr("X");
appendInt(matrixRows);
appendStr(" matrix of");
} else if (isVector()) {
appendStr(" ");
appendInt(vectorSize);
appendStr("-component vector of");
}
*p = 0;
TString s(buf);
s.append(getBasicTypeString());
appendStr(" ");
typeString.append(getBasicTypeString());
if (qualifier.builtIn != EbvNone) {
s.append(" ");
s.append(getBuiltInVariableString());
appendStr(" ");
appendStr(getBuiltInVariableString());
}
// Add struct/block members
if (structure) {
s.append("{");
appendStr("{");
for (size_t i = 0; i < structure->size(); ++i) {
if (s.size() > 3 * GlslangMaxTypeLength) {
// If we are getting too long, cut it short,
// just need to draw the line somewhere, as there is no limit to
// how large a struct/block type can get.
s.append("...");
break;
}
if (! (*structure)[i].type->hiddenMember()) {
s.append((*structure)[i].type->getCompleteString());
s.append(" ");
s.append((*structure)[i].type->getFieldName());
typeString.append((*structure)[i].type->getCompleteString());
typeString.append(" ");
typeString.append((*structure)[i].type->getFieldName());
if (i < structure->size() - 1)
s.append(", ");
appendStr(", ");
}
}
s.append("}");
appendStr("}");
}
return s;
return typeString;
}
TString getBasicTypeString() const

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.1909"
#define GLSLANG_REVISION "Overload400-PrecQual.1911"
#define GLSLANG_DATE "14-Mar-2017"