summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader_environment.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-06-24 07:41:09 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:39 +0200
commit7dafa96ab59892b7f1fbffdb61e4326e6443955f (patch)
tree5ab58d56860db635542ea1ec24be258bd86b40b9 /src/video_core/shader_environment.cpp
parentvk_graphics_pipeline: Implement conservative rendering (diff)
downloadyuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.tar
yuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.tar.gz
yuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.tar.bz2
yuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.tar.lz
yuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.tar.xz
yuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.tar.zst
yuzu-7dafa96ab59892b7f1fbffdb61e4326e6443955f.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/shader_environment.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/shader_environment.cpp b/src/video_core/shader_environment.cpp
index d463e2b56..429cab30d 100644
--- a/src/video_core/shader_environment.cpp
+++ b/src/video_core/shader_environment.cpp
@@ -22,7 +22,7 @@
namespace VideoCommon {
constexpr std::array<char, 8> MAGIC_NUMBER{'y', 'u', 'z', 'u', 'c', 'a', 'c', 'h'};
-constexpr u32 CACHE_VERSION = 4;
+constexpr u32 CACHE_VERSION = 5;
constexpr size_t INST_SIZE = sizeof(u64);
@@ -155,6 +155,10 @@ void GenericEnvironment::Serialize(std::ofstream& file) const {
.write(reinterpret_cast<const char*>(&shared_memory_size), sizeof(shared_memory_size));
} else {
file.write(reinterpret_cast<const char*>(&sph), sizeof(sph));
+ if (stage == Shader::Stage::Geometry) {
+ file.write(reinterpret_cast<const char*>(&gp_passthrough_mask),
+ sizeof(gp_passthrough_mask));
+ }
}
}
@@ -202,6 +206,7 @@ GraphicsEnvironment::GraphicsEnvironment(Tegra::Engines::Maxwell3D& maxwell3d_,
u32 start_address_)
: GenericEnvironment{gpu_memory_, program_base_, start_address_}, maxwell3d{&maxwell3d_} {
gpu_memory->ReadBlock(program_base + start_address, &sph, sizeof(sph));
+ gp_passthrough_mask = maxwell3d->regs.gp_passthrough_mask;
switch (program) {
case Maxwell::ShaderProgram::VertexA:
stage = Shader::Stage::VertexA;
@@ -319,6 +324,9 @@ void FileEnvironment::Deserialize(std::ifstream& file) {
.read(reinterpret_cast<char*>(&shared_memory_size), sizeof(shared_memory_size));
} else {
file.read(reinterpret_cast<char*>(&sph), sizeof(sph));
+ if (stage == Shader::Stage::Geometry) {
+ file.read(reinterpret_cast<char*>(&gp_passthrough_mask), sizeof(gp_passthrough_mask));
+ }
}
}