&brw_cc_vp,
&brw_cc_unit,
- &brw_vs_constants, /* Before vs_surfaces and constant_buffer */
- &brw_wm_constants, /* Before wm_surfaces and constant_buffer */
+ /* Surface state setup. Must come before the VS/WM unit. The binding
+ * table upload must be last.
+ */
+ &brw_vs_pull_constants,
+ &brw_wm_pull_constants,
+ &brw_renderbuffer_surfaces,
+ &brw_texture_surfaces,
+ &brw_binding_table,
- &brw_vs_surfaces, /* must do before unit */
- &brw_wm_constant_surface, /* must do before wm surfaces/bind bo */
- &brw_wm_surfaces, /* must do before samplers and unit */
- &brw_wm_binding_table,
- &brw_wm_samplers,
+ &brw_samplers,
+ /* These set up state for brw_psp_urb_cbs */
&brw_wm_unit,
&brw_sf_vp,
&brw_sf_unit,
&gen6_depth_stencil_state, /* must do before cc unit */
&gen6_cc_state_pointers,
- &brw_vs_constants, /* Before vs_surfaces and constant_buffer */
- &brw_wm_constants, /* Before wm_surfaces and constant_buffer */
- &gen6_vs_constants, /* Before vs_state */
- &gen6_wm_constants, /* Before wm_state */
-
- &brw_vs_surfaces, /* must do before unit */
- &brw_wm_constant_surface, /* must do before wm surfaces/bind bo */
- &brw_wm_surfaces, /* must do before samplers and unit */
- &brw_wm_binding_table,
+ &gen6_vs_push_constants, /* Before vs_state */
+ &gen6_wm_push_constants, /* Before wm_state */
- &brw_wm_samplers,
+ /* Surface state setup. Must come before the VS/WM unit. The binding
+ * table upload must be last.
+ */
+ &brw_vs_pull_constants,
+ &brw_wm_pull_constants,
+ &gen6_renderbuffer_surfaces,
+ &brw_texture_surfaces,
+ &gen6_sol_surface,
+ &brw_binding_table,
+
+ &brw_samplers,
&gen6_sampler_state,
&gen6_vs_state,
&brw_drawing_rect,
+ &gen6_sol_indices,
&brw_indices,
&brw_index_buffer,
&brw_vertices,
&gen7_cc_state_pointer,
&gen7_depth_stencil_state_pointer,
- &brw_vs_constants, /* Before vs_surfaces and constant_buffer */
- &brw_wm_constants, /* Before wm_surfaces and constant_buffer */
- &gen6_vs_constants, /* Before vs_state */
- &gen6_wm_constants, /* Before wm_surfaces and constant_buffer */
+ &gen6_vs_push_constants, /* Before vs_state */
+ &gen6_wm_push_constants, /* Before wm_surfaces and constant_buffer */
- &brw_vs_surfaces, /* must do before unit */
- &gen7_wm_constant_surface, /* must do before wm surfaces/bind bo */
- &gen7_wm_surfaces, /* must do before samplers and unit */
- &brw_wm_binding_table,
+ /* Surface state setup. Must come before the VS/WM unit. The binding
+ * table upload must be last.
+ */
+ &brw_vs_pull_constants,
+ &brw_wm_pull_constants,
+ &gen6_renderbuffer_surfaces,
+ &brw_texture_surfaces,
+ &brw_binding_table,
&gen7_samplers,
&gen7_disable_stages,
&gen7_vs_state,
+ &gen7_sol_state,
&gen7_clip_state,
&gen7_sbe_state,
&gen7_sf_state,
num_atoms = ARRAY_SIZE(gen4_atoms);
}
+ brw->atoms = atoms;
+ brw->num_atoms = num_atoms;
+
while (num_atoms--) {
assert((*atoms)->dirty.mesa |
(*atoms)->dirty.brw |
(*atoms)->dirty.cache);
-
- if ((*atoms)->prepare)
- brw->prepare_atoms[brw->num_prepare_atoms++] = **atoms;
- if ((*atoms)->emit)
- brw->emit_atoms[brw->num_emit_atoms++] = **atoms;
+ assert((*atoms)->emit);
atoms++;
}
- assert(brw->num_emit_atoms <= ARRAY_SIZE(brw->emit_atoms));
- assert(brw->num_prepare_atoms <= ARRAY_SIZE(brw->prepare_atoms));
}
DEFINE_BIT(BRW_NEW_WM_INPUT_DIMENSIONS),
DEFINE_BIT(BRW_NEW_PROGRAM_CACHE),
DEFINE_BIT(BRW_NEW_PSP),
- DEFINE_BIT(BRW_NEW_WM_SURFACES),
+ DEFINE_BIT(BRW_NEW_SURFACES),
DEFINE_BIT(BRW_NEW_INDICES),
DEFINE_BIT(BRW_NEW_INDEX_BUFFER),
DEFINE_BIT(BRW_NEW_VERTICES),
DEFINE_BIT(BRW_NEW_BATCH),
- DEFINE_BIT(BRW_NEW_NR_WM_SURFACES),
- DEFINE_BIT(BRW_NEW_NR_VS_SURFACES),
DEFINE_BIT(BRW_NEW_VS_CONSTBUF),
- DEFINE_BIT(BRW_NEW_WM_CONSTBUF),
DEFINE_BIT(BRW_NEW_VS_BINDING_TABLE),
DEFINE_BIT(BRW_NEW_GS_BINDING_TABLE),
DEFINE_BIT(BRW_NEW_PS_BINDING_TABLE),
DEFINE_BIT(BRW_NEW_STATE_BASE_ADDRESS),
+ DEFINE_BIT(BRW_NEW_HIZ),
{0, 0, 0}
};
/***********************************************************************
* Emit all state:
*/
-void brw_validate_state( struct brw_context *brw )
+void brw_upload_state(struct brw_context *brw)
{
struct gl_context *ctx = &brw->intel.ctx;
struct intel_context *intel = &brw->intel;
struct brw_state_flags *state = &brw->state.dirty;
- const struct brw_tracked_state *atoms = brw->prepare_atoms;
- int num_atoms = brw->num_prepare_atoms;
- GLuint i;
+ int i;
+ static int dirty_count = 0;
state->mesa |= brw->intel.NewGLState;
brw->intel.NewGLState = 0;
brw->intel.Fallback = false; /* boolean, not bitfield */
- /* do prepare stage for all atoms */
- for (i = 0; i < num_atoms; i++) {
- const struct brw_tracked_state *atom = &atoms[i];
-
- if (check_state(state, &atom->dirty)) {
- atom->prepare(brw);
-
- if (brw->intel.Fallback)
- break;
- }
- }
-
intel_check_front_buffer_rendering(intel);
- /* Make sure that the textures which are referenced by the current
- * brw fragment program are actually present/valid.
- * If this fails, we can experience GPU lock-ups.
- */
- {
- const struct brw_fragment_program *fp;
- fp = brw_fragment_program_const(brw->fragment_program);
- if (fp) {
- assert((fp->tex_units_used & ctx->Texture._EnabledUnits)
- == fp->tex_units_used);
- }
- }
-}
-
-
-void brw_upload_state(struct brw_context *brw)
-{
- struct brw_state_flags *state = &brw->state.dirty;
- const struct brw_tracked_state *atoms = brw->emit_atoms;
- int num_atoms = brw->num_emit_atoms;
- int i;
- static int dirty_count = 0;
-
if (unlikely(INTEL_DEBUG)) {
/* Debug version which enforces various sanity checks on the
* state flags which are generated and checked to help ensure
memset(&examined, 0, sizeof(examined));
prev = *state;
- for (i = 0; i < num_atoms; i++) {
- const struct brw_tracked_state *atom = &atoms[i];
+ for (i = 0; i < brw->num_atoms; i++) {
+ const struct brw_tracked_state *atom = brw->atoms[i];
struct brw_state_flags generated;
if (brw->intel.Fallback)
}
}
else {
- for (i = 0; i < num_atoms; i++) {
- const struct brw_tracked_state *atom = &atoms[i];
+ for (i = 0; i < brw->num_atoms; i++) {
+ const struct brw_tracked_state *atom = brw->atoms[i];
if (brw->intel.Fallback)
break;