|
@@ -85,6 +85,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
|
|
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()
|
|
|
+ bool tileQCOM : 1; // is tile shading attachment
|
|
|
|
|
|
unsigned int vectorSize : 3; // vector return type size.
|
|
|
// Some languages support structures as sample results. Storing the whole structure in the
|
|
@@ -127,6 +128,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
|
|
bool isShadow() const { return shadow; }
|
|
|
bool isArrayed() const { return arrayed; }
|
|
|
|
|
|
+ bool isTileAttachmentQCOM() const { return tileQCOM; }
|
|
|
+
|
|
|
void clear()
|
|
|
{
|
|
|
type = EbtVoid;
|
|
@@ -139,6 +142,7 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
|
|
sampler = false;
|
|
|
external = false;
|
|
|
yuv = false;
|
|
|
+ tileQCOM = false;
|
|
|
|
|
|
#ifdef ENABLE_HLSL
|
|
|
clearReturnStruct();
|
|
@@ -220,7 +224,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
|
|
isCombined() == right.isCombined() &&
|
|
|
isPureSampler() == right.isPureSampler() &&
|
|
|
isExternal() == right.isExternal() &&
|
|
|
- isYuv() == right.isYuv()
|
|
|
+ isYuv() == right.isYuv() &&
|
|
|
+ isTileAttachmentQCOM() == right.isTileAttachmentQCOM()
|
|
|
#ifdef ENABLE_HLSL
|
|
|
&& getVectorSize() == right.getVectorSize() &&
|
|
|
getStructReturnIndex() == right.getStructReturnIndex()
|
|
@@ -260,6 +265,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler,
|
|
|
s.append("attachmentEXT");
|
|
|
else if (isSubpass())
|
|
|
s.append("subpass");
|
|
|
+ else if (isTileAttachmentQCOM())
|
|
|
+ s.append("attachmentQCOM");
|
|
|
else
|
|
|
s.append("image");
|
|
|
} else if (isCombined()) {
|
|
@@ -850,6 +857,8 @@ public:
|
|
|
layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd;
|
|
|
layoutFormat = ElfNone;
|
|
|
|
|
|
+ layoutTileAttachmentQCOM = false;
|
|
|
+
|
|
|
clearInterstageLayout();
|
|
|
|
|
|
layoutSpecConstantId = layoutSpecConstantIdEnd;
|
|
@@ -951,6 +960,8 @@ public:
|
|
|
bool layoutBindlessSampler;
|
|
|
bool layoutBindlessImage;
|
|
|
|
|
|
+ bool layoutTileAttachmentQCOM;
|
|
|
+
|
|
|
bool hasUniformLayout() const
|
|
|
{
|
|
|
return hasMatrix() ||
|
|
@@ -1069,6 +1080,10 @@ public:
|
|
|
{
|
|
|
return layoutBindlessImage;
|
|
|
}
|
|
|
+ bool isTileAttachmentQCOM() const
|
|
|
+ {
|
|
|
+ return layoutTileAttachmentQCOM;
|
|
|
+ }
|
|
|
|
|
|
// GL_EXT_spirv_intrinsics
|
|
|
bool hasSpirvDecorate() const { return spirvDecorate != nullptr; }
|
|
@@ -1282,7 +1297,7 @@ public:
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-// Qualifiers that don't need to be keep per object. They have shader scope, not object scope.
|
|
|
+// Qualifiers that don't need to be kept per object. They have shader scope, not object scope.
|
|
|
// So, they will not be part of TType, TQualifier, etc.
|
|
|
struct TShaderQualifiers {
|
|
|
TLayoutGeometry geometry; // geometry/tessellation shader in/out primitives
|
|
@@ -1312,6 +1327,9 @@ struct TShaderQualifiers {
|
|
|
bool layoutDerivativeGroupLinear; // true if layout derivative_group_linearNV set
|
|
|
int primitives; // mesh shader "max_primitives"DerivativeGroupLinear; // true if layout derivative_group_linearNV set
|
|
|
bool layoutPrimitiveCulling; // true if layout primitive_culling set
|
|
|
+ bool layoutNonCoherentTileAttachmentReadQCOM; // fragment shaders -- per object
|
|
|
+ int layoutTileShadingRateQCOM[3]; // compute shader
|
|
|
+ bool layoutTileShadingRateQCOMNotDefault[3]; // compute shader
|
|
|
TLayoutDepth getDepth() const { return layoutDepth; }
|
|
|
TLayoutStencil getStencil() const { return layoutStencil; }
|
|
|
|
|
@@ -1348,6 +1366,13 @@ struct TShaderQualifiers {
|
|
|
layoutDerivativeGroupQuads = false;
|
|
|
layoutDerivativeGroupLinear = false;
|
|
|
layoutPrimitiveCulling = false;
|
|
|
+ layoutNonCoherentTileAttachmentReadQCOM = false;
|
|
|
+ layoutTileShadingRateQCOM[0] = 0;
|
|
|
+ layoutTileShadingRateQCOM[1] = 0;
|
|
|
+ layoutTileShadingRateQCOM[2] = 0;
|
|
|
+ layoutTileShadingRateQCOMNotDefault[0] = false;
|
|
|
+ layoutTileShadingRateQCOMNotDefault[1] = false;
|
|
|
+ layoutTileShadingRateQCOMNotDefault[2] = false;
|
|
|
primitives = TQualifier::layoutNotSet;
|
|
|
interlockOrdering = EioNone;
|
|
|
}
|
|
@@ -1417,6 +1442,15 @@ struct TShaderQualifiers {
|
|
|
interlockOrdering = src.interlockOrdering;
|
|
|
if (src.layoutPrimitiveCulling)
|
|
|
layoutPrimitiveCulling = src.layoutPrimitiveCulling;
|
|
|
+ if (src.layoutNonCoherentTileAttachmentReadQCOM)
|
|
|
+ layoutNonCoherentTileAttachmentReadQCOM = src.layoutNonCoherentTileAttachmentReadQCOM;
|
|
|
+ for (int i = 0; i < 3; ++i) {
|
|
|
+ if (src.layoutTileShadingRateQCOM[i] > 1)
|
|
|
+ layoutTileShadingRateQCOM[i] = src.layoutTileShadingRateQCOM[i];
|
|
|
+ }
|
|
|
+ for (int i = 0; i < 3; ++i) {
|
|
|
+ layoutTileShadingRateQCOMNotDefault[i] = src.layoutTileShadingRateQCOMNotDefault[i] || layoutTileShadingRateQCOMNotDefault[i];
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1465,6 +1499,7 @@ public:
|
|
|
bool coopmatNV : 1;
|
|
|
bool coopmatKHR : 1;
|
|
|
bool coopvecNV : 1;
|
|
|
+ bool tileAttachmentQCOM: 1;
|
|
|
TArraySizes* arraySizes;
|
|
|
const TType* userDef;
|
|
|
TSourceLoc loc;
|
|
@@ -1494,6 +1529,7 @@ public:
|
|
|
coopmatNV = false;
|
|
|
coopmatKHR = false;
|
|
|
coopvecNV = false;
|
|
|
+ tileAttachmentQCOM = false;
|
|
|
spirvType = nullptr;
|
|
|
}
|
|
|
|
|
@@ -1554,7 +1590,7 @@ public:
|
|
|
explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0,
|
|
|
bool isVector = false) :
|
|
|
basicType(t), vectorSize(static_cast<uint32_t>(vs) & 0b1111), matrixCols(static_cast<uint32_t>(mc) & 0b1111), matrixRows(static_cast<uint32_t>(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
|
|
|
- arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
|
|
|
+ tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
|
|
|
spirvType(nullptr)
|
|
|
{
|
|
|
assert(vs >= 0);
|
|
@@ -1570,7 +1606,7 @@ public:
|
|
|
TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0,
|
|
|
bool isVector = false) :
|
|
|
basicType(t), vectorSize(static_cast<uint32_t>(vs) & 0b1111), matrixCols(static_cast<uint32_t>(mc) & 0b1111), matrixRows(static_cast<uint32_t>(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
|
|
|
- arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
|
|
|
+ tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
|
|
|
spirvType(nullptr)
|
|
|
{
|
|
|
assert(vs >= 0);
|
|
@@ -1588,7 +1624,7 @@ public:
|
|
|
explicit TType(const TPublicType& p) :
|
|
|
basicType(p.basicType),
|
|
|
vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(p.coopvecNV),
|
|
|
- arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters),
|
|
|
+ tileAttachmentQCOM(p.tileAttachmentQCOM), arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters),
|
|
|
spirvType(p.spirvType)
|
|
|
{
|
|
|
if (basicType == EbtSampler)
|
|
@@ -1645,7 +1681,7 @@ public:
|
|
|
// for construction of sampler types
|
|
|
TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) :
|
|
|
basicType(EbtSampler), vectorSize(1u), matrixCols(0u), matrixRows(0u), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
|
|
|
- arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
|
|
|
+ tileAttachmentQCOM(false), arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
|
|
|
sampler(sampler), typeParameters(nullptr), spirvType(nullptr)
|
|
|
{
|
|
|
qualifier.clear();
|
|
@@ -1694,13 +1730,16 @@ public:
|
|
|
coopmatKHRUseValid = false;
|
|
|
coopvecNV = false;
|
|
|
typeParameters = nullptr;
|
|
|
+ } else if (isTileAttachmentQCOM()) {
|
|
|
+ tileAttachmentQCOM = false;
|
|
|
+ typeParameters = nullptr;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// for making structures, ...
|
|
|
TType(TTypeList* userDef, const TString& n) :
|
|
|
basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
|
|
|
- arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
|
|
|
+ tileAttachmentQCOM(false), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
|
|
|
spirvType(nullptr)
|
|
|
{
|
|
|
sampler.clear();
|
|
@@ -1710,7 +1749,7 @@ public:
|
|
|
// For interface blocks
|
|
|
TType(TTypeList* userDef, const TString& n, const TQualifier& q) :
|
|
|
basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false),
|
|
|
- qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
|
|
|
+ tileAttachmentQCOM(false), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr),
|
|
|
spirvType(nullptr)
|
|
|
{
|
|
|
sampler.clear();
|
|
@@ -1719,7 +1758,7 @@ public:
|
|
|
// for block reference (first parameter must be EbtReference)
|
|
|
explicit TType(TBasicType t, const TType &p, const TString& n) :
|
|
|
basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false),
|
|
|
- arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
|
|
|
+ tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr),
|
|
|
spirvType(nullptr)
|
|
|
{
|
|
|
assert(t == EbtReference);
|
|
@@ -1758,6 +1797,7 @@ public:
|
|
|
coopmatKHRuse = copyOf.coopmatKHRuse;
|
|
|
coopmatKHRUseValid = copyOf.coopmatKHRUseValid;
|
|
|
coopvecNV = copyOf.isCoopVecNV();
|
|
|
+ tileAttachmentQCOM = copyOf.tileAttachmentQCOM;
|
|
|
}
|
|
|
|
|
|
// Make complete copy of the whole type graph rooted at 'copyOf'.
|
|
@@ -1876,7 +1916,7 @@ public:
|
|
|
}
|
|
|
virtual bool isOpaque() const { return basicType == EbtSampler
|
|
|
|| basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery
|
|
|
- || basicType == EbtHitObjectNV; }
|
|
|
+ || basicType == EbtHitObjectNV || isTileAttachmentQCOM(); }
|
|
|
virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
|
|
|
|
|
|
virtual bool isAttachmentEXT() const { return basicType == EbtSampler && getSampler().isAttachmentEXT(); }
|
|
@@ -1894,6 +1934,7 @@ public:
|
|
|
bool isCoopMatKHR() const { return coopmatKHR; }
|
|
|
bool isCoopVecNV() const { return coopvecNV; }
|
|
|
bool isCoopMatOrVec() const { return isCoopMat() || isCoopVecNV(); }
|
|
|
+ bool isTileAttachmentQCOM() const { return tileAttachmentQCOM; }
|
|
|
bool isReference() const { return getBasicType() == EbtReference; }
|
|
|
bool isSpirvType() const { return getBasicType() == EbtSpirvType; }
|
|
|
int getCoopMatKHRuse() const { return static_cast<int>(coopmatKHRuse); }
|
|
@@ -2244,7 +2285,7 @@ public:
|
|
|
appendStr(" layoutSecondaryViewportRelativeOffset=");
|
|
|
appendInt(qualifier.layoutSecondaryViewportRelativeOffset);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (qualifier.layoutShaderRecord)
|
|
|
appendStr(" shaderRecordNV");
|
|
|
if (qualifier.layoutFullQuads)
|
|
@@ -2967,6 +3008,7 @@ protected:
|
|
|
uint32_t coopmatKHRuse : 3; // Accepts one of three values: 0, 1, 2 (gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator)
|
|
|
bool coopmatKHRUseValid : 1; // True if coopmatKHRuse has been set
|
|
|
bool coopvecNV : 1;
|
|
|
+ bool tileAttachmentQCOM : 1;
|
|
|
TQualifier qualifier;
|
|
|
|
|
|
TArraySizes* arraySizes; // nullptr unless an array; can be shared across types
|