mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
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:
32
app/src/main/cpp/skyline/gpu/shader_manager.cpp
Normal file
32
app/src/main/cpp/skyline/gpu/shader_manager.cpp
Normal 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,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
17
app/src/main/cpp/skyline/gpu/shader_manager.h
Normal file
17
app/src/main/cpp/skyline/gpu/shader_manager.h
Normal 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);
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user