static void
upload_3dstate_so_buffers(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
- struct gl_context *ctx = &intel->ctx;
+ struct gl_context *ctx = &brw->ctx;
/* BRW_NEW_VERTEX_PROGRAM */
const struct gl_shader_program *vs_prog =
ctx->Shader.CurrentVertexProgram;
continue;
}
- bo = intel_bufferobj_buffer(intel, bufferobj, INTEL_WRITE_PART);
+ bo = intel_bufferobj_buffer(brw, bufferobj, INTEL_WRITE_PART);
stride = linked_xfb_info->BufferStride[i] * 4;
start = xfb_obj->Offset[i];
end = ALIGN(start + xfb_obj->Size[i], 4);
assert(end <= bo->size);
- /* If we don't have hardware contexts, then we reset our offsets at the
- * start of every batch, so we track the number of vertices written in
- * software and increment our pointers by that many.
- */
- if (!intel->hw_ctx) {
- start += brw->sol.offset_0_batch_start * stride;
- assert(start <= end);
- }
-
BEGIN_BATCH(4);
OUT_BATCH(_3DSTATE_SO_BUFFER << 16 | (4 - 2));
OUT_BATCH((i << SO_BUFFER_INDEX_SHIFT) | stride);
* stream. We only have one stream of rendering coming out of the GS unit, so
* we only emit stream 0 (low 16 bits) SO_DECLs.
*/
-static void
-upload_3dstate_so_decl_list(struct brw_context *brw,
- const struct brw_vue_map *vue_map)
+void
+gen7_upload_3dstate_so_decl_list(struct brw_context *brw,
+ const struct brw_vue_map *vue_map)
{
- struct intel_context *intel = &brw->intel;
- struct gl_context *ctx = &intel->ctx;
+ struct gl_context *ctx = &brw->ctx;
/* BRW_NEW_VERTEX_PROGRAM */
const struct gl_shader_program *vs_prog =
ctx->Shader.CurrentVertexProgram;
upload_3dstate_streamout(struct brw_context *brw, bool active,
const struct brw_vue_map *vue_map)
{
- struct intel_context *intel = &brw->intel;
- struct gl_context *ctx = &intel->ctx;
+ struct gl_context *ctx = &brw->ctx;
/* BRW_NEW_TRANSFORM_FEEDBACK */
struct gl_transform_feedback_object *xfb_obj =
ctx->TransformFeedback.CurrentObject;
static void
upload_sol_state(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
- struct gl_context *ctx = &intel->ctx;
+ struct gl_context *ctx = &brw->ctx;
/* BRW_NEW_TRANSFORM_FEEDBACK */
bool active = _mesa_is_xfb_active_and_unpaused(ctx);
if (active) {
upload_3dstate_so_buffers(brw);
/* BRW_NEW_VUE_MAP_GEOM_OUT */
- upload_3dstate_so_decl_list(brw, &brw->vue_map_geom_out);
-
- /* If we don't have hardware contexts, then some other client may have
- * changed the SO write offsets, and we need to rewrite them.
- */
- if (!intel->hw_ctx)
- intel->batch.needs_sol_reset = true;
+ gen7_upload_3dstate_so_decl_list(brw, &brw->vue_map_geom_out);
}
/* Finally, set up the SOL stage. This command must always follow updates to
.emit = upload_sol_state,
};
+void
+gen7_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
+ struct gl_transform_feedback_object *obj)
+{
+ struct brw_context *brw = brw_context(ctx);
+
+ intel_batchbuffer_flush(brw);
+ brw->batch.needs_sol_reset = true;
+}
+
void
gen7_end_transform_feedback(struct gl_context *ctx,
struct gl_transform_feedback_object *obj)
* This also covers any cache flushing required.
*/
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = &brw->intel;
- intel_batchbuffer_flush(intel);
+ intel_batchbuffer_flush(brw);
}