diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c index 48c7ef47745..4cb288880d3 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_texture.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_texture.c @@ -235,11 +235,10 @@ get_bcolor_offset(struct fd_context *ctx, const struct pipe_sampler_state *sampl } unsigned idx = fd6_ctx->bcolor_cache->entries; - - assert(idx < FD6_MAX_BORDER_COLORS); - - if (idx >= FD6_MAX_BORDER_COLORS) + if (idx >= FD6_MAX_BORDER_COLORS) { + mesa_loge("too many border colors"); return 0; + } entries[idx] = key; diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_texture.h b/src/gallium/drivers/freedreno/a6xx/fd6_texture.h index d1b43a8164a..095fe9b1721 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_texture.h +++ b/src/gallium/drivers/freedreno/a6xx/fd6_texture.h @@ -60,7 +60,7 @@ struct PACKED fd6_bcolor_entry { }; #define FD6_BORDER_COLOR_SIZE sizeof(struct fd6_bcolor_entry) -#define FD6_MAX_BORDER_COLORS 128 +#define FD6_MAX_BORDER_COLORS 256 struct fd6_sampler_stateobj { struct pipe_sampler_state base;