Added semantic and semantic_idx layout qualifiers.
This commit is contained in:
parent
e87d0d5703
commit
bb2d06b0a3
@ -856,6 +856,10 @@ public:
|
|||||||
layoutBindlessSampler = false;
|
layoutBindlessSampler = false;
|
||||||
layoutBindlessImage = false;
|
layoutBindlessImage = false;
|
||||||
layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd;
|
layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd;
|
||||||
|
// BEGIN @MEWIN - 2023-11-21 - Added semantic and semantic_idx layout qualifiers.
|
||||||
|
layoutSemantic = layoutSemanticEnd;
|
||||||
|
layoutSemanticIndex = layoutSemanticIndexEnd;
|
||||||
|
// END @MEWIN
|
||||||
layoutFormat = ElfNone;
|
layoutFormat = ElfNone;
|
||||||
|
|
||||||
clearInterstageLayout();
|
clearInterstageLayout();
|
||||||
@ -940,6 +944,14 @@ public:
|
|||||||
unsigned int layoutBufferReferenceAlign : 6;
|
unsigned int layoutBufferReferenceAlign : 6;
|
||||||
static const unsigned int layoutBufferReferenceAlignEnd = 0x3F;
|
static const unsigned int layoutBufferReferenceAlignEnd = 0x3F;
|
||||||
|
|
||||||
|
// BEGIN @MEWIN - 2023-11-21 - Added semantic and semantic_idx layout qualifiers.
|
||||||
|
unsigned int layoutSemantic : 5;
|
||||||
|
static const unsigned int layoutSemanticEnd = 0x1F;
|
||||||
|
|
||||||
|
unsigned int layoutSemanticIndex : 3;
|
||||||
|
static const unsigned int layoutSemanticIndexEnd = 7;
|
||||||
|
// END @MEWIN
|
||||||
|
|
||||||
TLayoutFormat layoutFormat : 8;
|
TLayoutFormat layoutFormat : 8;
|
||||||
|
|
||||||
bool layoutPushConstant;
|
bool layoutPushConstant;
|
||||||
@ -1057,6 +1069,16 @@ public:
|
|||||||
bool isShaderRecord() const { return layoutShaderRecord; }
|
bool isShaderRecord() const { return layoutShaderRecord; }
|
||||||
bool hasHitObjectShaderRecordNV() const { return layoutHitObjectShaderRecordNV; }
|
bool hasHitObjectShaderRecordNV() const { return layoutHitObjectShaderRecordNV; }
|
||||||
bool hasBufferReference() const { return layoutBufferReference; }
|
bool hasBufferReference() const { return layoutBufferReference; }
|
||||||
|
// BEGIN @MEWIN - 2023-11-21 - Added semantic and semantic_idx layout qualifiers.
|
||||||
|
bool hasSemantic() const
|
||||||
|
{
|
||||||
|
return layoutSemantic != layoutSemanticEnd;
|
||||||
|
}
|
||||||
|
bool hasSemanticIndex() const
|
||||||
|
{
|
||||||
|
return layoutSemanticIndex != layoutSemanticIndexEnd;
|
||||||
|
}
|
||||||
|
// END @MEWIN
|
||||||
bool hasBufferReferenceAlign() const
|
bool hasBufferReferenceAlign() const
|
||||||
{
|
{
|
||||||
return layoutBufferReferenceAlign != layoutBufferReferenceAlignEnd;
|
return layoutBufferReferenceAlign != layoutBufferReferenceAlignEnd;
|
||||||
|
@ -5928,6 +5928,24 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
|
|||||||
if (nonLiteral)
|
if (nonLiteral)
|
||||||
error(loc, "needs a literal integer", "location", "");
|
error(loc, "needs a literal integer", "location", "");
|
||||||
return;
|
return;
|
||||||
|
// BEGIN @MEWIN - 2023-11-21 - Added semantic and semantic_idx layout qualifiers.
|
||||||
|
} else if (id == "semantic") {
|
||||||
|
if ((unsigned int) value >= TQualifier::layoutSemanticEnd)
|
||||||
|
error(loc, "semantic is too large", id.c_str(), "");
|
||||||
|
else
|
||||||
|
publicType.qualifier.layoutSemantic = value;
|
||||||
|
if (nonLiteral)
|
||||||
|
error(loc, "needs a literal integer", "location", "");
|
||||||
|
return;
|
||||||
|
} else if (id == "semantic_idx") {
|
||||||
|
if ((unsigned int) value >= TQualifier::layoutSemanticIndexEnd)
|
||||||
|
error(loc, "semantic index is too large", id.c_str(), "");
|
||||||
|
else
|
||||||
|
publicType.qualifier.layoutSemanticIndex = value;
|
||||||
|
if (nonLiteral)
|
||||||
|
error(loc, "needs a literal integer", "location", "");
|
||||||
|
return;
|
||||||
|
// END @MEWIN
|
||||||
} else if (id == "set") {
|
} else if (id == "set") {
|
||||||
if ((unsigned int)value >= TQualifier::layoutSetEnd)
|
if ((unsigned int)value >= TQualifier::layoutSetEnd)
|
||||||
error(loc, "set is too large", id.c_str(), "");
|
error(loc, "set is too large", id.c_str(), "");
|
||||||
@ -6257,6 +6275,13 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie
|
|||||||
if (src.hasSpecConstantId())
|
if (src.hasSpecConstantId())
|
||||||
dst.layoutSpecConstantId = src.layoutSpecConstantId;
|
dst.layoutSpecConstantId = src.layoutSpecConstantId;
|
||||||
|
|
||||||
|
// BEGIN @MEWIN - 2023-11-21 - Added semantic and semantic_idx layout qualifiers.
|
||||||
|
if (src.hasSemantic())
|
||||||
|
dst.layoutSemantic = src.layoutSemantic;
|
||||||
|
if (src.hasSemanticIndex())
|
||||||
|
dst.layoutSemanticIndex = src.layoutSemanticIndex;
|
||||||
|
// END @MEWIN
|
||||||
|
|
||||||
if (src.hasComponent())
|
if (src.hasComponent())
|
||||||
dst.layoutComponent = src.layoutComponent;
|
dst.layoutComponent = src.layoutComponent;
|
||||||
if (src.hasIndex())
|
if (src.hasIndex())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user