summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h')
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h68
1 files changed, 41 insertions, 27 deletions
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
index 9961c943a09..3ed402d4902 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
@@ -79,6 +79,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool ms : 1;
bool image : 1; // image, combined should be false
bool combined : 1; // true means texture is combined with a sampler, false means texture with no sampler
+ bool sampler : 1; // true means a pure sampler, other fields should be clear()
#ifdef ENABLE_HLSL
unsigned int vectorSize : 3; // vector return type size.
unsigned int getVectorSize() const { return vectorSize; }
@@ -105,8 +106,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool isRect() const { return false; }
bool isSubpass() const { return false; }
bool isCombined() const { return true; }
- bool isPureSampler() const { return false; }
- bool isTexture() const { return false; }
bool isImage() const { return false; }
bool isImageClass() const { return false; }
bool isMultiSample() const { return false; }
@@ -114,7 +113,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
void setExternal(bool e) { }
bool isYuv() const { return false; }
#else
- bool sampler : 1; // true means a pure sampler, other fields should be clear()
bool external : 1; // GL_OES_EGL_image_external
bool yuv : 1; // GL_EXT_YUV_target
// Some languages support structures as sample results. Storing the whole structure in the
@@ -125,8 +123,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
bool isRect() const { return dim == EsdRect; }
bool isSubpass() const { return dim == EsdSubpass; }
bool isCombined() const { return combined; }
- bool isPureSampler() const { return sampler; }
- bool isTexture() const { return !sampler && !image; }
bool isImage() const { return image && !isSubpass(); }
bool isImageClass() const { return image; }
bool isMultiSample() const { return ms; }
@@ -134,7 +130,12 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
void setExternal(bool e) { external = e; }
bool isYuv() const { return yuv; }
#endif
+ bool isTexture() const { return !sampler && !image; }
+ bool isPureSampler() const { return sampler; }
+
void setCombined(bool c) { combined = c; }
+ void setBasicType(TBasicType t) { type = t; }
+ TBasicType getBasicType() const { return type; }
bool isShadow() const { return shadow; }
bool isArrayed() const { return arrayed; }
@@ -147,8 +148,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
ms = false;
image = false;
combined = false;
-#ifndef GLSLANG_WEB
sampler = false;
+#ifndef GLSLANG_WEB
external = false;
yuv = false;
#endif
@@ -195,6 +196,14 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
ms = m;
}
+ // make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword
+ void setPureSampler(bool s)
+ {
+ clear();
+ sampler = true;
+ shadow = s;
+ }
+
#ifndef GLSLANG_WEB
// make a subpass input attachment
void setSubpass(TBasicType t, bool m = false)
@@ -205,14 +214,6 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
dim = EsdSubpass;
ms = m;
}
-
- // make a pure sampler, no texture, no image, nothing combined, the 'sampler' keyword
- void setPureSampler(bool s)
- {
- clear();
- sampler = true;
- shadow = s;
- }
#endif
bool operator==(const TSampler& right) const
@@ -527,6 +528,7 @@ public:
void clearMemory()
{
+#ifndef GLSLANG_WEB
coherent = false;
devicecoherent = false;
queuefamilycoherent = false;
@@ -537,6 +539,7 @@ public:
restrict = false;
readonly = false;
writeonly = false;
+#endif
}
const char* semanticName;
@@ -549,16 +552,6 @@ public:
bool centroid : 1;
bool smooth : 1;
bool flat : 1;
- bool coherent : 1;
- bool devicecoherent : 1;
- bool queuefamilycoherent : 1;
- bool workgroupcoherent : 1;
- bool subgroupcoherent : 1;
- bool nonprivate : 1;
- bool volatil : 1;
- bool restrict : 1;
- bool readonly : 1;
- bool writeonly : 1;
// having a constant_id is not sufficient: expressions have no id, but are still specConstant
bool specConstant : 1;
bool nonUniform : 1;
@@ -566,6 +559,9 @@ public:
#ifdef GLSLANG_WEB
bool isWriteOnly() const { return false; }
bool isReadOnly() const { return false; }
+ bool isRestrict() const { return false; }
+ bool isCoherent() const { return false; }
+ bool isVolatile() const { return false; }
bool isSample() const { return false; }
bool isMemory() const { return false; }
bool isMemoryQualifierImageAndSSBOOnly() const { return false; }
@@ -587,8 +583,21 @@ public:
bool perTaskNV : 1;
bool patch : 1;
bool sample : 1;
+ bool restrict : 1;
+ bool readonly : 1;
+ bool writeonly : 1;
+ bool coherent : 1;
+ bool volatil : 1;
+ bool devicecoherent : 1;
+ bool queuefamilycoherent : 1;
+ bool workgroupcoherent : 1;
+ bool subgroupcoherent : 1;
+ bool nonprivate : 1;
bool isWriteOnly() const { return writeonly; }
bool isReadOnly() const { return readonly; }
+ bool isRestrict() const { return restrict; }
+ bool isCoherent() const { return coherent; }
+ bool isVolatile() const { return volatil; }
bool isSample() const { return sample; }
bool isMemory() const
{
@@ -779,8 +788,8 @@ public:
{
layoutLocation = layoutLocationEnd;
layoutComponent = layoutComponentEnd;
- layoutIndex = layoutIndexEnd;
#ifndef GLSLANG_WEB
+ layoutIndex = layoutIndexEnd;
clearStreamLayout();
clearXfbLayout();
#endif
@@ -885,7 +894,9 @@ public:
layoutSet = layoutSetEnd;
layoutBinding = layoutBindingEnd;
+#ifndef GLSLANG_WEB
layoutAttachment = layoutAttachmentEnd;
+#endif
}
bool hasMatrix() const
@@ -922,6 +933,7 @@ public:
bool hasOffset() const { return false; }
bool isNonPerspective() const { return false; }
bool hasIndex() const { return false; }
+ unsigned getIndex() const { return 0; }
bool hasComponent() const { return false; }
bool hasStream() const { return false; }
bool hasFormat() const { return false; }
@@ -946,6 +958,7 @@ public:
{
return layoutIndex != layoutIndexEnd;
}
+ unsigned getIndex() const { return layoutIndex; }
bool hasComponent() const
{
return layoutComponent != layoutComponentEnd;
@@ -1920,6 +1933,7 @@ public:
case EbtFloat: return "float";
case EbtInt: return "int";
case EbtUint: return "uint";
+ case EbtSampler: return "sampler/image";
#ifndef GLSLANG_WEB
case EbtVoid: return "void";
case EbtDouble: return "double";
@@ -1932,7 +1946,6 @@ public:
case EbtUint64: return "uint64_t";
case EbtBool: return "bool";
case EbtAtomicUint: return "atomic_uint";
- case EbtSampler: return "sampler/image";
case EbtStruct: return "structure";
case EbtBlock: return "block";
case EbtAccStructNV: return "accelerationStructureNV";
@@ -2193,7 +2206,8 @@ public:
const TTypeList* getStruct() const { assert(isStruct()); return structure; }
void setStruct(TTypeList* s) { assert(isStruct()); structure = s; }
TTypeList* getWritableStruct() const { assert(isStruct()); return structure; } // This should only be used when known to not be sharing with other threads
-
+ void setBasicType(const TBasicType& t) { basicType = t; }
+
int computeNumComponents() const
{
int components = 0;