gen6_upload_vec4_push_constants(brw, &vp->program.Base, prog_data,
stage_state, AUB_TRACE_VS_CONSTANTS);
+
+ if (brw->gen >= 7) {
+ if (brw->gen == 7 && !brw->is_haswell)
+ gen7_emit_vs_workaround_flush(brw);
+
+ gen7_upload_constant_state(brw, stage_state, true /* active */,
+ _3DSTATE_CONSTANT_VS);
+ }
}
const struct brw_tracked_state gen6_vs_push_constants = {
.dirty = {
.mesa = _NEW_TRANSFORM | _NEW_PROGRAM_CONSTANTS,
.brw = (BRW_NEW_BATCH |
- BRW_NEW_VERTEX_PROGRAM),
+ BRW_NEW_VERTEX_PROGRAM |
+ BRW_NEW_PUSH_CONSTANT_ALLOCATION),
.cache = CACHE_NEW_VS_PROG,
},
.emit = gen6_upload_vs_push_constants,
brw->wm.base.push_const_size = ALIGN(prog_data->base.nr_params, 8) / 8;
}
+
+ if (brw->gen >= 7) {
+ gen7_upload_constant_state(brw, &brw->wm.base, true,
+ _3DSTATE_CONSTANT_PS);
+ }
}
const struct brw_tracked_state gen6_wm_push_constants = {
.dirty = {
.mesa = _NEW_PROGRAM_CONSTANTS,
.brw = (BRW_NEW_BATCH |
- BRW_NEW_FRAGMENT_PROGRAM),
+ BRW_NEW_FRAGMENT_PROGRAM |
+ BRW_NEW_PUSH_CONSTANT_ALLOCATION),
.cache = CACHE_NEW_WM_PROG,
},
.emit = gen6_upload_wm_push_constants,
static void
gen7_upload_gs_push_constants(struct brw_context *brw)
{
+ const struct brw_stage_state *stage_state = &brw->gs.base;
/* BRW_NEW_GEOMETRY_PROGRAM */
- const struct brw_geometry_program *vp =
+ const struct brw_geometry_program *gp =
(struct brw_geometry_program *) brw->geometry_program;
- if (!vp)
- return;
- /* CACHE_NEW_GS_PROG */
- const struct brw_vec4_prog_data *prog_data = &brw->gs.prog_data->base;
- struct brw_stage_state *stage_state = &brw->gs.base;
+ if (gp) {
+ /* CACHE_NEW_GS_PROG */
+ const struct brw_vec4_prog_data *prog_data = &brw->gs.prog_data->base;
+ struct brw_stage_state *stage_state = &brw->gs.base;
+
+ gen6_upload_vec4_push_constants(brw, &gp->program.Base, prog_data,
+ stage_state, AUB_TRACE_VS_CONSTANTS);
+ }
- gen6_upload_vec4_push_constants(brw, &vp->program.Base, prog_data,
- stage_state, AUB_TRACE_VS_CONSTANTS);
+ gen7_upload_constant_state(brw, stage_state, gp, _3DSTATE_CONSTANT_GS);
}
const struct brw_tracked_state gen7_gs_push_constants = {
.dirty = {
.mesa = _NEW_TRANSFORM | _NEW_PROGRAM_CONSTANTS,
.brw = (BRW_NEW_BATCH |
- BRW_NEW_GEOMETRY_PROGRAM),
+ BRW_NEW_GEOMETRY_PROGRAM |
+ BRW_NEW_PUSH_CONSTANT_ALLOCATION),
.cache = CACHE_NEW_GS_PROG,
},
.emit = gen7_upload_gs_push_constants,
/* CACHE_NEW_GS_PROG */
const struct brw_vec4_prog_data *prog_data = &brw->gs.prog_data->base;
- gen7_upload_constant_state(brw, stage_state, active, _3DSTATE_CONSTANT_GS);
-
/**
* From Graphics BSpec: 3D-Media-GPGPU Engine > 3D Pipeline Stages >
* Geometry > Geometry Shader > State:
const struct brw_tracked_state gen7_gs_state = {
.dirty = {
- .mesa = _NEW_TRANSFORM | _NEW_PROGRAM_CONSTANTS,
+ .mesa = _NEW_TRANSFORM,
.brw = (BRW_NEW_CONTEXT |
BRW_NEW_GEOMETRY_PROGRAM |
- BRW_NEW_BATCH |
- BRW_NEW_PUSH_CONSTANT_ALLOCATION),
+ BRW_NEW_BATCH),
.cache = CACHE_NEW_GS_PROG
},
.emit = upload_gs_state,
if (!brw->is_haswell)
gen7_emit_vs_workaround_flush(brw);
- gen7_upload_constant_state(brw, stage_state, true /* active */,
- _3DSTATE_CONSTANT_VS);
-
/* Use ALT floating point mode for ARB vertex programs, because they
* require 0^0 == 1.
*/
const struct brw_tracked_state gen7_vs_state = {
.dirty = {
- .mesa = _NEW_TRANSFORM | _NEW_PROGRAM_CONSTANTS,
+ .mesa = _NEW_TRANSFORM,
.brw = (BRW_NEW_CONTEXT |
BRW_NEW_VERTEX_PROGRAM |
- BRW_NEW_BATCH |
- BRW_NEW_PUSH_CONSTANT_ALLOCATION),
+ BRW_NEW_BATCH),
.cache = CACHE_NEW_VS_PROG
},
.emit = upload_vs_state,
const int max_threads_shift = brw->is_haswell ?
HSW_PS_MAX_THREADS_SHIFT : IVB_PS_MAX_THREADS_SHIFT;
- /* CACHE_NEW_WM_PROG */
- gen7_upload_constant_state(brw, &brw->wm.base, true, _3DSTATE_CONSTANT_PS);
-
dw2 = dw4 = dw5 = 0;
dw2 |=
const struct brw_tracked_state gen7_ps_state = {
.dirty = {
- .mesa = (_NEW_PROGRAM_CONSTANTS |
- _NEW_COLOR |
+ .mesa = (_NEW_COLOR |
_NEW_BUFFERS |
_NEW_MULTISAMPLE),
.brw = (BRW_NEW_FRAGMENT_PROGRAM |
- BRW_NEW_BATCH |
- BRW_NEW_PUSH_CONSTANT_ALLOCATION),
+ BRW_NEW_BATCH),
.cache = (CACHE_NEW_WM_PROG)
},
.emit = upload_ps_state,
/* CACHE_NEW_GS_PROG */
const struct brw_vec4_prog_data *prog_data = &brw->gs.prog_data->base;
- gen7_upload_constant_state(brw, stage_state, active, _3DSTATE_CONSTANT_GS);
-
if (active) {
int urb_entry_write_offset = 1;
uint32_t urb_entry_output_length =
const struct brw_tracked_state gen8_gs_state = {
.dirty = {
- .mesa = _NEW_TRANSFORM | _NEW_PROGRAM_CONSTANTS,
+ .mesa = _NEW_TRANSFORM,
.brw = (BRW_NEW_CONTEXT |
BRW_NEW_GEOMETRY_PROGRAM |
- BRW_NEW_BATCH |
- BRW_NEW_PUSH_CONSTANT_ALLOCATION),
+ BRW_NEW_BATCH),
.cache = CACHE_NEW_GS_PROG
},
.emit = gen8_upload_gs_state,
struct gl_context *ctx = &brw->ctx;
uint32_t dw3 = 0, dw6 = 0, dw7 = 0;
- /* CACHE_NEW_WM_PROG */
- gen7_upload_constant_state(brw, &brw->wm.base, true, _3DSTATE_CONSTANT_PS);
-
/* Initialize the execution mask with VMask. Otherwise, derivatives are
* incorrect for subspans where some of the pixels are unlit. We believe
* the bit just didn't take effect in previous generations.
const struct brw_tracked_state gen8_ps_state = {
.dirty = {
- .mesa = _NEW_PROGRAM_CONSTANTS | _NEW_MULTISAMPLE,
+ .mesa = _NEW_MULTISAMPLE,
.brw = BRW_NEW_FRAGMENT_PROGRAM |
- BRW_NEW_BATCH |
- BRW_NEW_PUSH_CONSTANT_ALLOCATION,
+ BRW_NEW_BATCH,
.cache = CACHE_NEW_WM_PROG
},
.emit = upload_ps_state,
/* CACHE_NEW_VS_PROG */
const struct brw_vec4_prog_data *prog_data = &brw->vs.prog_data->base;
- gen7_upload_constant_state(brw, stage_state, true /* active */,
- _3DSTATE_CONSTANT_VS);
-
/* Use ALT floating point mode for ARB vertex programs, because they
* require 0^0 == 1.
*/
const struct brw_tracked_state gen8_vs_state = {
.dirty = {
- .mesa = _NEW_TRANSFORM | _NEW_PROGRAM_CONSTANTS,
+ .mesa = _NEW_TRANSFORM,
.brw = BRW_NEW_CONTEXT |
BRW_NEW_VERTEX_PROGRAM |
- BRW_NEW_BATCH |
- BRW_NEW_PUSH_CONSTANT_ALLOCATION,
+ BRW_NEW_BATCH,
.cache = CACHE_NEW_VS_PROG
},
.emit = upload_vs_state,