diff options
author | marha <marha@users.sourceforge.net> | 2013-02-05 08:22:00 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-02-05 08:23:51 +0100 |
commit | 76c527be60066b647468ad66f8e4d7dd18fa1769 (patch) | |
tree | 2e4653dc3adf874409cf9baba399fd64537115d4 /mesalib/src/glsl/link_varyings.h | |
parent | a6d5f8de1394c338d01b65be7dba3520bf8bdf4b (diff) | |
download | vcxsrv-76c527be60066b647468ad66f8e4d7dd18fa1769.tar.gz vcxsrv-76c527be60066b647468ad66f8e4d7dd18fa1769.tar.bz2 vcxsrv-76c527be60066b647468ad66f8e4d7dd18fa1769.zip |
fontconfig mesa xkeyboard-config git update 5 feb 2013
xkeyboard-config commit b4be67b48fb11989f1824dd0b1c8c399430162b0
fontconfig commit 95af7447dba7c54ed162b667c0bb2ea6500e8f32
mesa commit 86536a321d9d26137587affe687a07da71f0b526
Diffstat (limited to 'mesalib/src/glsl/link_varyings.h')
-rw-r--r-- | mesalib/src/glsl/link_varyings.h | 59 |
1 files changed, 54 insertions, 5 deletions
diff --git a/mesalib/src/glsl/link_varyings.h b/mesalib/src/glsl/link_varyings.h index 057e4b219..ee1010a7b 100644 --- a/mesalib/src/glsl/link_varyings.h +++ b/mesalib/src/glsl/link_varyings.h @@ -42,23 +42,66 @@ class ir_variable; /** + * Data structure describing a varying which is available for use in transform + * feedback. + * + * For example, if the vertex shader contains: + * + * struct S { + * vec4 foo; + * float[3] bar; + * }; + * + * varying S[2] v; + * + * Then there would be tfeedback_candidate objects corresponding to the + * following varyings: + * + * v[0].foo + * v[0].bar + * v[1].foo + * v[1].bar + */ +struct tfeedback_candidate +{ + /** + * Toplevel variable containing this varying. In the above example, this + * would point to the declaration of the varying v. + */ + ir_variable *toplevel_var; + + /** + * Type of this varying. In the above example, this would point to the + * glsl_type for "vec4" or "float[3]". + */ + const glsl_type *type; + + /** + * Offset within the toplevel variable where this varying occurs (counted + * in multiples of the size of a float). + */ + unsigned offset; +}; + + +/** * Data structure tracking information about a transform feedback declaration * during linking. */ class tfeedback_decl { public: - bool init(struct gl_context *ctx, struct gl_shader_program *prog, + void init(struct gl_context *ctx, struct gl_shader_program *prog, const void *mem_ctx, const char *input); static bool is_same(const tfeedback_decl &x, const tfeedback_decl &y); - bool assign_location(struct gl_context *ctx, struct gl_shader_program *prog, - ir_variable *output_var); + bool assign_location(struct gl_context *ctx, + struct gl_shader_program *prog); unsigned get_num_outputs() const; bool store(struct gl_context *ctx, struct gl_shader_program *prog, struct gl_transform_feedback_info *info, unsigned buffer, const unsigned max_outputs) const; - ir_variable *find_output_var(gl_shader_program *prog, - gl_shader *producer) const; + const tfeedback_candidate *find_candidate(gl_shader_program *prog, + hash_table *tfeedback_candidates); bool is_next_buffer_separator() const { @@ -158,6 +201,12 @@ private: * Whether this is gl_NextBuffer from ARB_transform_feedback3. */ bool next_buffer_separator; + + /** + * If find_candidate() has been called, pointer to the tfeedback_candidate + * data structure that was found. Otherwise NULL. + */ + const tfeedback_candidate *matched_candidate; }; |