From 871ddb919b424293894a23a8f83200fed572d6a9 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Sat, 5 Nov 2011 11:17:32 -0700 Subject: glsl: Assign transform feedback varying slots in linker. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch modifies the GLSL linker to assign additional slots for varying variables used by transform feedback, and record the varying slots used by transform feedback for use by the driver back-end. This required modifying assign_varying_locations() so that it assigns a varying location if either (a) the varying is used by the next stage of the GL pipeline, or (b) the varying is required by transform feedback. In order to avoid duplicating the code to assign a single varying location, I moved it into its own function, assign_varying_location(). In addition, to support transform feedback in the case where there is no fragment shader, it is now possible to call assign_varying_locations() with a consumer of NULL. Reviewed-by: Marek Olšák Tested-by: Marek Olšák --- src/mesa/main/mtypes.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 58dc9af0ff4..adcbaeb1986 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1824,6 +1824,16 @@ struct prog_instruction; struct gl_program_parameter_list; struct gl_uniform_list; +/** Post-link transform feedback info. */ +struct gl_transform_feedback_info { + unsigned NumOutputs; + + struct { + unsigned OutputRegister; + unsigned OutputBuffer; + unsigned NumComponents; + } Outputs[MAX_PROGRAM_OUTPUTS]; +}; /** * Base class for any kind of program object @@ -2206,6 +2216,9 @@ struct gl_shader_program GLchar **VaryingNames; /**< Array [NumVarying] of char * */ } TransformFeedback; + /** Post-link transform feedback info. */ + struct gl_transform_feedback_info LinkedTransformFeedback; + /** Geometry shader state - copied into gl_geometry_program at link time */ struct { GLint VerticesOut; -- cgit v1.2.3