From 88a3c05b7bad050d4e24c299425a6c480d1facac Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 4 Apr 2019 20:07:11 -0300 Subject: gl_shader_decompiler: Fix TXQ types TXQ returns integer types. Shaders usually do: R0 = TXQ(); // => int R0 = static_cast(R0); If we don't treat it as an integer, it will cast a binary float value as float - resulting in a corrupted number. --- src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 11d1169f0..7300a4037 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -1196,11 +1196,12 @@ private: switch (meta->element) { case 0: case 1: - return "textureSize(" + sampler + ", " + lod + ')' + GetSwizzle(meta->element); + return "itof(int(textureSize(" + sampler + ", " + lod + ')' + + GetSwizzle(meta->element) + "))"; case 2: return "0"; case 3: - return "textureQueryLevels(" + sampler + ')'; + return "itof(textureQueryLevels(" + sampler + "))"; } UNREACHABLE(); return "0"; -- cgit v1.2.3