Mesa (master): mesa: Add an option so driver can opt out of varying packing .

Paul Berry stereotype441 at kemper.freedesktop.org
Fri Dec 14 19:29:54 UTC 2012


Module: Mesa
Branch: master
Commit: 6ee500cfd28324bef27f145fbe03e77993810c45
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ee500cfd28324bef27f145fbe03e77993810c45

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Thu Dec 13 12:45:37 2012 -0800

mesa: Add an option so driver can opt out of varying packing.

On hardware that supports a limited number of texture indirections,
varying packing will comsume an extra texture indirection, since ALU
operations are needed in the fragment shader to unpack the varyings
before any texturing can be done.

This patch introduces a new driver option,
ctx->Const.DisableVaryingPacking, which can be used by a driver to opt
out of varying packing if the extra texture indirection is costly
enough to outweigh the advantages of packing varyings.

Reviewed-by: Marek Olšák <maraeo at gmail.com>

---

 src/mesa/main/mtypes.h |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 11a8322..b59498f 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2928,6 +2928,17 @@ struct gl_constants
 
    /** GL_ARB_map_buffer_alignment */
    GLuint MinMapBufferAlignment;
+
+   /**
+    * Disable varying packing.  This is out of spec, but potentially useful
+    * for older platforms that supports a limited number of texture
+    * indirections--on these platforms, unpacking the varyings in the fragment
+    * shader increases the number of texture indirections by 1, which might
+    * make some shaders not executable at all.
+    *
+    * Drivers that support transform feedback must set this value to GL_FALSE.
+    */
+   GLboolean DisableVaryingPacking;
 };
 
 




More information about the mesa-commit mailing list