diff options
| author | 2023-04-05 01:29:46 +0200 | |
|---|---|---|
| committer | 2023-04-08 16:12:30 +0200 | |
| commit | 780240e6979b198e7bd10feaad5399b8b4b63762 (patch) | |
| tree | c145f48c66cf003e618cefc63496e3f5b7637f56 /src/video_core/renderer_vulkan | |
| parent | Merge pull request #10024 from german77/crysis (diff) | |
| download | yuzu-780240e6979b198e7bd10feaad5399b8b4b63762.tar.gz yuzu-780240e6979b198e7bd10feaad5399b8b4b63762.tar.xz yuzu-780240e6979b198e7bd10feaad5399b8b4b63762.zip | |
shader_recompiler: Add subpixel offset for correct rounding at `ImageGather`
On AMD a subpixel offset of 1/512 of the texel size is applied to the texture coordinates at a ImageGather call to ensure the rounding at the texel centers is done the same way as in Maxwell or other Nvidia architectures.
See https://www.reedbeta.com/blog/texture-gathers-and-coordinate-precision/ for more details why this might be necessary.
This should fix shadow artifacts at object edges in Zelda: Breath of the Wild (#9957, #6956).
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 0684cceed..f51257267 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -329,6 +329,7 @@ PipelineCache::PipelineCache(RasterizerVulkan& rasterizer_, const Device& device | |||
| 329 | 329 | ||
| 330 | .lower_left_origin_mode = false, | 330 | .lower_left_origin_mode = false, |
| 331 | .need_declared_frag_colors = false, | 331 | .need_declared_frag_colors = false, |
| 332 | .need_gather_subpixel_offset = device.NeedsGatherSubpixelOffset(), | ||
| 332 | 333 | ||
| 333 | .has_broken_spirv_clamp = driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, | 334 | .has_broken_spirv_clamp = driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, |
| 334 | .has_broken_spirv_position_input = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, | 335 | .has_broken_spirv_position_input = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY, |