diff options
| author | 2020-03-02 01:08:10 -0300 | |
|---|---|---|
| committer | 2020-03-09 18:40:53 -0300 | |
| commit | b1acb4f73f79a555480d1405bc9732cab111f6e2 (patch) | |
| tree | e4f98cd81bbc476a88481151550cd6a515c3dd45 /src | |
| parent | gl_shader_decompiler: Add identifier to decompiled code (diff) | |
| download | yuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.tar.gz yuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.tar.xz yuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.zip | |
shader/registry: Address feedback
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/shader/registry.cpp | 11 | ||||
| -rw-r--r-- | src/video_core/shader/registry.h | 18 |
3 files changed, 18 insertions, 13 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index cb89daba1..0108e708c 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -57,7 +57,7 @@ using TextureIR = std::variant<TextureOffset, TextureDerivates, TextureArgument> | |||
| 57 | constexpr u32 MAX_CONSTBUFFER_ELEMENTS = | 57 | constexpr u32 MAX_CONSTBUFFER_ELEMENTS = |
| 58 | static_cast<u32>(Maxwell::MaxConstBufferSize) / (4 * sizeof(float)); | 58 | static_cast<u32>(Maxwell::MaxConstBufferSize) / (4 * sizeof(float)); |
| 59 | 59 | ||
| 60 | std::string_view CommonDeclarations = R"(#define ftoi floatBitsToInt | 60 | constexpr std::string_view CommonDeclarations = R"(#define ftoi floatBitsToInt |
| 61 | #define ftou floatBitsToUint | 61 | #define ftou floatBitsToUint |
| 62 | #define itof intBitsToFloat | 62 | #define itof intBitsToFloat |
| 63 | #define utof uintBitsToFloat | 63 | #define utof uintBitsToFloat |
diff --git a/src/video_core/shader/registry.cpp b/src/video_core/shader/registry.cpp index 90dfab293..4a1e16c1e 100644 --- a/src/video_core/shader/registry.cpp +++ b/src/video_core/shader/registry.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <tuple> | 6 | #include <tuple> |
| 7 | 7 | ||
| 8 | #include "common/assert.h" | ||
| 8 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 9 | #include "video_core/engines/kepler_compute.h" | 10 | #include "video_core/engines/kepler_compute.h" |
| 10 | #include "video_core/engines/maxwell_3d.h" | 11 | #include "video_core/engines/maxwell_3d.h" |
| @@ -144,4 +145,14 @@ bool Registry::HasEqualKeys(const Registry& rhs) const { | |||
| 144 | std::tie(rhs.keys, rhs.bound_samplers, rhs.bindless_samplers); | 145 | std::tie(rhs.keys, rhs.bound_samplers, rhs.bindless_samplers); |
| 145 | } | 146 | } |
| 146 | 147 | ||
| 148 | const GraphicsInfo& Registry::GetGraphicsInfo() const { | ||
| 149 | ASSERT(stage != Tegra::Engines::ShaderType::Compute); | ||
| 150 | return graphics_info; | ||
| 151 | } | ||
| 152 | |||
| 153 | const ComputeInfo& Registry::GetComputeInfo() const { | ||
| 154 | ASSERT(stage == Tegra::Engines::ShaderType::Compute); | ||
| 155 | return compute_info; | ||
| 156 | } | ||
| 157 | |||
| 147 | } // namespace VideoCommon::Shader | 158 | } // namespace VideoCommon::Shader |
diff --git a/src/video_core/shader/registry.h b/src/video_core/shader/registry.h index 7b7fad3d1..07998c4db 100644 --- a/src/video_core/shader/registry.h +++ b/src/video_core/shader/registry.h | |||
| @@ -85,6 +85,12 @@ public: | |||
| 85 | /// Returns true if the keys are equal to the other ones in the registry. | 85 | /// Returns true if the keys are equal to the other ones in the registry. |
| 86 | bool HasEqualKeys(const Registry& rhs) const; | 86 | bool HasEqualKeys(const Registry& rhs) const; |
| 87 | 87 | ||
| 88 | /// Returns graphics information from this shader | ||
| 89 | const GraphicsInfo& GetGraphicsInfo() const; | ||
| 90 | |||
| 91 | /// Returns compute information from this shader | ||
| 92 | const ComputeInfo& GetComputeInfo() const; | ||
| 93 | |||
| 88 | /// Gives an getter to the const buffer keys in the database. | 94 | /// Gives an getter to the const buffer keys in the database. |
| 89 | const KeyMap& GetKeys() const { | 95 | const KeyMap& GetKeys() const { |
| 90 | return keys; | 96 | return keys; |
| @@ -105,18 +111,6 @@ public: | |||
| 105 | return bound_buffer; | 111 | return bound_buffer; |
| 106 | } | 112 | } |
| 107 | 113 | ||
| 108 | /// Returns compute information from this shader | ||
| 109 | const GraphicsInfo& GetGraphicsInfo() const { | ||
| 110 | ASSERT(stage != Tegra::Engines::ShaderType::Compute); | ||
| 111 | return graphics_info; | ||
| 112 | } | ||
| 113 | |||
| 114 | /// Returns compute information from this shader | ||
| 115 | const ComputeInfo& GetComputeInfo() const { | ||
| 116 | ASSERT(stage == Tegra::Engines::ShaderType::Compute); | ||
| 117 | return compute_info; | ||
| 118 | } | ||
| 119 | |||
| 120 | /// Obtains access to the guest driver's profile. | 114 | /// Obtains access to the guest driver's profile. |
| 121 | VideoCore::GuestDriverProfile& AccessGuestDriverProfile() { | 115 | VideoCore::GuestDriverProfile& AccessGuestDriverProfile() { |
| 122 | return engine ? engine->AccessGuestDriverProfile() : stored_guest_driver_profile; | 116 | return engine ? engine->AccessGuestDriverProfile() : stored_guest_driver_profile; |