/* Calculate interpolants for triangle and line rasterization.
*/
-static void
+void
brw_upload_clip_prog(struct brw_context *brw)
{
struct gl_context *ctx = &brw->ctx;
struct brw_clip_prog_key key;
+ if (!brw_state_dirty(brw,
+ _NEW_BUFFERS |
+ _NEW_LIGHT |
+ _NEW_POLYGON |
+ _NEW_TRANSFORM,
+ BRW_NEW_BLORP |
+ BRW_NEW_INTERPOLATION_MAP |
+ BRW_NEW_REDUCED_PRIMITIVE |
+ BRW_NEW_VUE_MAP_GEOM_OUT))
+ return;
+
memset(&key, 0, sizeof(key));
/* Populate the key:
compile_clip_prog( brw, &key );
}
}
-
-
-const struct brw_tracked_state brw_clip_prog = {
- .dirty = {
- .mesa = _NEW_BUFFERS |
- _NEW_LIGHT |
- _NEW_POLYGON |
- _NEW_TRANSFORM,
- .brw = BRW_NEW_BLORP |
- BRW_NEW_INTERPOLATION_MAP |
- BRW_NEW_REDUCED_PRIMITIVE |
- BRW_NEW_VUE_MAP_GEOM_OUT,
- },
- .emit = brw_upload_clip_prog
-};
/* Set up interpolation modes for every element in the VUE */
-static void
+void
brw_setup_vue_interpolation(struct brw_context *brw)
{
const struct gl_fragment_program *fprog = brw->fragment_program;
struct brw_vue_map *vue_map = &brw->vue_map_geom_out;
+ if (!brw_state_dirty(brw,
+ _NEW_LIGHT,
+ BRW_NEW_BLORP |
+ BRW_NEW_FRAGMENT_PROGRAM |
+ BRW_NEW_VUE_MAP_GEOM_OUT))
+ return;
+
memset(&brw->interpolation_mode, INTERP_QUALIFIER_NONE, sizeof(brw->interpolation_mode));
brw->ctx.NewDriverState |= BRW_NEW_INTERPOLATION_MAP;
}
}
}
-
-
-const struct brw_tracked_state brw_interpolation_map = {
- .dirty = {
- .mesa = _NEW_LIGHT,
- .brw = BRW_NEW_BLORP |
- BRW_NEW_FRAGMENT_PROGRAM |
- BRW_NEW_VUE_MAP_GEOM_OUT,
- },
- .emit = brw_setup_vue_interpolation
-};
/* Calculate interpolants for triangle and line rasterization.
*/
-static void
+void
brw_upload_sf_prog(struct brw_context *brw)
{
struct gl_context *ctx = &brw->ctx;
struct brw_sf_prog_key key;
+
+ if (!brw_state_dirty(brw,
+ _NEW_BUFFERS |
+ _NEW_HINT |
+ _NEW_LIGHT |
+ _NEW_POINT |
+ _NEW_POLYGON |
+ _NEW_PROGRAM |
+ _NEW_TRANSFORM,
+ BRW_NEW_BLORP |
+ BRW_NEW_INTERPOLATION_MAP |
+ BRW_NEW_REDUCED_PRIMITIVE |
+ BRW_NEW_VUE_MAP_GEOM_OUT))
+ return;
+
/* _NEW_BUFFERS */
bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
compile_sf_prog( brw, &key );
}
}
-
-
-const struct brw_tracked_state brw_sf_prog = {
- .dirty = {
- .mesa = _NEW_BUFFERS |
- _NEW_HINT |
- _NEW_LIGHT |
- _NEW_POINT |
- _NEW_POLYGON |
- _NEW_PROGRAM |
- _NEW_TRANSFORM,
- .brw = BRW_NEW_BLORP |
- BRW_NEW_INTERPOLATION_MAP |
- BRW_NEW_REDUCED_PRIMITIVE |
- BRW_NEW_VUE_MAP_GEOM_OUT,
- },
- .emit = brw_upload_sf_prog
-};
-
extern const struct brw_tracked_state brw_blend_constant_color;
extern const struct brw_tracked_state brw_cc_vp;
extern const struct brw_tracked_state brw_cc_unit;
-extern const struct brw_tracked_state brw_clip_prog;
extern const struct brw_tracked_state brw_clip_unit;
extern const struct brw_tracked_state brw_vs_pull_constants;
extern const struct brw_tracked_state brw_tcs_pull_constants;
extern const struct brw_tracked_state brw_polygon_stipple_offset;
extern const struct brw_tracked_state brw_polygon_stipple;
extern const struct brw_tracked_state brw_recalculate_urb_fence;
-extern const struct brw_tracked_state brw_sf_prog;
extern const struct brw_tracked_state brw_sf_unit;
extern const struct brw_tracked_state brw_sf_vp;
extern const struct brw_tracked_state brw_state_base_address;
extern const struct brw_tracked_state brw_cs_abo_surfaces;
extern const struct brw_tracked_state brw_cs_image_surfaces;
extern const struct brw_tracked_state brw_wm_unit;
-extern const struct brw_tracked_state brw_interpolation_map;
extern const struct brw_tracked_state brw_psp_urb_cbs;
void gen7_disable_hw_binding_tables(struct brw_context *brw);
void gen7_reset_hw_bt_pool_offsets(struct brw_context *brw);
+/* brw_interpolation_map.c */
+void brw_setup_vue_interpolation(struct brw_context *brw);
+
+/* brw_clip.c */
+void brw_upload_clip_prog(struct brw_context *brw);
+
+/* brw_sf.c */
+void brw_upload_sf_prog(struct brw_context *brw);
+
/* gen7_l3_state.c */
void
gen7_restore_default_l3_config(struct brw_context *brw);
static const struct brw_tracked_state *gen4_atoms[] =
{
- &brw_interpolation_map,
-
- &brw_clip_prog, /* must do before state base address */
- &brw_sf_prog, /* must do before state base address */
-
/* Once all the programs are done, we know how large urb entry
* sizes need to be and can decide if we need to change the urb
* layout.
old_separate != brw->vue_map_geom_out.separate)
brw->ctx.NewDriverState |= BRW_NEW_VUE_MAP_GEOM_OUT;
+ if (brw->gen < 6) {
+ brw_setup_vue_interpolation(brw);
+ brw_upload_clip_prog(brw);
+ brw_upload_sf_prog(brw);
+ }
+
brw_upload_wm_prog(brw);
} else if (pipeline == BRW_COMPUTE_PIPELINE) {
brw_upload_cs_prog(brw);