Skip to content

Commit 1980a5d

Browse files
ConvertUBOToPushConstantPass: return SuccessWithoutChange if UBO is not found
1 parent aabb421 commit 1980a5d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Graphics/ShaderTools/src/ConvertUBOToPushConstant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class ConvertUBOToPushConstantPass : public spvtools::opt::Pass
9393
if (candidate_ids.empty())
9494
{
9595
// Block name not found
96-
return Status::Failure;
96+
return Status::SuccessWithoutChange;
9797
}
9898

9999
// Try each candidate ID to find a UniformBuffer
@@ -188,7 +188,7 @@ class ConvertUBOToPushConstantPass : public spvtools::opt::Pass
188188
if (target_var == nullptr)
189189
{
190190
// No UniformBuffer found with the given block name
191-
return Status::Failure;
191+
return Status::SuccessWithoutChange;
192192
}
193193

194194
uint32_t target_var_id = target_var->result_id();

Tests/DiligentCoreTest/src/ShaderTools/SPIRVShaderResourcesTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ void TestConvertUBOToPushConstant_InvalidBlockName(SHADER_COMPILER Compiler)
345345
if (::testing::Test::IsSkipped())
346346
return;
347347

348-
SPIRV = ConvertUBOToPushConstants(SPIRV, PatchedAttribName);
349-
EXPECT_TRUE(SPIRV.empty());
348+
std::vector<unsigned int> PatchedSPIRV = ConvertUBOToPushConstants(SPIRV, PatchedAttribName);
349+
EXPECT_EQ(SPIRV, PatchedSPIRV);
350350
}
351351

352352
TEST_F(SPIRVShaderResourcesTest, ConvertUBOToPushConstant_InvalidBlockName_GLSLang)
@@ -369,8 +369,8 @@ void TestConvertUBOToPushConstant_InvalidResourceType(SHADER_COMPILER Compiler)
369369
if (::testing::Test::IsSkipped())
370370
return;
371371

372-
SPIRV = ConvertUBOToPushConstants(SPIRV, PatchedAttribName);
373-
EXPECT_TRUE(SPIRV.empty());
372+
std::vector<unsigned int> PatchedSPIRV = ConvertUBOToPushConstants(SPIRV, PatchedAttribName);
373+
EXPECT_EQ(SPIRV, PatchedSPIRV);
374374
}
375375

376376
TEST_F(SPIRVShaderResourcesTest, ConvertUBOToPushConstant_InvalidResourceType_GLSLang)

0 commit comments

Comments
 (0)