Merge pull request #46099 from lawnjelly/ewok_fix_valgrind

Batching - fix a couple of minor valgrind bugs.
This commit is contained in:
Rémi Verschelde 2021-02-17 11:45:41 +01:00 committed by GitHub
commit 2c3272ba79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -1063,6 +1063,10 @@ void RasterizerCanvasBaseGLES2::initialize() {
state.canvas_shader.init();
state.using_light_angle = false;
state.using_large_vertex = false;
state.using_modulate = false;
_set_texture_rect_mode(true);
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_RGBA_SHADOWS, storage->config.use_rgba_2d_shadows);

View file

@ -1900,7 +1900,7 @@ bool C_PREAMBLE::_prefill_rect(RasterizerCanvas::Item::CommandRect *rect, FillSt
// we need to treat color change separately because we need to count these
// to decide whether to switch on the fly to colored vertices.
if (!r_fill_state.curr_batch->color.equals(col)) {
if (!change_batch && !r_fill_state.curr_batch->color.equals(col)) {
change_batch = true;
bdata.total_color_changes++;
}