Rationalize locations of type string methods.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20684 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
6f045f3e72
commit
d7f9406f82
4 changed files with 71 additions and 71 deletions
|
|
@ -55,69 +55,6 @@ public:
|
|||
TInfoSink& infoSink;
|
||||
};
|
||||
|
||||
TString TType::getCompleteTypeString() const
|
||||
{
|
||||
TString s;
|
||||
|
||||
if (type == EbtSampler) {
|
||||
switch (sampler.type) {
|
||||
case EbtFloat: break;
|
||||
case EbtInt: s.append("i"); break;
|
||||
case EbtUint: s.append("u"); break;
|
||||
}
|
||||
if (sampler.image)
|
||||
s.append("image");
|
||||
else
|
||||
s.append("sampler");
|
||||
switch (sampler.dim) {
|
||||
case Esd1D: s.append("1D"); break;
|
||||
case Esd2D: s.append("2D"); break;
|
||||
case Esd3D: s.append("3D"); break;
|
||||
case EsdCube: s.append("Cube"); break;
|
||||
case EsdRect: s.append("Rect"); break;
|
||||
case EsdBuffer: s.append("Buffer"); break;
|
||||
}
|
||||
if (sampler.arrayed)
|
||||
s.append("Array");
|
||||
if (sampler.shadow)
|
||||
s.append("Shadow");
|
||||
if (sampler.ms)
|
||||
s.append("MS");
|
||||
} else
|
||||
s.append(getBasicString());
|
||||
|
||||
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