From fa76d77be61ad3f0b295a87236e74f150597751f Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Thu, 22 Mar 2018 00:05:59 +0100 Subject: Initial commit for better brightness. Needs more work, uses too many VGPRs. Also, maybe work on a single shared variable? --- BuddhaTest/src/BuddhaTest.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'BuddhaTest/src/BuddhaTest.cpp') 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. -- cgit v1.2.3