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_misc.cpp')
-rw-r--r--source/val/validate_misc.cpp41
1 files changed, 21 insertions, 20 deletions
diff --git a/source/val/validate_misc.cpp b/source/val/validate_misc.cpp
index 5acc21eaa..d71fd2d26 100644
--- a/source/val/validate_misc.cpp
+++ b/source/val/validate_misc.cpp
@@ -30,7 +30,7 @@ spv_result_t ValidateUndef(ValidationState_t& _, const Instruction* inst) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Cannot create undefined values with void type";
}
- if (_.HasCapability(SpvCapabilityShader) &&
+ if (_.HasCapability(spv::Capability::Shader) &&
_.ContainsLimitedUseIntOrFloatType(inst->type_id()) &&
!_.IsPointerType(inst->type_id())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
@@ -50,7 +50,8 @@ spv_result_t ValidateShaderClock(ValidationState_t& _,
bool is_int32 = false, is_const_int32 = false;
uint32_t value = 0;
std::tie(is_int32, is_const_int32, value) = _.EvalInt32IfConst(scope);
- if (is_const_int32 && value != SpvScopeSubgroup && value != SpvScopeDevice) {
+ if (is_const_int32 && spv::Scope(value) != spv::Scope::Subgroup &&
+ spv::Scope(value) != spv::Scope::Device) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(4652) << "Scope must be Subgroup or Device";
}
@@ -104,18 +105,18 @@ spv_result_t ValidateExpect(ValidationState_t& _, const Instruction* inst) {
spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst) {
switch (inst->opcode()) {
- case SpvOpUndef:
+ case spv::Op::OpUndef:
if (auto error = ValidateUndef(_, inst)) return error;
break;
default:
break;
}
switch (inst->opcode()) {
- case SpvOpBeginInvocationInterlockEXT:
- case SpvOpEndInvocationInterlockEXT:
+ case spv::Op::OpBeginInvocationInterlockEXT:
+ case spv::Op::OpEndInvocationInterlockEXT:
_.function(inst->function()->id())
->RegisterExecutionModelLimitation(
- SpvExecutionModelFragment,
+ spv::ExecutionModel::Fragment,
"OpBeginInvocationInterlockEXT/OpEndInvocationInterlockEXT "
"require Fragment execution model");
@@ -126,14 +127,14 @@ spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst) {
const auto* execution_modes =
state.GetExecutionModes(entry_point->id());
- auto find_interlock = [](const SpvExecutionMode& mode) {
+ auto find_interlock = [](const spv::ExecutionMode& mode) {
switch (mode) {
- case SpvExecutionModePixelInterlockOrderedEXT:
- case SpvExecutionModePixelInterlockUnorderedEXT:
- case SpvExecutionModeSampleInterlockOrderedEXT:
- case SpvExecutionModeSampleInterlockUnorderedEXT:
- case SpvExecutionModeShadingRateInterlockOrderedEXT:
- case SpvExecutionModeShadingRateInterlockUnorderedEXT:
+ case spv::ExecutionMode::PixelInterlockOrderedEXT:
+ case spv::ExecutionMode::PixelInterlockUnorderedEXT:
+ case spv::ExecutionMode::SampleInterlockOrderedEXT:
+ case spv::ExecutionMode::SampleInterlockUnorderedEXT:
+ case spv::ExecutionMode::ShadingRateInterlockOrderedEXT:
+ case spv::ExecutionMode::ShadingRateInterlockUnorderedEXT:
return true;
default:
return false;
@@ -156,18 +157,18 @@ spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst) {
return true;
});
break;
- case SpvOpDemoteToHelperInvocationEXT:
+ case spv::Op::OpDemoteToHelperInvocationEXT:
_.function(inst->function()->id())
->RegisterExecutionModelLimitation(
- SpvExecutionModelFragment,
+ spv::ExecutionModel::Fragment,
"OpDemoteToHelperInvocationEXT requires Fragment execution "
"model");
break;
- case SpvOpIsHelperInvocationEXT: {
+ case spv::Op::OpIsHelperInvocationEXT: {
const uint32_t result_type = inst->type_id();
_.function(inst->function()->id())
->RegisterExecutionModelLimitation(
- SpvExecutionModelFragment,
+ spv::ExecutionModel::Fragment,
"OpIsHelperInvocationEXT requires Fragment execution model");
if (!_.IsBoolScalarType(result_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
@@ -175,17 +176,17 @@ spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst) {
<< spvOpcodeString(inst->opcode());
break;
}
- case SpvOpReadClockKHR:
+ case spv::Op::OpReadClockKHR:
if (auto error = ValidateShaderClock(_, inst)) {
return error;
}
break;
- case SpvOpAssumeTrueKHR:
+ case spv::Op::OpAssumeTrueKHR:
if (auto error = ValidateAssumeTrue(_, inst)) {
return error;
}
break;
- case SpvOpExpectKHR:
+ case spv::Op::OpExpectKHR:
if (auto error = ValidateExpect(_, inst)) {
return error;
}