i915g: Add support for per-vertex point size.

Closes: #4973
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11668>
This commit is contained in:
Emma Anholt 2021-06-30 13:02:28 -07:00 committed by Marge Bot
parent e58ab64223
commit 487a493325
4 changed files with 14 additions and 9 deletions

View file

@ -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

View file

@ -11,7 +11,6 @@ shaders@glsl-sin,Fail
shaders@glsl-uniform-interstage-limits@520 vs- 1 fs,Fail
shaders@glsl-uniform-interstage-limits@subdivide 5,Fail
shaders@glsl-uniform-interstage-limits@subdivide 5- statechanges,Fail
shaders@glsl-vs-point-size,Fail
shaders@ssa@fs-if-def-else-break,Fail
shaders@ssa@fs-lost-copy-problem,Fail
shaders@ssa@fs-swap-problem,Fail
@ -277,7 +276,6 @@ spec@arb_pixel_buffer_object@texsubimage pbo,Fail
spec@arb_point_parameters@arb_point_parameters-point-attenuation,Crash
spec@arb_point_parameters@arb_point_parameters-point-attenuation@Aliased combinations,Fail
spec@arb_point_parameters@arb_point_parameters-point-attenuation@Antialiased combinations,Fail
spec@arb_provoking_vertex@arb-provoking-vertex-render,Fail
spec@arb_sampler_objects@gl_ext_texture_srgb_decode,Fail
spec@arb_shader_texture_lod@execution@glsl-fs-texturelod-01,Fail

View file

@ -28,6 +28,7 @@
/* Authors: Keith Whitwell <keithw@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;
}

View file

@ -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]) {