uniform buffer rebinding

This commit is contained in:
Greg Wells
2025-07-01 12:19:26 -04:00
parent 7c5c333fa2
commit f7f5d4b3a4
5 changed files with 46 additions and 16 deletions

View File

@@ -115,10 +115,16 @@ void metalBindUniform(gnCommandBufferHandle buffer, gnUniform uniform, uint32_t
if (uniform->uniform->bindings[i].type == GN_UNIFORM_BUFFER_DESCRIPTOR) {
gnBufferUniformInfo info = *(gnBufferUniformInfo*)uniform->uniform->bindings[i].data;
[encoder setVertexBuffer:info.buffer->buffer->buffer
offset:info.offset
atIndex:(info.binding + 1)
];
for (int c = 0; c < buffer->commandBuffer->boundGraphcisPipeline->graphicsPipeline->vertexShaderMaps.uniformBufferMaps.count; c++) {
metalBindingMap map = buffer->commandBuffer->boundGraphcisPipeline->graphicsPipeline->vertexShaderMaps.uniformBufferMaps.data[c];
if (map.set == set && map.binding == uniform->uniform->bindings[i].binding) {
[encoder setVertexBuffer:info.buffer->buffer->buffer
offset:info.offset
atIndex:1
];
break;
}
}
} else if (uniform->uniform->bindings[i].type == GN_IMAGE_DESCRIPTOR) {
for (int c = 0; c < buffer->commandBuffer->boundGraphcisPipeline->graphicsPipeline->fragmentShaderMaps.textureMaps.count; c++) {
metalBindingMap map = buffer->commandBuffer->boundGraphcisPipeline->graphicsPipeline->fragmentShaderMaps.textureMaps.data[c];