From 201edfb02df05025c3443fe067c4777915d9df6c Mon Sep 17 00:00:00 2001 From: Paris Oplopoios Date: Tue, 27 Aug 2024 19:47:27 +0300 Subject: [PATCH] I hate the gles.patch (#590) --- .github/gles.patch | 8 ++++---- src/core/PICA/shader_gen_glsl.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/gles.patch b/.github/gles.patch index c5cdb7d4..50721dac 100644 --- a/.github/gles.patch +++ b/.github/gles.patch @@ -21,7 +21,7 @@ index 990e2f80..2e7842ac 100644 void main() { diff --git a/src/host_shaders/opengl_fragment_shader.frag b/src/host_shaders/opengl_fragment_shader.frag -index 9f07df0b..2ab623af 100644 +index 9f07df0b..75b708f7 100644 --- a/src/host_shaders/opengl_fragment_shader.frag +++ b/src/host_shaders/opengl_fragment_shader.frag @@ -1,4 +1,5 @@ @@ -97,9 +97,9 @@ index 9f07df0b..2ab623af 100644 - int se_x = bitfieldExtract(GPUREG_LIGHTi_SPOTDIR_LOW, 0, 13); - int se_y = bitfieldExtract(GPUREG_LIGHTi_SPOTDIR_LOW, 16, 13); - int se_z = bitfieldExtract(GPUREG_LIGHTi_SPOTDIR_HIGH, 0, 13); -+ int se_x = bitfieldExtract(uint(GPUREG_LIGHTi_SPOTDIR_LOW), 0, 13); -+ int se_y = bitfieldExtract(uint(GPUREG_LIGHTi_SPOTDIR_LOW), 16, 13); -+ int se_z = bitfieldExtract(uint(GPUREG_LIGHTi_SPOTDIR_HIGH), 0, 13); ++ int se_x = bitfieldExtractCompat(uint(GPUREG_LIGHTi_SPOTDIR_LOW), 0, 13); ++ int se_y = bitfieldExtractCompat(uint(GPUREG_LIGHTi_SPOTDIR_LOW), 16, 13); ++ int se_z = bitfieldExtractCompat(uint(GPUREG_LIGHTi_SPOTDIR_HIGH), 0, 13); if ((se_x & 0x1000) == 0x1000) se_x |= 0xffffe000; if ((se_y & 0x1000) == 0x1000) se_y |= 0xffffe000; diff --git a/src/core/PICA/shader_gen_glsl.cpp b/src/core/PICA/shader_gen_glsl.cpp index aa605dd2..154e403c 100644 --- a/src/core/PICA/shader_gen_glsl.cpp +++ b/src/core/PICA/shader_gen_glsl.cpp @@ -44,7 +44,6 @@ std::string FragmentGenerator::getDefaultVertexShader() { if (api == API::GLES) { ret += R"( #define USING_GLES 1 - #define fma(a, b, c) ((a) * (b) + (c)) precision mediump int; precision mediump float; @@ -108,6 +107,7 @@ std::string FragmentGenerator::generate(const FragmentConfig& config) { if (api == API::GLES) { ret += R"( #define USING_GLES 1 + #define fma(a, b, c) ((a) * (b) + (c)) precision mediump int; precision mediump float;