iris: clamp PointWidth in 3DSTATE_SF like i965 does
authorTapani Pälli <tapani.palli@intel.com>
Tue, 30 Mar 2021 13:57:49 +0000 (16:57 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 1 Apr 2021 07:18:23 +0000 (10:18 +0300)
Values match how MinimumPointWidth, MaximumPointWidth is setup. This
fixes assert hit in debug build when packing the struct with too large
value for genxml.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9942>

src/gallium/drivers/iris/iris_state.c

index aa37c83..6643e66 100644 (file)
@@ -1793,7 +1793,7 @@ iris_create_rasterizer_state(struct pipe_context *ctx,
       sf.SmoothPointEnable = (state->point_smooth || state->multisample) &&
                              !state->point_quad_rasterization;
       sf.PointWidthSource = state->point_size_per_vertex ? Vertex : State;
-      sf.PointWidth = state->point_size;
+      sf.PointWidth = CLAMP(state->point_size, 0.125f, 255.875f);
 
       if (state->flatshade_first) {
          sf.TriangleFanProvokingVertexSelect = 1;