diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-03-14 06:19:02 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-04-10 19:20:25 +0200 |
commit | ad53b233c58fdf90da0e05283eb8146acb50fad3 (patch) | |
tree | d717684c4a3b324142e1532c30e7d1b9fbddd23b /src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |
parent | video_core: Add sirit as optional dependency with Vulkan (diff) | |
download | yuzu-ad53b233c58fdf90da0e05283eb8146acb50fad3.tar yuzu-ad53b233c58fdf90da0e05283eb8146acb50fad3.tar.gz yuzu-ad53b233c58fdf90da0e05283eb8146acb50fad3.tar.bz2 yuzu-ad53b233c58fdf90da0e05283eb8146acb50fad3.tar.lz yuzu-ad53b233c58fdf90da0e05283eb8146acb50fad3.tar.xz yuzu-ad53b233c58fdf90da0e05283eb8146acb50fad3.tar.zst yuzu-ad53b233c58fdf90da0e05283eb8146acb50fad3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp new file mode 100644 index 000000000..3b8793840 --- /dev/null +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp @@ -0,0 +1,45 @@ +// Copyright 2019 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <sirit/sirit.h> + +#include "common/assert.h" +#include "video_core/engines/maxwell_3d.h" +#include "video_core/engines/shader_header.h" +#include "video_core/renderer_vulkan/vk_shader_decompiler.h" +#include "video_core/shader/shader_ir.h" + +namespace Vulkan::VKShader { + +using namespace VideoCommon::Shader; + +using ShaderStage = Tegra::Engines::Maxwell3D::Regs::ShaderStage; + +class SPIRVDecompiler : public Sirit::Module { +public: + explicit SPIRVDecompiler(const ShaderIR& ir, ShaderStage stage) + : Module(0x00010300), ir{ir}, stage{stage}, header{ir.GetHeader()} {} + + void Decompile() { + UNIMPLEMENTED(); + } + + ShaderEntries GetShaderEntries() const { + UNIMPLEMENTED(); + return {}; + } + +private: + const ShaderIR& ir; + const ShaderStage stage; + const Tegra::Shader::Header header; +}; + +DecompilerResult Decompile(const VideoCommon::Shader::ShaderIR& ir, Maxwell::ShaderStage stage) { + auto decompiler = std::make_unique<SPIRVDecompiler>(ir, stage); + decompiler->Decompile(); + return {std::move(decompiler), decompiler->GetShaderEntries()}; +} + +} // namespace Vulkan::VKShader |