draw->pipeline.flatshade->next = next;
next = draw->pipeline.flatshade;
}
-
+
+ if (draw->feedback.enabled || draw->feedback.discard) {
+ draw->pipeline.feedback->next = next;
+ next = draw->pipeline.feedback;
+ }
+
draw->pipeline.first = next;
}
}
+void
+draw_set_vertex_shader(struct draw_context *draw,
+ const struct pipe_shader_state *shader)
+{
+ draw->vertex_shader = *shader;
+}
+
+
void
draw_set_vertex_buffer(struct draw_context *draw,
unsigned attr,
}
+/**
+ * Tell drawing context where to find mapped vertex buffers.
+ */
void
-draw_set_vertex_shader(struct draw_context *draw,
- const struct pipe_shader_state *shader)
+draw_set_mapped_vertex_buffer(struct draw_context *draw,
+ unsigned attr, const void *buffer)
{
- draw->vertex_shader = *shader;
+ draw->mapped_vbuffer[attr] = buffer;
+}
+
+
+void
+draw_set_mapped_constant_buffer(struct draw_context *draw,
+ const void *buffer)
+{
+ draw->mapped_constants = buffer;
}
+
+
+void
+draw_set_mapped_feedback_buffer(struct draw_context *draw, uint index,
+ void *buffer, uint size)
+{
+ draw->mapped_feedback_buffer[index] = buffer;
+ draw->mapped_feedback_buffer_size[index] = size; /* in bytes */
+}
+
unsigned draw_trim( unsigned count, unsigned first, unsigned incr );
-void draw_set_mapped_element_buffer( struct draw_context *draw,
- unsigned eltSize, void *elements );
-void draw_set_mapped_vertex_buffer(struct draw_context *draw,
- unsigned attr, const void *buffer);
+void
+draw_set_vertex_shader(struct draw_context *draw,
+ const struct pipe_shader_state *shader);
-void draw_set_mapped_constant_buffer(struct draw_context *draw,
- const void *buffer);
void
draw_set_vertex_buffer(struct draw_context *draw,
unsigned attr,
const struct pipe_vertex_element *element);
-void
-draw_set_vertex_shader(struct draw_context *draw,
- const struct pipe_shader_state *shader);
+void draw_set_mapped_element_buffer( struct draw_context *draw,
+ unsigned eltSize, void *elements );
+
+void draw_set_mapped_vertex_buffer(struct draw_context *draw,
+ unsigned attr, const void *buffer);
+void draw_set_mapped_constant_buffer(struct draw_context *draw,
+ const void *buffer);
+
+void
+draw_set_mapped_feedback_buffer(struct draw_context *draw, uint index,
+ void *buffer, uint size);
void
draw_arrays(struct draw_context *draw, unsigned prim,
}
-/**
- * Tell drawing context where to find mapped vertex buffers.
- */
-void draw_set_mapped_vertex_buffer(struct draw_context *draw,
- unsigned attr, const void *buffer)
-{
- draw->mapped_vbuffer[attr] = buffer;
-}
-
-
-void draw_set_mapped_constant_buffer(struct draw_context *draw,
- const void *buffer)
-{
- draw->mapped_constants = buffer;
-}
-
-
unsigned
draw_prim_info(unsigned prim, unsigned *first, unsigned *incr)
{
struct draw_stage *first; /**< one of the following */
/* stages (in logical order) */
+ struct draw_stage *feedback;
struct draw_stage *flatshade;
struct draw_stage *clip;
struct draw_stage *cull;
/* pipe state that we need: */
struct pipe_setup_state setup;
+ struct pipe_feedback_state feedback;
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
struct pipe_vertex_element vertex_element[PIPE_ATTRIB_MAX];
struct pipe_shader_state vertex_shader;
+ struct pipe_vertex_buffer feedback_buffer[PIPE_ATTRIB_MAX];
+ struct pipe_vertex_element feedback_element[PIPE_ATTRIB_MAX];
/** The mapped vertex element/index buffer */
const void *mapped_elts;
/** The mapped constant buffers (for vertex shader) */
const void *mapped_constants;
+ /** The mapped vertex element/index buffer */
+ void *mapped_feedback_buffer[PIPE_MAX_FEEDBACK_ATTRIBS];
+ uint mapped_feedback_buffer_size[PIPE_MAX_FEEDBACK_ATTRIBS]; /* in bytes */
+
/* Clip derived state:
*/
float plane[12][4];
+extern struct draw_stage *draw_feedback_stage( struct draw_context *context );
extern struct draw_stage *draw_unfilled_stage( struct draw_context *context );
extern struct draw_stage *draw_twoside_stage( struct draw_context *context );
extern struct draw_stage *draw_offset_stage( struct draw_context *context );
void (*set_viewport_state)( struct pipe_context *,
const struct pipe_viewport_state * );
+ /*
+ * Vertex arrays
+ */
void (*set_vertex_buffer)( struct pipe_context *,
unsigned index,
const struct pipe_vertex_buffer * );
-
+
void (*set_vertex_element)( struct pipe_context *,
unsigned index,
const struct pipe_vertex_element * );
-
+
+ /*
+ * Vertex feedback
+ */
+ void (*set_feedback_buffer)(struct pipe_context *,
+ unsigned index,
+ struct pipe_vertex_buffer *);
+
+ void (*set_feedback_element)(struct pipe_context *,
+ unsigned index,
+ const struct pipe_vertex_element *);
+
/*
* Surface functions
#define PIPE_ATTRIB_MAX 32
#define PIPE_MAX_COLOR_BUFS 8
#define PIPE_MAX_TEXTURE_LEVELS 16
+#define PIPE_MAX_FEEDBACK_ATTRIBS 16
/* fwd decl */
float offset_scale;
};
+
+/**
+ * Post-transform vertex feeback
+ */
+struct pipe_feedback_state {
+ uint enabled:1; /**< enable feedback? */
+ uint discard:1; /**< discard primitives? */
+ uint interleaved:1; /**< interleaved output? */
+ uint num_attribs;
+ uint attrib[PIPE_MAX_FEEDBACK_ATTRIBS];
+ uint size[PIPE_MAX_FEEDBACK_ATTRIBS];
+};
+
+
struct pipe_poly_stipple {
unsigned stipple[32];
};
pipe/draw/draw_clip.c \
pipe/draw/draw_context.c\
pipe/draw/draw_cull.c \
+ pipe/draw/draw_feedback.c \
pipe/draw/draw_flatshade.c \
pipe/draw/draw_offset.c \
pipe/draw/draw_prim.c \