From 1b610aab583211210f189b46904b66c483f8e38b Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 19 Feb 2020 01:22:11 +0100 Subject: [PATCH] gallivm: fix crash with bptc border color sampling bptc uses fallback for decoding, but still need to handle border color properly. v2: adjust piglit gitlab-ci expectations Reviewed-by: Brian Paul Part-of: --- .gitlab-ci/piglit/quick_gl.txt | 8 +++----- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci/piglit/quick_gl.txt b/.gitlab-ci/piglit/quick_gl.txt index 586ec3c046d..f23284b8080 100644 --- a/.gitlab-ci/piglit/quick_gl.txt +++ b/.gitlab-ci/piglit/quick_gl.txt @@ -975,8 +975,6 @@ spec/arb_texture_barrier/arb_texture_barrier-blending-in-shader 512 42 8 8 8: sk spec/arb_texture_buffer_object/indexed: skip spec/arb_texture_buffer_object/negative-unsupported: skip spec/arb_texture_compression_bptc/bptc-float-modes: fail -spec/arb_texture_compression_bptc/texwrap formats bordercolor: crash -spec/arb_texture_compression_bptc/texwrap formats bordercolor-swizzled: crash spec/arb_texture_cube_map/copyteximage cube samples=16: skip spec/arb_texture_cube_map/copyteximage cube samples=2: skip spec/arb_texture_cube_map/copyteximage cube samples=32: skip @@ -2205,9 +2203,9 @@ wgl/wgl-sanity: skip summary: name: results ---- -------- - pass: 19320 + pass: 19328 fail: 234 - crash: 2 + crash: 0 skip: 1948 timeout: 0 warn: 2 @@ -2217,4 +2215,4 @@ summary: changes: 0 fixes: 0 regressions: 0 - total: 21524 + total: 21530 diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 77dd08c1b10..a86ece1b0d0 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -2357,13 +2357,16 @@ lp_build_clamp_border_color(struct lp_build_sample_context *bld, max_clamp = vec4_bld.one; } else if (format_desc->layout == UTIL_FORMAT_LAYOUT_RGTC || - format_desc->layout == UTIL_FORMAT_LAYOUT_ETC) { + format_desc->layout == UTIL_FORMAT_LAYOUT_ETC || + format_desc->layout == UTIL_FORMAT_LAYOUT_BPTC) { switch (format_desc->format) { case PIPE_FORMAT_RGTC1_UNORM: case PIPE_FORMAT_RGTC2_UNORM: case PIPE_FORMAT_LATC1_UNORM: case PIPE_FORMAT_LATC2_UNORM: case PIPE_FORMAT_ETC1_RGB8: + case PIPE_FORMAT_BPTC_RGBA_UNORM: + case PIPE_FORMAT_BPTC_SRGBA: min_clamp = vec4_bld.zero; max_clamp = vec4_bld.one; break; @@ -2374,6 +2377,12 @@ lp_build_clamp_border_color(struct lp_build_sample_context *bld, min_clamp = lp_build_const_vec(gallivm, vec4_type, -1.0F); max_clamp = vec4_bld.one; break; + case PIPE_FORMAT_BPTC_RGB_FLOAT: + /* not sure if we should clamp to max half float? */ + break; + case PIPE_FORMAT_BPTC_RGB_UFLOAT: + min_clamp = vec4_bld.zero; + break; default: assert(0); break; -- 2.30.2