Updated glslang.
This commit is contained in:
parent
a71cb0868b
commit
a262a534ea
33
3rdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
33
3rdparty/glslang/SPIRV/SpvBuilder.cpp
vendored
@ -242,6 +242,11 @@ Id Builder::makePointer(StorageClass storageClass, Id pointee)
|
|||||||
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||||
module.mapInstruction(type);
|
module.mapInstruction(type);
|
||||||
|
|
||||||
|
if (emitNonSemanticShaderDebugInfo) {
|
||||||
|
const Id debugResultId = makePointerDebugType(storageClass, pointee);
|
||||||
|
debugId[type->getResultId()] = debugResultId;
|
||||||
|
}
|
||||||
|
|
||||||
return type->getResultId();
|
return type->getResultId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1070,6 +1075,34 @@ Id Builder::makeCompositeDebugType(std::vector<Id> const& memberTypes, char cons
|
|||||||
return type->getResultId();
|
return type->getResultId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Id Builder::makePointerDebugType(StorageClass storageClass, Id const baseType)
|
||||||
|
{
|
||||||
|
const Id debugBaseType = debugId[baseType];
|
||||||
|
if (!debugBaseType) {
|
||||||
|
return makeDebugInfoNone();
|
||||||
|
}
|
||||||
|
const Id scID = makeUintConstant(storageClass);
|
||||||
|
for (Instruction* otherType : groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer]) {
|
||||||
|
if (otherType->getIdOperand(2) == debugBaseType &&
|
||||||
|
otherType->getIdOperand(3) == scID) {
|
||||||
|
return otherType->getResultId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Instruction* type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
|
||||||
|
type->addIdOperand(nonSemanticShaderDebugInfo);
|
||||||
|
type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypePointer);
|
||||||
|
type->addIdOperand(debugBaseType);
|
||||||
|
type->addIdOperand(scID);
|
||||||
|
type->addIdOperand(makeUintConstant(0));
|
||||||
|
|
||||||
|
groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer].push_back(type);
|
||||||
|
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
|
||||||
|
module.mapInstruction(type);
|
||||||
|
|
||||||
|
return type->getResultId();
|
||||||
|
}
|
||||||
|
|
||||||
Id Builder::makeDebugSource(const Id fileName) {
|
Id Builder::makeDebugSource(const Id fileName) {
|
||||||
if (debugSourceId.find(fileName) != debugSourceId.end())
|
if (debugSourceId.find(fileName) != debugSourceId.end())
|
||||||
return debugSourceId[fileName];
|
return debugSourceId[fileName];
|
||||||
|
1
3rdparty/glslang/SPIRV/SpvBuilder.h
vendored
1
3rdparty/glslang/SPIRV/SpvBuilder.h
vendored
@ -226,6 +226,7 @@ public:
|
|||||||
Id makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc);
|
Id makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc);
|
||||||
Id makeCompositeDebugType(std::vector<Id> const& memberTypes, char const*const name,
|
Id makeCompositeDebugType(std::vector<Id> const& memberTypes, char const*const name,
|
||||||
NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType = false);
|
NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType = false);
|
||||||
|
Id makePointerDebugType(StorageClass storageClass, Id const baseType);
|
||||||
Id makeDebugSource(const Id fileName);
|
Id makeDebugSource(const Id fileName);
|
||||||
Id makeDebugCompilationUnit();
|
Id makeDebugCompilationUnit();
|
||||||
Id createDebugGlobalVariable(Id const type, char const*const name, Id const variable);
|
Id createDebugGlobalVariable(Id const type, char const*const name, Id const variable);
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
// including identifying what extensions are needed if a version does not allow a symbol
|
// including identifying what extensions are needed if a version does not allow a symbol
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <array>
|
||||||
#include "Initialize.h"
|
#include "Initialize.h"
|
||||||
#include "span.h"
|
#include "span.h"
|
||||||
|
|
||||||
@ -6280,7 +6281,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
|
|||||||
{
|
{
|
||||||
if ((ms || image) && shadow)
|
if ((ms || image) && shadow)
|
||||||
continue;
|
continue;
|
||||||
if (ms && profile != EEsProfile && version < 150)
|
if (ms && profile != EEsProfile && version < 140)
|
||||||
continue;
|
continue;
|
||||||
if (ms && image && profile == EEsProfile)
|
if (ms && image && profile == EEsProfile)
|
||||||
continue;
|
continue;
|
||||||
|
@ -632,7 +632,7 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn
|
|||||||
else {
|
else {
|
||||||
// input/output blocks either don't exist or can't be variably indexed
|
// input/output blocks either don't exist or can't be variably indexed
|
||||||
}
|
}
|
||||||
} else if (language == EShLangFragment && base->getQualifier().isPipeOutput())
|
} else if (language == EShLangFragment && base->getQualifier().isPipeOutput() && base->getQualifier().builtIn != EbvSampleMask)
|
||||||
requireProfile(base->getLoc(), ~EEsProfile, "variable indexing fragment shader output array");
|
requireProfile(base->getLoc(), ~EEsProfile, "variable indexing fragment shader output array");
|
||||||
else if (base->getBasicType() == EbtSampler && version >= 130) {
|
else if (base->getBasicType() == EbtSampler && version >= 130) {
|
||||||
const char* explanation = "variable indexing sampler array";
|
const char* explanation = "variable indexing sampler array";
|
||||||
@ -1360,7 +1360,10 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
|
|||||||
requireInt16Arithmetic(loc, "built-in function", "(u)int16 types can only be in uniform block or buffer storage");
|
requireInt16Arithmetic(loc, "built-in function", "(u)int16 types can only be in uniform block or buffer storage");
|
||||||
if (builtIn && fnCandidate->getType().contains8BitInt())
|
if (builtIn && fnCandidate->getType().contains8BitInt())
|
||||||
requireInt8Arithmetic(loc, "built-in function", "(u)int8 types can only be in uniform block or buffer storage");
|
requireInt8Arithmetic(loc, "built-in function", "(u)int8 types can only be in uniform block or buffer storage");
|
||||||
|
if (builtIn && (fnCandidate->getBuiltInOp() == EOpTextureFetch || fnCandidate->getBuiltInOp() == EOpTextureQuerySize)) {
|
||||||
|
if ((*fnCandidate)[0].type->getSampler().isMultiSample() && version <= 140)
|
||||||
|
requireExtensions(loc, 1, &E_GL_ARB_texture_multisample, fnCandidate->getName().c_str());
|
||||||
|
}
|
||||||
if (arguments != nullptr) {
|
if (arguments != nullptr) {
|
||||||
// Make sure qualifications work for these arguments.
|
// Make sure qualifications work for these arguments.
|
||||||
TIntermAggregate* aggregate = arguments->getAsAggregate();
|
TIntermAggregate* aggregate = arguments->getAsAggregate();
|
||||||
@ -1756,6 +1759,11 @@ TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction
|
|||||||
name == "gl_MeshPrimitivesNV") {
|
name == "gl_MeshPrimitivesNV") {
|
||||||
length = getIoArrayImplicitSize(type.getQualifier());
|
length = getIoArrayImplicitSize(type.getQualifier());
|
||||||
}
|
}
|
||||||
|
} else if (const auto typed = intermNode->getAsTyped()) {
|
||||||
|
if (typed->getQualifier().builtIn == EbvSampleMask) {
|
||||||
|
requireProfile(loc, EEsProfile, "the array size of gl_SampleMask and gl_SampleMaskIn is ceil(gl_MaxSamples/32)");
|
||||||
|
length = (resources.maxSamples + 31) / 32;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (length == 0) {
|
if (length == 0) {
|
||||||
if (intermNode->getAsSymbolNode() && isIoResizeArray(type))
|
if (intermNode->getAsSymbolNode() && isIoResizeArray(type))
|
||||||
|
Loading…
Reference in New Issue
Block a user