From c401960634f3a3822f55d720b647355f2a40b83a Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Thu, 4 Mar 2021 20:28:57 +0000 Subject: [PATCH] Batching - fix custom MODULATE shader applying modulate twice One of the new fvf types (FVF_MODULATED) allows batching custom shaders that use modulate. The only slight oversight is that there is a special define when MODULATE is used in a custom shader, called MODULATE_USED, that is checked, and if set it does NOT apply final_modulate as part of canvas.glsl. This MODULATE_USED define wasn't checked when the new FVF was used and modulate was passed in an attribute. This PR moves the application of the final_modulate into the #ifndef MODULATE_USED section. --- drivers/gles2/shaders/canvas.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index b6371980cda..3cf5ca841f9 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -480,10 +480,10 @@ FRAGMENT_SHADER_CODE #endif } +#if !defined(MODULATE_USED) #ifdef USE_ATTRIB_MODULATE color *= modulate_interp; #else -#if !defined(MODULATE_USED) color *= final_modulate; #endif #endif