aboutsummaryrefslogtreecommitdiff
path: root/BuddhaTest/src/BuddhaTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BuddhaTest/src/BuddhaTest.cpp')
-rw-r--r--BuddhaTest/src/BuddhaTest.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/BuddhaTest/src/BuddhaTest.cpp b/BuddhaTest/src/BuddhaTest.cpp
index 0ae94b0..4de252d 100644
--- a/BuddhaTest/src/BuddhaTest.cpp
+++ b/BuddhaTest/src/BuddhaTest.cpp
@@ -118,7 +118,13 @@ int main(int argc, char * argv[])
glBufferData(GL_SHADER_STORAGE_BUFFER, 4 *3* pixelCount, nullptr, GL_DYNAMIC_COPY);
glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R8,GL_RED,GL_UNSIGNED_INT,nullptr);
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 2, drawBuffer);
- glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
+
+ GLuint brightnessBuffer;
+ glGenBuffers(1,&brightnessBuffer);
+ glBindBuffer(GL_SHADER_STORAGE_BUFFER, brightnessBuffer);
+ glBufferData(GL_SHADER_STORAGE_BUFFER, 16,nullptr, GL_DYNAMIC_COPY);
+ glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R8,GL_RED,GL_UNSIGNED_INT,nullptr);
+ glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 3, brightnessBuffer);
//the state buffer is special. While making each entry 8 bytes large and using std430 layout, the data is never read back,
//so we can get away with being more lenient and allowing the compiler to choose layout without much extra work.