diff --git a/CMakeLists.txt b/CMakeLists.txt index b97c02d..95a8c9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,12 +28,13 @@ if (APPLE) set(VULKAN_BUILT ON) set(METAL_BUILT ON) endif() +add_subdirectory(projects/utils) add_subdirectory(projects/loader) # build gryphn loader add_subdirectory(projects/core) # build gryphn core add_subdirectory(projects/extensions) add_subdirectory(projects/platform) # build gryphn platform add_subdirectory(projects/validation_layers/function_loader/) -target_link_libraries(Gryphn INTERFACE GryphnCore GryphnLoader GryphnPlatform GryphnFunctionValidator GryphnExtensions) +target_link_libraries(Gryphn INTERFACE GryphnUtils GryphnCore GryphnLoader GryphnPlatform GryphnFunctionValidator GryphnExtensions) if (VULKAN_BUILT) target_link_libraries(Gryphn INTERFACE GryphnVulkanImpl) diff --git a/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m b/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m index 4451a97..dd296aa 100644 --- a/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m +++ b/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m @@ -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; diff --git a/projects/apis/metal/src/shader_module/metal_shader_compiler.mm b/projects/apis/metal/src/shader_module/metal_shader_compiler.mm index a4d852e..986fe28 100644 --- a/projects/apis/metal/src/shader_module/metal_shader_compiler.mm +++ b/projects/apis/metal/src/shader_module/metal_shader_compiler.mm @@ -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(); diff --git a/projects/apis/metal/src/shader_module/metal_shader_module.m b/projects/apis/metal/src/shader_module/metal_shader_module.m index e27771c..24b2259 100644 --- a/projects/apis/metal/src/shader_module/metal_shader_module.m +++ b/projects/apis/metal/src/shader_module/metal_shader_module.m @@ -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)) { diff --git a/projects/apis/vulkan/src/shader_module/vulkan_shader_module.c b/projects/apis/vulkan/src/shader_module/vulkan_shader_module.c index 519b236..f549f90 100644 --- a/projects/apis/vulkan/src/shader_module/vulkan_shader_module.c +++ b/projects/apis/vulkan/src/shader_module/vulkan_shader_module.c @@ -28,7 +28,7 @@ gnReturnCode createShaderModule(gnShaderModule module, gnDevice device, gnShader .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, .stage = vkGryphnShaderModuleStage(shaderModuleInfo.stage), .module = module->shaderModule->shaderModule, - .pName = shaderModuleInfo.entryPoint.value + .pName = gnToCString(shaderModuleInfo.entryPoint) }; return GN_SUCCESS;