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. 5
      src/vrend_renderer.c

@ -3557,7 +3557,10 @@ static inline void vrend_fill_shader_key(struct vrend_sub_context *sub_ctx,
key->fs.cbufs_signed_int_bitmask, key->fs.cbufs_signed_int_bitmask,
key->fs.cbufs_unsigned_int_bitmask); key->fs.cbufs_unsigned_int_bitmask);
} }
key->fs.surface_component_bits[i] = util_format_get_component_bits(sub_ctx->surf[i]->format, UTIL_FORMAT_COLORSPACE_RGB, 0); /* 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);
}
} }
} }

Loading…
Cancel
Save