uint32_t defaults_offset;
};
+struct v3d_stream_output_target {
+ struct pipe_stream_output_target base;
+ /* Number of transform feedback vertices written to this target */
+ uint32_t recorded_vertex_count;
+};
+
struct v3d_streamout_stateobj {
struct pipe_stream_output_target *targets[PIPE_MAX_SO_BUFFERS];
/* Number of vertices we've written into the buffer so far. */
return (struct v3d_sampler_state *)psampler;
}
+static inline struct v3d_stream_output_target *
+v3d_stream_output_target(struct pipe_stream_output_target *ptarget)
+{
+ return (struct v3d_stream_output_target *)ptarget;
+}
+
struct pipe_context *v3d_context_create(struct pipe_screen *pscreen,
void *priv, unsigned flags);
void v3d_program_init(struct pipe_context *pctx);
/* XXX: Only count if we didn't overflow. */
v3d->tf_prims_generated += prims;
+ for (int i = 0; i < v3d->streamout.num_targets; i++) {
+ struct v3d_stream_output_target *target =
+ v3d_stream_output_target(v3d->streamout.targets[i]);
+ target->recorded_vertex_count += info->count;
+ }
}
static void
unsigned buffer_offset,
unsigned buffer_size)
{
- struct pipe_stream_output_target *target;
+ struct v3d_stream_output_target *target;
- target = CALLOC_STRUCT(pipe_stream_output_target);
+ target = CALLOC_STRUCT(v3d_stream_output_target);
if (!target)
return NULL;
- pipe_reference_init(&target->reference, 1);
- pipe_resource_reference(&target->buffer, prsc);
+ pipe_reference_init(&target->base.reference, 1);
+ pipe_resource_reference(&target->base.buffer, prsc);
- target->context = pctx;
- target->buffer_offset = buffer_offset;
- target->buffer_size = buffer_size;
+ target->base.context = pctx;
+ target->base.buffer_offset = buffer_offset;
+ target->base.buffer_size = buffer_size;
- return target;
+ return &target->base;
}
static void