Skip to content

Commit

Permalink
Don0t leave accidental nonzero values
Browse files Browse the repository at this point in the history
  • Loading branch information
LNDF committed Oct 15, 2024
1 parent 23f75bc commit 400773f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/video_core/renderer_vulkan/liverpool_to_vk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,10 @@ vk::ClearValue ColorBufferClearValue(const AmdGpu::Liverpool::ColorBuffer& color
}

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

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;
}
}
Expand Down

0 comments on commit 400773f

Please sign in to comment.