[Vulkan] Smear scalar bools.
Addresses some shader validation warnings
This commit is contained in:
@@ -3333,7 +3333,8 @@ spv::Id SpirvShaderTranslator::EndianSwap128Uint4(spv::Id value,
|
|||||||
uint_vector_temp_.push_back(3);
|
uint_vector_temp_.push_back(3);
|
||||||
uint_vector_temp_.push_back(2);
|
uint_vector_temp_.push_back(2);
|
||||||
value = builder_->createTriOp(
|
value = builder_->createTriOp(
|
||||||
spv::OpSelect, type_uint4_, is_8in64,
|
spv::OpSelect, type_uint4_,
|
||||||
|
builder_->smearScalar(spv::NoPrecision, is_8in64, type_bool4_),
|
||||||
builder_->createRvalueSwizzle(spv::NoPrecision, type_uint4_, value,
|
builder_->createRvalueSwizzle(spv::NoPrecision, type_uint4_, value,
|
||||||
uint_vector_temp_),
|
uint_vector_temp_),
|
||||||
value);
|
value);
|
||||||
@@ -3348,7 +3349,8 @@ spv::Id SpirvShaderTranslator::EndianSwap128Uint4(spv::Id value,
|
|||||||
uint_vector_temp_.push_back(1);
|
uint_vector_temp_.push_back(1);
|
||||||
uint_vector_temp_.push_back(0);
|
uint_vector_temp_.push_back(0);
|
||||||
value = builder_->createTriOp(
|
value = builder_->createTriOp(
|
||||||
spv::OpSelect, type_uint4_, is_8in128,
|
spv::OpSelect, type_uint4_,
|
||||||
|
builder_->smearScalar(spv::NoPrecision, is_8in128, type_bool4_),
|
||||||
builder_->createRvalueSwizzle(spv::NoPrecision, type_uint4_, value,
|
builder_->createRvalueSwizzle(spv::NoPrecision, type_uint4_, value,
|
||||||
uint_vector_temp_),
|
uint_vector_temp_),
|
||||||
value);
|
value);
|
||||||
|
|||||||
@@ -172,9 +172,11 @@ void SpirvShaderTranslator::ExportToMemory(uint8_t export_eM) {
|
|||||||
uint_vector_temp_.push_back(1);
|
uint_vector_temp_.push_back(1);
|
||||||
uint_vector_temp_.push_back(0);
|
uint_vector_temp_.push_back(0);
|
||||||
uint_vector_temp_.push_back(3);
|
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) {
|
for_each_eM([&](uint32_t eM_index) {
|
||||||
eM_swapped[eM_index] = builder_->createTriOp(
|
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_,
|
builder_->createRvalueSwizzle(spv::NoPrecision, type_float4_,
|
||||||
eM_original[eM_index], uint_vector_temp_),
|
eM_original[eM_index], uint_vector_temp_),
|
||||||
eM_original[eM_index]);
|
eM_original[eM_index]);
|
||||||
|
|||||||
Reference in New Issue
Block a user