Explorar o código

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.
lawnjelly %!s(int64=4) %!d(string=hai) anos
pai
achega
c401960634
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/gles2/shaders/canvas.glsl

+ 1 - 1
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