<field name="mode" size="6" start="0" type="Primitive"/>
</packet>
+ <packet code="33" name="Indirect Indexed Instanced Prim List" cl="B" max_ver="33">
+ <field name="Stride in Multiples of 4 Bytes" size="8" start="104" type="uint"/>
+ <field name="Address of Indices List" size="32" start="72" type="address"/>
+ <field name="Address" size="32" start="40" type="address"/>
+ <field name="Enable Primitive Restarts" size="1" start="39" type="bool"/>
+ <field name="Number of Draw Indirect Indexed Records" size="31" start="8" type="uint"/>
+
+ <field name="Index type" size="2" start="6" type="uint">
+ <value name="Index type 8-bit" value="0"/>
+ <value name="Index type 16-bit" value="1"/>
+ <value name="Index type 32-bit" value="2"/>
+ </field>
+
+ <field name="mode" size="6" start="0" type="Primitive"/>
+ </packet>
+
+ <packet code="33" name="Indirect Indexed Instanced Prim List" cl="B" min_ver="41">
+ <field name="Stride in Multiples of 4 Bytes" size="8" start="72" type="uint"/>
+ <field name="Address" size="32" start="40" type="address"/>
+ <field name="Enable Primitive Restarts" size="1" start="39" type="bool"/>
+ <field name="Number of Draw Indirect Indexed Records" size="31" start="8" type="uint"/>
+
+ <field name="Index type" size="2" start="6" type="uint">
+ <value name="Index type 8-bit" value="0"/>
+ <value name="Index type 16-bit" value="1"/>
+ <value name="Index type 32-bit" value="2"/>
+ </field>
+
+ <field name="mode" size="6" start="0" type="Primitive"/>
+ </packet>
+
<packet code="34" name="Indexed Instanced Prim List" cl="B" max_ver="33">
<field name="Enable Primitive Restarts" size="1" start="135" type="bool"/>
<field name="Maximum index" size="31" start="104" type="uint"/>
<field name="mode" size="8" start="0" type="Primitive"/>
</packet>
+ <packet code="37" name="Indirect Vertex Array Instanced Prims" cl="B">
+ <field name="Stride in Multiples of 4 Bytes" size="8" start="72" type="uint"/>
+ <field name="Address" size="32" start="40" type="address"/>
+ <field name="Number of Draw Indirect Array Records" size="32" start="8" type="uint"/>
+
+ <field name="mode" size="8" start="0" type="Primitive"/>
+ </packet>
+
<packet code="38" name="Vertex Array Instanced Prims" cl="B">
<field name="Index of First Vertex" size="32" start="72" type="uint"/>
<field name="Number of Instances" size="32" start="40" type="uint"/>
case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
case PIPE_CAP_COMPUTE:
case PIPE_CAP_DRAW_INDIRECT:
+ case PIPE_CAP_MULTI_DRAW_INDIRECT:
case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
case PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET:
case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
for (int s = 0; s < PIPE_SHADER_TYPES; s++)
v3d_predraw_check_stage_inputs(pctx, s);
+ if (info->indirect)
+ v3d_flush_jobs_writing_resource(v3d, info->indirect->buffer);
+
struct v3d_job *job = v3d_get_job_for_fbo(v3d);
/* If vertex texturing depends on the output of rendering, we need to
}
#endif
- if (info->instance_count > 1) {
+ if (info->indirect) {
+ cl_emit(&job->bcl, INDIRECT_INDEXED_INSTANCED_PRIM_LIST, prim) {
+ prim.index_type = ffs(info->index_size) - 1;
+#if V3D_VERSION < 40
+ prim.address_of_indices_list =
+ cl_address(rsc->bo, offset);
+#endif /* V3D_VERSION < 40 */
+ prim.mode = info->mode | prim_tf_enable;
+ prim.enable_primitive_restarts = info->primitive_restart;
+
+ prim.number_of_draw_indirect_indexed_records = info->indirect->draw_count;
+
+ prim.stride_in_multiples_of_4_bytes = info->indirect->stride >> 2;
+ prim.address = cl_address(v3d_resource(info->indirect->buffer)->bo,
+ info->indirect->offset);
+ }
+ } else if (info->instance_count > 1) {
cl_emit(&job->bcl, INDEXED_INSTANCED_PRIM_LIST, prim) {
prim.index_type = ffs(info->index_size) - 1;
#if V3D_VERSION >= 40
if (info->has_user_indices)
pipe_resource_reference(&prsc, NULL);
} else {
- if (info->instance_count > 1) {
+ if (info->indirect) {
+ cl_emit(&job->bcl, INDIRECT_VERTEX_ARRAY_INSTANCED_PRIMS, prim) {
+ prim.mode = info->mode | prim_tf_enable;
+ prim.number_of_draw_indirect_array_records = info->indirect->draw_count;
+
+ prim.stride_in_multiples_of_4_bytes = info->indirect->stride >> 2;
+ prim.address = cl_address(v3d_resource(info->indirect->buffer)->bo,
+ info->indirect->offset);
+ }
+ } else if (info->instance_count > 1) {
cl_emit(&job->bcl, VERTEX_ARRAY_INSTANCED_PRIMS, prim) {
prim.mode = info->mode | prim_tf_enable;
prim.index_of_first_vertex = info->start;