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

Vincent Lejeune vljn at ovi.com
Thu Feb 23 12:12:25 PST 2012


---
 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..447d432 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
+{
+   NONE, /** no limitation (scalar architecture : swrast, nouveau) */
+   SMOOTH_NOPERSPECTIVE_MIXED, /** Smooth and noperspective varying can be mixed but not with flat (i965) */
+   NO_MIXED_INTERPOLATION, /** Dont mix different interpolation (r300 and r600) */
+   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..cdda499 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 = AVOID_PACKING;
 
    /* Default pragma settings */
    options.DefaultPragmas.Optimize = GL_TRUE;
-- 
1.7.7



More information about the mesa-dev mailing list