SSBO update: we get the pointer on the GPU memory and we copy our data: GlBindBuffer(GL_SHADER_STORAGE_BUFFER, 0) GlBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(shader_data), &shader_data, GL_DYNAMIC_COPY) GlBindBuffer(GL_SHADER_STORAGE_BUFFER, ssbo) Let’s take again our C/C++ data structure, used in the article about UBOs: The management of SSBOs is very similar to the management of UBOs. The SSBO bible can be found here: GL_ARB_shader_storage_buffer_object. On Windows and Linux (with NVIDIA or AMD closed-source drivers), SSBOs are available for all OpenGL 4 capable GPUs. Then no SSBOs on OS X before at least a decade □ Mavericks, the last version of OS X, supports OpenGL 4.1 only. On a GeForce GTX 660, it’s possible to allocate a 2GB of VRAM for a SSBO. Shader Storage Buffer Objects (or SSBO) can be seen as unlocked UBOs: they are accessible in reading AND writing in a GLSL shader and their size seems to be limited by the amount of GPU memory available. Limited size, read-only mode, humm… With all modern graphics cards and their tons of gigabytes of dedicated vram, we can do better than 64KB for a GPU buffer. The size of an UBO is somewhat limited: 64KB for AMD and NVIDIA GPUs and 16KB for Intel ones. To sum up a little bit, UBOs are read-only GPU-accessible memory zones for a GLSL shader. In this tutorial, we meet Uniform Buffer Objects (or UBO).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |