gallivm: fix crash with bptc border color sampling
authorRoland Scheidegger <sroland@vmware.com>
Wed, 19 Feb 2020 00:22:11 +0000 (01:22 +0100)
committerRoland Scheidegger <rscheidegger_lists@hispeed.ch>
Thu, 20 Feb 2020 17:32:54 +0000 (17:32 +0000)
bptc uses fallback for decoding, but still need to handle border color
properly.

v2: adjust piglit gitlab-ci expectations

Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3886>

.gitlab-ci/piglit/quick_gl.txt
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c

index 586ec3c046d68ee3a22e724a762c9a3a62480830..f23284b80801a1f9f7cd72e6f5780b2911888d98 100644 (file)
@@ -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
index 77dd08c1b10b0ff81f8ca3b04a2aa14b7f87ab2f..a86ece1b0d0526bf3d00232e428f18016a630fcd 100644 (file)
@@ -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;