From 49ba71a5945f51fa17e8ce286d6247b0b8244a1e Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Wed, 26 Nov 2025 00:35:37 -0400 Subject: [PATCH] [vk, rasterizer] offsets float x Uint --- src/video_core/renderer_vulkan/vk_rasterizer.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index e9ad59158a..7a8138edcb 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -1404,8 +1404,10 @@ void RasterizerVulkan::UpdateSampleLocations(Tegra::Engines::Maxwell3D::Regs& re for (u32 sample_index = 0; sample_index < sample_count; ++sample_index) { const auto& packed = regs.multisample_sample_locations[sample_index / 4]; const auto [raw_x, raw_y] = packed.Location(sample_index % 4); - const float x = clamp_coord((static_cast(raw_x) - 8) * unit); - const float y = clamp_coord((static_cast(raw_y) - 8) * unit); + const float offset_x = static_cast(static_cast(raw_x) - 8); + const float offset_y = static_cast(static_cast(raw_y) - 8); + const float x = clamp_coord(offset_x * unit); + const float y = clamp_coord(offset_y * unit); locations[sample_index] = VkSampleLocationEXT{.x = x, .y = y}; } @@ -1415,12 +1417,13 @@ void RasterizerVulkan::UpdateSampleLocations(Tegra::Engines::Maxwell3D::Regs& re .sampleLocationsPerPixel = vk_samples, .sampleLocationGridSize = {1u, 1u}, .sampleLocationsCount = sample_count, - .pSampleLocations = locations.data(), + .pSampleLocations = nullptr, }; - scheduler.Record([info, locations](vk::CommandBuffer cmdbuf) mutable { + const auto sample_locations = locations; + scheduler.Record([info, sample_locations](vk::CommandBuffer cmdbuf) { auto info_copy = info; - info_copy.pSampleLocations = locations.data(); + info_copy.pSampleLocations = sample_locations.data(); cmdbuf.SetSampleLocationsEXT(info_copy); }); }