brw_init_surface_formats(brw);
- if (brw->is_g4x || brw->gen >= 5) {
- brw->CMD_VF_STATISTICS = GM45_3DSTATE_VF_STATISTICS;
- brw->CMD_PIPELINE_SELECT = CMD_PIPELINE_SELECT_GM45;
- } else {
- brw->CMD_VF_STATISTICS = GEN4_3DSTATE_VF_STATISTICS;
- brw->CMD_PIPELINE_SELECT = CMD_PIPELINE_SELECT_965;
- }
-
brw->max_vs_threads = devinfo->max_vs_threads;
brw->max_gs_threads = devinfo->max_gs_threads;
brw->max_wm_threads = devinfo->max_wm_threads;
*/
int num_samples;
- /* hw-dependent 3DSTATE_VF_STATISTICS opcode */
- uint32_t CMD_VF_STATISTICS;
- /* hw-dependent 3DSTATE_PIPELINE_SELECT opcode */
- uint32_t CMD_PIPELINE_SELECT;
-
/**
* Platform specific constants containing the maximum number of threads
* for each pipeline stage.
void
brw_upload_invariant_state(struct brw_context *brw)
{
+ const bool is_965 = brw->gen == 4 && !brw->is_g4x;
+
/* 3DSTATE_SIP, 3DSTATE_MULTISAMPLE, etc. are nonpipelined. */
if (brw->gen == 6)
intel_emit_post_sync_nonzero_flush(brw);
/* Select the 3D pipeline (as opposed to media) */
+ const uint32_t _3DSTATE_PIPELINE_SELECT =
+ is_965 ? CMD_PIPELINE_SELECT_965 : CMD_PIPELINE_SELECT_GM45;
BEGIN_BATCH(1);
- OUT_BATCH(brw->CMD_PIPELINE_SELECT << 16 | 0);
+ OUT_BATCH(_3DSTATE_PIPELINE_SELECT << 16 | 0);
ADVANCE_BATCH();
if (brw->gen < 6) {
ADVANCE_BATCH();
}
+ const uint32_t _3DSTATE_VF_STATISTICS =
+ is_965 ? GEN4_3DSTATE_VF_STATISTICS : GM45_3DSTATE_VF_STATISTICS;
BEGIN_BATCH(1);
- OUT_BATCH(brw->CMD_VF_STATISTICS << 16 |
+ OUT_BATCH(_3DSTATE_VF_STATISTICS << 16 |
(unlikely(INTEL_DEBUG & DEBUG_STATS) ? 1 : 0));
ADVANCE_BATCH();
}