From 51f3d9b777ab37ba71adbe61fd5123681de14815 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 28 Nov 2022 11:09:20 +0900 Subject: [PATCH] [vulkan] Fix particle local and dispatch sizes This gets particles working in renderdoc, but they're quite broken stand-alone, which I think means that synchronization is a problem. --- libs/video/renderer/vulkan/shader/partphysics.comp | 2 +- libs/video/renderer/vulkan/vulkan_particles.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/video/renderer/vulkan/shader/partphysics.comp b/libs/video/renderer/vulkan/shader/partphysics.comp index 89dbc3ff6..9c9a933f8 100644 --- a/libs/video/renderer/vulkan/shader/partphysics.comp +++ b/libs/video/renderer/vulkan/shader/partphysics.comp @@ -1,6 +1,6 @@ #version 450 -layout (local_size_x = 32, local_size_y = 32) in; +layout (local_size_x = 1, local_size_y = 1) in; struct Particle { vec4 pos; diff --git a/libs/video/renderer/vulkan/vulkan_particles.c b/libs/video/renderer/vulkan/vulkan_particles.c index 19d9963b2..adf72185c 100644 --- a/libs/video/renderer/vulkan/vulkan_particles.c +++ b/libs/video/renderer/vulkan/vulkan_particles.c @@ -449,7 +449,7 @@ particles_update (qfv_renderframe_t *rFrame) }; QFV_PushConstants (device, packet->cmd, pctx->physics_layout, 2, push_constants); - dfunc->vkCmdDispatch (packet->cmd, 8, 8, 8); + dfunc->vkCmdDispatch (packet->cmd, MaxParticles, 1, 1); dfunc->vkCmdSetEvent (packet->cmd, pframe->physicsEvent, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT); QFV_PacketSubmit (packet);