Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/val/validate_ray_query.cpp')
-rw-r--r--source/val/validate_ray_query.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/val/validate_ray_query.cpp b/source/val/validate_ray_query.cpp
index f92bf016a..b553449d0 100644
--- a/source/val/validate_ray_query.cpp
+++ b/source/val/validate_ray_query.cpp
@@ -28,8 +28,10 @@ spv_result_t ValidateRayQueryPointer(ValidationState_t& _,
uint32_t ray_query_index) {
const uint32_t ray_query_id = inst->GetOperandAs<uint32_t>(ray_query_index);
auto variable = _.FindDef(ray_query_id);
- if (!variable || (variable->opcode() != SpvOpVariable &&
- variable->opcode() != SpvOpFunctionParameter)) {
+ const auto var_opcode = variable->opcode();
+ if (!variable ||
+ (var_opcode != SpvOpVariable && var_opcode != SpvOpFunctionParameter &&
+ var_opcode != SpvOpAccessChain)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Ray Query must be a memory object declaration";
}