Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spirv-val: Re-enable OpControlBarrier VU #5527

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions source/val/validate_memory_semantics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
2 changes: 2 additions & 0 deletions source/val/validation_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
38 changes: 19 additions & 19 deletions test/val/val_barriers_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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(
Expand All @@ -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"),
Expand All @@ -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"),
Expand All @@ -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"),
Expand All @@ -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"),
Expand All @@ -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"),
Expand All @@ -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"),
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down