mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-27 03:42:51 -06:00
use msl recompiler
This commit is contained in:
parent
61dfe608da
commit
5a2c073ebe
1 changed files with 7 additions and 4 deletions
|
@ -4,6 +4,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -15,7 +16,7 @@
|
||||||
#include "common/microprofile.h"
|
#include "common/microprofile.h"
|
||||||
#include "common/thread_worker.h"
|
#include "common/thread_worker.h"
|
||||||
#include "core/core.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/environment.h"
|
||||||
#include "shader_recompiler/frontend/maxwell/control_flow.h"
|
#include "shader_recompiler/frontend/maxwell/control_flow.h"
|
||||||
#include "shader_recompiler/frontend/maxwell/translate_program.h"
|
#include "shader_recompiler/frontend/maxwell/translate_program.h"
|
||||||
|
@ -33,7 +34,7 @@
|
||||||
namespace Metal {
|
namespace Metal {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using Shader::Backend::SPIRV::EmitSPIRV;
|
using Shader::Backend::MSL::EmitMSL;
|
||||||
using Shader::Maxwell::ConvertLegacyToGeneric;
|
using Shader::Maxwell::ConvertLegacyToGeneric;
|
||||||
using Shader::Maxwell::GenerateGeometryPassthrough;
|
using Shader::Maxwell::GenerateGeometryPassthrough;
|
||||||
using Shader::Maxwell::MergeDualVertexPrograms;
|
using Shader::Maxwell::MergeDualVertexPrograms;
|
||||||
|
@ -265,8 +266,10 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
|
||||||
|
|
||||||
const auto runtime_info{MakeRuntimeInfo(programs, key, program, previous_stage)};
|
const auto runtime_info{MakeRuntimeInfo(programs, key, program, previous_stage)};
|
||||||
ConvertLegacyToGeneric(program, runtime_info);
|
ConvertLegacyToGeneric(program, runtime_info);
|
||||||
const std::vector<u32> code{EmitSPIRV(profile, runtime_info, program, binding)};
|
const std::string code{EmitMSL(profile, runtime_info, program, binding)};
|
||||||
// TODO: translate the shader to metal using spirv cross
|
// HACK
|
||||||
|
std::cout << code << std::endl;
|
||||||
|
// TODO: create MTL::Function
|
||||||
// functions[stage_index] = ;
|
// functions[stage_index] = ;
|
||||||
previous_stage = &program;
|
previous_stage = &program;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue