summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2023-02-03 10:34:30 -0800
committerclayjohn <claynjohn@gmail.com>2023-02-03 10:34:30 -0800
commitbf0cc8f52aa40e4859806032aeee8e13971d511b (patch)
treeadbb943a1d6defcfdc398ca9232ef4970648a298 /drivers/gles3/shaders
parenta16b0fec4093b22ef5f14c1a4eb9363c890ab06d (diff)
Ignore instance color and instance custom_data when not used in the OpenGL renderer
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r--drivers/gles3/shaders/canvas.glsl10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl
index 1631c65385..8c7b52f379 100644
--- a/drivers/gles3/shaders/canvas.glsl
+++ b/drivers/gles3/shaders/canvas.glsl
@@ -162,9 +162,13 @@ void main() {
vec2 uv = uv_attrib;
#ifdef USE_INSTANCING
- vec4 instance_color = vec4(unpackHalf2x16(instance_color_custom_data.x), unpackHalf2x16(instance_color_custom_data.y));
- color *= instance_color;
- instance_custom = vec4(unpackHalf2x16(instance_color_custom_data.z), unpackHalf2x16(instance_color_custom_data.w));
+ if (bool(read_draw_data_flags & FLAGS_INSTANCING_HAS_COLORS)) {
+ vec4 instance_color = vec4(unpackHalf2x16(instance_color_custom_data.x), unpackHalf2x16(instance_color_custom_data.y));
+ color *= instance_color;
+ }
+ if (bool(read_draw_data_flags & FLAGS_INSTANCING_HAS_CUSTOM_DATA)) {
+ instance_custom = vec4(unpackHalf2x16(instance_color_custom_data.z), unpackHalf2x16(instance_color_custom_data.w));
+ }
#endif
#else