0
$\begingroup$

The typical way I see transform feedback being used is:

    glGenBuffers(1, &tbo);
    glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, tbo);
    glBufferData(GL_TRANSFORM_FEEDBACK_BUFFER, sizeof(data), nullptr, GL_DYNAMIC_COPY);

However, new, DSA OpenGL eschews the binding points. Is there a DSA way to bind a buffer to the transform feedback binding point?

$\endgroup$

2 Answers 2

1
$\begingroup$

Binding points (and other state) are still important when doing actual draw calls (stuff like VAOs, UBOs, SSBOs and programs are still bound). It's only bind-to-edit that was eschewed.

In your case the most DSA way to do that would be:

glCreateBuffers(1, &tbo);
glNamedBufferData(tbo,sizeof(data), nullptr, GL_DYNAMIC_COPY);

glBindBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, tbo);
$\endgroup$
0
5
$\begingroup$

There isn't a DSA way to bind buffers to the feedback buffer bindings. But that's because transform feedbacks are objects, and there is a DSA way to attach buffers to transform feedback objects:

GLuint buffer;
glCreateBuffers(1, &buffer);
//Fill in buffer's data.

GLuint feedback;
glCreateTransformFeedbacks(1, &feedback);
glTransformFeedbackBufferRange(feedback, 0, buffer, offset, size);

You can then bind feedback when you're ready to actually do your feedback operations into those buffers.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.