From 5a2c073ebe7c3098f3f2cf3eac4fcf8854ba15bf Mon Sep 17 00:00:00 2001 From: Samuliak Date: Sat, 4 May 2024 11:25:23 +0200 Subject: [PATCH] use msl recompiler --- src/video_core/renderer_metal/mtl_pipeline_cache.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/video_core/renderer_metal/mtl_pipeline_cache.cpp b/src/video_core/renderer_metal/mtl_pipeline_cache.cpp index d142ccbf89..00e7503567 100644 --- a/src/video_core/renderer_metal/mtl_pipeline_cache.cpp +++ b/src/video_core/renderer_metal/mtl_pipeline_cache.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -15,7 +16,7 @@ #include "common/microprofile.h" #include "common/thread_worker.h" #include "core/core.h" -#include "shader_recompiler/backend/spirv/emit_spirv.h" +#include "shader_recompiler/backend/msl/emit_msl.h" #include "shader_recompiler/environment.h" #include "shader_recompiler/frontend/maxwell/control_flow.h" #include "shader_recompiler/frontend/maxwell/translate_program.h" @@ -33,7 +34,7 @@ namespace Metal { namespace { -using Shader::Backend::SPIRV::EmitSPIRV; +using Shader::Backend::MSL::EmitMSL; using Shader::Maxwell::ConvertLegacyToGeneric; using Shader::Maxwell::GenerateGeometryPassthrough; using Shader::Maxwell::MergeDualVertexPrograms; @@ -265,8 +266,10 @@ std::unique_ptr PipelineCache::CreateGraphicsPipeline( const auto runtime_info{MakeRuntimeInfo(programs, key, program, previous_stage)}; ConvertLegacyToGeneric(program, runtime_info); - const std::vector code{EmitSPIRV(profile, runtime_info, program, binding)}; - // TODO: translate the shader to metal using spirv cross + const std::string code{EmitMSL(profile, runtime_info, program, binding)}; + // HACK + std::cout << code << std::endl; + // TODO: create MTL::Function // functions[stage_index] = ; previous_stage = &program; }