summaryrefslogtreecommitdiffstats
path: root/drivers/gles3/shaders
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-08 11:50:12 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-08 11:50:12 +0100
commit774c4631fd316cb51eb45c6972bfd54633ed86f9 (patch)
tree746e967a391d4c2ee0a3101876082c4a2e83f2b3 /drivers/gles3/shaders
parentdf29fc91edabf712d5e597d0ddd4cf015d99722e (diff)
parente69968b79432d1a3f9544e70b634f8fe08cb1aa8 (diff)
downloadredot-engine-774c4631fd316cb51eb45c6972bfd54633ed86f9.tar.gz
Merge pull request #84733 from clayjohn/GL-CanvasGroup-performance
Only copy the relevant portion of the screen when copying to backbuffer in Compatibility backend
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r--drivers/gles3/shaders/copy.glsl5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gles3/shaders/copy.glsl b/drivers/gles3/shaders/copy.glsl
index 265acc1430..f37968a4fd 100644
--- a/drivers/gles3/shaders/copy.glsl
+++ b/drivers/gles3/shaders/copy.glsl
@@ -3,6 +3,7 @@
mode_default = #define MODE_SIMPLE_COPY
mode_copy_section = #define USE_COPY_SECTION \n#define MODE_SIMPLE_COPY
+mode_copy_section_source = #define USE_COPY_SECTION \n#define MODE_SIMPLE_COPY \n#define MODE_COPY_FROM
mode_gaussian_blur = #define MODE_GAUSSIAN_BLUR
mode_mipmap = #define MODE_MIPMAP
mode_simple_color = #define MODE_SIMPLE_COLOR \n#define USE_COPY_SECTION
@@ -21,7 +22,7 @@ out vec2 uv_interp;
// Defined in 0-1 coords.
uniform highp vec4 copy_section;
#endif
-#ifdef MODE_GAUSSIAN_BLUR
+#if defined(MODE_GAUSSIAN_BLUR) || defined(MODE_COPY_FROM)
uniform highp vec4 source_section;
#endif
@@ -32,7 +33,7 @@ void main() {
#if defined(USE_COPY_SECTION) || defined(MODE_GAUSSIAN_BLUR)
gl_Position.xy = (copy_section.xy + uv_interp.xy * copy_section.zw) * 2.0 - 1.0;
#endif
-#ifdef MODE_GAUSSIAN_BLUR
+#if defined(MODE_GAUSSIAN_BLUR) || defined(MODE_COPY_FROM)
uv_interp = source_section.xy + uv_interp * source_section.zw;
#endif
}