shader: Make surface_component_bits conditional on logicops

This shader key field is only used if logic ops are enabled, so we can
gain a little bit of performance by avoid unnecessary recompilation
here.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Italo Nicola 3 years ago committed by Gert Wollny
parent 5f488ed00d
commit 407db929f9
  1. 3
      src/vrend_renderer.c

@ -3557,9 +3557,12 @@ static inline void vrend_fill_shader_key(struct vrend_sub_context *sub_ctx,
key->fs.cbufs_signed_int_bitmask,
key->fs.cbufs_unsigned_int_bitmask);
}
/* Currently we only use this information if logicop_enable is set */
if (sub_ctx->blend_state.logicop_enable) {
key->fs.surface_component_bits[i] = util_format_get_component_bits(sub_ctx->surf[i]->format, UTIL_FORMAT_COLORSPACE_RGB, 0);
}
}
}
key->pstipple_tex = sub_ctx->rs_state.poly_stipple_enable;
key->color_two_side = sub_ctx->rs_state.light_twoside;

Loading…
Cancel
Save