From: Dave Airlie Date: Tue, 24 Mar 2020 22:01:27 +0000 (+1000) Subject: llvmpipe: enable ARB_sample_shading X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dab8803af431ff2044b4d7b17bb505079bf63d1e;p=mesa.git llvmpipe: enable ARB_sample_shading Reviewed-by: Roland Scheidegger Part-of: --- diff --git a/.gitlab-ci/piglit/glslparser.txt b/.gitlab-ci/piglit/glslparser.txt index de2eeda1559..e670ce9430c 100644 --- a/.gitlab-ci/piglit/glslparser.txt +++ b/.gitlab-ci/piglit/glslparser.txt @@ -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 diff --git a/.gitlab-ci/piglit/quick_gl.txt b/.gitlab-ci/piglit/quick_gl.txt index b493665d66d..74e04837727 100644 --- a/.gitlab-ci/piglit/quick_gl.txt +++ b/.gitlab-ci/piglit/quick_gl.txt @@ -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 diff --git a/docs/features.txt b/docs/features.txt index 5893e8a7b13..1a764e85e92 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -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) diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index 825fde9a7cd..6c5392141ba 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -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; diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c index ddb8af1a89d..59eed414550 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.c +++ b/src/gallium/drivers/llvmpipe/lp_scene.c @@ -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; diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 25f4b0f1bea..a980700b16e 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -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; diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c index 10e5930851d..ddf2c206a4c 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c @@ -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; diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 2ce97260d2f..f4959fb8b5a 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -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;