Introduce ShaderManager with Proxy Shader Compiler Logger/Settings

This class will be entirely responsible for any interop with the shader compiler, it is also responsible for caching and compilation of shaders in itself.
This commit is contained in:
PixelyIon
2021-12-02 00:43:10 +05:30
parent def9cedbee
commit ece2785582
6 changed files with 56 additions and 3 deletions

View File

@ -0,0 +1,32 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/)
#include <shader_compiler/common/settings.h>
#include <shader_compiler/common/log.h>
#include "shader_manager.h"
namespace Shader::Log {
void Debug(const std::string &message) {
skyline::Logger::Write(skyline::Logger::LogLevel::Debug, message);
}
void Warn(const std::string &message) {
skyline::Logger::Write(skyline::Logger::LogLevel::Warn, message);
}
void Error(const std::string &message) {
skyline::Logger::Write(skyline::Logger::LogLevel::Error, message);
}
}
namespace skyline::gpu {
ShaderManager::ShaderManager(const DeviceState &state) {
Shader::Settings::values = {
.disable_shader_loop_safety_checks = false,
.renderer_debug = true,
.resolution_info = {
.active = false,
},
};
}
}

View File

@ -0,0 +1,17 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright © 2021 Skyline Team and Contributors (https://github.com/skyline-emu/)
#pragma once
#include <vulkan/vulkan.hpp>
#include <common.h>
namespace skyline::gpu {
/**
* @brief The Shader Manager is responsible for caching and looking up shaders alongside handling compilation of shaders when not found in any cache
*/
class ShaderManager {
public:
ShaderManager(const DeviceState& state);
};
}