[Mesa-dev] [PATCH V5 2/6] i965: Add helper functions for interpolation map

Chris Forbes chrisf at ijw.co.nz
Wed Jul 31 04:07:13 PDT 2013


Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 src/mesa/drivers/dri/i965/brw_context.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 7b5fd13..9580f29 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -420,6 +420,24 @@ struct interpolation_mode_map {
    unsigned char mode[BRW_VARYING_SLOT_COUNT];
 };
 
+static inline int brw_any_flat_varyings(struct interpolation_mode_map *map)
+{
+   for (int i = 0; i < BRW_VARYING_SLOT_COUNT; i++)
+      if (map->mode[i] == INTERP_QUALIFIER_FLAT)
+         return 1;
+
+   return 0;
+}
+
+static inline int brw_any_noperspective_varyings(struct interpolation_mode_map *map)
+{
+   for (int i = 0; i < BRW_VARYING_SLOT_COUNT; i++)
+      if (map->mode[i] == INTERP_QUALIFIER_NOPERSPECTIVE)
+         return 1;
+
+   return 0;
+}
+
 
 struct brw_sf_prog_data {
    GLuint urb_read_length;
-- 
1.8.3.4



More information about the mesa-dev mailing list