Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Can I create PBO in this way?

To create a buffer in OpenGL, we need to write following code down:

GLuint buffer;
glCreateBuffers(1,&buffer);
glNamedBufferStorage(buffer,size,data,flags);

I know that we can create a PBO in this way:

GLuint pbo;
glCreateBuffers(1,&pbo);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER,&pbo);
glBufferData(...);//initializing buffer

my question is, can I create pbo in the first manner?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

There is no such thing as a "PBO"; at least, not in the way you seem to regard it. There are just buffer objects, and being the source/destination of a pixel transfer is merely one usage of them. A buffer object is in no way directly associated with any particular use of it.

You can use a buffer object for a pixel transfer, then use the same one for vertex data, then use the same one for something else. Or you can use different parts of a buffer object for different usages. OpenGL does not care. Any buffer can be used for any of the things a buffer can be used for at any time (within certain sane restrictions).

The buffer you created with the DSA APIs can be used for pixel transfers just like any other buffer object.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading