diff options
author | GPUCode <geoster3d@gmail.com> | 2023-09-23 10:25:24 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-09-25 15:20:32 +0200 |
commit | b60013b27764c4aa75125a5d8159f27a58bedf6c (patch) | |
tree | df3e2dadd6fee709483da4dc7cb30b83a4403e7e /src/video_core/host_shaders/convert_non_msaa_to_msaa.comp | |
parent | renderer_vulkan: Implement MSAA copies (diff) | |
download | yuzu-b60013b27764c4aa75125a5d8159f27a58bedf6c.tar yuzu-b60013b27764c4aa75125a5d8159f27a58bedf6c.tar.gz yuzu-b60013b27764c4aa75125a5d8159f27a58bedf6c.tar.bz2 yuzu-b60013b27764c4aa75125a5d8159f27a58bedf6c.tar.lz yuzu-b60013b27764c4aa75125a5d8159f27a58bedf6c.tar.xz yuzu-b60013b27764c4aa75125a5d8159f27a58bedf6c.tar.zst yuzu-b60013b27764c4aa75125a5d8159f27a58bedf6c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/host_shaders/convert_non_msaa_to_msaa.comp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/video_core/host_shaders/convert_non_msaa_to_msaa.comp b/src/video_core/host_shaders/convert_non_msaa_to_msaa.comp index dedd962f1..c7ce38efa 100644 --- a/src/video_core/host_shaders/convert_non_msaa_to_msaa.comp +++ b/src/video_core/host_shaders/convert_non_msaa_to_msaa.comp @@ -15,9 +15,12 @@ void main() { // TODO: Specialization constants for num_samples? const int num_samples = imageSamples(output_msaa); + const ivec3 msaa_size = imageSize(output_msaa); + const ivec3 out_size = imageSize(img_in); + const ivec3 scale = out_size / msaa_size; for (int curr_sample = 0; curr_sample < num_samples; ++curr_sample) { - const int single_sample_x = 2 * coords.x + (curr_sample & 1); - const int single_sample_y = 2 * coords.y + ((curr_sample / 2) & 1); + const int single_sample_x = scale.x * coords.x + (curr_sample & 1); + const int single_sample_y = scale.y * coords.y + ((curr_sample / 2) & 1); const ivec3 single_coords = ivec3(single_sample_x, single_sample_y, coords.z); if (any(greaterThanEqual(single_coords, imageSize(img_in)))) { |