[Mesa-dev] [PATCH] mesa: Adds parameter to drive varyings packing

Vincent Lejeune vljn at ovi.com
Fri Feb 24 11:03:37 PST 2012


v2: Prefix enum with PACKING_CONSTRAINT_ + fix doxygen comment
---
 src/mesa/main/mtypes.h    |   10 ++++++++++
 src/mesa/main/shaderapi.c |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 9200f3f..c29fc16 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2392,6 +2392,14 @@ struct gl_shader_state
    GLbitfield Flags;                    /**< Mask of GLSL_x flags */
 };
 
+enum packing_constraint
+{
+   PACKING_CONSTRAINT_NONE, /**< <o limitation (scalar architecture : swrast, nouveau) */
+   PACKING_CONSTRAINT_SMOOTH_NOPERSPECTIVE_MIXED, /**< Smooth and noperspective varying can be mixed but not with flat (i965) */
+   PACKING_CONSTRAINT_NO_MIXED_INTERPOLATION, /**< Dont mix different interpolation (r300 and r600) */
+   PACKING_CONSTRAINT_AVOID_PACKING, /**< Disable packing */
+};
+
 /**
  * Compiler options for a single GLSL shaders type
  */
@@ -2422,6 +2430,8 @@ struct gl_shader_compiler_options
    GLuint MaxUnrollIterations;
 
    struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */
+
+   enum packing_constraint VaryingsPackingConstraint;
 };
 
 /**
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index 0e655a0..d885850 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -103,6 +103,7 @@ _mesa_init_shader_state(struct gl_context *ctx)
 
    memset(&options, 0, sizeof(options));
    options.MaxUnrollIterations = 32;
+   options.VaryingsPackingConstraint = PACKING_CONSTRAINT_AVOID_PACKING;
 
    /* Default pragma settings */
    options.DefaultPragmas.Optimize = GL_TRUE;
-- 
1.7.7



More information about the mesa-dev mailing list