[Mesa-dev] [PATCH 04/13] i965: Remove unnecessary brw->tess_ctrl_program assertions.

Kenneth Graunke kenneth at whitecape.org
Tue Dec 22 02:20:49 PST 2015


This is trying to enforce the fact that the hardware requires HS, TE,
and DS to be enabled or disabled together.  But it's kind of an ad-hoc
attempt, and not too useful.

More importantly, we aren't going to have a gl_shader_program for the
TCS which is automatically generated when none is present.  (We'll just
handle it in the driver backend.)  So, these will trip for no reason.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_tcs.c       | 2 +-
 src/mesa/drivers/dri/i965/gen7_te_state.c | 2 --
 src/mesa/drivers/dri/i965/gen7_urb.c      | 1 -
 src/mesa/drivers/dri/i965/gen8_ds_state.c | 1 -
 src/mesa/drivers/dri/i965/gen8_hs_state.c | 1 -
 5 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_tcs.c b/src/mesa/drivers/dri/i965/brw_tcs.c
index aa0e87a..5de6f48 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs.c
@@ -189,7 +189,7 @@ brw_upload_tcs_prog(struct brw_context *brw)
       (struct brw_tess_ctrl_program *) brw->tess_ctrl_program;
    struct brw_tess_eval_program *tep =
       (struct brw_tess_eval_program *) brw->tess_eval_program;
-   assert(tcp && tep);
+   assert(tep);
 
    if (!brw_state_dirty(brw,
                         _NEW_TEXTURE,
diff --git a/src/mesa/drivers/dri/i965/gen7_te_state.c b/src/mesa/drivers/dri/i965/gen7_te_state.c
index 6d7ce40..f221307 100644
--- a/src/mesa/drivers/dri/i965/gen7_te_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_te_state.c
@@ -31,8 +31,6 @@ upload_te_state(struct brw_context *brw)
 {
    /* BRW_NEW_TESS_PROGRAMS */
    bool active = brw->tess_eval_program;
-   if (active)
-      assert(brw->tess_ctrl_program);
 
    const struct brw_tes_prog_data *tes_prog_data = brw->tes.prog_data;
 
diff --git a/src/mesa/drivers/dri/i965/gen7_urb.c b/src/mesa/drivers/dri/i965/gen7_urb.c
index bc24a66..00edbcc 100644
--- a/src/mesa/drivers/dri/i965/gen7_urb.c
+++ b/src/mesa/drivers/dri/i965/gen7_urb.c
@@ -168,7 +168,6 @@ gen7_upload_urb(struct brw_context *brw)
 
    /* BRW_NEW_TESS_PROGRAMS */
    const bool tess_present = brw->tess_eval_program;
-   assert(!tess_present || brw->tess_ctrl_program);
    /* BRW_NEW_TCS_PROG_DATA */
    unsigned hs_size = tess_present ? brw->tcs.prog_data->base.urb_entry_size : 1;
    unsigned hs_entry_size_bytes = hs_size * 64;
diff --git a/src/mesa/drivers/dri/i965/gen8_ds_state.c b/src/mesa/drivers/dri/i965/gen8_ds_state.c
index 5555800..d91eb77 100644
--- a/src/mesa/drivers/dri/i965/gen8_ds_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_ds_state.c
@@ -33,7 +33,6 @@ gen8_upload_ds_state(struct brw_context *brw)
    const struct brw_stage_state *stage_state = &brw->tes.base;
    /* BRW_NEW_TESS_PROGRAMS */
    bool active = brw->tess_eval_program;
-   assert(!active || brw->tess_ctrl_program);
 
    /* BRW_NEW_TES_PROG_DATA */
    const struct brw_tes_prog_data *tes_prog_data = brw->tes.prog_data;
diff --git a/src/mesa/drivers/dri/i965/gen8_hs_state.c b/src/mesa/drivers/dri/i965/gen8_hs_state.c
index 1277420..b12f99e 100644
--- a/src/mesa/drivers/dri/i965/gen8_hs_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_hs_state.c
@@ -32,7 +32,6 @@ gen8_upload_hs_state(struct brw_context *brw)
    const struct brw_stage_state *stage_state = &brw->tcs.base;
    /* BRW_NEW_TESS_PROGRAMS */
    bool active = brw->tess_ctrl_program;
-   assert(!active || brw->tess_eval_program);
    /* BRW_NEW_HS_PROG_DATA */
    const struct brw_vue_prog_data *prog_data = &brw->tcs.prog_data->base;
 
-- 
2.6.4



More information about the mesa-dev mailing list