aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorAntia Puentes <[email protected]>2018-12-15 18:33:18 +0100
committerAlejandro PiƱeiro <[email protected]>2019-07-12 23:42:41 +0200
commite1464a1cf892b08902785d81c2e1f1c95e1083de (patch)
tree5511d2b280487e5ffb0b42ffb5749291c11670bf /src/compiler/glsl
parent53087a89acafc340c3368d72267e8abf98b22dec (diff)
nir/linker: Add XFB resources to the program resource list
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/gl_nir_linker.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c
index 4bf94c05a15..57ee435fa27 100644
--- a/src/compiler/glsl/gl_nir_linker.c
+++ b/src/compiler/glsl/gl_nir_linker.c
@@ -154,6 +154,33 @@ nir_build_program_resource_list(struct gl_context *ctx,
return;
}
+ /* Add transform feedback varyings and buffers. */
+ if (prog->last_vert_prog) {
+ struct gl_transform_feedback_info *linked_xfb =
+ prog->last_vert_prog->sh.LinkedTransformFeedback;
+
+ /* Add varyings. */
+ if (linked_xfb->NumVarying > 0) {
+ for (int i = 0; i < linked_xfb->NumVarying; i++) {
+ if (!link_util_add_program_resource(prog, resource_set,
+ GL_TRANSFORM_FEEDBACK_VARYING,
+ &linked_xfb->Varyings[i], 0))
+ return;
+ }
+ }
+
+ /* Add buffers. */
+ for (unsigned i = 0; i < ctx->Const.MaxTransformFeedbackBuffers; i++) {
+ if ((linked_xfb->ActiveBuffers >> i) & 1) {
+ linked_xfb->Buffers[i].Binding = i;
+ if (!link_util_add_program_resource(prog, resource_set,
+ GL_TRANSFORM_FEEDBACK_BUFFER,
+ &linked_xfb->Buffers[i], 0))
+ return;
+ }
+ }
+ }
+
/* Add uniforms
*
* Here, it is expected that nir_link_uniforms() has already been