summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-03-02 05:08:10 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-03-09 22:40:53 +0100
commitb1acb4f73f79a555480d1405bc9732cab111f6e2 (patch)
treee4f98cd81bbc476a88481151550cd6a515c3dd45 /src/video_core
parentgl_shader_decompiler: Add identifier to decompiled code (diff)
downloadyuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.tar
yuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.tar.gz
yuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.tar.bz2
yuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.tar.lz
yuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.tar.xz
yuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.tar.zst
yuzu-b1acb4f73f79a555480d1405bc9732cab111f6e2.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp2
-rw-r--r--src/video_core/shader/registry.cpp11
-rw-r--r--src/video_core/shader/registry.h18
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>
constexpr u32 MAX_CONSTBUFFER_ELEMENTS =
static_cast<u32>(Maxwell::MaxConstBufferSize) / (4 * sizeof(float));
-std::string_view CommonDeclarations = R"(#define ftoi floatBitsToInt
+constexpr std::string_view CommonDeclarations = R"(#define ftoi floatBitsToInt
#define ftou floatBitsToUint
#define itof intBitsToFloat
#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 @@
#include <algorithm>
#include <tuple>
+#include "common/assert.h"
#include "common/common_types.h"
#include "video_core/engines/kepler_compute.h"
#include "video_core/engines/maxwell_3d.h"
@@ -144,4 +145,14 @@ bool Registry::HasEqualKeys(const Registry& rhs) const {
std::tie(rhs.keys, rhs.bound_samplers, rhs.bindless_samplers);
}
+const GraphicsInfo& Registry::GetGraphicsInfo() const {
+ ASSERT(stage != Tegra::Engines::ShaderType::Compute);
+ return graphics_info;
+}
+
+const ComputeInfo& Registry::GetComputeInfo() const {
+ ASSERT(stage == Tegra::Engines::ShaderType::Compute);
+ return compute_info;
+}
+
} // 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:
/// Returns true if the keys are equal to the other ones in the registry.
bool HasEqualKeys(const Registry& rhs) const;
+ /// Returns graphics information from this shader
+ const GraphicsInfo& GetGraphicsInfo() const;
+
+ /// Returns compute information from this shader
+ const ComputeInfo& GetComputeInfo() const;
+
/// Gives an getter to the const buffer keys in the database.
const KeyMap& GetKeys() const {
return keys;
@@ -105,18 +111,6 @@ public:
return bound_buffer;
}
- /// Returns compute information from this shader
- const GraphicsInfo& GetGraphicsInfo() const {
- ASSERT(stage != Tegra::Engines::ShaderType::Compute);
- return graphics_info;
- }
-
- /// Returns compute information from this shader
- const ComputeInfo& GetComputeInfo() const {
- ASSERT(stage == Tegra::Engines::ShaderType::Compute);
- return compute_info;
- }
-
/// Obtains access to the guest driver's profile.
VideoCore::GuestDriverProfile& AccessGuestDriverProfile() {
return engine ? engine->AccessGuestDriverProfile() : stored_guest_driver_profile;