draw_set_mapped_element_buffer(draw, 0, NULL);
}
+ /* Map feedback buffers if enabled */
+ if (i915->feedback.enabled) {
+ const uint n = i915->feedback.interleaved ? 1 : i915->feedback.num_attribs;
+ for (i = 0; i < n; i++) {
+ void *ptr = pipe->winsys->buffer_map(pipe->winsys,
+ i915->feedback_buffer[i].buffer,
+ PIPE_BUFFER_FLAG_WRITE);
+ draw_set_mapped_feedback_buffer(draw, i, ptr,
+ i915->feedback_buffer[i].size);
+ }
+ }
+
+
draw_set_mapped_constant_buffer(draw,
i915->current.constants[PIPE_SHADER_VERTEX]);
draw_set_mapped_element_buffer(draw, 0, NULL);
}
+ /* Unmap feedback buffers if enabled */
+ if (i915->feedback.enabled) {
+ const uint n = i915->feedback.interleaved ? 1 : i915->feedback.num_attribs;
+ for (i = 0; i < n; i++) {
+ pipe->winsys->buffer_unmap(pipe->winsys,
+ i915->feedback_buffer[i].buffer);
+ draw_set_mapped_feedback_buffer(draw, i, NULL, 0);
+ }
+ }
+
return TRUE;
}
struct pipe_clear_color_state clear_color;
struct pipe_clip_state clip;
struct pipe_constant_buffer constants[PIPE_SHADER_TYPES];
+ struct pipe_feedback_state feedback;
struct pipe_framebuffer_state framebuffer;
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_ATTRIB_MAX];
+ /** Feedback buffers */
+ struct pipe_feedback_buffer feedback_buffer[PIPE_MAX_FEEDBACK_ATTRIBS];
+
unsigned dirty;
unsigned *batch_start;
}
+static void
+i915_set_feedback_state(struct pipe_context *pipe,
+ const struct pipe_feedback_state *feedback)
+{
+ struct i915_context *i915 = i915_context(pipe);
+ i915->feedback = *feedback;
+ draw_set_feedback_state(i915->draw, feedback);
+}
+
+
+static void
+i915_set_feedback_buffer(struct pipe_context *pipe,
+ unsigned index,
+ const struct pipe_feedback_buffer *feedback)
+{
+ struct i915_context *i915 = i915_context(pipe);
+
+ assert(index < PIPE_MAX_FEEDBACK_ATTRIBS);
+
+ /* Need to be careful with referencing */
+ pipe->winsys->buffer_reference(pipe->winsys,
+ &i915->feedback_buffer[index].buffer,
+ feedback->buffer);
+ i915->feedback_buffer[index].size = feedback->size;
+ i915->feedback_buffer[index].start_offset = feedback->start_offset;
+}
+
static void i915_set_clear_color_state(struct pipe_context *pipe,
i915->pipe.set_clear_color_state = i915_set_clear_color_state;
i915->pipe.set_constant_buffer = i915_set_constant_buffer;
i915->pipe.set_framebuffer_state = i915_set_framebuffer_state;
+ i915->pipe.set_feedback_state = i915_set_feedback_state;
+ i915->pipe.set_feedback_buffer = i915_set_feedback_buffer;
+
i915->pipe.set_polygon_stipple = i915_set_polygon_stipple;
i915->pipe.set_scissor_state = i915_set_scissor_state;
i915->pipe.set_texture_state = i915_set_texture_state;