diff options
-rw-r--r-- | src/mesa/drivers/dri/i965/gen7_blorp.c | 24 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/gen8_blorp.c | 28 |
2 files changed, 52 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.c b/src/mesa/drivers/dri/i965/gen7_blorp.c index 0afd76bff5a..abdc4be14c8 100644 --- a/src/mesa/drivers/dri/i965/gen7_blorp.c +++ b/src/mesa/drivers/dri/i965/gen7_blorp.c @@ -228,6 +228,24 @@ gen7_blorp_emit_surface_state(struct brw_context *brw, return wm_surf_offset; } +/* Hardware seems to try to fetch the constants even though the corresponding + * stage gets disabled. Therefore make sure the settings for the constant + * buffer are valid. + */ +static void +gen7_blorp_emit_disable_constant_state(struct brw_context *brw, + unsigned opcode) +{ + BEGIN_BATCH(7); + OUT_BATCH(opcode << 16 | (7 - 2)); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); +} /* 3DSTATE_VS * @@ -760,6 +778,12 @@ gen7_blorp_exec(struct brw_context *brw, gen7_blorp_emit_blend_state_pointer(brw, cc_blend_state_offset); gen7_blorp_emit_cc_state_pointer(brw, cc_state_offset); } + + gen7_blorp_emit_disable_constant_state(brw, _3DSTATE_CONSTANT_VS); + gen7_blorp_emit_disable_constant_state(brw, _3DSTATE_CONSTANT_HS); + gen7_blorp_emit_disable_constant_state(brw, _3DSTATE_CONSTANT_DS); + gen7_blorp_emit_disable_constant_state(brw, _3DSTATE_CONSTANT_GS); + depthstencil_offset = gen6_blorp_emit_depth_stencil_state(brw, params); gen7_blorp_emit_depth_stencil_state_pointers(brw, depthstencil_offset); if (brw->use_resource_streamer) diff --git a/src/mesa/drivers/dri/i965/gen8_blorp.c b/src/mesa/drivers/dri/i965/gen8_blorp.c index 7ca24a8b372..21fcd9e0e15 100644 --- a/src/mesa/drivers/dri/i965/gen8_blorp.c +++ b/src/mesa/drivers/dri/i965/gen8_blorp.c @@ -156,6 +156,29 @@ gen8_blorp_emit_blend_state(struct brw_context *brw, return blend_state_offset; } +/* Hardware seems to try to fetch the constants even though the corresponding + * stage gets disabled. Therefore make sure the settings for the constant + * buffer are valid. + */ +static void +gen8_blorp_emit_disable_constant_state(struct brw_context *brw, + unsigned opcode) +{ + BEGIN_BATCH(11); + OUT_BATCH(opcode << 16 | (11 - 2)); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); +} + /* 3DSTATE_VS * * Disable vertex shader. @@ -657,6 +680,11 @@ gen8_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params) const uint32_t cc_state_offset = gen6_blorp_emit_cc_state(brw); gen7_blorp_emit_cc_state_pointer(brw, cc_state_offset); + gen8_blorp_emit_disable_constant_state(brw, _3DSTATE_CONSTANT_VS); + gen8_blorp_emit_disable_constant_state(brw, _3DSTATE_CONSTANT_HS); + gen8_blorp_emit_disable_constant_state(brw, _3DSTATE_CONSTANT_DS); + gen8_blorp_emit_disable_constant_state(brw, _3DSTATE_CONSTANT_GS); + gen8_blorp_emit_disable_constant_ps(brw); wm_bind_bo_offset = gen8_blorp_emit_surface_states(brw, params); |