lavapipe: fix primitive-restart for uint8 indices
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 16 Mar 2021 15:00:33 +0000 (16:00 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 16 Mar 2021 21:17:16 +0000 (21:17 +0000)
I forgot to add an implicit primitive-restart index for uint8 while
adding support for this initially. But we also have a nice little
helper to simplify this, so let's use that instead of open-coding.

Fixes: 6526e6d11b8 ("lavapipe: implement VK_EXT_index_type_uint8")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9622>

src/gallium/drivers/llvmpipe/ci/deqp-lvp-fails.txt
src/gallium/drivers/zink/ci/deqp-zink-lvp-fails.txt
src/gallium/drivers/zink/ci/deqp-zink-lvp-flakes.txt
src/gallium/drivers/zink/ci/zink-quick_gl.txt
src/gallium/frontends/lavapipe/lvp_execute.c

index 548f184..98b61c2 100644 (file)
@@ -11,7 +11,6 @@ dEQP-VK.glsl.texture_functions.query.texturequerylod.sampler1dshadow_fragment,Fa
 dEQP-VK.glsl.texture_functions.query.texturequerylod.sampler2darray_fixed_fragment,Fail
 dEQP-VK.glsl.texture_functions.query.texturequerylod.sampler2darrayshadow_fragment,Fail
 dEQP-VK.glsl.texture_functions.query.texturequerylod.sampler2dshadow_fragment,Fail
-dEQP-VK.pipeline.input_assembly.primitive_restart.index_type_uint8.line_strip_with_adjacency,Fail
 dEQP-VK.rasterization.primitives_multisample_4_bit.no_stipple.points,Fail
 dEQP-VK.tessellation.invariance.outer_triangle_set.quads_fractional_odd_spacing,Timeout
 dEQP-VK.texture.filtering.2d.combinations.linear_mipmap_linear.linear.clamp_to_edge.repeat,Fail
index 2cfd087..5e328ff 100644 (file)
@@ -245,19 +245,6 @@ dEQP-GLES3.functional.fragment_out.random.94,Fail
 dEQP-GLES3.functional.fragment_out.random.98,Fail
 dEQP-GLES3.functional.polygon_offset.fixed16_render_with_units,Fail
 dEQP-GLES3.functional.polygon_offset.fixed24_displacement_with_units,Fail
-dEQP-GLES3.functional.primitive_restart.basic.triangle_fan.unsigned_byte.draw_elements_instanced,Fail
-dEQP-GLES3.functional.primitive_restart.basic.triangle_strip.unsigned_byte.draw_range_elements,Fail
-dEQP-GLES3.functional.primitive_restart.begin_restart_duplicate_restarts.line_strip.unsigned_byte.draw_range_elements,Fail
-dEQP-GLES3.functional.primitive_restart.begin_restart_duplicate_restarts.triangle_fan.unsigned_byte.draw_range_elements,Fail
-dEQP-GLES3.functional.primitive_restart.begin_restart_end_restart_duplicate_restarts.line_strip.unsigned_byte.draw_elements,Fail
-dEQP-GLES3.functional.primitive_restart.begin_restart_end_restart_duplicate_restarts.triangle_fan.unsigned_byte.draw_elements,Fail
-dEQP-GLES3.functional.primitive_restart.begin_restart_end_restart.triangle_strip.unsigned_byte.draw_elements,Fail
-dEQP-GLES3.functional.primitive_restart.begin_restart.triangle_fan.unsigned_byte.draw_elements_instanced,Fail
-dEQP-GLES3.functional.primitive_restart.begin_restart.triangle_strip.unsigned_byte.draw_range_elements,Fail
-dEQP-GLES3.functional.primitive_restart.duplicate_restarts.triangle_fan.unsigned_byte.draw_range_elements,Fail
-dEQP-GLES3.functional.primitive_restart.end_restart_duplicate_restarts.line_strip.unsigned_byte.draw_elements,Fail
-dEQP-GLES3.functional.primitive_restart.end_restart_duplicate_restarts.triangle_fan.unsigned_byte.draw_elements,Fail
-dEQP-GLES3.functional.primitive_restart.end_restart_duplicate_restarts.triangle_strip.unsigned_byte.draw_elements_instanced,Fail
 dEQP-GLES3.functional.rasterization.flatshading.lines,Fail
 dEQP-GLES3.functional.shaders.texture_functions.texturegrad.isampler2darray_vertex,Fail
 dEQP-GLES3.functional.shaders.texture_functions.texturegrad.isampler3d_vertex,Fail
index 50773b8..e69de29 100644 (file)
@@ -1,6 +0,0 @@
-dEQP-GLES3.functional.primitive_restart.begin_restart.line_strip.unsigned_byte.draw_elements_instanced
-dEQP-GLES3.functional.primitive_restart.duplicate_restarts.line_strip.unsigned_byte.draw_range_elements
-dEQP-GLES3.functional.primitive_restart.end_restart.triangle_strip.unsigned_byte.draw_elements
-dEQP-GLES3.functional.primitive_restart.end_restart_duplicate_restarts.triangle_strip.unsigned_byte.draw_elements_instanced
-dEQP-GLES3.functional.primitive_restart.basic.line_strip.unsigned_byte.draw_elements_instanced
-dEQP-GLES3.functional.primitive_restart.begin_restart_end_restart_duplicate_restarts.triangle_strip.unsigned_byte.draw_elements_instanced
index 43fd8b8..c234775 100644 (file)
@@ -735,9 +735,6 @@ spec/!opengl 3.0/clearbuffer-depth-cs-probe: skip
 spec/!opengl 3.0/clearbuffer-stencil: fail
 spec/!opengl 3.0/sampler-cube-shadow: fail
 spec/!opengl 3.1/draw-buffers-errors: skip
-spec/!opengl 3.1/primitive-restart-xfb flush: fail
-spec/!opengl 3.1/primitive-restart-xfb generated: fail
-spec/!opengl 3.1/primitive-restart-xfb written: fail
 spec/!opengl 3.2/gl-3.2-adj-prims cull-back pv-first: fail
 spec/!opengl 3.2/gl-3.2-adj-prims cull-back pv-last: fail
 spec/!opengl 3.2/gl-3.2-adj-prims cull-front pv-first: fail
@@ -2585,7 +2582,6 @@ spec/ext_window_rectangles/render_gles3: skip
 spec/glsl-1.50/built-in constants compatibility: skip
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_line_loop ffs: fail
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_line_loop other: fail
-spec/glsl-1.50/execution/geometry/primitive-id-restart gl_line_strip ffs: fail
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_line_strip_adjacency ffs: fail
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_line_strip_adjacency other: fail
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_lines ffs: fail
@@ -2594,8 +2590,6 @@ spec/glsl-1.50/execution/geometry/primitive-id-restart gl_lines_adjacency ffs: f
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_lines_adjacency other: fail
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_points ffs: fail
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_points other: fail
-spec/glsl-1.50/execution/geometry/primitive-id-restart gl_triangle_fan ffs: fail
-spec/glsl-1.50/execution/geometry/primitive-id-restart gl_triangle_strip ffs: fail
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_triangle_strip_adjacency ffs: fail
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_triangle_strip_adjacency other: fail
 spec/glsl-1.50/execution/geometry/primitive-id-restart gl_triangles ffs: fail
@@ -2708,9 +2702,6 @@ spec/nv_fragment_program_option/fp-set-02: skip
 spec/nv_fragment_program_option/fp-unpack-01: skip
 spec/nv_image_formats/nv_image_formats-gles3: skip
 spec/nv_primitive_restart/primitive-restart-disable_vbo: fail
-spec/nv_primitive_restart/primitive-restart-draw-mode-line_strip: fail
-spec/nv_primitive_restart/primitive-restart-draw-mode-triangle_fan: fail
-spec/nv_primitive_restart/primitive-restart-draw-mode-triangle_strip: fail
 spec/nv_primitive_restart/primitive-restart-vbo_combined_vertex_and_index: fail
 spec/nv_primitive_restart/primitive-restart-vbo_index_only: fail
 spec/nv_primitive_restart/primitive-restart-vbo_separate_vertex_and_index: fail
index a06dabd..cf29946 100644 (file)
@@ -38,6 +38,7 @@
 #include "util/u_sampler.h"
 #include "util/u_box.h"
 #include "util/u_inlines.h"
+#include "util/u_prim_restart.h"
 #include "util/format/u_format_zs.h"
 
 #include "vk_util.h"
@@ -2114,12 +2115,9 @@ static void handle_draw_indexed(struct lvp_cmd_buffer_entry *cmd,
    state->info.index_bias = cmd->u.draw_indexed.vertex_offset;
    state->info.view_mask = subpass->view_mask;
 
-   if (state->info.primitive_restart) {
-      if (state->info.index_size == 4)
-         state->info.restart_index = 0xffffffff;
-      else
-         state->info.restart_index = 0xffff;
-   }
+   if (state->info.primitive_restart)
+      state->info.restart_index = util_prim_restart_index_from_size(state->info.index_size);
+
    state->pctx->draw_vbo(state->pctx, &state->info, NULL, &state->draw, 1);
 }