Mesa (mesa_7_7_branch): st/mesa: move assert on nr vs insns until after pos_invarient expansion

Keith Whitwell keithw at kemper.freedesktop.org
Fri Dec 18 10:41:33 PST 2009


Module: Mesa
Branch: mesa_7_7_branch
Commit: 325f045c04121b989bddfca02711e3d03f7f9c3f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=325f045c04121b989bddfca02711e3d03f7f9c3f

Author: Keith Whitwell <keithw at vmware.com>
Date:   Fri Dec 18 18:39:44 2009 +0000

st/mesa: move assert on nr vs insns until after pos_invarient expansion

It is possible to have a 1-instruction vertex shader before expanding
pos_invarient.  Not sure what this assert achieved, but at least move
it where it is correct.

---

 src/mesa/state_tracker/st_atom_shader.c |    2 --
 src/mesa/state_tracker/st_program.c     |    2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index 6e311e5..9208f3f 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -287,8 +287,6 @@ find_translated_vp(struct st_context *st,
 #endif
       }
 
-      assert(stvp->Base.Base.NumInstructions > 1);
-
       st_translate_vertex_program(st, stvp, xvp->output_to_slot,
                                   xvp->output_to_semantic_name,
                                   xvp->output_to_semantic_index);
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 190b6a5..cf19f8f 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -87,6 +87,8 @@ st_translate_vertex_program(struct st_context *st,
    if (stvp->Base.IsPositionInvariant)
       _mesa_insert_mvp_code(st->ctx, &stvp->Base);
 
+   assert(stvp->Base.Base.NumInstructions > 1);
+
    /*
     * Determine number of inputs, the mappings between VERT_ATTRIB_x
     * and TGSI generic input indexes, plus input attrib semantic info.



More information about the mesa-commit mailing list