summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2018-09-11 03:00:55 +0200
committerFernandoS27 <fsahmkow27@gmail.com>2018-09-11 18:34:27 +0200
commite926757c8f7d8d1fc90e62c2b891a65fe1119173 (patch)
treeff73d819e09b1aa8172dc7f5420a98c109286270 /src/video_core/renderer_opengl
parentMerge pull request #1291 from lioncash/default (diff)
downloadyuzu-e926757c8f7d8d1fc90e62c2b891a65fe1119173.tar
yuzu-e926757c8f7d8d1fc90e62c2b891a65fe1119173.tar.gz
yuzu-e926757c8f7d8d1fc90e62c2b891a65fe1119173.tar.bz2
yuzu-e926757c8f7d8d1fc90e62c2b891a65fe1119173.tar.lz
yuzu-e926757c8f7d8d1fc90e62c2b891a65fe1119173.tar.xz
yuzu-e926757c8f7d8d1fc90e62c2b891a65fe1119173.tar.zst
yuzu-e926757c8f7d8d1fc90e62c2b891a65fe1119173.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index e350113f1..d826d98eb 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -12,6 +12,7 @@
#include "common/assert.h"
#include "common/common_types.h"
#include "video_core/engines/shader_bytecode.h"
+#include "video_core/engines/shader_header.h"
#include "video_core/renderer_opengl/gl_rasterizer.h"
#include "video_core/renderer_opengl/gl_shader_decompiler.h"
@@ -26,7 +27,7 @@ using Tegra::Shader::Sampler;
using Tegra::Shader::SubOp;
constexpr u32 PROGRAM_END = MAX_PROGRAM_CODE_LENGTH;
-constexpr u32 PROGRAM_HEADER_SIZE = 0x50;
+constexpr u32 PROGRAM_HEADER_SIZE = sizeof(Tegra::Shader::Header);
class DecompileFail : public std::runtime_error {
public:
@@ -674,7 +675,7 @@ public:
u32 main_offset, Maxwell3D::Regs::ShaderStage stage, const std::string& suffix)
: subroutines(subroutines), program_code(program_code), main_offset(main_offset),
stage(stage), suffix(suffix) {
-
+ std::memcpy(&header, program_code.data(), sizeof(Tegra::Shader::Header));
Generate(suffix);
}
@@ -2502,6 +2503,7 @@ private:
private:
const std::set<Subroutine>& subroutines;
const ProgramCode& program_code;
+ Tegra::Shader::Header header;
const u32 main_offset;
Maxwell3D::Regs::ShaderStage stage;
const std::string& suffix;