From d9fd9751382d3a1c37d9200c37713e2d0ff4c4ea Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 13 Nov 2023 15:15:30 +0000 Subject: [PATCH] Add a test of unmapping read-only persistent buffers on GL --- util/test/demos/gl/gl_parameter_zoo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util/test/demos/gl/gl_parameter_zoo.cpp b/util/test/demos/gl/gl_parameter_zoo.cpp index ebe6f26eb..fe2157a9f 100644 --- a/util/test/demos/gl/gl_parameter_zoo.cpp +++ b/util/test/demos/gl/gl_parameter_zoo.cpp @@ -184,6 +184,10 @@ void main() ActivateContext(mainWindow, NULL); ActivateContext(mainWindow, mainContext, true); + GLuint mapPersTest = MakeBuffer(); + glBindBuffer(GL_SHADER_STORAGE_BUFFER, mapPersTest); + glBufferStorage(GL_SHADER_STORAGE_BUFFER, 1024, 0, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT); + while(Running()) { // trash the texture pack/unpack state @@ -198,6 +202,10 @@ void main() glPixelStorei(GL_PACK_SKIP_ROWS, 33); glPixelStorei(GL_PACK_ALIGNMENT, 8); + glBindBuffer(GL_SHADER_STORAGE_BUFFER, mapPersTest); + glMapBufferRange(GL_SHADER_STORAGE_BUFFER, 0, 1024, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT); + glUnmapBuffer(GL_SHADER_STORAGE_BUFFER); + for(int i = 0; i < 100; i++) glGetError();