support dynamic uniform buffers on vulkan

This commit is contained in:
Gregory Wells
2025-07-23 11:37:12 -04:00
parent 9c03d38f51
commit 0da1a8a4f6
14 changed files with 22 additions and 13 deletions

View File

@@ -69,12 +69,12 @@ void drawIndexed(gnCommandBufferHandle buffer, gnIndexType type, int indexCount,
buffer->commandBuffer->changedBuffer = gnFalse;
}
void bindUniform(gnCommandBufferHandle buffer, gnUniform uniform, uint32_t set) {
void bindUniform(gnCommandBufferHandle buffer, gnUniform uniform, uint32_t set, uint32_t dynamicOffsetCount, uint32_t* dynamicOffsets) {
vkCmdBindDescriptorSets(
buffer->commandBuffer->buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS,
buffer->commandBuffer->boundGraphicsPipeline->graphicsPipeline->pipelineLayout, set, 1,
&uniform->uniform->set, 0, NULL
&uniform->uniform->set, dynamicOffsetCount, dynamicOffsets
);
}

View File

@@ -17,5 +17,5 @@ void setScissor(gnCommandBuffer buffer, gnScissor scissor);
void bindBuffer(gnCommandBufferHandle buffer, gnBufferHandle bufferToBind, gnBufferType type);
void draw(gnCommandBuffer buffer, int vertexCount, int firstVertex, int instanceCount, int firstInstance);
void drawIndexed(gnCommandBufferHandle buffer, gnIndexType type, int indexCount, int firstIndex, int vertexOffset, int instanceCount, int firstInstance);
void bindUniform(gnCommandBufferHandle buffer, gnUniform uniform, uint32_t set);
void bindUniform(gnCommandBufferHandle buffer, gnUniform uniform, uint32_t set, uint32_t dynamicOffsetCount, uint32_t* dynamicOffsets);
void pushConstant(gnCommandBufferHandle buffer, gnPushConstantLayout layout, void* data);