mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Updated spirv-tools.
This commit is contained in:
@@ -461,6 +461,28 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!_.IsValidStorageClass(storage_class)) {
|
||||
return _.diag(SPV_ERROR_INVALID_BINARY, inst)
|
||||
<< "Invalid storage class for target environment";
|
||||
}
|
||||
|
||||
if (storage_class == SpvStorageClassGeneric) {
|
||||
return _.diag(SPV_ERROR_INVALID_BINARY, inst)
|
||||
<< "OpVariable storage class cannot be Generic";
|
||||
}
|
||||
|
||||
if (inst->function() && storage_class != SpvStorageClassFunction) {
|
||||
return _.diag(SPV_ERROR_INVALID_LAYOUT, inst)
|
||||
<< "Variables must have a function[7] storage class inside"
|
||||
" of a function";
|
||||
}
|
||||
|
||||
if (!inst->function() && storage_class == SpvStorageClassFunction) {
|
||||
return _.diag(SPV_ERROR_INVALID_LAYOUT, inst)
|
||||
<< "Variables can not have a function[7] storage class "
|
||||
"outside of a function";
|
||||
}
|
||||
|
||||
// SPIR-V 3.32.8: Check that pointer type and variable type have the same
|
||||
// storage class.
|
||||
const auto result_storage_class_index = 1;
|
||||
@@ -1568,8 +1590,8 @@ spv_result_t ValidatePtrComparison(ValidationState_t& _,
|
||||
<< "Operand type must be a pointer";
|
||||
}
|
||||
|
||||
SpvStorageClass sc = op1_type->GetOperandAs<SpvStorageClass>(1u);
|
||||
if (_.addressing_model() == SpvAddressingModelLogical) {
|
||||
SpvStorageClass sc = op1_type->GetOperandAs<SpvStorageClass>(1u);
|
||||
if (sc != SpvStorageClassWorkgroup && sc != SpvStorageClassStorageBuffer) {
|
||||
return _.diag(SPV_ERROR_INVALID_ID, inst)
|
||||
<< "Invalid pointer storage class";
|
||||
@@ -1580,6 +1602,9 @@ spv_result_t ValidatePtrComparison(ValidationState_t& _,
|
||||
<< "Workgroup storage class pointer requires VariablePointers "
|
||||
"capability to be specified";
|
||||
}
|
||||
} else if (sc == SpvStorageClassPhysicalStorageBuffer) {
|
||||
return _.diag(SPV_ERROR_INVALID_ID, inst)
|
||||
<< "Cannot use a pointer in the PhysicalStorageBuffer storage class";
|
||||
}
|
||||
|
||||
return SPV_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user