diff options
author | Dave Airlie <[email protected]> | 2020-04-16 17:15:28 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2020-04-27 12:35:24 +1000 |
commit | 65906d133130df5308b32c3fc92fb8690d231abc (patch) | |
tree | 01f973b33bea9fd080389f96362066a9c4f7a394 | |
parent | 1f071db43a676c17c1765434ed0abfcf3d659815 (diff) |
llvmpipe/setup: add point size clamping
Fixes
dEQP-GLES2.functional.rasterization.limits.points
dEQP-VK.rasterization.primitive_size.points.point_size*
Reviewed-by: Roland Scheidegger <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>
-rw-r--r-- | .gitlab-ci/deqp-llvmpipe-fails.txt | 1 | ||||
-rw-r--r-- | .gitlab-ci/deqp-virgl-fails.txt | 1 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_limits.h | 4 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_screen.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_point.c | 5 |
5 files changed, 9 insertions, 4 deletions
diff --git a/.gitlab-ci/deqp-llvmpipe-fails.txt b/.gitlab-ci/deqp-llvmpipe-fails.txt index 05da36f575a..795cc4bab44 100644 --- a/.gitlab-ci/deqp-llvmpipe-fails.txt +++ b/.gitlab-ci/deqp-llvmpipe-fails.txt @@ -28,7 +28,6 @@ dEQP-GLES2.functional.rasterization.interpolation.basic.lines_wide dEQP-GLES2.functional.rasterization.interpolation.projected.line_loop_wide dEQP-GLES2.functional.rasterization.interpolation.projected.line_strip_wide dEQP-GLES2.functional.rasterization.interpolation.projected.lines_wide -dEQP-GLES2.functional.rasterization.limits.points dEQP-GLES2.functional.shaders.texture_functions.fragment.texture2d_bias dEQP-GLES2.functional.shaders.texture_functions.fragment.texture2dproj_vec3_bias dEQP-GLES2.functional.shaders.texture_functions.fragment.texture2dproj_vec4_bias diff --git a/.gitlab-ci/deqp-virgl-fails.txt b/.gitlab-ci/deqp-virgl-fails.txt index 463ab89eeea..afb05cf55ec 100644 --- a/.gitlab-ci/deqp-virgl-fails.txt +++ b/.gitlab-ci/deqp-virgl-fails.txt @@ -30,7 +30,6 @@ dEQP-GLES2.functional.rasterization.interpolation.basic.lines_wide dEQP-GLES2.functional.rasterization.interpolation.projected.line_loop_wide dEQP-GLES2.functional.rasterization.interpolation.projected.line_strip_wide dEQP-GLES2.functional.rasterization.interpolation.projected.lines_wide -dEQP-GLES2.functional.rasterization.limits.points dEQP-GLES3.functional.clipping.line.wide_line_clip_viewport_corner dEQP-GLES3.functional.clipping.point.wide_point_clip_viewport_center dEQP-GLES3.functional.clipping.triangle_vertex.clip_two.clip_neg_y_neg_z_and_neg_x_neg_y_pos_z diff --git a/src/gallium/drivers/llvmpipe/lp_limits.h b/src/gallium/drivers/llvmpipe/lp_limits.h index 569179ecdf4..945156bf0ea 100644 --- a/src/gallium/drivers/llvmpipe/lp_limits.h +++ b/src/gallium/drivers/llvmpipe/lp_limits.h @@ -95,4 +95,8 @@ */ #define LP_MAX_SETUP_VARIANTS 64 +/* + * Max point size reported. Cap vertex shader point sizes to this. + */ +#define LP_MAX_POINT_WIDTH 255.0f #endif /* LP_LIMITS_H */ diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 9109e471108..9b691e819b1 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -478,7 +478,7 @@ llvmpipe_get_paramf(struct pipe_screen *screen, enum pipe_capf param) case PIPE_CAPF_MAX_POINT_WIDTH: /* fall-through */ case PIPE_CAPF_MAX_POINT_WIDTH_AA: - return 255.0; /* arbitrary */ + return LP_MAX_POINT_WIDTH; /* arbitrary */ case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY: return 16.0; /* not actually signficant at this time */ case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS: diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c index 092febdba92..fe0de06d15f 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_point.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c @@ -337,10 +337,13 @@ try_setup_point( struct lp_setup_context *setup, /* x/y positions in fixed point */ const struct lp_setup_variant_key *key = &setup->setup.variant->key; const int sizeAttr = setup->psize_slot; - const float size + float size = (setup->point_size_per_vertex && sizeAttr > 0) ? v0[sizeAttr][0] : setup->point_size; + if (size > LP_MAX_POINT_WIDTH) + size = LP_MAX_POINT_WIDTH; + /* Yes this is necessary to accurately calculate bounding boxes * with the two fill-conventions we support. GL (normally) ends * up needing a bottom-left fill convention, which requires |