Updated spirv-tools.

This commit is contained in:
Бранимир Караџић
2024-10-18 20:28:32 -07:00
parent 0796d4ffab
commit 4157813255
76 changed files with 4871 additions and 4434 deletions

View File

@@ -156,7 +156,9 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _,
param_nonarray_type_id =
_.FindDef(param_nonarray_type_id)->GetOperandAs<uint32_t>(1u);
}
if (_.GetIdOpcode(param_nonarray_type_id) == spv::Op::OpTypePointer) {
if (_.GetIdOpcode(param_nonarray_type_id) == spv::Op::OpTypePointer ||
_.GetIdOpcode(param_nonarray_type_id) ==
spv::Op::OpTypeUntypedPointerKHR) {
auto param_nonarray_type = _.FindDef(param_nonarray_type_id);
if (param_nonarray_type->GetOperandAs<spv::StorageClass>(1u) ==
spv::StorageClass::PhysicalStorageBuffer) {
@@ -185,7 +187,7 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _,
<< ": can't specify both Aliased and Restrict for "
"PhysicalStorageBuffer pointer.";
}
} else {
} else if (param_nonarray_type->opcode() == spv::Op::OpTypePointer) {
const auto pointee_type_id =
param_nonarray_type->GetOperandAs<uint32_t>(2);
const auto pointee_type = _.FindDef(pointee_type_id);
@@ -288,7 +290,8 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _,
}
if (_.addressing_model() == spv::AddressingModel::Logical) {
if (parameter_type->opcode() == spv::Op::OpTypePointer &&
if ((parameter_type->opcode() == spv::Op::OpTypePointer ||
parameter_type->opcode() == spv::Op::OpTypeUntypedPointerKHR) &&
!_.options()->relax_logical_pointer) {
spv::StorageClass sc =
parameter_type->GetOperandAs<spv::StorageClass>(1u);
@@ -317,9 +320,11 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _,
// Validate memory object declaration requirements.
if (argument->opcode() != spv::Op::OpVariable &&
argument->opcode() != spv::Op::OpUntypedVariableKHR &&
argument->opcode() != spv::Op::OpFunctionParameter) {
const bool ssbo_vptr = _.features().variable_pointers &&
sc == spv::StorageClass::StorageBuffer;
const bool ssbo_vptr =
_.HasCapability(spv::Capability::VariablePointersStorageBuffer) &&
sc == spv::StorageClass::StorageBuffer;
const bool wg_vptr =
_.HasCapability(spv::Capability::VariablePointers) &&
sc == spv::StorageClass::Workgroup;