aboutsummaryrefslogtreecommitdiff
path: root/BuddhaTest/src
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2018-03-22 00:05:59 +0100
committerAndreas Grois <andi@grois.info>2018-03-22 00:05:59 +0100
commitfa76d77be61ad3f0b295a87236e74f150597751f (patch)
treedf7aa409cf1d7c1955e8f89c08c771b3289527c7 /BuddhaTest/src
parentcca3254becdf793b9335a1f21bcda2c0909f4d1a (diff)
Initial commit for better brightness.
Needs more work, uses too many VGPRs. Also, maybe work on a single shared variable?
Diffstat (limited to 'BuddhaTest/src')
-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.