Mesa (main): i915g: Add support for per-vertex point size.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 2 15:47:15 UTC 2021


Module: Mesa
Branch: main
Commit: 487a49332592ad5f77841ac37fd2b601c9472e8b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=487a49332592ad5f77841ac37fd2b601c9472e8b

Author: Emma Anholt <emma at anholt.net>
Date:   Wed Jun 30 13:02:28 2021 -0700

i915g: Add support for per-vertex point size.

Closes: #4973
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11668>

---

 src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt   |  4 ----
 src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt |  2 --
 src/gallium/drivers/i915/i915_state.c                 |  7 ++++++-
 src/gallium/drivers/i915/i915_state_derived.c         | 10 ++++++++--
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt b/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt
index d0f7cebbc53..ef9730a323f 100644
--- a/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt
+++ b/src/gallium/drivers/i915/ci/deqp-i915-g33-fails.txt
@@ -15,9 +15,6 @@ dEQP-GLES2.functional.clipping.line.wide_line_clip_viewport_corner,Fail
 dEQP-GLES2.functional.clipping.point.wide_point_clip,Fail
 dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_center,Fail
 dEQP-GLES2.functional.clipping.point.wide_point_clip_viewport_corner,Fail
-dEQP-GLES2.functional.clipping.point.wide_point_z_clip,Fail
-dEQP-GLES2.functional.clipping.point.wide_point_z_clip_viewport_center,Fail
-dEQP-GLES2.functional.clipping.point.wide_point_z_clip_viewport_corner,Fail
 dEQP-GLES2.functional.clipping.triangle_vertex.clip_two.clip_neg_y_neg_z_and_neg_x_neg_y_pos_z,Fail
 dEQP-GLES2.functional.clipping.triangle_vertex.clip_two.clip_pos_y_pos_z_and_neg_x_neg_y_neg_z,Fail
 dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb10_a2,Fail
@@ -328,7 +325,6 @@ dEQP-GLES2.functional.rasterization.interpolation.projected.lines_wide,Fail
 dEQP-GLES2.functional.rasterization.primitives.line_loop_wide,Fail
 dEQP-GLES2.functional.rasterization.primitives.line_strip_wide,Fail
 dEQP-GLES2.functional.rasterization.primitives.lines_wide,Fail
-dEQP-GLES2.functional.rasterization.primitives.points,Fail
 dEQP-GLES2.functional.shaders.builtin_variable.frontfacing,Fail
 dEQP-GLES2.functional.shaders.discard.dynamic_loop_always,Fail
 dEQP-GLES2.functional.shaders.discard.dynamic_loop_dynamic,Fail
diff --git a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
index a92eb5726ec..e066b512ffc 100644
--- a/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
+++ b/src/gallium/drivers/i915/ci/piglit-i915-g33-fails.txt
@@ -11,7 +11,6 @@ shaders at glsl-sin,Fail
 shaders at glsl-uniform-interstage-limits@520 vs- 1 fs,Fail
 shaders at glsl-uniform-interstage-limits@subdivide 5,Fail
 shaders at glsl-uniform-interstage-limits@subdivide 5- statechanges,Fail
-shaders at glsl-vs-point-size,Fail
 shaders at ssa@fs-if-def-else-break,Fail
 shaders at ssa@fs-lost-copy-problem,Fail
 shaders at ssa@fs-swap-problem,Fail
@@ -277,7 +276,6 @@ spec at arb_pixel_buffer_object@texsubimage pbo,Fail
 spec at arb_point_parameters@arb_point_parameters-point-attenuation,Crash
 
 spec at arb_point_parameters@arb_point_parameters-point-attenuation at Aliased combinations,Fail
-spec at arb_point_parameters@arb_point_parameters-point-attenuation at Antialiased combinations,Fail
 spec at arb_provoking_vertex@arb-provoking-vertex-render,Fail
 spec at arb_sampler_objects@gl_ext_texture_srgb_decode,Fail
 spec at arb_shader_texture_lod@execution at glsl-fs-texturelod-01,Fail
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index ffc5c5332be..1b064c63980 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -28,6 +28,7 @@
 /* Authors:  Keith Whitwell <keithw at vmware.com>
  */
 
+#include "compiler/nir/nir_builder.h"
 #include "draw/draw_context.h"
 #include "nir/nir_to_tgsi.h"
 #include "tgsi/tgsi_parse.h"
@@ -573,13 +574,17 @@ i915_create_vs_state(struct pipe_context *pipe,
 
    struct pipe_shader_state from_nir;
    if (templ->type == PIPE_SHADER_IR_NIR) {
+      nir_shader *s = templ->ir.nir;
+
+      NIR_PASS_V(s, nir_lower_point_size, 1.0, 255.0);
+
       /* The gallivm draw path doesn't support non-native-integers NIR shaders,
        * st/mesa does native-integers for the screen as a whole rather than
        * per-stage, and i915 FS can't do native integers.  So, convert to TGSI,
        * where the draw path *does* support non-native-integers.
        */
       from_nir.type = PIPE_SHADER_IR_TGSI;
-      from_nir.tokens = nir_to_tgsi(templ->ir.nir, pipe->screen);
+      from_nir.tokens = nir_to_tgsi(s, pipe->screen);
       templ = &from_nir;
    }
 
diff --git a/src/gallium/drivers/i915/i915_state_derived.c b/src/gallium/drivers/i915/i915_state_derived.c
index 2402c55e226..db565e80ff8 100644
--- a/src/gallium/drivers/i915/i915_state_derived.c
+++ b/src/gallium/drivers/i915/i915_state_derived.c
@@ -109,8 +109,14 @@ calculate_vertex_layout(struct i915_context *i915)
       vinfo.attrib[0].emit = EMIT_3F;
    }
 
-   /* hardware point size */
-   /* XXX todo */
+   /* point size.  if not emitted here, then point size comes from LIS4. */
+   if (i915->rasterizer->templ.point_size_per_vertex) {
+      src = draw_find_shader_output(i915->draw, TGSI_SEMANTIC_PSIZE, 0);
+      if (src != -1) {
+         draw_emit_vertex_attr(&vinfo, EMIT_1F, src);
+         vinfo.hwfmt[0] |= S4_VFMT_POINT_WIDTH;
+      }
+   }
 
    /* primary color */
    if (colors[0]) {



More information about the mesa-commit mailing list