zink: implement ARB_draw_indirect
other than the vaguely gross case of primitive restart with incompatible draw modes and/or restart index, this is no trouble since the buffer formats are compatible Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7191>
This commit is contained in:

committed by
Marge Bot

parent
3e3b6e995f
commit
7c5129985b
@@ -114,7 +114,7 @@ GL 3.3, GLSL 3.30 --- all DONE: i965, nv50, nvc0, r600, radeonsi, llvmpipe, soft
|
||||
GL 4.0, GLSL 4.00 --- all DONE: i965/gen7+, nvc0, r600, radeonsi, llvmpipe, virgl
|
||||
|
||||
GL_ARB_draw_buffers_blend DONE (freedreno, i965/gen6+, nv50, softpipe, swr, zink, panfrost)
|
||||
GL_ARB_draw_indirect DONE (freedreno, i965/gen7+, softpipe, swr, v3d)
|
||||
GL_ARB_draw_indirect DONE (freedreno, i965/gen7+, softpipe, swr, v3d, zink)
|
||||
GL_ARB_gpu_shader5 DONE (i965/gen7+)
|
||||
- 'precise' qualifier DONE (softpipe)
|
||||
- Dynamically uniform sampler array indices DONE (softpipe)
|
||||
|
@@ -509,6 +509,11 @@ zink_draw_vbo(struct pipe_context *pctx,
|
||||
struct zink_resource *res = zink_resource(index_buffer);
|
||||
vkCmdBindIndexBuffer(batch->cmdbuf, res->buffer, index_offset, index_type);
|
||||
zink_batch_reference_resource_rw(batch, res, false);
|
||||
if (dinfo->indirect) {
|
||||
struct zink_resource *indirect = zink_resource(dinfo->indirect->buffer);
|
||||
zink_batch_reference_resource_rw(batch, indirect, false);
|
||||
vkCmdDrawIndexedIndirect(batch->cmdbuf, indirect->buffer, dinfo->indirect->offset, dinfo->indirect->draw_count, dinfo->indirect->stride);
|
||||
} else
|
||||
vkCmdDrawIndexed(batch->cmdbuf,
|
||||
dinfo->count, dinfo->instance_count,
|
||||
need_index_buffer_unref ? 0 : dinfo->start, dinfo->index_bias, dinfo->start_instance);
|
||||
@@ -518,8 +523,11 @@ zink_draw_vbo(struct pipe_context *pctx,
|
||||
screen->vk_CmdDrawIndirectByteCountEXT(batch->cmdbuf, dinfo->instance_count, dinfo->start_instance,
|
||||
zink_resource(so_target->counter_buffer)->buffer, so_target->counter_buffer_offset, 0,
|
||||
MIN2(so_target->stride, screen->info.tf_props.maxTransformFeedbackBufferDataStride));
|
||||
}
|
||||
else
|
||||
} else if (dinfo->indirect) {
|
||||
struct zink_resource *indirect = zink_resource(dinfo->indirect->buffer);
|
||||
zink_batch_reference_resource_rw(batch, indirect, false);
|
||||
vkCmdDrawIndirect(batch->cmdbuf, indirect->buffer, dinfo->indirect->offset, dinfo->indirect->draw_count, dinfo->indirect->stride);
|
||||
} else
|
||||
vkCmdDraw(batch->cmdbuf, dinfo->count, dinfo->instance_count, dinfo->start, dinfo->start_instance);
|
||||
}
|
||||
|
||||
|
@@ -97,6 +97,7 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
switch (param) {
|
||||
case PIPE_CAP_NPOT_TEXTURES:
|
||||
case PIPE_CAP_TGSI_TEXCOORD:
|
||||
case PIPE_CAP_DRAW_INDIRECT:
|
||||
return 1;
|
||||
|
||||
case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
|
||||
|
Reference in New Issue
Block a user