diff options
| author | Wollnashorn <Wollnashorn@users.noreply.github.com> | 2023-04-05 01:29:46 +0200 |
|---|---|---|
| committer | Wollnashorn <Wollnashorn@users.noreply.github.com> | 2023-04-08 16:12:30 +0200 |
| commit | 780240e6979b198e7bd10feaad5399b8b4b63762 (patch) | |
| tree | c145f48c66cf003e618cefc63496e3f5b7637f56 /src/video_core/renderer_opengl/gl_device.h | |
| parent | bbdfe1fab1f1706b7e6a62d93951bb451bbeec43 (diff) | |
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_opengl/gl_device.h')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_device.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h index 3ff8cad83..e8104c4de 100644 --- a/src/video_core/renderer_opengl/gl_device.h +++ b/src/video_core/renderer_opengl/gl_device.h @@ -160,6 +160,10 @@ public: return need_fastmath_off; } + bool NeedsGatherSubpixelOffset() const { + return need_gather_subpixel_offset; + } + bool HasCbufFtouBug() const { return has_cbuf_ftou_bug; } @@ -225,6 +229,7 @@ private: bool has_draw_texture{}; bool warp_size_potentially_larger_than_guest{}; bool need_fastmath_off{}; + bool need_gather_subpixel_offset{}; bool has_cbuf_ftou_bug{}; bool has_bool_ref_bug{}; bool can_report_memory{}; |
