llvmpipe: enable ARB_sample_shading
authorDave Airlie <airlied@redhat.com>
Tue, 24 Mar 2020 22:01:27 +0000 (08:01 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 06:20:38 +0000 (06:20 +0000)
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>

.gitlab-ci/piglit/glslparser.txt
.gitlab-ci/piglit/quick_gl.txt
docs/features.txt
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_scene.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/llvmpipe/lp_state_blend.c
src/gallium/drivers/llvmpipe/lp_state_fs.c

index de2eeda1559403e3a8bbbcbca2625bc6bb2bc462..e670ce9430c2a53719a8aac8cc584f7cf9d06359 100644 (file)
@@ -1136,18 +1136,22 @@ spec/arb_gpu_shader_int64/compiler/built-in-functions/sign-i64vec4.vert: skip
 spec/arb_gpu_shader_int64/compiler/built-in-functions/sign-int64_t.frag: skip
 spec/arb_gpu_shader_int64/compiler/built-in-functions/sign-int64_t.geom: skip
 spec/arb_gpu_shader_int64/compiler/built-in-functions/sign-int64_t.vert: skip
-spec/arb_sample_shading/compiler/gl_numsamples.frag: skip
-spec/arb_sample_shading/compiler/gl_sampleid.frag: skip
-spec/arb_sample_shading/compiler/gl_samplemask.frag: skip
-spec/arb_sample_shading/compiler/gl_sampleposition.frag: skip
-spec/arb_sample_shading/preprocessor/enabled-compat.frag: skip
-spec/arb_sample_shading/preprocessor/enabled-compat.vert: skip
-spec/arb_sample_shading/preprocessor/enabled-core.comp: skip
-spec/arb_sample_shading/preprocessor/enabled-core.frag: skip
-spec/arb_sample_shading/preprocessor/enabled-core.geom: skip
-spec/arb_sample_shading/preprocessor/enabled-core.tesc: skip
-spec/arb_sample_shading/preprocessor/enabled-core.tese: skip
-spec/arb_sample_shading/preprocessor/enabled-core.vert: skip
+spec/arb_sample_shading/preprocessor/disabled-defined-compat.frag: skip
+spec/arb_sample_shading/preprocessor/disabled-defined-compat.vert: skip
+spec/arb_sample_shading/preprocessor/disabled-defined-core.comp: skip
+spec/arb_sample_shading/preprocessor/disabled-defined-core.frag: skip
+spec/arb_sample_shading/preprocessor/disabled-defined-core.geom: skip
+spec/arb_sample_shading/preprocessor/disabled-defined-core.tesc: skip
+spec/arb_sample_shading/preprocessor/disabled-defined-core.tese: skip
+spec/arb_sample_shading/preprocessor/disabled-defined-core.vert: skip
+spec/arb_sample_shading/preprocessor/disabled-undefined-compat.frag: skip
+spec/arb_sample_shading/preprocessor/disabled-undefined-compat.vert: skip
+spec/arb_sample_shading/preprocessor/disabled-undefined-core.comp: skip
+spec/arb_sample_shading/preprocessor/disabled-undefined-core.frag: skip
+spec/arb_sample_shading/preprocessor/disabled-undefined-core.geom: skip
+spec/arb_sample_shading/preprocessor/disabled-undefined-core.tesc: skip
+spec/arb_sample_shading/preprocessor/disabled-undefined-core.tese: skip
+spec/arb_sample_shading/preprocessor/disabled-undefined-core.vert: skip
 spec/arb_separate_shader_objects/preprocessor/disabled-defined-compat.frag: skip
 spec/arb_separate_shader_objects/preprocessor/disabled-defined-compat.vert: skip
 spec/arb_separate_shader_objects/preprocessor/disabled-defined-core.comp: skip
@@ -4880,10 +4884,10 @@ spec/oes_texture_storage_multisample_2d_array/preprocessor/enabled-es.geom: skip
 summary:
        name:  results
        ----  --------
-       pass:     9904
+       pass:     9900
        fail:        2
       crash:        0
-       skip:     4877
+       skip:     4881
     timeout:        0
        warn:        0
  incomplete:        0
index b493665d66df43a2019701faaafb7bb16e49a495..74e048377278e68564d60552b5cd0af6878f987d 100644 (file)
@@ -429,8 +429,20 @@ spec/arb_compute_shader/display-list: skip
 spec/arb_compute_variable_group_size/errors: skip
 spec/arb_compute_variable_group_size/local-size: skip
 spec/arb_compute_variable_group_size/minmax: skip
-spec/arb_copy_image/arb_copy_image-formats --samples=2: skip
-spec/arb_copy_image/arb_copy_image-formats --samples=4: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=2/source: gl_depth32f_stencil8/destination: gl_depth32f_stencil8: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=2/source: gl_depth_component/destination: gl_depth_component: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=2/source: gl_depth_component16/destination: gl_depth_component16: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=2/source: gl_depth_component24/destination: gl_depth_component24: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=2/source: gl_depth_component32/destination: gl_depth_component32: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=2/source: gl_depth_stencil/destination: gl_depth_stencil: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=2/source: gl_stencil_index8/destination: gl_stencil_index8: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=4/source: gl_depth32f_stencil8/destination: gl_depth32f_stencil8: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=4/source: gl_depth_component/destination: gl_depth_component: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=4/source: gl_depth_component16/destination: gl_depth_component16: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=4/source: gl_depth_component24/destination: gl_depth_component24: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=4/source: gl_depth_component32/destination: gl_depth_component32: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=4/source: gl_depth_stencil/destination: gl_depth_stencil: skip
+spec/arb_copy_image/arb_copy_image-formats --samples=4/source: gl_stencil_index8/destination: gl_stencil_index8: skip
 spec/arb_copy_image/arb_copy_image-formats --samples=8: skip
 spec/arb_depth_buffer_float/depthstencil-render-miplevels 1024 d=z32f_s8_s=z24_s8: skip
 spec/arb_depth_buffer_float/depthstencil-render-miplevels 1024 d=z32f_s=z24_s8: skip
@@ -460,10 +472,8 @@ spec/arb_enhanced_layouts/arb_enhanced_layouts-transform-feedback-layout-qualifi
 spec/arb_enhanced_layouts/gs-stream-location-aliasing: fail
 spec/arb_fragment_program/fp-indirections: skip
 spec/arb_fragment_shader_interlock/arb_fragment_shader_interlock-image-load-store: skip
-spec/arb_framebuffer_no_attachments/arb_framebuffer_no_attachments-atomic/per-sample: skip
 spec/arb_framebuffer_no_attachments/arb_framebuffer_no_attachments-params/dsa: skip
 spec/arb_framebuffer_no_attachments/arb_framebuffer_no_attachments-query/ms2: skip
-spec/arb_framebuffer_no_attachments/arb_framebuffer_no_attachments-roundup-samples: skip
 spec/arb_framebuffer_object/fbo-blit-scaled-linear: fail
 spec/arb_geometry_shader4/arb_geometry_shader4-ignore-adjacent-vertices  gl_line_strip_adjacency: skip
 spec/arb_geometry_shader4/arb_geometry_shader4-ignore-adjacent-vertices  gl_lines_adjacency: skip
@@ -504,65 +514,86 @@ spec/arb_query_buffer_object/qbo/query-gl_time_elapsed-sync_cpu_read_after_cache
 spec/arb_query_buffer_object/qbo/query-gl_time_elapsed-sync_cpu_read_after_cache_test-gl_unsigned_int: fail
 spec/arb_query_buffer_object/qbo/query-gl_time_elapsed-sync_cpu_read_after_cache_test-gl_unsigned_int64_arb: fail
 spec/arb_sample_locations/test: skip
-spec/arb_sample_shading/arb_sample_shading-api: skip
-spec/arb_sample_shading/arb_sample_shading-builtin-gl-sample-mask-mrt-alpha: skip
-spec/arb_sample_shading/arb_sample_shading-builtin-gl-sample-mask-mrt-alpha-to-coverage-combinations: skip
-spec/arb_sample_shading/builtin-gl-num-samples 0: skip
+spec/arb_sample_shading/arb_sample_shading-builtin-gl-sample-mask-mrt-alpha-to-coverage-combinations: fail
 spec/arb_sample_shading/builtin-gl-num-samples 16: skip
-spec/arb_sample_shading/builtin-gl-num-samples 2: skip
 spec/arb_sample_shading/builtin-gl-num-samples 32: skip
-spec/arb_sample_shading/builtin-gl-num-samples 4: skip
 spec/arb_sample_shading/builtin-gl-num-samples 6: skip
 spec/arb_sample_shading/builtin-gl-num-samples 8: skip
-spec/arb_sample_shading/builtin-gl-sample-id 0: skip
 spec/arb_sample_shading/builtin-gl-sample-id 16: skip
-spec/arb_sample_shading/builtin-gl-sample-id 2: skip
 spec/arb_sample_shading/builtin-gl-sample-id 32: skip
-spec/arb_sample_shading/builtin-gl-sample-id 4: skip
 spec/arb_sample_shading/builtin-gl-sample-id 6: skip
 spec/arb_sample_shading/builtin-gl-sample-id 8: skip
-spec/arb_sample_shading/builtin-gl-sample-mask 0: skip
+spec/arb_sample_shading/builtin-gl-sample-mask 0: fail
 spec/arb_sample_shading/builtin-gl-sample-mask 16: skip
-spec/arb_sample_shading/builtin-gl-sample-mask 2: skip
 spec/arb_sample_shading/builtin-gl-sample-mask 32: skip
-spec/arb_sample_shading/builtin-gl-sample-mask 4: skip
 spec/arb_sample_shading/builtin-gl-sample-mask 6: skip
 spec/arb_sample_shading/builtin-gl-sample-mask 8: skip
-spec/arb_sample_shading/builtin-gl-sample-mask-simple 0: skip
+spec/arb_sample_shading/builtin-gl-sample-mask-simple 0: fail
 spec/arb_sample_shading/builtin-gl-sample-mask-simple 16: skip
-spec/arb_sample_shading/builtin-gl-sample-mask-simple 2: skip
 spec/arb_sample_shading/builtin-gl-sample-mask-simple 32: skip
-spec/arb_sample_shading/builtin-gl-sample-mask-simple 4: skip
 spec/arb_sample_shading/builtin-gl-sample-mask-simple 6: skip
 spec/arb_sample_shading/builtin-gl-sample-mask-simple 8: skip
-spec/arb_sample_shading/builtin-gl-sample-position 0: skip
 spec/arb_sample_shading/builtin-gl-sample-position 16: skip
-spec/arb_sample_shading/builtin-gl-sample-position 2: skip
 spec/arb_sample_shading/builtin-gl-sample-position 32: skip
-spec/arb_sample_shading/builtin-gl-sample-position 4: skip
 spec/arb_sample_shading/builtin-gl-sample-position 6: skip
 spec/arb_sample_shading/builtin-gl-sample-position 8: skip
 spec/arb_sample_shading/ignore-centroid-qualifier 16: skip
-spec/arb_sample_shading/ignore-centroid-qualifier 2: skip
 spec/arb_sample_shading/ignore-centroid-qualifier 32: skip
-spec/arb_sample_shading/ignore-centroid-qualifier 4: skip
 spec/arb_sample_shading/ignore-centroid-qualifier 6: skip
 spec/arb_sample_shading/ignore-centroid-qualifier 8: skip
 spec/arb_sample_shading/interpolate-at-sample-position 16: skip
-spec/arb_sample_shading/interpolate-at-sample-position 2: skip
 spec/arb_sample_shading/interpolate-at-sample-position 32: skip
-spec/arb_sample_shading/interpolate-at-sample-position 4: skip
 spec/arb_sample_shading/interpolate-at-sample-position 6: skip
 spec/arb_sample_shading/interpolate-at-sample-position 8: skip
 spec/arb_sample_shading/samplemask 0 all: skip
 spec/arb_sample_shading/samplemask 16: skip
 spec/arb_sample_shading/samplemask 16 all: skip
-spec/arb_sample_shading/samplemask 2: skip
-spec/arb_sample_shading/samplemask 2 all: skip
+spec/arb_sample_shading/samplemask 2 all/0.250000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 2 all/0.250000 partition: skip
+spec/arb_sample_shading/samplemask 2 all/0.500000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 2 all/0.500000 partition: skip
+spec/arb_sample_shading/samplemask 2 all/1.000000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 2 all/1.000000 partition: skip
+spec/arb_sample_shading/samplemask 2 all/noms fix: fail
+spec/arb_sample_shading/samplemask 2 all/noms mask_in_one: fail
+spec/arb_sample_shading/samplemask 2 all/noms partition: skip
+spec/arb_sample_shading/samplemask 2 all/sample mask_in_one: fail
+spec/arb_sample_shading/samplemask 2 all/sample partition: skip
+spec/arb_sample_shading/samplemask 2/0.250000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 2/0.250000 partition: skip
+spec/arb_sample_shading/samplemask 2/0.500000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 2/0.500000 partition: skip
+spec/arb_sample_shading/samplemask 2/1.000000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 2/1.000000 partition: skip
+spec/arb_sample_shading/samplemask 2/noms fix: fail
+spec/arb_sample_shading/samplemask 2/noms mask_in_one: fail
+spec/arb_sample_shading/samplemask 2/noms partition: skip
+spec/arb_sample_shading/samplemask 2/sample mask_in_one: fail
+spec/arb_sample_shading/samplemask 2/sample partition: skip
 spec/arb_sample_shading/samplemask 32: skip
 spec/arb_sample_shading/samplemask 32 all: skip
-spec/arb_sample_shading/samplemask 4: skip
-spec/arb_sample_shading/samplemask 4 all: skip
+spec/arb_sample_shading/samplemask 4 all/0.250000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 4 all/0.250000 partition: skip
+spec/arb_sample_shading/samplemask 4 all/0.500000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 4 all/0.500000 partition: skip
+spec/arb_sample_shading/samplemask 4 all/1.000000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 4 all/1.000000 partition: skip
+spec/arb_sample_shading/samplemask 4 all/noms fix: fail
+spec/arb_sample_shading/samplemask 4 all/noms mask_in_one: fail
+spec/arb_sample_shading/samplemask 4 all/noms partition: skip
+spec/arb_sample_shading/samplemask 4 all/sample mask_in_one: fail
+spec/arb_sample_shading/samplemask 4 all/sample partition: skip
+spec/arb_sample_shading/samplemask 4/0.250000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 4/0.250000 partition: skip
+spec/arb_sample_shading/samplemask 4/0.500000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 4/0.500000 partition: skip
+spec/arb_sample_shading/samplemask 4/1.000000 mask_in_one: fail
+spec/arb_sample_shading/samplemask 4/1.000000 partition: skip
+spec/arb_sample_shading/samplemask 4/noms fix: fail
+spec/arb_sample_shading/samplemask 4/noms mask_in_one: fail
+spec/arb_sample_shading/samplemask 4/noms partition: skip
+spec/arb_sample_shading/samplemask 4/sample mask_in_one: fail
+spec/arb_sample_shading/samplemask 4/sample partition: skip
 spec/arb_sample_shading/samplemask 6: skip
 spec/arb_sample_shading/samplemask 6 all: skip
 spec/arb_sample_shading/samplemask 8: skip
@@ -1683,10 +1714,10 @@ wgl/wgl-sanity: skip
 summary:
        name:  results
        ----  --------
-       pass:    20103
-       fail:      197
+       pass:    20701
+       fail:      224
       crash:        0
-       skip:     1461
+       skip:     1465
     timeout:        0
        warn:        6
  incomplete:        0
@@ -1695,4 +1726,4 @@ summary:
     changes:        0
       fixes:        0
 regressions:        0
-      total:    21785
+      total:    22414
index 5893e8a7b13e76ccae15e23604b9b10c3c3892fb..1a764e85e928a4de1e9ae56926de9b12a38d22fd 100644 (file)
@@ -129,7 +129,7 @@ GL 4.0, GLSL 4.00 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, virgl
   - Interpolation functions                             DONE (softpipe)
   - New overload resolution rules                       DONE (softpipe)
   GL_ARB_gpu_shader_fp64                                DONE (i965/gen7+, llvmpipe, softpipe, swr)
-  GL_ARB_sample_shading                                 DONE (freedreno/a6xx, i965/gen6+, nv50)
+  GL_ARB_sample_shading                                 DONE (freedreno/a6xx, i965/gen6+, nv50, llvmpipe)
   GL_ARB_shader_subroutine                              DONE (freedreno, i965/gen6+, nv50, llvmpipe, softpipe, swr)
   GL_ARB_tessellation_shader                            DONE (i965/gen7+, llvmpipe, swr)
   GL_ARB_texture_buffer_object_rgb32                    DONE (freedreno, i965/gen6+, llvmpipe, softpipe, swr)
index 825fde9a7cd1b9c21948800962e8da6fed8332a1..6c5392141ba18c3278676c9e6aea20da8315f14f 100644 (file)
@@ -75,6 +75,7 @@ struct llvmpipe_context {
 
    /** Other rendering state */
    unsigned sample_mask;
+   unsigned min_samples;
    struct pipe_blend_color blend_color;
    struct pipe_stencil_ref stencil_ref;
    struct pipe_clip_state clip;
index ddb8af1a89dd974b5c87b88e0ae24e84ed253109..59eed4145504942a08f6250f37cb72dd2af5ebb3 100644 (file)
@@ -106,8 +106,8 @@ lp_scene_is_empty(struct lp_scene *scene )
 {
    unsigned x, y;
 
-   for (y = 0; y < TILES_Y; y++) {
-      for (x = 0; x < TILES_X; x++) {
+   for (y = 0; y < scene->tiles_y; y++) {
+      for (x = 0; x < scene->tiles_x; x++) {
          const struct cmd_bin *bin = lp_scene_get_bin(scene, x, y);
          if (bin->head) {
             return FALSE;
index 25f4b0f1beabaa2064ad1349dee6ff43159d45e0..a980700b16ecf02edd79d9e7983524cab7054240 100644 (file)
@@ -259,7 +259,6 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
       return 4;
    case PIPE_CAP_TEXTURE_GATHER_SM5:
-   case PIPE_CAP_SAMPLE_SHADING:
    case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
       return 0;
    case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
@@ -400,6 +399,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_VOTE:
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TEXTURE_MULTISAMPLE:
+   case PIPE_CAP_SAMPLE_SHADING:
    case PIPE_CAP_PACKED_UNIFORMS: {
       struct llvmpipe_screen *lscreen = llvmpipe_screen(screen);
       return !lscreen->use_tgsi;
index 10e5930851dd390196a3c1b1038f86cc2c16665e..ddf2c206a4c6aa859168b351180395613ad0b19e 100644 (file)
@@ -186,6 +186,19 @@ llvmpipe_set_sample_mask(struct pipe_context *pipe,
    }
 }
 
+static void
+llvmpipe_set_min_samples(struct pipe_context *pipe,
+                         unsigned min_samples)
+{
+   struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+
+   if (min_samples != llvmpipe->min_samples) {
+      llvmpipe->min_samples = min_samples;
+
+      llvmpipe->dirty |= LP_NEW_FS;
+   }
+}
+
 void
 llvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe)
 {
@@ -201,6 +214,7 @@ llvmpipe_init_blend_funcs(struct llvmpipe_context *llvmpipe)
 
    llvmpipe->pipe.set_stencil_ref = llvmpipe_set_stencil_ref;
    llvmpipe->pipe.set_sample_mask = llvmpipe_set_sample_mask;
+   llvmpipe->pipe.set_min_samples = llvmpipe_set_min_samples;
 
    llvmpipe->dirty |= LP_NEW_SAMPLE_MASK;
    llvmpipe->sample_mask = ~0;
index 2ce97260d2f85efc39873e9c2a1a0639dbf9251f..f4959fb8b5a21b80800f39a690344a1ce2f16855 100644 (file)
@@ -3723,7 +3723,7 @@ make_variant_key(struct llvmpipe_context *lp,
    key->min_samples = 1;
    if (key->multisample) {
       key->coverage_samples = util_framebuffer_get_num_samples(&lp->framebuffer);
-      key->min_samples = 1;
+      key->min_samples = lp->min_samples == 1 ? 1 : key->coverage_samples;
    }
    key->nr_cbufs = lp->framebuffer.nr_cbufs;