From d7db0881808376864eb71eb5dde8b651a5cf891d Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 7 Apr 2020 20:38:14 -0300 Subject: video_core/texture: Use a LUT to convert sRGB texture borders This is a reversed look up table extracted from https://gist.github.com/rygorous/2203834#file-gistfile1-cpp-L41-L62 that is used in https://github.com/devkitPro/deko3d/blob/04d4e9e587fa3dc5447b43d273bc45f440226e41/source/maxwell/tsc_generate.cpp#L38 Games usually bind 0xFD expecting a float texture border of 1.0f. The conversion previous to this commit was multiplying the uint8 sRGB texture border color by 255. This is close to 1.0f but when that difference matters, some graphical glitches appear. This look up table is manually changed in the edges, clamping towards 0.0f and 1.0f. While we are at it, move this logic to its own translation unit. --- src/video_core/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'src/video_core/CMakeLists.txt') diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index effe76a63..f7febd6a2 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -148,6 +148,7 @@ add_library(video_core STATIC textures/convert.h textures/decoders.cpp textures/decoders.h + textures/texture.cpp textures/texture.h video_core.cpp video_core.h -- cgit v1.2.3