From 8a22dd4c6863f54c043be0b9e2074025f8b0ee74 Mon Sep 17 00:00:00 2001 From: saschawillems Date: Tue, 29 Nov 2016 20:45:38 +0100 Subject: [PATCH] Changed global and local compute work group sizes (Fixes #251) --- computeparticles/computeparticles.cpp | 2 +- data/shaders/computeparticles/particle.comp | 2 +- .../computeparticles/particle.comp.spv | Bin 5212 -> 5212 bytes 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/computeparticles/computeparticles.cpp b/computeparticles/computeparticles.cpp index beb3fdd3..21053ba5 100644 --- a/computeparticles/computeparticles.cpp +++ b/computeparticles/computeparticles.cpp @@ -204,7 +204,7 @@ public: vkCmdBindDescriptorSets(compute.commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, compute.pipelineLayout, 0, 1, &compute.descriptorSet, 0, 0); // Dispatch the compute job - vkCmdDispatch(compute.commandBuffer, PARTICLE_COUNT / 16, 1, 1); + vkCmdDispatch(compute.commandBuffer, PARTICLE_COUNT / 256, 1, 1); // Add memory barrier to ensure that compute shader has finished writing to the buffer // Without this the (rendering) vertex shader may display incomplete results (partial data from last frame) diff --git a/data/shaders/computeparticles/particle.comp b/data/shaders/computeparticles/particle.comp index b9848140..202ec9d4 100644 --- a/data/shaders/computeparticles/particle.comp +++ b/data/shaders/computeparticles/particle.comp @@ -16,7 +16,7 @@ layout(std140, binding = 0) buffer Pos Particle particles[ ]; }; -layout (local_size_x = 16, local_size_y = 16) in; +layout (local_size_x = 256) in; layout (binding = 1) uniform UBO { diff --git a/data/shaders/computeparticles/particle.comp.spv b/data/shaders/computeparticles/particle.comp.spv index 7a800bfa3968ef584efddcbc30369bd1db95761c..85d8f637b9ee3a8a4232bb81169c56ff964bcb8f 100644 GIT binary patch delta 43 ucmcbkaYti93M&I60|Vp6%=2ubAeIgT8-qIo1H&aCz6iu~Hv6*k^8x_emI&kk delta 43 rcmcbkaYti93abDE1B1ZE%=2ubAeIgT8-qKLz68V