mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-10-18 19:20:05 +00:00
parent
1a2de48a12
commit
55adf4cf70
@ -123,11 +123,11 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _,
|
||||
// WebGPU Specific rules
|
||||
if (spvIsWebGPUEnv(_.context()->target_env)) {
|
||||
// Scope for execution must be limited to Workgroup or Subgroup
|
||||
if (value != SpvScopeWorkgroup && value != SpvScopeSubgroup) {
|
||||
if (value != SpvScopeWorkgroup) {
|
||||
return _.diag(SPV_ERROR_INVALID_DATA, inst)
|
||||
<< spvOpcodeString(opcode)
|
||||
<< ": in WebGPU environment Execution Scope is limited to "
|
||||
<< "Workgroup and Subgroup";
|
||||
<< "Workgroup";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -403,7 +403,7 @@ OpControlBarrier %device %workgroup %none
|
||||
"is limited to Workgroup and Subgroup"));
|
||||
}
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierWebGPUExecutionScopeDevice) {
|
||||
TEST_F(ValidateBarriers, OpControlBarrierWebGPUExecutionScopeDeviceBad) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %device %workgroup %none
|
||||
)";
|
||||
@ -412,7 +412,19 @@ OpControlBarrier %device %workgroup %none
|
||||
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_WEBGPU_0));
|
||||
EXPECT_THAT(getDiagnosticString(),
|
||||
HasSubstr("ControlBarrier: in WebGPU environment Execution Scope "
|
||||
"is limited to Workgroup and Subgroup"));
|
||||
"is limited to Workgroup"));
|
||||
}
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierWebGPUExecutionScopeSubgroupBad) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %workgroup %none
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateWebGPUShaderCode(body), SPV_ENV_WEBGPU_0);
|
||||
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_WEBGPU_0));
|
||||
EXPECT_THAT(getDiagnosticString(),
|
||||
HasSubstr("ControlBarrier: in WebGPU environment Execution Scope "
|
||||
"is limited to Workgroup"));
|
||||
}
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierVulkanMemoryScopeSubgroup) {
|
||||
|
Loading…
Reference in New Issue
Block a user