diff options
author | Emma Anholt <emma@anholt.net> | 2022-02-08 10:36:30 -0800 |
---|---|---|
committer | Emma Anholt <emma@anholt.net> | 2022-02-08 18:50:01 -0800 |
commit | bd24f418c3cda345b9ac753977ad034e5c9cff28 (patch) | |
tree | c478a06d45e8b862a51b6734a872c6e7aa6f7452 | |
parent | 4968f8c0663ae090ad61be867401d1b497b06707 (diff) |
r300: Throw a compile error instead of an assert in r300 swizzle rewrites.
I hit this on shader-db, but I really just want to get stats for unrelated
changes.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14938>
-rw-r--r-- | src/gallium/drivers/r300/compiler/radeon_dataflow_swizzles.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/compiler/radeon_dataflow_swizzles.c b/src/gallium/drivers/r300/compiler/radeon_dataflow_swizzles.c index a16f4715c70..2cc624f8982 100644 --- a/src/gallium/drivers/r300/compiler/radeon_dataflow_swizzles.c +++ b/src/gallium/drivers/r300/compiler/radeon_dataflow_swizzles.c @@ -376,7 +376,10 @@ static unsigned try_rewrite_constant(struct radeon_compiler *c, continue; } - assert(new_swz <= RC_SWIZZLE_W); + if (new_swz > RC_SWIZZLE_W) { + rc_error(c, "Bad swizzle in try_rewrite_constant()"); + new_swz = RC_SWIZZLE_X; + } switch (old_swz) { case RC_SWIZZLE_ZERO: |