aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2011-11-05 11:17:32 -0700
committerPaul Berry <[email protected]>2011-11-09 11:12:47 -0800
commit871ddb919b424293894a23a8f83200fed572d6a9 (patch)
treecef7a86fd7e1387f89223ac6bde1dafa6c341557 /src/mesa
parent6f5c73797087c6e7842665f84e41caedea59bb65 (diff)
glsl: Assign transform feedback varying slots in linker.
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 <[email protected]> Tested-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/mtypes.h13
1 files changed, 13 insertions, 0 deletions
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;