some more stuff that idk why i did it

This commit is contained in:
Gregory Wells
2025-07-21 13:50:39 -04:00
parent 239d8bcdb8
commit a08778c099
5 changed files with 7 additions and 4 deletions

View File

@@ -89,7 +89,7 @@ gnReturnCode createMetalGraphicsPipeline(gnGraphicsPipeline graphicsPipeline, gn
}
const char* name = info.shaderModules[i]->info.entryPoint.value;
const char* name = gnToCString(info.shaderModules[i]->info.entryPoint);
if (strcmp(name, "main") == 0) name = "main0";
gnBool foundFunction = false;

View File

@@ -18,6 +18,8 @@ void handle_resources(spirv_cross::CompilerMSL& compiler, spirv_cross::SmallVect
GN_CPP_FUNCTION mtlCompiler mtlCreateCompiler(mtlCompilerInfo* info) {
mtlInternalCompiler* compiler = (mtlInternalCompiler*)malloc(sizeof(mtlInternalCompiler));
// if(info->stage == mtlVertex) compiler->mslCompiler->set_entry_point(info->entryPoint, spv::ExecutionModelVertex);
// if(info->stage == mtlFragment) compiler->mslCompiler->set_entry_point(info->entryPoint, spv::ExecutionModelFragment);
compiler->mslCompiler = new spirv_cross::CompilerMSL(info->code, info->wordCount);
spirv_cross::CompilerMSL::Options options = compiler->mslCompiler->get_msl_options();

View File

@@ -12,7 +12,7 @@ gnReturnCode createMetalShaderModule(gnShaderModule module, gnDevice device, gnS
mtlCompilerInfo info = {
.code = shaderModuleInfo.code,
.wordCount = shaderModuleInfo.size / 4,
.entryPoint = shaderModuleInfo.entryPoint.value,
.entryPoint = gnToCString(shaderModuleInfo.entryPoint),
.stage = (shaderModuleInfo.stage == GN_FRAGMENT_SHADER_MODULE) ? mtlFragment : mtlVertex
};
if ((device->outputDevice->device.argumentBuffersSupport == MTLArgumentBuffersTier2)) {