From b3d8b4c0b423539f17c13713673cfeb6d66ff7ed Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 12 Jun 2013 13:23:48 +0200 Subject: glsl/linker: eliminate unused and set-but-unused built-in varyings This eliminates built-in varyings such as gl_Color, gl_SecondaryColor, gl_TexCoord, and gl_FogFragCoord if they are unused by the next stage or not written at all (e.g. gl_TexCoord elements). The gl_TexCoord array is broken down into separate vec4s if needed. v2: - use a switch statement in varying_info_visitor::visit(ir_variable*) - use snprintf - disable the optimization for GLES2 Reviewed-by: Ian Romanick --- src/glsl/link_varyings.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/glsl/link_varyings.h') diff --git a/src/glsl/link_varyings.h b/src/glsl/link_varyings.h index daa9d79c94f..7f7be353b6d 100644 --- a/src/glsl/link_varyings.h +++ b/src/glsl/link_varyings.h @@ -125,6 +125,10 @@ public: return this->vector_elements * this->matrix_columns * this->size; } + unsigned get_location() const { + return this->location; + } + private: /** * The name that was supplied to glTransformFeedbackVaryings. Used for -- cgit v1.2.3