gallium/aux: Move index offsetting from prim restart to primconvert
Fixes: b34fed64 ("u_prim_restart: Fix index scanning with start offset")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5799
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14346>
This commit is contained in:
@@ -239,7 +239,7 @@ util_prim_restart_convert_to_direct(const void *index_map,
|
||||
#define SCAN_INDEXES(TYPE) \
|
||||
for (i = 0; i <= draw->count; i++) { \
|
||||
if (i == draw->count || \
|
||||
((const TYPE *) index_map)[draw->start + i] == info->restart_index) { \
|
||||
((const TYPE *) index_map)[i] == info->restart_index) { \
|
||||
/* cut / restart */ \
|
||||
if (count > 0) { \
|
||||
if (!add_range(info->mode, &ranges, draw->start + start, count, draw->index_bias)) { \
|
||||
|
||||
@@ -270,19 +270,3 @@ spec@khr_texture_compression_astc@miptree-gl srgb-fp,Fail
|
||||
spec@khr_texture_compression_astc@miptree-gl srgb-fp@sRGB decode full precision,Fail
|
||||
spec@khr_texture_compression_astc@miptree-gles srgb,Fail
|
||||
spec@khr_texture_compression_astc@miptree-gles srgb-fp,Fail
|
||||
|
||||
# Regression from i965
|
||||
# "primitive-restart: failure drawing with glDrawElements(GL_TRIANGLE_STRIP, GL_UNSIGNED_SHORT), DISABLE_VBO
|
||||
# primitive-restart: failure drawing with glDrawElements(GL_TRIANGLE_STRIP, GL_UNSIGNED_INT), DISABLE_VBO
|
||||
# primitive-restart: failure drawing with glDrawElements(GL_LINE_STRIP, GL_UNSIGNED_SHORT), DISABLE_VBO
|
||||
# primitive-restart: failure drawing with glDrawElements(GL_LINE_STRIP, GL_UNSIGNED_INT), DISABLE_VBO"
|
||||
spec@nv_primitive_restart@primitive-restart-disable_vbo,Fail
|
||||
|
||||
# Regression from i965
|
||||
spec@nv_primitive_restart@primitive-restart-draw-mode-line_loop,Fail
|
||||
spec@nv_primitive_restart@primitive-restart-draw-mode-polygon,Fail
|
||||
spec@nv_primitive_restart@primitive-restart-draw-mode-quad_strip,Fail
|
||||
spec@nv_primitive_restart@primitive-restart-draw-mode-quads,Fail
|
||||
spec@nv_primitive_restart@primitive-restart-draw-mode-triangle_fan,Fail
|
||||
spec@nv_primitive_restart@primitive-restart-vbo_combined_vertex_and_index,Fail
|
||||
spec@nv_primitive_restart@primitive-restart-vbo_vertex_only,Fail
|
||||
|
||||
@@ -148,7 +148,7 @@ primconvert_init_draw(struct primconvert_context *pc,
|
||||
src = pipe_buffer_map(pc->pipe, info->index.resource,
|
||||
PIPE_MAP_READ, &src_transfer);
|
||||
}
|
||||
src = (const uint8_t *)src;
|
||||
const void *restart_src = (const uint8_t *)src + draw->start * info->index_size;
|
||||
|
||||
/* if the resulting primitive type is not supported by the driver for primitive restart,
|
||||
* or if the original primitive type was not supported by the driver,
|
||||
@@ -160,7 +160,7 @@ primconvert_init_draw(struct primconvert_context *pc,
|
||||
/* step 1: rewrite draw to not use primitive primitive restart;
|
||||
* this pre-filters degenerate primitives
|
||||
*/
|
||||
direct_draws = util_prim_restart_convert_to_direct(src, info, draw, &num_direct_draws,
|
||||
direct_draws = util_prim_restart_convert_to_direct(restart_src, info, draw, &num_direct_draws,
|
||||
&new_info->min_index, &new_info->max_index, &total_index_count);
|
||||
new_info->primitive_restart = false;
|
||||
/* step 2: get a translator function which does nothing but handle any index size conversions
|
||||
|
||||
Reference in New Issue
Block a user