Skip to content

Add support for multiple transform feedback buffer slots #9031

Description

@AlexAPPi

Description:

Currently, transform feedback supports binding only a single buffer without the ability to specify a slot index. This limitation makes it difficult to use transform feedback in more advanced GPU workflows where multiple output streams are required.

In many practical scenarios (e.g. partial GPU-based simulation, multi-stage processing, or separating different attribute streams), a single transform feedback buffer is not sufficient. The ability to bind buffers to specific indices (slots) is essential to fully utilize transform feedback functionality as provided by underlying graphics APIs.

Proposal:

Add support for binding transform feedback buffers with an explicit slot index.

Suggested API (example):

setTransformFeedbackBuffer(buffer, slot = 0);

or

setTransformFeedbackBuffers([
  { buffer, slot: 0 },
  { buffer: anotherBuffer, slot: 1 }
]);

Expected behavior:

  • Allow binding multiple buffers to different transform feedback slots.
  • Ensure compatibility with WebGL2 / OpenGL ES 3.0 behavior (gl.bindBufferBase / gl.bindBufferRange).
  • Maintain backward compatibility by defaulting to slot 0.

Use cases:

  • Splitting simulation data into multiple streams (positions, velocities, etc.).
  • Performing partial GPU computations where different outputs must be written independently.
  • More efficient memory layouts without interleaving attributes.

Additional context:

This feature would significantly improve flexibility when offloading computations to the GPU, especially in complex rendering or simulation pipelines.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions