diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-03-22 21:03:20 -0300 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-22 21:51:24 -0400 |
commit | c63cf4fa2e22538a01c191e1f97ac0f93b67e804 (patch) | |
tree | 2e9be29df86e6282a431da2f1503f128dd7aea8d /src/shader_recompiler | |
parent | 2be5c7eff40647344da7951dc5e20a7deebf78aa (diff) |
vk_pipeline_cache: Add pipeline cache
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r-- | src/shader_recompiler/environment.h | 11 | ||||
-rw-r--r-- | src/shader_recompiler/file_environment.cpp | 4 | ||||
-rw-r--r-- | src/shader_recompiler/file_environment.h | 4 | ||||
-rw-r--r-- | src/shader_recompiler/stage.h | 4 |
4 files changed, 15 insertions, 8 deletions
diff --git a/src/shader_recompiler/environment.h b/src/shader_recompiler/environment.h index 1fcaa56dda..6dec4b2554 100644 --- a/src/shader_recompiler/environment.h +++ b/src/shader_recompiler/environment.h @@ -3,8 +3,8 @@ #include <array> #include "common/common_types.h" -#include "shader_recompiler/stage.h" #include "shader_recompiler/program_header.h" +#include "shader_recompiler/stage.h" namespace Shader { @@ -14,9 +14,9 @@ public: [[nodiscard]] virtual u64 ReadInstruction(u32 address) = 0; - [[nodiscard]] virtual u32 TextureBoundBuffer() = 0; + [[nodiscard]] virtual u32 TextureBoundBuffer() const = 0; - [[nodiscard]] virtual std::array<u32, 3> WorkgroupSize() = 0; + [[nodiscard]] virtual std::array<u32, 3> WorkgroupSize() const = 0; [[nodiscard]] const ProgramHeader& SPH() const noexcept { return sph; @@ -26,9 +26,14 @@ public: return stage; } + [[nodiscard]] u32 StartAddress() const noexcept { + return start_address; + } + protected: ProgramHeader sph{}; Stage stage{}; + u32 start_address{}; }; } // namespace Shader diff --git a/src/shader_recompiler/file_environment.cpp b/src/shader_recompiler/file_environment.cpp index 21700c72b0..f2104f444e 100644 --- a/src/shader_recompiler/file_environment.cpp +++ b/src/shader_recompiler/file_environment.cpp @@ -39,11 +39,11 @@ u64 FileEnvironment::ReadInstruction(u32 offset) { return data[offset / 8]; } -u32 FileEnvironment::TextureBoundBuffer() { +u32 FileEnvironment::TextureBoundBuffer() const { throw NotImplementedException("Texture bound buffer serialization"); } -std::array<u32, 3> FileEnvironment::WorkgroupSize() { +std::array<u32, 3> FileEnvironment::WorkgroupSize() const { return {1, 1, 1}; } diff --git a/src/shader_recompiler/file_environment.h b/src/shader_recompiler/file_environment.h index 62302bc8ed..17640a6229 100644 --- a/src/shader_recompiler/file_environment.h +++ b/src/shader_recompiler/file_environment.h @@ -14,9 +14,9 @@ public: u64 ReadInstruction(u32 offset) override; - u32 TextureBoundBuffer() override; + u32 TextureBoundBuffer() const override; - std::array<u32, 3> WorkgroupSize() override; + std::array<u32, 3> WorkgroupSize() const override; private: std::vector<u64> data; diff --git a/src/shader_recompiler/stage.h b/src/shader_recompiler/stage.h index fc6ce60435..7d4f2c0bba 100644 --- a/src/shader_recompiler/stage.h +++ b/src/shader_recompiler/stage.h @@ -4,9 +4,11 @@ #pragma once +#include "common/common_types.h" + namespace Shader { -enum class Stage { +enum class Stage : u32 { Compute, VertexA, VertexB, |