Expose the sampler type from a TType, and add a way to rebuild just the sampler type name for messages/annotation.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20672 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
e141d5c99c
commit
6f045f3e72
5 changed files with 42 additions and 32 deletions
|
|
@ -55,30 +55,9 @@ public:
|
|||
TInfoSink& infoSink;
|
||||
};
|
||||
|
||||
TString TType::getCompleteString() const
|
||||
TString TType::getCompleteTypeString() const
|
||||
{
|
||||
const int maxSize = 100;
|
||||
char buf[maxSize];
|
||||
char *p = &buf[0];
|
||||
char *end = &buf[maxSize];
|
||||
|
||||
if (qualifier.storage != EvqTemporary && qualifier.storage != EvqGlobal)
|
||||
p += snprintf(p, end - p, "%s ", getStorageQualifierString());
|
||||
if (arraySizes) {
|
||||
if (arraySizes->front() == 0)
|
||||
p += snprintf(p, end - p, "unsized array of ");
|
||||
else
|
||||
p += snprintf(p, end - p, "%d-element array of ", arraySizes->front());
|
||||
}
|
||||
if (qualifier.precision != EpqNone)
|
||||
p += snprintf(p, end - p, "%s ", getPrecisionQualifierString());
|
||||
if (matrixCols > 0)
|
||||
p += snprintf(p, end - p, "%dX%d matrix of ", matrixCols, matrixRows);
|
||||
else if (vectorSize > 1)
|
||||
p += snprintf(p, end - p, "%d-component vector of ", vectorSize);
|
||||
|
||||
*p = 0;
|
||||
TString s(buf);
|
||||
TString s;
|
||||
|
||||
if (type == EbtSampler) {
|
||||
switch (sampler.type) {
|
||||
|
|
@ -110,6 +89,35 @@ TString TType::getCompleteString() const
|
|||
return s;
|
||||
}
|
||||
|
||||
TString TType::getCompleteString() const
|
||||
{
|
||||
const int maxSize = 100;
|
||||
char buf[maxSize];
|
||||
char *p = &buf[0];
|
||||
char *end = &buf[maxSize];
|
||||
|
||||
if (qualifier.storage != EvqTemporary && qualifier.storage != EvqGlobal)
|
||||
p += snprintf(p, end - p, "%s ", getStorageQualifierString());
|
||||
if (arraySizes) {
|
||||
if (arraySizes->front() == 0)
|
||||
p += snprintf(p, end - p, "unsized array of ");
|
||||
else
|
||||
p += snprintf(p, end - p, "%d-element array of ", arraySizes->front());
|
||||
}
|
||||
if (qualifier.precision != EpqNone)
|
||||
p += snprintf(p, end - p, "%s ", getPrecisionQualifierString());
|
||||
if (matrixCols > 0)
|
||||
p += snprintf(p, end - p, "%dX%d matrix of ", matrixCols, matrixRows);
|
||||
else if (vectorSize > 1)
|
||||
p += snprintf(p, end - p, "%d-component vector of ", vectorSize);
|
||||
|
||||
*p = 0;
|
||||
TString s(buf);
|
||||
s.append(getCompleteTypeString());
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
//
|
||||
// Helper functions for printing, not part of traversing.
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue