glsl: add transform feedback buffers to resource list
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -3852,7 +3852,8 @@ write_top_level_array_size_and_stride:
|
||||
* resource data.
|
||||
*/
|
||||
void
|
||||
build_program_resource_list(struct gl_shader_program *shProg)
|
||||
build_program_resource_list(struct gl_context *ctx,
|
||||
struct gl_shader_program *shProg)
|
||||
{
|
||||
/* Rebuild resource list. */
|
||||
if (shProg->ProgramResourceList) {
|
||||
@@ -3910,6 +3911,17 @@ build_program_resource_list(struct gl_shader_program *shProg)
|
||||
}
|
||||
}
|
||||
|
||||
/* Add transform feedback buffers. */
|
||||
for (unsigned i = 0; i < ctx->Const.MaxTransformFeedbackBuffers; i++) {
|
||||
if ((shProg->LinkedTransformFeedback.ActiveBuffers >> i) & 1) {
|
||||
shProg->LinkedTransformFeedback.Buffers[i].Binding = i;
|
||||
if (!add_program_resource(shProg, GL_TRANSFORM_FEEDBACK_BUFFER,
|
||||
&shProg->LinkedTransformFeedback.Buffers[i],
|
||||
0))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add uniforms from uniform storage. */
|
||||
for (unsigned i = 0; i < shProg->NumUniformStorage; i++) {
|
||||
/* Do not add uniforms internally used by Mesa. */
|
||||
|
@@ -43,7 +43,8 @@ extern void
|
||||
link_shaders(struct gl_context *ctx, struct gl_shader_program *prog);
|
||||
|
||||
extern void
|
||||
build_program_resource_list(struct gl_shader_program *shProg);
|
||||
build_program_resource_list(struct gl_context *ctx,
|
||||
struct gl_shader_program *shProg);
|
||||
|
||||
extern void
|
||||
linker_error(struct gl_shader_program *prog, const char *fmt, ...)
|
||||
|
@@ -260,6 +260,6 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
|
||||
if (brw->precompile && !brw_shader_precompile(ctx, shProg))
|
||||
return false;
|
||||
|
||||
build_program_resource_list(shProg);
|
||||
build_program_resource_list(ctx, shProg);
|
||||
return true;
|
||||
}
|
||||
|
@@ -2976,7 +2976,7 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
_mesa_reference_program(ctx, &linked_prog, NULL);
|
||||
}
|
||||
|
||||
build_program_resource_list(prog);
|
||||
build_program_resource_list(ctx, prog);
|
||||
return prog->LinkStatus;
|
||||
}
|
||||
|
||||
|
@@ -6811,7 +6811,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
validate_ir_tree(ir);
|
||||
}
|
||||
|
||||
build_program_resource_list(prog);
|
||||
build_program_resource_list(ctx, prog);
|
||||
|
||||
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||
struct gl_program *linked_prog;
|
||||
|
Reference in New Issue
Block a user