From 71617c33284f728167010f0af2c267a8b7fad271 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Sun, 27 Jun 2021 20:30:27 -0700 Subject: [PATCH] i915g: Fix off-by-one in constant count assertion. You can have up to C[31]. Part-of: --- src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt | 2 +- src/gallium/drivers/i915/i915_state_emit.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt index d78d0f5db9d..a92eb5726ec 100644 --- a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt +++ b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt @@ -696,7 +696,7 @@ spec@glsl-1.10@execution@fs-sign-times-neg-abs,Fail spec@glsl-1.10@execution@fs-sign-times-sign,Fail spec@glsl-1.10@execution@gl_lightsource_indirect,Fail spec@glsl-1.10@execution@glsl-1.10-built-in-matrix-state,Fail -spec@glsl-1.10@execution@glsl-1.10-built-in-uniform-state,Crash +spec@glsl-1.10@execution@glsl-1.10-built-in-uniform-state,Fail spec@glsl-1.10@execution@glsl-clamp-vertex-color,Fail spec@glsl-1.10@execution@glsl-fs-convolution-1,Fail spec@glsl-1.10@execution@glsl-fs-convolution-2,Fail diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index 5190a47bfaa..7f6469b00d1 100644 --- a/src/gallium/drivers/i915/i915_state_emit.c +++ b/src/gallium/drivers/i915/i915_state_emit.c @@ -331,7 +331,7 @@ emit_constants(struct i915_context *i915) */ const uint32_t nr = i915->fs->num_constants; - assert(nr < I915_MAX_CONSTANT); + assert(nr <= I915_MAX_CONSTANT); if (nr) { uint32_t i;