From 22a33d6742e2edfcdab947179c073428b427be9c Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Date: Wed, 22 Jan 2025 13:01:17 +0100 Subject: [PATCH] Update SPIRV-Tools known good version Also update tests for texture*Offset functions with non-const offsets to use the new validator option, without expecting a failure. --- SPIRV/SpvTools.cpp | 1 + .../spv.sparsetextureoffset_non_const.vert.out | 1 - Test/baseResults/spv.textureoffset_non_const.vert.out | 1 - glslang/MachineIndependent/localintermediate.h | 10 +++++----- known_good.json | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/SPIRV/SpvTools.cpp b/SPIRV/SpvTools.cpp index a7a1a73a49..d1b411f29a 100644 --- a/SPIRV/SpvTools.cpp +++ b/SPIRV/SpvTools.cpp @@ -165,6 +165,7 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector< spvValidatorOptionsSetBeforeHlslLegalization(options, prelegalization); spvValidatorOptionsSetScalarBlockLayout(options, intermediate.usingScalarBlockLayout()); spvValidatorOptionsSetWorkgroupScalarBlockLayout(options, intermediate.usingScalarBlockLayout()); + spvValidatorOptionsSetAllowOffsetTextureOperand(options, intermediate.usingTextureOffsetNonConst()); spvValidateWithOptions(context, options, &binary, &diagnostic); // report diff --git a/Test/baseResults/spv.sparsetextureoffset_non_const.vert.out b/Test/baseResults/spv.sparsetextureoffset_non_const.vert.out index bf37b524b3..817a04cadf 100644 --- a/Test/baseResults/spv.sparsetextureoffset_non_const.vert.out +++ b/Test/baseResults/spv.sparsetextureoffset_non_const.vert.out @@ -1,5 +1,4 @@ spv.sparsetextureoffset_non_const.vert -Validation failed // Module Version 10000 // Generated by (magic number): 8000b // Id's are bound by 114 diff --git a/Test/baseResults/spv.textureoffset_non_const.vert.out b/Test/baseResults/spv.textureoffset_non_const.vert.out index 20191b92af..8a66e2fa35 100644 --- a/Test/baseResults/spv.textureoffset_non_const.vert.out +++ b/Test/baseResults/spv.textureoffset_non_const.vert.out @@ -1,5 +1,4 @@ spv.textureoffset_non_const.vert -Validation failed // Module Version 10000 // Generated by (magic number): 8000b // Id's are bound by 140 diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 2fae237a2f..0ab9e4b078 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -1035,11 +1035,11 @@ class TIntermediate { #endif bool usingScalarBlockLayout() const { - for (auto extIt = requestedExtensions.begin(); extIt != requestedExtensions.end(); ++extIt) { - if (*extIt == E_GL_EXT_scalar_block_layout) - return true; - } - return false; + return IsRequestedExtension(E_GL_EXT_scalar_block_layout); + } + + bool usingTextureOffsetNonConst() const { + return IsRequestedExtension(E_GL_EXT_texture_offset_non_const); } bool IsRequestedExtension(const char* extension) const diff --git a/known_good.json b/known_good.json index f2ed725b35..a6af44a378 100644 --- a/known_good.json +++ b/known_good.json @@ -5,7 +5,7 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit": "4d2f0b40bfe290dea6c6904dafdf7fd8328ba346" + "commit": "066c3d52c2fca8d9df79ca37055c3f5eddf2ffce" }, { "name" : "spirv-tools/external/spirv-headers",