[Mesa-dev] [PATCH 5/6] i965: Use brw_wm_prog_data::uses_kill, not gl_fragment_program::UsesKill
Kenneth Graunke
kenneth at whitecape.org
Mon Nov 24 22:03:14 PST 2014
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_wm_state.c | 3 ++-
src/mesa/drivers/dri/i965/gen6_wm_state.c | 2 +-
src/mesa/drivers/dri/i965/gen7_wm_state.c | 2 +-
src/mesa/drivers/dri/i965/gen8_depth_state.c | 4 ++--
src/mesa/drivers/dri/i965/gen8_ps_state.c | 2 +-
5 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c
index 8d5fcce..233260f 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_state.c
@@ -175,7 +175,8 @@ brw_upload_wm_unit(struct brw_context *brw)
wm->wm5.program_computes_depth = 0;
/* _NEW_COLOR */
- wm->wm5.program_uses_killpixel = fp->UsesKill || ctx->Color.AlphaEnabled;
+ wm->wm5.program_uses_killpixel =
+ prog_data->uses_kill || ctx->Color.AlphaEnabled;
wm->wm5.enable_8_pix = 1;
if (prog_data->prog_offset_16)
diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c
index 8081ccc..c6c7f22 100644
--- a/src/mesa/drivers/dri/i965/gen6_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c
@@ -188,7 +188,7 @@ upload_wm_state(struct brw_context *brw)
GEN6_WM_BARYCENTRIC_INTERPOLATION_MODE_SHIFT;
/* _NEW_COLOR, _NEW_MULTISAMPLE */
- if (fp->program.UsesKill || ctx->Color.AlphaEnabled ||
+ if (prog_data->uses_kill || ctx->Color.AlphaEnabled ||
ctx->Multisample.SampleAlphaToCoverage ||
prog_data->uses_omask)
dw5 |= GEN6_WM_KILL_ENABLE;
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c
index 62edb2d..8f851d8 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c
@@ -86,7 +86,7 @@ upload_wm_state(struct brw_context *brw)
/* _NEW_COLOR, _NEW_MULTISAMPLE */
/* Enable if the pixel shader kernel generates and outputs oMask.
*/
- if (fp->program.UsesKill || ctx->Color.AlphaEnabled ||
+ if (prog_data->uses_kill || ctx->Color.AlphaEnabled ||
ctx->Multisample.SampleAlphaToCoverage ||
prog_data->uses_omask) {
dw1 |= GEN7_WM_KILL_ENABLE;
diff --git a/src/mesa/drivers/dri/i965/gen8_depth_state.c b/src/mesa/drivers/dri/i965/gen8_depth_state.c
index e716141..8efc7c5 100644
--- a/src/mesa/drivers/dri/i965/gen8_depth_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_depth_state.c
@@ -286,7 +286,7 @@ pma_fix_enable(const struct brw_context *brw)
(fp->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) &&
fp->FragDepthLayout != FRAG_DEPTH_LAYOUT_UNCHANGED;
- /* BRW_NEW_FRAGMENT_PROGRAM: 3DSTATE_PS_EXTRA::PixelShaderKillsPixels
+ /* CACHE_NEW_WM_PROG: 3DSTATE_PS_EXTRA::PixelShaderKillsPixels
* CACHE_NEW_WM_PROG: 3DSTATE_PS_EXTRA::oMask Present to RenderTarget
* _NEW_MULTISAMPLE: 3DSTATE_PS_BLEND::AlphaToCoverageEnable
* _NEW_COLOR: 3DSTATE_PS_BLEND::AlphaTestEnable
@@ -295,7 +295,7 @@ pma_fix_enable(const struct brw_context *brw)
* 3DSTATE_WM::ForceKillPix != ForceOff is always true.
*/
const bool kill_pixel =
- fp->UsesKill ||
+ brw->wm.prog_data->uses_kill ||
brw->wm.prog_data->uses_omask ||
(ctx->Multisample._Enabled && ctx->Multisample.SampleAlphaToCoverage) ||
ctx->Color.AlphaEnabled;
diff --git a/src/mesa/drivers/dri/i965/gen8_ps_state.c b/src/mesa/drivers/dri/i965/gen8_ps_state.c
index d6577fd..0c17243 100644
--- a/src/mesa/drivers/dri/i965/gen8_ps_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_ps_state.c
@@ -40,7 +40,7 @@ upload_ps_extra(struct brw_context *brw)
dw1 |= GEN8_PSX_PIXEL_SHADER_VALID;
- if (fp->program.UsesKill)
+ if (prog_data->uses_kill)
dw1 |= GEN8_PSX_KILL_ENABLE;
if (prog_data->num_varying_inputs != 0)
--
2.1.3
More information about the mesa-dev
mailing list