Buffer transmission and update in OpenGL

Source: Internet
Author: User

Graphics API features that it is difficult to see what is behind the scenes from the name, so there are a lot of twists and turns between it and best pratice. Yesterday I checked the buffer transfer and update Methods in OpenGL and found something I didn't notice before.

After creating a buffer object, you can transmit data from the CPU memory to the GPU memory through glbufferdata/glbuffersubdata. First, the data will be transferred to a page-locked memory by memcpy, this memory area can be directly accessed by the GPU. So far, glbufferdata will be directly returned, and subsequent data will be transmitted asynchronously from page-locked memory to GPU mempry.

The better way to update data is to use glmapbuffer/glunmapbuffer. glmapbuffer directly allocates space in page-locked memory and returns a pointer. By writing page-locked memory directly, memcpy is avoided once. Some Extensions support alignment of addresses so that SSE commands can be executed in their memory space.

I don't know if there is any inaccuracy. I will record it for now and test it with time.

Buffer transmission and update in OpenGL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.