i965: Inform compiler of variable range to silence warning.
authorMatt Turner <mattst88@gmail.com>
Fri, 15 Jan 2016 21:38:46 +0000 (13:38 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 19 Jan 2016 20:08:59 +0000 (12:08 -0800)
Extends commit 6531ccb70 to silence the warning in release builds as
well.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/drivers/dri/i965/brw_vue_map.c

index fea24368e8c4f8beaf841986724de046d9adeec2..b66c209b24d199f9789ebefd4625abef02000fd8 100644 (file)
@@ -248,6 +248,8 @@ brw_compute_tess_vue_map(struct brw_vue_map *vue_map,
 static const char *
 varying_name(brw_varying_slot slot)
 {
+   assume(slot < BRW_VARYING_SLOT_COUNT);
+
    if (slot < VARYING_SLOT_MAX)
       return gl_varying_slot_name(slot);
 
@@ -257,7 +259,6 @@ varying_name(brw_varying_slot slot)
       [BRW_VARYING_SLOT_PNTC - VARYING_SLOT_MAX] = "BRW_VARYING_SLOT_PNTC",
    };
 
-   assert(slot < BRW_VARYING_SLOT_COUNT);
    return brw_names[slot - VARYING_SLOT_MAX];
 }