Updated glslang.

This commit is contained in:
Бранимир Караџић 2023-02-02 19:00:35 -08:00
parent a7ef647e98
commit 028a1cc605
9 changed files with 555 additions and 39 deletions

View File

@ -175,7 +175,7 @@ protected:
spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct,
glslang::TLayoutPacking, const glslang::TQualifier&);
void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking,
const glslang::TQualifier&, spv::Id);
const glslang::TQualifier&, spv::Id, const std::vector<spv::Id>& spvMembers);
spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim);
spv::Id accessChainLoad(const glslang::TType& type);
void accessChainStore(const glslang::TType& type, spv::Id rvalue);
@ -375,10 +375,9 @@ spv::Decoration TranslatePrecisionDecoration(const glslang::TType& type)
}
// Translate glslang type to SPIR-V block decorations.
spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useStorageBuffer)
spv::Decoration TranslateBlockDecoration(const glslang::TStorageQualifier storage, bool useStorageBuffer)
{
if (type.getBasicType() == glslang::EbtBlock) {
switch (type.getQualifier().storage) {
switch (storage) {
case glslang::EvqUniform: return spv::DecorationBlock;
case glslang::EvqBuffer: return useStorageBuffer ? spv::DecorationBlock : spv::DecorationBufferBlock;
case glslang::EvqVaryingIn: return spv::DecorationBlock;
@ -396,7 +395,6 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useSto
assert(0);
break;
}
}
return spv::DecorationMax;
}
@ -4672,7 +4670,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy
structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers] = spvType;
// Decorate it
decorateStructType(type, glslangMembers, explicitLayout, qualifier, spvType);
decorateStructType(type, glslangMembers, explicitLayout, qualifier, spvType, spvMembers);
for (int i = 0; i < (int)deferredForwardPointers.size(); ++i) {
auto it = deferredForwardPointers[i];
@ -4686,7 +4684,8 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
const glslang::TTypeList* glslangMembers,
glslang::TLayoutPacking explicitLayout,
const glslang::TQualifier& qualifier,
spv::Id spvType)
spv::Id spvType,
const std::vector<spv::Id>& spvMembers)
{
// Name and decorate the non-hidden members
int offset = -1;
@ -4839,7 +4838,16 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
// Decorate the structure
builder.addDecoration(spvType, TranslateLayoutDecoration(type, qualifier.layoutMatrix));
builder.addDecoration(spvType, TranslateBlockDecoration(type, glslangIntermediate->usingStorageBuffer()));
const auto basicType = type.getBasicType();
const auto typeStorageQualifier = type.getQualifier().storage;
if (basicType == glslang::EbtBlock) {
builder.addDecoration(spvType, TranslateBlockDecoration(typeStorageQualifier, glslangIntermediate->usingStorageBuffer()));
} else if (basicType == glslang::EbtStruct && glslangIntermediate->getSpv().vulkan > 0) {
const auto hasRuntimeArray = !spvMembers.empty() && builder.getOpCode(spvMembers.back()) == spv::OpTypeRuntimeArray;
if (hasRuntimeArray) {
builder.addDecoration(spvType, TranslateBlockDecoration(typeStorageQualifier, glslangIntermediate->usingStorageBuffer()));
}
}
if (qualifier.hasHitObjectShaderRecordNV())
builder.addDecoration(spvType, spv::DecorationHitObjectShaderRecordBufferNV);

View File

@ -34,8 +34,8 @@
#ifndef GLSLANG_BUILD_INFO
#define GLSLANG_BUILD_INFO
#define GLSLANG_VERSION_MAJOR 11
#define GLSLANG_VERSION_MINOR 13
#define GLSLANG_VERSION_MAJOR 12
#define GLSLANG_VERSION_MINOR 0
#define GLSLANG_VERSION_PATCH 0
#define GLSLANG_VERSION_FLAVOR ""

View File

@ -823,8 +823,10 @@ bool HlslGrammar::acceptLayoutQualifierList(TQualifier& qualifier)
// | UINT
// | BOOL
//
bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType)
bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType,
TPrecisionQualifier& precision)
{
precision = EpqNone;
switch (peek()) {
case EHTokFloat:
basicType = EbtFloat;
@ -842,6 +844,23 @@ bool HlslGrammar::acceptTemplateVecMatBasicType(TBasicType& basicType)
case EHTokBool:
basicType = EbtBool;
break;
case EHTokHalf:
basicType = parseContext.hlslEnable16BitTypes() ? EbtFloat16 : EbtFloat;
break;
case EHTokMin16float:
case EHTokMin10float:
basicType = parseContext.hlslEnable16BitTypes() ? EbtFloat16 : EbtFloat;
precision = EpqMedium;
break;
case EHTokMin16int:
case EHTokMin12int:
basicType = parseContext.hlslEnable16BitTypes() ? EbtInt16 : EbtInt;
precision = EpqMedium;
break;
case EHTokMin16uint:
basicType = parseContext.hlslEnable16BitTypes() ? EbtUint16 : EbtUint;
precision = EpqMedium;
break;
default:
return false;
}
@ -867,7 +886,8 @@ bool HlslGrammar::acceptVectorTemplateType(TType& type)
}
TBasicType basicType;
if (! acceptTemplateVecMatBasicType(basicType)) {
TPrecisionQualifier precision;
if (! acceptTemplateVecMatBasicType(basicType, precision)) {
expected("scalar type");
return false;
}
@ -890,7 +910,7 @@ bool HlslGrammar::acceptVectorTemplateType(TType& type)
const int vecSizeI = vecSize->getAsConstantUnion()->getConstArray()[0].getIConst();
new(&type) TType(basicType, EvqTemporary, vecSizeI);
new(&type) TType(basicType, EvqTemporary, precision, vecSizeI);
if (vecSizeI == 1)
type.makeVector();
@ -919,7 +939,8 @@ bool HlslGrammar::acceptMatrixTemplateType(TType& type)
}
TBasicType basicType;
if (! acceptTemplateVecMatBasicType(basicType)) {
TPrecisionQualifier precision;
if (! acceptTemplateVecMatBasicType(basicType, precision)) {
expected("scalar type");
return false;
}
@ -956,7 +977,7 @@ bool HlslGrammar::acceptMatrixTemplateType(TType& type)
if (! acceptLiteral(cols))
return false;
new(&type) TType(basicType, EvqTemporary, 0,
new(&type) TType(basicType, EvqTemporary, precision, 0,
rows->getAsConstantUnion()->getConstArray()[0].getIConst(),
cols->getAsConstantUnion()->getConstArray()[0].getIConst());
@ -2064,6 +2085,251 @@ bool HlslGrammar::acceptType(TType& type, TIntermNode*& nodeList)
new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 4);
break;
case EHTokMin16float1x1:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 1);
break;
case EHTokMin16float1x2:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 2);
break;
case EHTokMin16float1x3:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 3);
break;
case EHTokMin16float1x4:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 1, 4);
break;
case EHTokMin16float2x1:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 1);
break;
case EHTokMin16float2x2:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 2);
break;
case EHTokMin16float2x3:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 3);
break;
case EHTokMin16float2x4:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 2, 4);
break;
case EHTokMin16float3x1:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 1);
break;
case EHTokMin16float3x2:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 2);
break;
case EHTokMin16float3x3:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 3);
break;
case EHTokMin16float3x4:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 3, 4);
break;
case EHTokMin16float4x1:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 1);
break;
case EHTokMin16float4x2:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 2);
break;
case EHTokMin16float4x3:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 3);
break;
case EHTokMin16float4x4:
new(&type) TType(min16float_bt, EvqTemporary, EpqMedium, 0, 4, 4);
break;
case EHTokMin10float1x1:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 1);
break;
case EHTokMin10float1x2:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 2);
break;
case EHTokMin10float1x3:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 3);
break;
case EHTokMin10float1x4:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 1, 4);
break;
case EHTokMin10float2x1:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 1);
break;
case EHTokMin10float2x2:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 2);
break;
case EHTokMin10float2x3:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 3);
break;
case EHTokMin10float2x4:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 2, 4);
break;
case EHTokMin10float3x1:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 1);
break;
case EHTokMin10float3x2:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 2);
break;
case EHTokMin10float3x3:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 3);
break;
case EHTokMin10float3x4:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 3, 4);
break;
case EHTokMin10float4x1:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 1);
break;
case EHTokMin10float4x2:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 2);
break;
case EHTokMin10float4x3:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 3);
break;
case EHTokMin10float4x4:
new(&type) TType(min10float_bt, EvqTemporary, EpqMedium, 0, 4, 4);
break;
case EHTokMin16int1x1:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 1);
break;
case EHTokMin16int1x2:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 2);
break;
case EHTokMin16int1x3:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 3);
break;
case EHTokMin16int1x4:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 1, 4);
break;
case EHTokMin16int2x1:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 1);
break;
case EHTokMin16int2x2:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 2);
break;
case EHTokMin16int2x3:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 3);
break;
case EHTokMin16int2x4:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 2, 4);
break;
case EHTokMin16int3x1:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 1);
break;
case EHTokMin16int3x2:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 2);
break;
case EHTokMin16int3x3:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 3);
break;
case EHTokMin16int3x4:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 3, 4);
break;
case EHTokMin16int4x1:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 1);
break;
case EHTokMin16int4x2:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 2);
break;
case EHTokMin16int4x3:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 3);
break;
case EHTokMin16int4x4:
new(&type) TType(min16int_bt, EvqTemporary, EpqMedium, 0, 4, 4);
break;
case EHTokMin12int1x1:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 1);
break;
case EHTokMin12int1x2:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 2);
break;
case EHTokMin12int1x3:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 3);
break;
case EHTokMin12int1x4:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 1, 4);
break;
case EHTokMin12int2x1:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 1);
break;
case EHTokMin12int2x2:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 2);
break;
case EHTokMin12int2x3:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 3);
break;
case EHTokMin12int2x4:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 2, 4);
break;
case EHTokMin12int3x1:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 1);
break;
case EHTokMin12int3x2:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 2);
break;
case EHTokMin12int3x3:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 3);
break;
case EHTokMin12int3x4:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 3, 4);
break;
case EHTokMin12int4x1:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 1);
break;
case EHTokMin12int4x2:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 2);
break;
case EHTokMin12int4x3:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 3);
break;
case EHTokMin12int4x4:
new(&type) TType(min12int_bt, EvqTemporary, EpqMedium, 0, 4, 4);
break;
case EHTokMin16uint1x1:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 1);
break;
case EHTokMin16uint1x2:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 2);
break;
case EHTokMin16uint1x3:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 3);
break;
case EHTokMin16uint1x4:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 1, 4);
break;
case EHTokMin16uint2x1:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 1);
break;
case EHTokMin16uint2x2:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 2);
break;
case EHTokMin16uint2x3:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 3);
break;
case EHTokMin16uint2x4:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 2, 4);
break;
case EHTokMin16uint3x1:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 1);
break;
case EHTokMin16uint3x2:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 2);
break;
case EHTokMin16uint3x3:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 3);
break;
case EHTokMin16uint3x4:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 3, 4);
break;
case EHTokMin16uint4x1:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 1);
break;
case EHTokMin16uint4x2:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 2);
break;
case EHTokMin16uint4x3:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 3);
break;
case EHTokMin16uint4x4:
new(&type) TType(min16uint_bt, EvqTemporary, EpqMedium, 0, 4, 4);
break;
default:
return false;
}

View File

@ -76,7 +76,7 @@ namespace glslang {
bool acceptLayoutQualifierList(TQualifier&);
bool acceptType(TType&);
bool acceptType(TType&, TIntermNode*& nodeList);
bool acceptTemplateVecMatBasicType(TBasicType&);
bool acceptTemplateVecMatBasicType(TBasicType&, TPrecisionQualifier&);
bool acceptVectorTemplateType(TType&);
bool acceptMatrixTemplateType(TType&);
bool acceptTessellationDeclType(TBuiltInVariable&);

View File

@ -312,6 +312,86 @@ void HlslScanContext::fillInKeywordMap()
(*KeywordMap)["double4x2"] = EHTokDouble4x2;
(*KeywordMap)["double4x3"] = EHTokDouble4x3;
(*KeywordMap)["double4x4"] = EHTokDouble4x4;
(*KeywordMap)["min16float1x1"] = EHTokMin16float1x1;
(*KeywordMap)["min16float1x2"] = EHTokMin16float1x2;
(*KeywordMap)["min16float1x3"] = EHTokMin16float1x3;
(*KeywordMap)["min16float1x4"] = EHTokMin16float1x4;
(*KeywordMap)["min16float2x1"] = EHTokMin16float2x1;
(*KeywordMap)["min16float2x2"] = EHTokMin16float2x2;
(*KeywordMap)["min16float2x3"] = EHTokMin16float2x3;
(*KeywordMap)["min16float2x4"] = EHTokMin16float2x4;
(*KeywordMap)["min16float3x1"] = EHTokMin16float3x1;
(*KeywordMap)["min16float3x2"] = EHTokMin16float3x2;
(*KeywordMap)["min16float3x3"] = EHTokMin16float3x3;
(*KeywordMap)["min16float3x4"] = EHTokMin16float3x4;
(*KeywordMap)["min16float4x1"] = EHTokMin16float4x1;
(*KeywordMap)["min16float4x2"] = EHTokMin16float4x2;
(*KeywordMap)["min16float4x3"] = EHTokMin16float4x3;
(*KeywordMap)["min16float4x4"] = EHTokMin16float4x4;
(*KeywordMap)["min10float1x1"] = EHTokMin10float1x1;
(*KeywordMap)["min10float1x2"] = EHTokMin10float1x2;
(*KeywordMap)["min10float1x3"] = EHTokMin10float1x3;
(*KeywordMap)["min10float1x4"] = EHTokMin10float1x4;
(*KeywordMap)["min10float2x1"] = EHTokMin10float2x1;
(*KeywordMap)["min10float2x2"] = EHTokMin10float2x2;
(*KeywordMap)["min10float2x3"] = EHTokMin10float2x3;
(*KeywordMap)["min10float2x4"] = EHTokMin10float2x4;
(*KeywordMap)["min10float3x1"] = EHTokMin10float3x1;
(*KeywordMap)["min10float3x2"] = EHTokMin10float3x2;
(*KeywordMap)["min10float3x3"] = EHTokMin10float3x3;
(*KeywordMap)["min10float3x4"] = EHTokMin10float3x4;
(*KeywordMap)["min10float4x1"] = EHTokMin10float4x1;
(*KeywordMap)["min10float4x2"] = EHTokMin10float4x2;
(*KeywordMap)["min10float4x3"] = EHTokMin10float4x3;
(*KeywordMap)["min10float4x4"] = EHTokMin10float4x4;
(*KeywordMap)["min16int1x1"] = EHTokMin16int1x1;
(*KeywordMap)["min16int1x2"] = EHTokMin16int1x2;
(*KeywordMap)["min16int1x3"] = EHTokMin16int1x3;
(*KeywordMap)["min16int1x4"] = EHTokMin16int1x4;
(*KeywordMap)["min16int2x1"] = EHTokMin16int2x1;
(*KeywordMap)["min16int2x2"] = EHTokMin16int2x2;
(*KeywordMap)["min16int2x3"] = EHTokMin16int2x3;
(*KeywordMap)["min16int2x4"] = EHTokMin16int2x4;
(*KeywordMap)["min16int3x1"] = EHTokMin16int3x1;
(*KeywordMap)["min16int3x2"] = EHTokMin16int3x2;
(*KeywordMap)["min16int3x3"] = EHTokMin16int3x3;
(*KeywordMap)["min16int3x4"] = EHTokMin16int3x4;
(*KeywordMap)["min16int4x1"] = EHTokMin16int4x1;
(*KeywordMap)["min16int4x2"] = EHTokMin16int4x2;
(*KeywordMap)["min16int4x3"] = EHTokMin16int4x3;
(*KeywordMap)["min16int4x4"] = EHTokMin16int4x4;
(*KeywordMap)["min12int1x1"] = EHTokMin12int1x1;
(*KeywordMap)["min12int1x2"] = EHTokMin12int1x2;
(*KeywordMap)["min12int1x3"] = EHTokMin12int1x3;
(*KeywordMap)["min12int1x4"] = EHTokMin12int1x4;
(*KeywordMap)["min12int2x1"] = EHTokMin12int2x1;
(*KeywordMap)["min12int2x2"] = EHTokMin12int2x2;
(*KeywordMap)["min12int2x3"] = EHTokMin12int2x3;
(*KeywordMap)["min12int2x4"] = EHTokMin12int2x4;
(*KeywordMap)["min12int3x1"] = EHTokMin12int3x1;
(*KeywordMap)["min12int3x2"] = EHTokMin12int3x2;
(*KeywordMap)["min12int3x3"] = EHTokMin12int3x3;
(*KeywordMap)["min12int3x4"] = EHTokMin12int3x4;
(*KeywordMap)["min12int4x1"] = EHTokMin12int4x1;
(*KeywordMap)["min12int4x2"] = EHTokMin12int4x2;
(*KeywordMap)["min12int4x3"] = EHTokMin12int4x3;
(*KeywordMap)["min12int4x4"] = EHTokMin12int4x4;
(*KeywordMap)["min16uint1x1"] = EHTokMin16uint1x1;
(*KeywordMap)["min16uint1x2"] = EHTokMin16uint1x2;
(*KeywordMap)["min16uint1x3"] = EHTokMin16uint1x3;
(*KeywordMap)["min16uint1x4"] = EHTokMin16uint1x4;
(*KeywordMap)["min16uint2x1"] = EHTokMin16uint2x1;
(*KeywordMap)["min16uint2x2"] = EHTokMin16uint2x2;
(*KeywordMap)["min16uint2x3"] = EHTokMin16uint2x3;
(*KeywordMap)["min16uint2x4"] = EHTokMin16uint2x4;
(*KeywordMap)["min16uint3x1"] = EHTokMin16uint3x1;
(*KeywordMap)["min16uint3x2"] = EHTokMin16uint3x2;
(*KeywordMap)["min16uint3x3"] = EHTokMin16uint3x3;
(*KeywordMap)["min16uint3x4"] = EHTokMin16uint3x4;
(*KeywordMap)["min16uint4x1"] = EHTokMin16uint4x1;
(*KeywordMap)["min16uint4x2"] = EHTokMin16uint4x2;
(*KeywordMap)["min16uint4x3"] = EHTokMin16uint4x3;
(*KeywordMap)["min16uint4x4"] = EHTokMin16uint4x4;
(*KeywordMap)["sampler"] = EHTokSampler;
(*KeywordMap)["sampler1D"] = EHTokSampler1d;
@ -806,6 +886,86 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier()
case EHTokDouble4x2:
case EHTokDouble4x3:
case EHTokDouble4x4:
case EHTokMin16float1x1:
case EHTokMin16float1x2:
case EHTokMin16float1x3:
case EHTokMin16float1x4:
case EHTokMin16float2x1:
case EHTokMin16float2x2:
case EHTokMin16float2x3:
case EHTokMin16float2x4:
case EHTokMin16float3x1:
case EHTokMin16float3x2:
case EHTokMin16float3x3:
case EHTokMin16float3x4:
case EHTokMin16float4x1:
case EHTokMin16float4x2:
case EHTokMin16float4x3:
case EHTokMin16float4x4:
case EHTokMin10float1x1:
case EHTokMin10float1x2:
case EHTokMin10float1x3:
case EHTokMin10float1x4:
case EHTokMin10float2x1:
case EHTokMin10float2x2:
case EHTokMin10float2x3:
case EHTokMin10float2x4:
case EHTokMin10float3x1:
case EHTokMin10float3x2:
case EHTokMin10float3x3:
case EHTokMin10float3x4:
case EHTokMin10float4x1:
case EHTokMin10float4x2:
case EHTokMin10float4x3:
case EHTokMin10float4x4:
case EHTokMin16int1x1:
case EHTokMin16int1x2:
case EHTokMin16int1x3:
case EHTokMin16int1x4:
case EHTokMin16int2x1:
case EHTokMin16int2x2:
case EHTokMin16int2x3:
case EHTokMin16int2x4:
case EHTokMin16int3x1:
case EHTokMin16int3x2:
case EHTokMin16int3x3:
case EHTokMin16int3x4:
case EHTokMin16int4x1:
case EHTokMin16int4x2:
case EHTokMin16int4x3:
case EHTokMin16int4x4:
case EHTokMin12int1x1:
case EHTokMin12int1x2:
case EHTokMin12int1x3:
case EHTokMin12int1x4:
case EHTokMin12int2x1:
case EHTokMin12int2x2:
case EHTokMin12int2x3:
case EHTokMin12int2x4:
case EHTokMin12int3x1:
case EHTokMin12int3x2:
case EHTokMin12int3x3:
case EHTokMin12int3x4:
case EHTokMin12int4x1:
case EHTokMin12int4x2:
case EHTokMin12int4x3:
case EHTokMin12int4x4:
case EHTokMin16uint1x1:
case EHTokMin16uint1x2:
case EHTokMin16uint1x3:
case EHTokMin16uint1x4:
case EHTokMin16uint2x1:
case EHTokMin16uint2x2:
case EHTokMin16uint2x3:
case EHTokMin16uint2x4:
case EHTokMin16uint3x1:
case EHTokMin16uint3x2:
case EHTokMin16uint3x3:
case EHTokMin16uint3x4:
case EHTokMin16uint4x1:
case EHTokMin16uint4x2:
case EHTokMin16uint4x3:
case EHTokMin16uint4x4:
return keyword;
// texturing types

View File

@ -249,6 +249,86 @@ enum EHlslTokenClass {
EHTokDouble4x2,
EHTokDouble4x3,
EHTokDouble4x4,
EHTokMin16float1x1,
EHTokMin16float1x2,
EHTokMin16float1x3,
EHTokMin16float1x4,
EHTokMin16float2x1,
EHTokMin16float2x2,
EHTokMin16float2x3,
EHTokMin16float2x4,
EHTokMin16float3x1,
EHTokMin16float3x2,
EHTokMin16float3x3,
EHTokMin16float3x4,
EHTokMin16float4x1,
EHTokMin16float4x2,
EHTokMin16float4x3,
EHTokMin16float4x4,
EHTokMin10float1x1,
EHTokMin10float1x2,
EHTokMin10float1x3,
EHTokMin10float1x4,
EHTokMin10float2x1,
EHTokMin10float2x2,
EHTokMin10float2x3,
EHTokMin10float2x4,
EHTokMin10float3x1,
EHTokMin10float3x2,
EHTokMin10float3x3,
EHTokMin10float3x4,
EHTokMin10float4x1,
EHTokMin10float4x2,
EHTokMin10float4x3,
EHTokMin10float4x4,
EHTokMin16int1x1,
EHTokMin16int1x2,
EHTokMin16int1x3,
EHTokMin16int1x4,
EHTokMin16int2x1,
EHTokMin16int2x2,
EHTokMin16int2x3,
EHTokMin16int2x4,
EHTokMin16int3x1,
EHTokMin16int3x2,
EHTokMin16int3x3,
EHTokMin16int3x4,
EHTokMin16int4x1,
EHTokMin16int4x2,
EHTokMin16int4x3,
EHTokMin16int4x4,
EHTokMin12int1x1,
EHTokMin12int1x2,
EHTokMin12int1x3,
EHTokMin12int1x4,
EHTokMin12int2x1,
EHTokMin12int2x2,
EHTokMin12int2x3,
EHTokMin12int2x4,
EHTokMin12int3x1,
EHTokMin12int3x2,
EHTokMin12int3x3,
EHTokMin12int3x4,
EHTokMin12int4x1,
EHTokMin12int4x2,
EHTokMin12int4x3,
EHTokMin12int4x4,
EHTokMin16uint1x1,
EHTokMin16uint1x2,
EHTokMin16uint1x3,
EHTokMin16uint1x4,
EHTokMin16uint2x1,
EHTokMin16uint2x2,
EHTokMin16uint2x3,
EHTokMin16uint2x4,
EHTokMin16uint3x1,
EHTokMin16uint3x2,
EHTokMin16uint3x3,
EHTokMin16uint3x4,
EHTokMin16uint4x1,
EHTokMin16uint4x2,
EHTokMin16uint4x3,
EHTokMin16uint4x4,
// texturing types
EHTokSampler,

View File

@ -212,9 +212,9 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
case EbtInt64:
if (rightUnionArray[i] == 0ll)
newConstArray[i].setI64Const(0x7FFFFFFFFFFFFFFFll);
else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == (long long)-0x8000000000000000ll)
newConstArray[i].setI64Const((long long)-0x8000000000000000ll);
newConstArray[i].setI64Const(LLONG_MAX);
else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN)
newConstArray[i].setI64Const(LLONG_MIN);
else
newConstArray[i].setI64Const(leftUnionArray[i].getI64Const() / rightUnionArray[i].getI64Const());
break;

View File

@ -80,10 +80,6 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b
globalBufferDefaults.layoutMatrix = ElmColumnMajor;
globalBufferDefaults.layoutPacking = spvVersion.spv != 0 ? ElpStd430 : ElpShared;
// use storage buffer on SPIR-V 1.3 and up
if (spvVersion.spv >= EShTargetSpv_1_3)
intermediate.setUseStorageBuffer();
globalInputDefaults.clear();
globalOutputDefaults.clear();
@ -3983,8 +3979,10 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
return;
}
if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble)
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) {
profileRequires(loc, EEsProfile, 300, nullptr, "non-float shader input/output");
profileRequires(loc, ~EEsProfile, 130, nullptr, "non-float shader input/output");
}
if (!qualifier.flat && !qualifier.isExplicitInterpolation() && !qualifier.isPervertexNV() && !qualifier.isPervertexEXT()) {
if (isTypeInt(publicType.basicType) ||

View File

@ -95,6 +95,10 @@ public:
globalUniformSet(TQualifier::layoutSetEnd),
atomicCounterBlockSet(TQualifier::layoutSetEnd)
{
// use storage buffer on SPIR-V 1.3 and up
if (spvVersion.spv >= EShTargetSpv_1_3)
intermediate.setUseStorageBuffer();
if (entryPoint != nullptr)
sourceEntryPointName = *entryPoint;
}