mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-21 19:20:07 +00:00
spirv-val: Re-enable OpControlBarrier VU (#5527)
This commit is contained in:
parent
5dbdc7b60b
commit
c96fe8b943
@ -203,15 +203,12 @@ spv_result_t ValidateMemorySemantics(ValidationState_t& _,
|
||||
"storage class";
|
||||
}
|
||||
|
||||
#if 0
|
||||
// TODO(atgoo@github.com): this check fails Vulkan CTS, reenable once fixed.
|
||||
if (opcode == spv::Op::OpControlBarrier && value && !includes_storage_class) {
|
||||
return _.diag(SPV_ERROR_INVALID_DATA, inst)
|
||||
<< spvOpcodeString(opcode)
|
||||
<< _.VkErrorID(4650) << spvOpcodeString(opcode)
|
||||
<< ": expected Memory Semantics to include a Vulkan-supported "
|
||||
"storage class if Memory Semantics is not None";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (opcode == spv::Op::OpAtomicFlagClear &&
|
||||
|
@ -2125,6 +2125,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
|
||||
return VUID_WRAP(VUID-StandaloneSpirv-None-04644);
|
||||
case 4645:
|
||||
return VUID_WRAP(VUID-StandaloneSpirv-None-04645);
|
||||
case 4650:
|
||||
return VUID_WRAP(VUID-StandaloneSpirv-OpControlBarrier-04650);
|
||||
case 4651:
|
||||
return VUID_WRAP(VUID-StandaloneSpirv-OpVariable-04651);
|
||||
case 4652:
|
||||
|
@ -410,7 +410,7 @@ OpControlBarrier %subgroup %cross_device %none
|
||||
TEST_F(ValidateBarriers,
|
||||
OpControlBarrierVulkan1p1WorkgroupNonComputeMemoryFailure) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %workgroup %acquire
|
||||
OpControlBarrier %subgroup %workgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateVulkanVertexShaderCode(body), SPV_ENV_VULKAN_1_1);
|
||||
@ -427,7 +427,7 @@ OpControlBarrier %subgroup %workgroup %acquire
|
||||
TEST_F(ValidateBarriers,
|
||||
OpControlBarrierVulkan1p1WorkgroupNonComputeExecutionFailure) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %workgroup %subgroup %acquire
|
||||
OpControlBarrier %workgroup %subgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateVulkanVertexShaderCode(body), SPV_ENV_VULKAN_1_1);
|
||||
@ -442,7 +442,7 @@ OpControlBarrier %workgroup %subgroup %acquire
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierVulkan1p1WorkgroupComputeSuccess) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %workgroup %workgroup %acquire
|
||||
OpControlBarrier %workgroup %workgroup %acquire_uniform_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_1);
|
||||
@ -451,7 +451,7 @@ OpControlBarrier %workgroup %workgroup %acquire
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierVulkan1p1WorkgroupNonComputeSuccess) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %subgroup %acquire
|
||||
OpControlBarrier %subgroup %subgroup %acquire_uniform_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateVulkanVertexShaderCode(body), SPV_ENV_VULKAN_1_1);
|
||||
@ -495,15 +495,15 @@ OpControlBarrier %device %device %acquire_and_release_uniform
|
||||
"AcquireRelease or SequentiallyConsistent"));
|
||||
}
|
||||
|
||||
// TODO(atgoo@github.com): the corresponding check fails Vulkan CTS,
|
||||
// reenable once fixed.
|
||||
TEST_F(ValidateBarriers, DISABLED_OpControlBarrierVulkanSubgroupStorageClass) {
|
||||
TEST_F(ValidateBarriers, OpControlBarrierVulkanSubgroupStorageClass) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %workgroup %device %acquire_release_subgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body), SPV_ENV_VULKAN_1_0);
|
||||
ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
|
||||
EXPECT_THAT(getDiagnosticString(),
|
||||
AnyVUID("VUID-StandaloneSpirv-OpControlBarrier-04650"));
|
||||
EXPECT_THAT(
|
||||
getDiagnosticString(),
|
||||
HasSubstr(
|
||||
@ -513,7 +513,7 @@ OpControlBarrier %workgroup %device %acquire_release_subgroup
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierSubgroupExecutionFragment1p1) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %subgroup %acquire_release_subgroup
|
||||
OpControlBarrier %subgroup %subgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body, "", "Fragment"),
|
||||
@ -523,7 +523,7 @@ OpControlBarrier %subgroup %subgroup %acquire_release_subgroup
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierWorkgroupExecutionFragment1p1) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %workgroup %workgroup %acquire_release
|
||||
OpControlBarrier %workgroup %workgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body, "", "Fragment"),
|
||||
@ -541,7 +541,7 @@ OpControlBarrier %workgroup %workgroup %acquire_release
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierSubgroupExecutionFragment1p0) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %workgroup %acquire_release
|
||||
OpControlBarrier %subgroup %workgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body, "", "Fragment"),
|
||||
@ -556,7 +556,7 @@ OpControlBarrier %subgroup %workgroup %acquire_release
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierSubgroupExecutionVertex1p1) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %subgroup %acquire_release_subgroup
|
||||
OpControlBarrier %subgroup %subgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body, "", "Vertex"),
|
||||
@ -566,7 +566,7 @@ OpControlBarrier %subgroup %subgroup %acquire_release_subgroup
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierWorkgroupExecutionVertex1p1) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %workgroup %workgroup %acquire_release
|
||||
OpControlBarrier %workgroup %workgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body, "", "Vertex"),
|
||||
@ -584,7 +584,7 @@ OpControlBarrier %workgroup %workgroup %acquire_release
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierSubgroupExecutionVertex1p0) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %workgroup %acquire_release
|
||||
OpControlBarrier %subgroup %workgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body, "", "Vertex"),
|
||||
@ -599,7 +599,7 @@ OpControlBarrier %subgroup %workgroup %acquire_release
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierSubgroupExecutionGeometry1p1) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %subgroup %acquire_release_subgroup
|
||||
OpControlBarrier %subgroup %subgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(
|
||||
@ -610,7 +610,7 @@ OpControlBarrier %subgroup %subgroup %acquire_release_subgroup
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierWorkgroupExecutionGeometry1p1) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %workgroup %workgroup %acquire_release
|
||||
OpControlBarrier %workgroup %workgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(
|
||||
@ -629,7 +629,7 @@ OpControlBarrier %workgroup %workgroup %acquire_release
|
||||
|
||||
TEST_F(ValidateBarriers, OpControlBarrierSubgroupExecutionGeometry1p0) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %workgroup %acquire_release
|
||||
OpControlBarrier %subgroup %workgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(
|
||||
@ -646,7 +646,7 @@ OpControlBarrier %subgroup %workgroup %acquire_release
|
||||
TEST_F(ValidateBarriers,
|
||||
OpControlBarrierSubgroupExecutionTessellationEvaluation1p1) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %subgroup %acquire_release_subgroup
|
||||
OpControlBarrier %subgroup %subgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body, "OpCapability Tessellation\n",
|
||||
@ -658,7 +658,7 @@ OpControlBarrier %subgroup %subgroup %acquire_release_subgroup
|
||||
TEST_F(ValidateBarriers,
|
||||
OpControlBarrierWorkgroupExecutionTessellationEvaluation1p1) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %workgroup %workgroup %acquire_release
|
||||
OpControlBarrier %workgroup %workgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body, "OpCapability Tessellation\n",
|
||||
@ -678,7 +678,7 @@ OpControlBarrier %workgroup %workgroup %acquire_release
|
||||
TEST_F(ValidateBarriers,
|
||||
OpControlBarrierSubgroupExecutionTessellationEvaluation1p0) {
|
||||
const std::string body = R"(
|
||||
OpControlBarrier %subgroup %workgroup %acquire_release
|
||||
OpControlBarrier %subgroup %workgroup %acquire_release_workgroup
|
||||
)";
|
||||
|
||||
CompileSuccessfully(GenerateShaderCode(body, "OpCapability Tessellation\n",
|
||||
|
Loading…
Reference in New Issue
Block a user