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

Vincent Lejeune vljn at ovi.com
Thu Feb 16 13:03:10 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 a2b01d0..f2f2dae 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2389,6 +2389,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
  */
@@ -2419,6 +2427,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