Initialize alpha to 1

This commit is contained in:
Lander Gallastegi 2024-10-15 00:30:32 +02:00
parent c3db3745a9
commit 665db9c339

View File

@ -748,6 +748,16 @@ vk::ClearValue ColorBufferClearValue(const AmdGpu::Liverpool::ColorBuffer& color
vk::ClearColorValue color{}; vk::ClearColorValue color{};
switch (number_type) {
case AmdGpu::NumberFormat::Uint:
case AmdGpu::NumberFormat::Sint:
color.uint32[3] = 1;
break;
default:
color.float32[3] = 1.0f;
break;
}
switch (format) { switch (format) {
case AmdGpu::DataFormat::Format8: case AmdGpu::DataFormat::Format8:
switch (number_type) { switch (number_type) {
@ -1060,6 +1070,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]); std::swap(color.float32[num_components - 1], color.float32[3]);
color.float32[num_components - 1] = 0.0f;
} }
} }