mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-23 12:10:06 +00:00
Image Operand Sample allows sparse image opcodes
@ehsannas had filed an issue against SPIR-V spec, concerning Image Operands section (3.14): Sample A following operand is the sample number of the sample to use. Only valid with OpImageFetch, OpImageRead, and OpImageWrite. Relaxing the check to allow OpImageSparseRead and OpImageSparseFetch to fix failing tests.
This commit is contained in:
parent
8c05012593
commit
dbc3a662c6
@ -469,10 +469,12 @@ spv_result_t ValidateImageOperands(ValidationState_t& _,
|
||||
|
||||
if (mask & SpvImageOperandsSampleMask) {
|
||||
if (opcode != SpvOpImageFetch && opcode != SpvOpImageRead &&
|
||||
opcode != SpvOpImageWrite) {
|
||||
opcode != SpvOpImageWrite && opcode != SpvOpImageSparseFetch &&
|
||||
opcode != SpvOpImageSparseRead) {
|
||||
return _.diag(SPV_ERROR_INVALID_DATA)
|
||||
<< "Image Operand Sample can only be used with OpImageFetch, "
|
||||
<< "OpImageRead and OpImageWrite: " << spvOpcodeString(opcode);
|
||||
<< "OpImageRead, OpImageWrite, OpImageSparseFetch and "
|
||||
<< "OpImageSparseRead: " << spvOpcodeString(opcode);
|
||||
}
|
||||
|
||||
if (info.multisampled == 0) {
|
||||
|
@ -2858,8 +2858,9 @@ TEST_F(ValidateImage, SampleWrongOpcode) {
|
||||
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
|
||||
EXPECT_THAT(getDiagnosticString(),
|
||||
HasSubstr("Image Operand Sample can only be used with "
|
||||
"OpImageFetch, OpImageRead "
|
||||
"and OpImageWrite: ImageSampleExplicitLod"));
|
||||
"OpImageFetch, OpImageRead, OpImageWrite, "
|
||||
"OpImageSparseFetch and OpImageSparseRead: "
|
||||
"ImageSampleExplicitLod"));
|
||||
}
|
||||
|
||||
TEST_F(ValidateImage, SampleImageToImageSuccess) {
|
||||
|
Loading…
Reference in New Issue
Block a user