mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
refactor(graphics): split renderer and recompiler into focused modules
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#ifndef EMULATOR_SRC_GRAPHICS_HOST_GPU_RENDERER_BLITHELPER_H_
|
||||
#define EMULATOR_SRC_GRAPHICS_HOST_GPU_RENDERER_BLITHELPER_H_
|
||||
|
||||
#include "common/common.h"
|
||||
#include "graphics/host_gpu/vulkanCommon.h"
|
||||
|
||||
#include <compare>
|
||||
#include <vector>
|
||||
|
||||
namespace Libs::Graphics {
|
||||
|
||||
class CommandScheduler;
|
||||
class Image;
|
||||
struct GraphicContext;
|
||||
|
||||
class BlitHelper final {
|
||||
public:
|
||||
inline static constexpr auto ColorToMsDepthLayout =
|
||||
vk::ImageLayout::eDepthStencilAttachmentOptimal;
|
||||
|
||||
BlitHelper(GraphicContext& graphics, CommandScheduler& scheduler);
|
||||
~BlitHelper();
|
||||
KYTY_CLASS_NO_COPY(BlitHelper);
|
||||
|
||||
void ReinterpretColorAsMsDepth(Image& source, Image& destination);
|
||||
|
||||
private:
|
||||
struct PipelineKey {
|
||||
uint32_t samples = 1;
|
||||
vk::Format format = vk::Format::eUndefined;
|
||||
|
||||
auto operator<=>(const PipelineKey&) const = default;
|
||||
};
|
||||
|
||||
struct Pipeline {
|
||||
PipelineKey key;
|
||||
vk::Pipeline handle = nullptr;
|
||||
};
|
||||
|
||||
[[nodiscard]] vk::ShaderModule CreateShader(const uint32_t* code, size_t words) const;
|
||||
[[nodiscard]] vk::Pipeline GetPipeline(PipelineKey key);
|
||||
|
||||
GraphicContext& m_graphics;
|
||||
CommandScheduler& m_scheduler;
|
||||
vk::DescriptorSetLayout m_descriptor_layout = nullptr;
|
||||
vk::PipelineLayout m_pipeline_layout = nullptr;
|
||||
vk::ShaderModule m_vertex_shader = nullptr;
|
||||
vk::ShaderModule m_fragment_shader = nullptr;
|
||||
std::vector<Pipeline> m_pipelines;
|
||||
};
|
||||
|
||||
} // namespace Libs::Graphics
|
||||
|
||||
#endif // EMULATOR_SRC_GRAPHICS_HOST_GPU_RENDERER_BLITHELPER_H_
|
||||
Reference in New Issue
Block a user