glslang parser: Arrays-of-arrays name-mangling and error messages (lots of A-of-A stuff to come a bit later). This patch from Google, David Neto <dneto@google.com>.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31137 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
f75276ba5c
commit
af9ab5f743
12 changed files with 102 additions and 22 deletions
|
|
@ -1261,10 +1261,14 @@ public:
|
|||
p += snprintf(p, end - p, "writeonly ");
|
||||
p += snprintf(p, end - p, "%s ", getStorageQualifierString());
|
||||
if (arraySizes) {
|
||||
if (arraySizes->sizes.front() == 0)
|
||||
if (arraySizes->sizes.front() == 0) {
|
||||
p += snprintf(p, end - p, "implicitly-sized array of ");
|
||||
else
|
||||
p += snprintf(p, end - p, "%d-element array of ", arraySizes->sizes.front());
|
||||
} else {
|
||||
for(int i = 0; i < (int)arraySizes->sizes.size() ; ++i) {
|
||||
// p += snprintf(p, end - p, "%s%d", (i == 0 ? "" : "x"), arraySizes->sizes[numDimensions-1-i]);
|
||||
p += snprintf(p, end - p, "%d-element array of ", arraySizes->sizes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (qualifier.precision != EpqNone)
|
||||
p += snprintf(p, end - p, "%s ", getPrecisionQualifierString());
|
||||
|
|
|
|||
|
|
@ -2543,12 +2543,12 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
|
|||
// compute
|
||||
if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 430)) {
|
||||
snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX,
|
||||
resources.maxComputeWorkGroupCountY,
|
||||
resources.maxComputeWorkGroupCountZ);
|
||||
resources.maxComputeWorkGroupCountY,
|
||||
resources.maxComputeWorkGroupCountZ);
|
||||
s.append(builtInConstant);
|
||||
snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupSize = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupSizeX,
|
||||
resources.maxComputeWorkGroupSizeY,
|
||||
resources.maxComputeWorkGroupSizeZ);
|
||||
resources.maxComputeWorkGroupSizeY,
|
||||
resources.maxComputeWorkGroupSizeZ);
|
||||
s.append(builtInConstant);
|
||||
|
||||
snprintf(builtInConstant, maxSize, "const int gl_MaxComputeUniformComponents = %d;", resources.maxComputeUniformComponents);
|
||||
|
|
|
|||
|
|
@ -112,10 +112,12 @@ void TType::buildMangledName(TString& mangledName)
|
|||
if (arraySizes) {
|
||||
const int maxSize = 11;
|
||||
char buf[maxSize];
|
||||
snprintf(buf, maxSize, "%d", arraySizes->sizes.front());
|
||||
mangledName += '[';
|
||||
mangledName += buf;
|
||||
mangledName += ']';
|
||||
for (int i = 0; i < (int)arraySizes->sizes.size(); ++i) {
|
||||
snprintf(buf, maxSize, "%d", arraySizes->sizes[i]);
|
||||
mangledName += '[';
|
||||
mangledName += buf;
|
||||
mangledName += ']';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue