diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 75617c3..7416a13 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -3597,7 +3597,7 @@ static inline void vrend_fill_shader_key(struct vrend_sub_context *sub_ctx, if (view && view->texture->target == GL_TEXTURE_BUFFER && tex_conv_table[view->format].flags & VIRGL_TEXTURE_NEED_SWIZZLE) { - key->sampler_views_lower_swizzle_mask |= 1 << i; + key->sampler_views_lower_swizzle_mask[i / 64] |= 1ull << (i % 64); key->tex_swizzle[i] = to_pipe_swizzle(view->gl_swizzle[0]) | to_pipe_swizzle(view->gl_swizzle[1]) << 3 | to_pipe_swizzle(view->gl_swizzle[2]) << 6 | diff --git a/src/vrend_shader.c b/src/vrend_shader.c index 8b9215f..f5a67de 100644 --- a/src/vrend_shader.c +++ b/src/vrend_shader.c @@ -2948,7 +2948,7 @@ static void translate_tex(struct dump_ctx *ctx, tex_ext, srcs[sampler_index], get_string(txfi), srcs[0], get_wm_string(twm), bias, offset); - if (ctx->key->sampler_views_lower_swizzle_mask & (1 << sinfo->sreg_index)) { + if (ctx->key->sampler_views_lower_swizzle_mask[sinfo->sreg_index / 64] & (1ull << (sinfo->sreg_index % 64))) { int16_t packed_swizzles = ctx->key->tex_swizzle[sinfo->sreg_index]; emit_buff(&ctx->glsl_strbufs, " val = vec4("); diff --git a/src/vrend_shader.h b/src/vrend_shader.h index e011d68..31cdcf0 100644 --- a/src/vrend_shader.h +++ b/src/vrend_shader.h @@ -32,6 +32,9 @@ #define VIRGL_NUM_CLIP_PLANES 8 +#define VREND_SHADER_SAMPLER_VIEWS_MASK_LENGTH \ + ((PIPE_MAX_SHADER_SAMPLER_VIEWS + 63) / 64) + enum gl_advanced_blend_mode { BLEND_NONE = 0, @@ -180,7 +183,7 @@ struct vrend_shader_key { } gs; }; - uint32_t sampler_views_lower_swizzle_mask; + uint64_t sampler_views_lower_swizzle_mask[VREND_SHADER_SAMPLER_VIEWS_MASK_LENGTH]; uint16_t tex_swizzle[PIPE_MAX_SHADER_SAMPLER_VIEWS]; uint8_t num_in_cull : 4;