* Misc invariant state packets
*/
-static void upload_invariant_state( struct brw_context *brw )
+void
+brw_upload_invariant_state(struct brw_context *brw)
{
struct intel_context *intel = &brw->intel;
.brw = BRW_NEW_CONTEXT,
.cache = 0
},
- .emit = upload_invariant_state
+ .emit = brw_upload_invariant_state
};
/**
&gen6_sf_vp,
/* Command packets: */
- &brw_invariant_state,
/* must do before binding table pointers, cc state ptrs */
&brw_state_base_address,
&brw_wm_prog,
/* Command packets: */
- &brw_invariant_state,
&gen7_push_constant_alloc,
/* must do before binding table pointers, cc state ptrs */
&haswell_cut_index,
};
+static void
+brw_upload_initial_gpu_state(struct brw_context *brw)
+{
+ struct intel_context *intel = &brw->intel;
+
+ /* On platforms with hardware contexts, we can set our initial GPU state
+ * right away rather than doing it via state atoms. This saves a small
+ * amount of overhead on every draw call.
+ */
+ if (!intel->hw_ctx)
+ return;
+
+ brw_upload_invariant_state(brw);
+}
void brw_init_state( struct brw_context *brw )
{
assert((*atoms)->emit);
atoms++;
}
+
+ brw_upload_initial_gpu_state(brw);
}