aboutsummaryrefslogtreecommitdiff
path: root/BuddhaTest/src/BuddhaTest.cpp
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2018-03-10 13:46:12 +0100
committerAndreas Grois <andi@grois.info>2018-03-10 13:46:12 +0100
commit710c12067531e6e05280d081203aeb3b945669a9 (patch)
tree3b89e9775a8515b1972cb96b71fbe0a110cc2ff5 /BuddhaTest/src/BuddhaTest.cpp
parent01b47b49462a3b6ade6e8819edad9f2455fe1143 (diff)
Fix mirroring in png output
Restrict starting value range to positive y-values, probably improving random quality
Diffstat (limited to 'BuddhaTest/src/BuddhaTest.cpp')
-rw-r--r--BuddhaTest/src/BuddhaTest.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/BuddhaTest/src/BuddhaTest.cpp b/BuddhaTest/src/BuddhaTest.cpp
index f8b9074..09a3cf1 100644
--- a/BuddhaTest/src/BuddhaTest.cpp
+++ b/BuddhaTest/src/BuddhaTest.cpp
@@ -21,6 +21,14 @@ int main()
unsigned int orbitLengthGreen = 100;
unsigned int orbitLengthBlue = 1000;
+ unsigned int localWorkgroupSizeX = 1024;
+ unsigned int localWorkgroupSizeY = 1;
+ unsigned int localWorkgroupSizeZ = 1;
+
+ unsigned int globalWorkGroupSizeX = 1024;
+ unsigned int globalWorkGroupSizeY = 1;
+ unsigned int globalWorkGroupSizeZ = 1;
+
GLFWwindow* window;
/* Initialize the library */
@@ -80,7 +88,7 @@ int main()
// Create and compile our GLSL program from the shaders
GLuint VertexAndFragmentShaders = Helpers::LoadShaders("Shaders/BuddhaVertex.glsl", "Shaders/BuddhaFragment.glsl");
//Do the same for the compute shader:
- GLuint ComputeShader = Helpers::LoadComputeShader("Shaders/BuddhaCompute.glsl", 1024, 1, 1);
+ GLuint ComputeShader = Helpers::LoadComputeShader("Shaders/BuddhaCompute.glsl", localWorkgroupSizeX, localWorkgroupSizeY, localWorkgroupSizeZ);
uint32_t iterationCount{0};
glUseProgram(ComputeShader);
@@ -97,7 +105,7 @@ int main()
glUseProgram(ComputeShader);
//increase iterationCount, which is used for pseudo random generation
glUniform1ui(iterationCountUniformHandle,++iterationCount);
- glDispatchCompute(1024, 1, 1);
+ glDispatchCompute(globalWorkGroupSizeX, globalWorkGroupSizeY, globalWorkGroupSizeZ);
//before reading the values in the ssbo, we need a memory barrier:
glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT); //I hope this is the correct (and only required) bit