[Vulkan] Smear scalar bools.

Addresses some shader validation warnings
This commit is contained in:
Herman S.
2025-12-14 00:42:08 +09:00
parent d505b6b53a
commit 6de637b794
2 changed files with 7 additions and 3 deletions

View File

@@ -172,9 +172,11 @@ void SpirvShaderTranslator::ExportToMemory(uint8_t export_eM) {
uint_vector_temp_.push_back(1);
uint_vector_temp_.push_back(0);
uint_vector_temp_.push_back(3);
spv::Id swap_red_blue_bool4 =
builder_->smearScalar(spv::NoPrecision, swap_red_blue, type_bool4_);
for_each_eM([&](uint32_t eM_index) {
eM_swapped[eM_index] = builder_->createTriOp(
spv::OpSelect, type_float4_, swap_red_blue,
spv::OpSelect, type_float4_, swap_red_blue_bool4,
builder_->createRvalueSwizzle(spv::NoPrecision, type_float4_,
eM_original[eM_index], uint_vector_temp_),
eM_original[eM_index]);