TOOLS: updated glslang

master
Martin Gerhardy 2022-01-22 20:03:14 +01:00
parent 361734361b
commit 771e333085
7 changed files with 24 additions and 29 deletions

View File

@ -174,6 +174,8 @@ update-glslang:
cp $(UPDATEDIR)/glslang.sync/*.cmake tools/glslang/
cp $(UPDATEDIR)/glslang.sync/README* tools/glslang/
dos2unix tools/glslang/SPIRV/spirv.hpp
python3 tools/glslang/gen_extension_headers.py -i tools/glslang/glslang/ExtensionHeaders -o tools/glslang/glslang/glsl_intrinsic_header.h
git checkout -f tools/glslang/glslang/build_info.h
update-simplecpp:
$(call UPDATE_GIT,simplecpp,https://github.com/danmar/simplecpp.git)

View File

@ -433,11 +433,11 @@ Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& opera
Instruction* type;
for (int t = 0; t < (int)groupedTypes[opcode].size(); ++t) {
type = groupedTypes[opcode][t];
if (type->getNumOperands() != operands.size())
if (static_cast<size_t>(type->getNumOperands()) != operands.size())
continue; // Number mismatch, find next
bool match = true;
for (int op = 0; match && op < operands.size(); ++op) {
for (size_t op = 0; match && op < operands.size(); ++op) {
match = (operands[op].isId ? type->getIdOperand(op) : type->getImmediateOperand(op)) == operands[op].word;
}
if (match)
@ -446,7 +446,7 @@ Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& opera
// not found, make it
type = new Instruction(getUniqueId(), NoType, opcode);
for (int op = 0; op < operands.size(); ++op) {
for (size_t op = 0; op < operands.size(); ++op) {
if (operands[op].isId)
type->addIdOperand(operands[op].word);
else

View File

@ -4270,7 +4270,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
//
//============================================================================
if (profile != EEsProfile && version >= 400) {
if (profile != EEsProfile && (version >= 400 || version == 150)) {
stageBuiltins[EShLangGeometry].append(
"void EmitStreamVertex(int);"
"void EndStreamPrimitive(int);"
@ -8353,10 +8353,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
}
if (profile != EEsProfile && version < 330 ) {
symbolTable.setFunctionExtensions("floatBitsToInt", 1, &E_GL_ARB_shader_bit_encoding);
symbolTable.setFunctionExtensions("floatBitsToUint", 1, &E_GL_ARB_shader_bit_encoding);
symbolTable.setFunctionExtensions("intBitsToFloat", 1, &E_GL_ARB_shader_bit_encoding);
symbolTable.setFunctionExtensions("uintBitsToFloat", 1, &E_GL_ARB_shader_bit_encoding);
const char* bitsConvertExt[2] = {E_GL_ARB_shader_bit_encoding, E_GL_ARB_gpu_shader5};
symbolTable.setFunctionExtensions("floatBitsToInt", 2, bitsConvertExt);
symbolTable.setFunctionExtensions("floatBitsToUint", 2, bitsConvertExt);
symbolTable.setFunctionExtensions("intBitsToFloat", 2, bitsConvertExt);
symbolTable.setFunctionExtensions("uintBitsToFloat", 2, bitsConvertExt);
}
if (profile != EEsProfile && version < 430 ) {

View File

@ -2495,6 +2495,8 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
case EOpEmitStreamVertex:
case EOpEndStreamPrimitive:
if (version == 150)
requireExtensions(loc, 1, &E_GL_ARB_gpu_shader5, "if the verison is 150 , the EmitStreamVertex and EndStreamPrimitive only support at extension GL_ARB_gpu_shader5");
intermediate.setMultiStream();
break;
@ -6210,11 +6212,13 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
#ifndef GLSLANG_WEB
if (qualifier.hasXfbOffset() && qualifier.hasXfbBuffer()) {
int repeated = intermediate.addXfbBufferOffset(type);
if (repeated >= 0)
error(loc, "overlapping offsets at", "xfb_offset", "offset %d in buffer %d", repeated, qualifier.layoutXfbBuffer);
if (type.isUnsizedArray())
if (type.isUnsizedArray()) {
error(loc, "unsized array", "xfb_offset", "in buffer %d", qualifier.layoutXfbBuffer);
} else {
int repeated = intermediate.addXfbBufferOffset(type);
if (repeated >= 0)
error(loc, "overlapping offsets at", "xfb_offset", "offset %d in buffer %d", repeated, qualifier.layoutXfbBuffer);
}
// "The offset must be a multiple of the size of the first component of the first
// qualified variable or block member, or a compile-time error results. Further, if applied to an aggregate

View File

@ -1802,7 +1802,7 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains
return size;
}
int numComponents;
int numComponents {0};
if (type.isScalar())
numComponents = 1;
else if (type.isVector())

View File

@ -162,8 +162,11 @@ typedef enum {
LAST_ELEMENT_MARKER(EShTargetCount),
} EShTargetLanguage;
// TODO(greg-lunarg): Fix non-determinism problem with Universal
// https://github.com/KhronosGroup/glslang/issues/2858
typedef enum {
EShTargetUniversal = 0, // Universal
EShTargetUniversal = 0, // Universal - Do not use, see comment above
EShTargetVulkan_1_0 = (1 << 22), // Vulkan 1.0
EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), // Vulkan 1.1
EShTargetVulkan_1_2 = (1 << 22) | (2 << 12), // Vulkan 1.2

View File

@ -51,22 +51,7 @@ std::string GL_EXT_shader_realtime_clock_GLSL = R"(
// POSSIBILITY OF SUCH DAMAGE.
//
#extension GL_EXT_spirv_intrinsics : enable
#extension GL_ARB_gpu_shader_int64 : enable
uvec2 clockRealtime2x32EXT(void) {
spirv_instruction (extensions = ["SPV_KHR_shader_clock"], capabilities = [5055], id = 5056)
uvec2 clockRealtime2x32EXT_internal(uint scope);
return clockRealtime2x32EXT_internal(1 /*Device scope*/);
}
uint64_t clockRealtimeEXT(void) {
spirv_instruction (extensions = ["SPV_KHR_shader_clock"], capabilities = [5055], id = 5056)
uint64_t clockRealtimeEXT_internal(uint scope);
return clockRealtimeEXT_internal(1 /*Device scope*/);
}
)";