v3d: fix glDrawTransformFeedback{Instanced}()
This needs to take the vertex count from the provided transform feedback buffer. v2: - don't take the vertex count from the underlying buffer, instead, take it from a v3d subclass of pipe_stream_output_target (Eric). Fixes piglit tests: spec/ext_transform_feedback2/draw-auto spec/ext_transform_feedback2/draw-auto instanced Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
47eb74ae00
commit
1a99fc0fd0
|
@ -561,6 +561,12 @@ v3d_stream_output_target(struct pipe_stream_output_target *ptarget)
|
|||
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);
|
||||
|
|
|
@ -852,16 +852,26 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue