Don0t leave accidental nonzero values

This commit is contained in:
Lander Gallastegi 2024-10-15 15:13:00 +02:00
parent 23f75bc6bb
commit 400773f21d

View File

@ -1066,7 +1066,10 @@ vk::ClearValue ColorBufferClearValue(const AmdGpu::Liverpool::ColorBuffer& color
} }
if (num_components == 1) { if (num_components == 1) {
if (comp_swap != Liverpool::ColorBuffer::SwapMode::Standard) {
color.float32[static_cast<int>(comp_swap)] = color.float32[0]; color.float32[static_cast<int>(comp_swap)] = color.float32[0];
color.float32[0] = 0.0f;
}
} else { } else {
if (comp_swap_alt && num_components == 4) { if (comp_swap_alt && num_components == 4) {
std::swap(color.float32[0], color.float32[2]); std::swap(color.float32[0], color.float32[2]);
@ -1077,7 +1080,7 @@ vk::ClearValue ColorBufferClearValue(const AmdGpu::Liverpool::ColorBuffer& color
} }
if (comp_swap_alt && num_components != 4) { if (comp_swap_alt && num_components != 4) {
std::swap(color.float32[num_components - 1], color.float32[3]); color.float32[3] = color.float32[num_components - 1];
color.float32[num_components - 1] = 0.0f; color.float32[num_components - 1] = 0.0f;
} }
} }