llvmpipe/setup: add point size clamping
authorDave Airlie <airlied@redhat.com>
Thu, 16 Apr 2020 07:15:28 +0000 (17:15 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 27 Apr 2020 02:35:24 +0000 (12:35 +1000)
Fixes
dEQP-GLES2.functional.rasterization.limits.points
dEQP-VK.rasterization.primitive_size.points.point_size*

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4574>

.gitlab-ci/deqp-llvmpipe-fails.txt
.gitlab-ci/deqp-virgl-fails.txt
src/gallium/drivers/llvmpipe/lp_limits.h
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/llvmpipe/lp_setup_point.c

index 05da36f575a9c9d8adb08e003bb8dbf123aaab3e..795cc4bab44f02f52478acddf189ae7e394765f8 100644 (file)
@@ -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
index 463ab89eeeadc7124440faaa672d926c0e5ab668..afb05cf55ec2e89473d4ca64d45051437f28d977 100644 (file)
@@ -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
index 569179ecdf49d27d793e9cb86ec06406bd0b0448..945156bf0ea7f1f80eb593ed63e0a340d6fbee43 100644 (file)
@@ -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 */
index 9109e4711086379656ae29e6f0508752196c01ec..9b691e819b1b257b55e0cd0b70c74616aa81996b 100644 (file)
@@ -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:
index 092febdba920f76afb3d49830c1040eca1cea814..fe0de06d15f5426b36c9559230c94128f9f9ce3d 100644 (file)
@@ -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