mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
zink: use util_draw_vbo_without_prim_restart for unsupported prim modes
this fixes up primitive restart functionality for the primitive types that vulkan doesn't support using primitive restart with fixes #2873 Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5912>
This commit is contained in:
parent
f4583b4086
commit
5959178381
1 changed files with 11 additions and 1 deletions
|
|
@ -197,6 +197,12 @@ line_width_needed(enum pipe_prim_type reduced_prim,
|
|||
}
|
||||
}
|
||||
|
||||
static inline bool
|
||||
restart_supported(enum pipe_prim_type mode)
|
||||
{
|
||||
return mode == PIPE_PRIM_LINE_STRIP || mode == PIPE_PRIM_TRIANGLE_STRIP || mode == PIPE_PRIM_TRIANGLE_FAN;
|
||||
}
|
||||
|
||||
void
|
||||
zink_draw_vbo(struct pipe_context *pctx,
|
||||
const struct pipe_draw_info *dinfo)
|
||||
|
|
@ -209,6 +215,11 @@ zink_draw_vbo(struct pipe_context *pctx,
|
|||
VkDeviceSize counter_buffer_offsets[PIPE_MAX_SO_OUTPUTS] = {};
|
||||
bool need_index_buffer_unref = false;
|
||||
|
||||
|
||||
if (dinfo->primitive_restart && !restart_supported(dinfo->mode)) {
|
||||
util_draw_vbo_without_prim_restart(pctx, dinfo);
|
||||
return;
|
||||
}
|
||||
if (dinfo->mode >= PIPE_PRIM_QUADS ||
|
||||
dinfo->mode == PIPE_PRIM_LINE_LOOP) {
|
||||
if (!u_trim_pipe_prim(dinfo->mode, (unsigned *)&dinfo->count))
|
||||
|
|
@ -223,7 +234,6 @@ zink_draw_vbo(struct pipe_context *pctx,
|
|||
if (!gfx_program)
|
||||
return;
|
||||
|
||||
/* this is broken for anything requiring primconvert atm */
|
||||
ctx->gfx_pipeline_state.primitive_restart = !!dinfo->primitive_restart;
|
||||
|
||||
VkPipeline pipeline = zink_get_gfx_pipeline(screen, gfx_program,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue