return (struct v3d_stream_output_target *)ptarget;
}
+static inline uint32_t
+v3d_stream_output_target_get_vertex_count(struct pipe_stream_output_target *ptarget)
+{
+ return v3d_stream_output_target(ptarget)->recorded_vertex_count;
+}
+
struct pipe_context *v3d_context_create(struct pipe_screen *pscreen,
void *priv, unsigned flags);
void v3d_program_init(struct pipe_context *pctx);
info->indirect->offset);
}
} else if (info->instance_count > 1) {
+ struct pipe_stream_output_target *so =
+ info->count_from_stream_output;
+ uint32_t vert_count = so ?
+ v3d_stream_output_target_get_vertex_count(so) :
+ info->count;
cl_emit(&job->bcl, VERTEX_ARRAY_INSTANCED_PRIMS, prim) {
prim.mode = info->mode | prim_tf_enable;
prim.index_of_first_vertex = info->start;
prim.number_of_instances = info->instance_count;
- prim.instance_length = info->count;
+ prim.instance_length = vert_count;
}
} else {
+ struct pipe_stream_output_target *so =
+ info->count_from_stream_output;
+ uint32_t vert_count = so ?
+ v3d_stream_output_target_get_vertex_count(so) :
+ info->count;
cl_emit(&job->bcl, VERTEX_ARRAY_PRIMS, prim) {
prim.mode = info->mode | prim_tf_enable;
- prim.length = info->count;
+ prim.length = vert_count;
prim.index_of_first_vertex = info->start;
}
}