summaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/environment.h11
-rw-r--r--src/shader_recompiler/file_environment.cpp4
-rw-r--r--src/shader_recompiler/file_environment.h4
-rw-r--r--src/shader_recompiler/stage.h4
4 files changed, 15 insertions, 8 deletions
diff --git a/src/shader_recompiler/environment.h b/src/shader_recompiler/environment.h
index 1fcaa56dd..6dec4b255 100644
--- a/src/shader_recompiler/environment.h
+++ b/src/shader_recompiler/environment.h
@@ -3,8 +3,8 @@
3#include <array> 3#include <array>
4 4
5#include "common/common_types.h" 5#include "common/common_types.h"
6#include "shader_recompiler/stage.h"
7#include "shader_recompiler/program_header.h" 6#include "shader_recompiler/program_header.h"
7#include "shader_recompiler/stage.h"
8 8
9namespace Shader { 9namespace Shader {
10 10
@@ -14,9 +14,9 @@ public:
14 14
15 [[nodiscard]] virtual u64 ReadInstruction(u32 address) = 0; 15 [[nodiscard]] virtual u64 ReadInstruction(u32 address) = 0;
16 16
17 [[nodiscard]] virtual u32 TextureBoundBuffer() = 0; 17 [[nodiscard]] virtual u32 TextureBoundBuffer() const = 0;
18 18
19 [[nodiscard]] virtual std::array<u32, 3> WorkgroupSize() = 0; 19 [[nodiscard]] virtual std::array<u32, 3> WorkgroupSize() const = 0;
20 20
21 [[nodiscard]] const ProgramHeader& SPH() const noexcept { 21 [[nodiscard]] const ProgramHeader& SPH() const noexcept {
22 return sph; 22 return sph;
@@ -26,9 +26,14 @@ public:
26 return stage; 26 return stage;
27 } 27 }
28 28
29 [[nodiscard]] u32 StartAddress() const noexcept {
30 return start_address;
31 }
32
29protected: 33protected:
30 ProgramHeader sph{}; 34 ProgramHeader sph{};
31 Stage stage{}; 35 Stage stage{};
36 u32 start_address{};
32}; 37};
33 38
34} // namespace Shader 39} // namespace Shader
diff --git a/src/shader_recompiler/file_environment.cpp b/src/shader_recompiler/file_environment.cpp
index 21700c72b..f2104f444 100644
--- a/src/shader_recompiler/file_environment.cpp
+++ b/src/shader_recompiler/file_environment.cpp
@@ -39,11 +39,11 @@ u64 FileEnvironment::ReadInstruction(u32 offset) {
39 return data[offset / 8]; 39 return data[offset / 8];
40} 40}
41 41
42u32 FileEnvironment::TextureBoundBuffer() { 42u32 FileEnvironment::TextureBoundBuffer() const {
43 throw NotImplementedException("Texture bound buffer serialization"); 43 throw NotImplementedException("Texture bound buffer serialization");
44} 44}
45 45
46std::array<u32, 3> FileEnvironment::WorkgroupSize() { 46std::array<u32, 3> FileEnvironment::WorkgroupSize() const {
47 return {1, 1, 1}; 47 return {1, 1, 1};
48} 48}
49 49
diff --git a/src/shader_recompiler/file_environment.h b/src/shader_recompiler/file_environment.h
index 62302bc8e..17640a622 100644
--- a/src/shader_recompiler/file_environment.h
+++ b/src/shader_recompiler/file_environment.h
@@ -14,9 +14,9 @@ public:
14 14
15 u64 ReadInstruction(u32 offset) override; 15 u64 ReadInstruction(u32 offset) override;
16 16
17 u32 TextureBoundBuffer() override; 17 u32 TextureBoundBuffer() const override;
18 18
19 std::array<u32, 3> WorkgroupSize() override; 19 std::array<u32, 3> WorkgroupSize() const override;
20 20
21private: 21private:
22 std::vector<u64> data; 22 std::vector<u64> data;
diff --git a/src/shader_recompiler/stage.h b/src/shader_recompiler/stage.h
index fc6ce6043..7d4f2c0bb 100644
--- a/src/shader_recompiler/stage.h
+++ b/src/shader_recompiler/stage.h
@@ -4,9 +4,11 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "common/common_types.h"
8
7namespace Shader { 9namespace Shader {
8 10
9enum class Stage { 11enum class Stage : u32 {
10 Compute, 12 Compute,
11 VertexA, 13 VertexA,
12 VertexB, 14 VertexB,