Fix compilation errors in Vulkan renderer

- Fix conversion warning in vk_zbc_clear.cpp by adding explicit static_cast<u8>
  to RGBA component extraction (same issue as OpenGL version)
- Remove unused renderpass_begin_info variable in present/taa.cpp to fix
  -Werror=unused-variable warning
This commit is contained in:
Zephyron
2025-09-21 14:53:23 +10:00
parent e6fa8cd74b
commit bc1b49285a
2 changed files with 4 additions and 18 deletions

View File

@@ -299,20 +299,6 @@ void TAA::Draw(Scheduler& scheduler, size_t image_index, VkImage* inout_image,
auto& image = m_dynamic_images[image_index];
const VkRenderPassBeginInfo renderpass_begin_info{
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
.pNext = nullptr,
.renderPass = *m_renderpass,
.framebuffer = *image.framebuffer,
.renderArea =
{
.offset = {0, 0},
.extent = m_extent,
},
.clearValueCount = 0,
.pClearValues = nullptr,
};
scheduler.RequestOutsideRenderPassOperationContext();
scheduler.Record([this, &image](vk::CommandBuffer cmdbuf) {
BeginRenderPass(cmdbuf, *m_renderpass, *image.framebuffer, m_extent);

View File

@@ -99,10 +99,10 @@ VkClearColorValue ZBCClear::ConvertColorToVulkan(const std::array<u32, 4>& color
const u32 primary_color = color_u32[0];
// Extract RGBA components (assuming RGBA8888 format)
const u8 r = (primary_color >> 0) & 0xFF;
const u8 g = (primary_color >> 8) & 0xFF;
const u8 b = (primary_color >> 16) & 0xFF;
const u8 a = (primary_color >> 24) & 0xFF;
const u8 r = static_cast<u8>((primary_color >> 0) & 0xFF);
const u8 g = static_cast<u8>((primary_color >> 8) & 0xFF);
const u8 b = static_cast<u8>((primary_color >> 16) & 0xFF);
const u8 a = static_cast<u8>((primary_color >> 24) & 0xFF);
// Convert to normalized float values [0.0, 1.0]
clear_color.float32[0] = static_cast<f32>(r) / 255.0f; // Red