5ed0fd067d
As part of the improvements to batch more cases, batching can store final_modulate as an attribute in the vertex format rather than sending as a uniform. This allows draw calls with different final_modulate to be batched together. However custom shader code was reading from only the final_modulate uniform, and not the attribute when it was in use. This was leading to visual errors. This is tricky to solve, because we cannot use the same name for the attribute in the vertex and fragment shaders, because one is an attribute and one a varying, whereas a uniform is accessible anywhere. To get around this, a macro is used which can translate to the most appropriate variable depending on whether uniform or attribute or varying is required. |
||
---|---|---|
.. | ||
shaders | ||
rasterizer_canvas_base_gles2.cpp | ||
rasterizer_canvas_base_gles2.h | ||
rasterizer_canvas_gles2.cpp | ||
rasterizer_canvas_gles2.h | ||
rasterizer_gles2.cpp | ||
rasterizer_gles2.h | ||
rasterizer_scene_gles2.cpp | ||
rasterizer_scene_gles2.h | ||
rasterizer_storage_gles2.cpp | ||
rasterizer_storage_gles2.h | ||
SCsub | ||
shader_compiler_gles2.cpp | ||
shader_compiler_gles2.h | ||
shader_gles2.cpp | ||
shader_gles2.h |