summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2015-03-20 12:36:21 -0700
committerJordan Justen <[email protected]>2015-03-31 16:40:24 -0700
commita8e39e19032d077a4adf7e451c608f3f139a05e2 (patch)
tree86ab4ec6f65db3d5511c0ef84c6661af8ca91db9 /src
parentd70f4e6daf4a548eb6debaa2a1646fea21e5fbf3 (diff)
i965/state: Only upload render programs for render state uploads
Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_upload.c45
1 files 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 8bd88f138d9..f24fcc730e5 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -583,17 +583,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
@@ -637,19 +640,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)) {
@@ -671,7 +676,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 =