ilo: move a santiy check into its assert()
authorChia-I Wu <olvaffe@gmail.com>
Fri, 12 Jul 2013 23:22:24 +0000 (07:22 +0800)
committerChia-I Wu <olvaffe@gmail.com>
Fri, 12 Jul 2013 23:27:28 +0000 (07:27 +0800)
The compiler does not know that ilo_3d_pipeline_estimate_size() is pure and
can be eliminated in a release build in gen6_pipeline_end().  Move the call
into the assert().

src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c

index d2f3300ceb3a3357cd708c5354f566ce81bc64c8..eefb2f96b598331af930145cb18e8499ec098155 100644 (file)
@@ -1351,12 +1351,9 @@ gen6_pipeline_end(struct ilo_3d_pipeline *p,
                   const struct ilo_context *ilo,
                   struct gen6_pipeline_session *session)
 {
-   int used, estimate;
-
    /* sanity check size estimation */
-   used = session->init_cp_space - ilo_cp_space(p->cp);
-   estimate = ilo_3d_pipeline_estimate_size(p, ILO_3D_PIPELINE_DRAW, ilo);
-   assert(used <= estimate);
+   assert(session->init_cp_space - ilo_cp_space(p->cp) <=
+         ilo_3d_pipeline_estimate_size(p, ILO_3D_PIPELINE_DRAW, ilo));
 
    p->state.reduced_prim = session->reduced_prim;
    p->state.primitive_restart = ilo->draw->primitive_restart;