metal storage buffers + rework of shader maps

This commit is contained in:
Greg Wells
2025-07-03 19:48:12 -04:00
parent 665ce6847a
commit b53a31c565
8 changed files with 83 additions and 93 deletions

View File

@@ -6,7 +6,7 @@
typedef struct gnPlatformGraphicsPipeline_t {
id<MTLRenderPipelineState> graphicsPipeline;
id<MTLDepthStencilState> depthState;
metalBindingMaps vertexShaderMaps, fragmentShaderMaps;
metalShaderMap vertexShaderMaps, fragmentShaderMaps;
} gnPlatformGraphicsPipeline;
gnReturnCode createMetalGraphicsPipeline(gnGraphicsPipeline graphicsPipeline, gnOutputDevice device, gnGraphicsPipelineInfo info);

View File

@@ -75,10 +75,10 @@ gnReturnCode createMetalGraphicsPipeline(gnGraphicsPipeline graphicsPipeline, gn
for (int i = 0; i < info.shaderModuleCount; i++) {
if (info.shaderModules[i]->info.stage == GN_VERTEX_SHADER_MODULE) {
[descriptor setVertexFunction:info.shaderModules[i]->shaderModule->function];
graphicsPipeline->graphicsPipeline->vertexShaderMaps = info.shaderModules[i]->shaderModule->maps;
graphicsPipeline->graphicsPipeline->vertexShaderMaps = info.shaderModules[i]->shaderModule->map;
} else if (info.shaderModules[i]->info.stage == GN_FRAGMENT_SHADER_MODULE) {
[descriptor setFragmentFunction:info.shaderModules[i]->shaderModule->function];
graphicsPipeline->graphicsPipeline->fragmentShaderMaps = info.shaderModules[i]->shaderModule->maps;
graphicsPipeline->graphicsPipeline->fragmentShaderMaps = info.shaderModules[i]->shaderModule->map;
} else {
return GN_UNSUPPORTED_SHADER_MODULE;
}