Update SPIRV-Headers (#4573)

* Add pass-through validation for Offsets image operand
  * it is counted as an offset parameter though
* Update DEPS
This commit is contained in:
alan-baker 2021-10-13 17:50:17 -04:00 committed by GitHub
parent 6dd73728e9
commit 0292d6b16a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 12 deletions

2
DEPS
View File

@ -6,7 +6,7 @@ vars = {
'effcee_revision': '2ec8f8738118cc483b67c04a759fee53496c5659',
'googletest_revision': '955c7f837efad184ec63e771c42542d37545eaef',
're2_revision': '4244cd1cb492fa1d10986ec67f862964c073f844',
'spirv_headers_revision': 'ae217c17809fadb232ec94b29304b4afcd417bb4',
'spirv_headers_revision': '19e8350415ed9516c8afffa19ae2c58559495a67',
}
deps = {

View File

@ -286,13 +286,14 @@ spv_result_t ValidateImageOperands(ValidationState_t& _,
// the module to be invalid.
if (mask == 0) return SPV_SUCCESS;
if (spvtools::utils::CountSetBits(
mask & (SpvImageOperandsOffsetMask | SpvImageOperandsConstOffsetMask |
SpvImageOperandsConstOffsetsMask)) > 1) {
if (spvtools::utils::CountSetBits(mask & (SpvImageOperandsOffsetMask |
SpvImageOperandsConstOffsetMask |
SpvImageOperandsConstOffsetsMask |
SpvImageOperandsOffsetsMask)) > 1) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(4662)
<< "Image Operands Offset, ConstOffset, ConstOffsets cannot be used "
<< "together";
<< "Image Operands Offset, ConstOffset, ConstOffsets, Offsets "
"cannot be used together";
}
const bool is_implicit_lod = IsImplicitLod(opcode);
@ -625,6 +626,10 @@ spv_result_t ValidateImageOperands(ValidationState_t& _,
// setup.
}
if (mask & SpvImageOperandsOffsetsMask) {
// TODO: add validation
}
return SPV_SUCCESS;
}

View File

@ -1815,9 +1815,10 @@ TEST_F(ValidateImage, SampleImplicitLodMoreThanOneOffset) {
CompileSuccessfully(GenerateShaderCode(body).c_str());
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Image Operands Offset, ConstOffset, ConstOffsets "
"cannot be used together"));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Image Operands Offset, ConstOffset, ConstOffsets, Offsets "
"cannot be used together"));
}
TEST_F(ValidateImage, SampleImplicitLodVulkanMoreThanOneOffset) {
@ -1833,9 +1834,10 @@ TEST_F(ValidateImage, SampleImplicitLodVulkanMoreThanOneOffset) {
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
EXPECT_THAT(getDiagnosticString(),
AnyVUID("VUID-StandaloneSpirv-Offset-04662"));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Image Operands Offset, ConstOffset, ConstOffsets "
"cannot be used together"));
EXPECT_THAT(
getDiagnosticString(),
HasSubstr("Image Operands Offset, ConstOffset, ConstOffsets, Offsets "
"cannot be used together"));
}
TEST_F(ValidateImage, SampleImplicitLodMinLodWrongType) {