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@gmail.com>
This commit is contained in:
Paul Berry 2012-12-13 12:45:37 -08:00
parent 1745a4d751
commit 6ee500cfd2
1 changed files with 11 additions and 0 deletions

View File

@ -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;
};