Skip to content

Commit

Permalink
[Vulkan] Use the correct descriptor layout for compute
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Jan 26, 2024
1 parent 2a78a5c commit f387859
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,8 @@ void kinc_g5_command_list_set_compute_constant_buffer(kinc_g5_command_list_t *li
lastComputeConstantBufferOffset = offset;

VkDescriptorSet descriptor_set = get_compute_descriptor_set();
uint32_t offsets[1] = {lastComputeConstantBufferOffset};
vkCmdBindDescriptorSets(list->impl._buffer, VK_PIPELINE_BIND_POINT_COMPUTE, current_compute_shader->impl.pipeline_layout, 0, 1, &descriptor_set, 1,
uint32_t offsets[2] = {lastComputeConstantBufferOffset, lastComputeConstantBufferOffset};
vkCmdBindDescriptorSets(list->impl._buffer, VK_PIPELINE_BIND_POINT_COMPUTE, current_compute_shader->impl.pipeline_layout, 0, 1, &descriptor_set, 2,
offsets);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ static void parse_shader(uint32_t *shader_source, int shader_length, kinc_intern

static VkShaderModule create_shader_module(const void *code, size_t size);

static VkDescriptorSetLayout compute_descriptor_layout;
static VkDescriptorPool compute_descriptor_pool;

static void create_compute_descriptor_layout(void) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ static VkDescriptorSet get_compute_descriptor_set() {
alloc_info.pNext = NULL;
alloc_info.descriptorPool = descriptor_pool;
alloc_info.descriptorSetCount = 1;
alloc_info.pSetLayouts = &desc_layout;
alloc_info.pSetLayouts = &compute_descriptor_layout;
VkDescriptorSet descriptor_set;
VkResult err = vkAllocateDescriptorSets(vk_ctx.device, &alloc_info, &descriptor_set);
assert(!err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static VkSemaphore framebuffer_available;
static VkSemaphore relay_semaphore;
static bool wait_for_relay = false;
static void command_list_should_wait_for_framebuffer(void);
static VkDescriptorSetLayout compute_descriptor_layout;

#include "ShaderHash.c.h"
#include "Vulkan.c.h"
Expand Down

0 comments on commit f387859

Please sign in to comment.