[Mesa-dev] [PATCH v3 5/9] i965/state: Only upload render programs for render state uploads
Jordan Justen
jordan.l.justen at intel.com
Fri Mar 20 17:29:00 PDT 2015
Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
---
src/mesa/drivers/dri/i965/brw_state_upload.c | 45 +++++++++++++++-------------
1 file changed, 25 insertions(+), 20 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index df31906..bc5112e 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -573,17 +573,20 @@ brw_print_dirty_count(struct dirty_bit_map *bit_map)
}
}
-static void
-brw_upload_programs(struct brw_context *brw)
+static inline void
+brw_upload_programs(struct brw_context *brw,
+ enum brw_pipeline pipeline)
{
- brw_upload_vs_prog(brw);
+ if (pipeline == BRW_RENDER_PIPELINE) {
+ brw_upload_vs_prog(brw);
- if (brw->gen < 6)
- brw_upload_ff_gs_prog(brw);
- else
- brw_upload_gs_prog(brw);
+ if (brw->gen < 6)
+ brw_upload_ff_gs_prog(brw);
+ else
+ brw_upload_gs_prog(brw);
- brw_upload_wm_prog(brw);
+ brw_upload_wm_prog(brw);
+ }
}
static inline void
@@ -627,19 +630,21 @@ brw_upload_pipeline_state(struct brw_context *brw,
brw_state->brw |= ~0ull;
}
- if (brw->fragment_program != ctx->FragmentProgram._Current) {
- brw->fragment_program = ctx->FragmentProgram._Current;
- brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM;
- }
+ if (pipeline == BRW_RENDER_PIPELINE) {
+ if (brw->fragment_program != ctx->FragmentProgram._Current) {
+ brw->fragment_program = ctx->FragmentProgram._Current;
+ brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM;
+ }
- if (brw->geometry_program != ctx->GeometryProgram._Current) {
- brw->geometry_program = ctx->GeometryProgram._Current;
- brw->state.dirty.brw |= BRW_NEW_GEOMETRY_PROGRAM;
- }
+ if (brw->geometry_program != ctx->GeometryProgram._Current) {
+ brw->geometry_program = ctx->GeometryProgram._Current;
+ brw->state.dirty.brw |= BRW_NEW_GEOMETRY_PROGRAM;
+ }
- if (brw->vertex_program != ctx->VertexProgram._Current) {
- brw->vertex_program = ctx->VertexProgram._Current;
- brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM;
+ if (brw->vertex_program != ctx->VertexProgram._Current) {
+ brw->vertex_program = ctx->VertexProgram._Current;
+ brw->state.dirty.brw |= BRW_NEW_VERTEX_PROGRAM;
+ }
}
if (brw->meta_in_progress != _mesa_meta_in_progress(ctx)) {
@@ -661,7 +666,7 @@ brw_upload_pipeline_state(struct brw_context *brw,
if (brw->gen == 6)
intel_emit_post_sync_nonzero_flush(brw);
- brw_upload_programs(brw);
+ brw_upload_programs(brw, pipeline);
merge_ctx_state(brw, &state);
const struct brw_tracked_state *atoms =
--
2.1.4
More information about the mesa-dev
mailing list