vrend: don't try to read from an undefined vertex element array

With the link_shader command we might end up calculating shader keys
without the full draw info being available, specifically, without the
vertex element array being defined. Skip querying the integer masks in
this case.

v2: Fix extra line (Yiwei)

Fixes: #664

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Gert Wollny 3 years ago
parent dffbb13a47
commit b2a4b64471
  1. 6
      src/vrend_renderer.c

@ -3542,8 +3542,10 @@ static inline void vrend_fill_shader_key(struct vrend_sub_context *sub_ctx,
if (vrend_state.use_core_profile) { if (vrend_state.use_core_profile) {
int i; int i;
// Only use integer info when drawing to avoid stale info. /* Only use integer info when drawing to avoid stale info.
if (vrend_state.use_integer && sub_ctx->drawing && * Since we can get here from link_shaders before actually drawing anything,
* we may have no vertex element array */
if (vrend_state.use_integer && sub_ctx->drawing && sub_ctx->ve &&
type == PIPE_SHADER_VERTEX) { type == PIPE_SHADER_VERTEX) {
key->vs.attrib_signed_int_bitmask = sub_ctx->ve->signed_int_bitmask; key->vs.attrib_signed_int_bitmask = sub_ctx->ve->signed_int_bitmask;
key->vs.attrib_unsigned_int_bitmask = sub_ctx->ve->unsigned_int_bitmask; key->vs.attrib_unsigned_int_bitmask = sub_ctx->ve->unsigned_int_bitmask;

Loading…
Cancel
Save