[renderer_vulkan, sgsr] Another try

This commit is contained in:
CamilleLaVey 2026-01-14 16:29:31 -04:00 committed by crueter
parent b0da792e96
commit a6dc55425c
1 changed files with 4 additions and 7 deletions

View File

@ -116,14 +116,11 @@ VkImageView SGSR::Draw(Scheduler& scheduler, size_t image_index, VkImage source_
const f32 viewport_width = (crop_rect.right - crop_rect.left) * input_image_width; const f32 viewport_width = (crop_rect.right - crop_rect.left) * input_image_width;
const f32 viewport_height = (crop_rect.bottom - crop_rect.top) * input_image_height; const f32 viewport_height = (crop_rect.bottom - crop_rect.top) * input_image_height;
// ViewportInfo[0] = vec4(1/inputWidth, 1/inputHeight, inputWidth, inputHeight)
// .xy = pixel step size for texture sampling
// .zw = input texture dimensions for coordinate scaling
PushConstants viewport_con{}; PushConstants viewport_con{};
viewport_con[0] = std::bit_cast<u32>(1.f / input_image_width); viewport_con[0] = std::bit_cast<u32>(1.f / output_image_width);
viewport_con[1] = std::bit_cast<u32>(1.f / input_image_height); viewport_con[1] = std::bit_cast<u32>(1.f / output_image_height);
viewport_con[2] = std::bit_cast<u32>(input_image_width); viewport_con[2] = std::bit_cast<u32>(output_image_width);
viewport_con[3] = std::bit_cast<u32>(input_image_height); viewport_con[3] = std::bit_cast<u32>(output_image_height);
UploadImages(scheduler); UploadImages(scheduler);
UpdateDescriptorSets(source_image_view, image_index); UpdateDescriptorSets(source_image_view, image_index);