summaryrefslogtreecommitdiff
path: root/src/video_core/shader_environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/shader_environment.cpp')
-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 @@
22namespace VideoCommon { 22namespace VideoCommon {
23 23
24constexpr std::array<char, 8> MAGIC_NUMBER{'y', 'u', 'z', 'u', 'c', 'a', 'c', 'h'}; 24constexpr std::array<char, 8> MAGIC_NUMBER{'y', 'u', 'z', 'u', 'c', 'a', 'c', 'h'};
25constexpr u32 CACHE_VERSION = 4; 25constexpr u32 CACHE_VERSION = 5;
26 26
27constexpr size_t INST_SIZE = sizeof(u64); 27constexpr size_t INST_SIZE = sizeof(u64);
28 28
@@ -155,6 +155,10 @@ void GenericEnvironment::Serialize(std::ofstream& file) const {
155 .write(reinterpret_cast<const char*>(&shared_memory_size), sizeof(shared_memory_size)); 155 .write(reinterpret_cast<const char*>(&shared_memory_size), sizeof(shared_memory_size));
156 } else { 156 } else {
157 file.write(reinterpret_cast<const char*>(&sph), sizeof(sph)); 157 file.write(reinterpret_cast<const char*>(&sph), sizeof(sph));
158 if (stage == Shader::Stage::Geometry) {
159 file.write(reinterpret_cast<const char*>(&gp_passthrough_mask),
160 sizeof(gp_passthrough_mask));
161 }
158 } 162 }
159} 163}
160 164
@@ -202,6 +206,7 @@ GraphicsEnvironment::GraphicsEnvironment(Tegra::Engines::Maxwell3D& maxwell3d_,
202 u32 start_address_) 206 u32 start_address_)
203 : GenericEnvironment{gpu_memory_, program_base_, start_address_}, maxwell3d{&maxwell3d_} { 207 : GenericEnvironment{gpu_memory_, program_base_, start_address_}, maxwell3d{&maxwell3d_} {
204 gpu_memory->ReadBlock(program_base + start_address, &sph, sizeof(sph)); 208 gpu_memory->ReadBlock(program_base + start_address, &sph, sizeof(sph));
209 gp_passthrough_mask = maxwell3d->regs.gp_passthrough_mask;
205 switch (program) { 210 switch (program) {
206 case Maxwell::ShaderProgram::VertexA: 211 case Maxwell::ShaderProgram::VertexA:
207 stage = Shader::Stage::VertexA; 212 stage = Shader::Stage::VertexA;
@@ -319,6 +324,9 @@ void FileEnvironment::Deserialize(std::ifstream& file) {
319 .read(reinterpret_cast<char*>(&shared_memory_size), sizeof(shared_memory_size)); 324 .read(reinterpret_cast<char*>(&shared_memory_size), sizeof(shared_memory_size));
320 } else { 325 } else {
321 file.read(reinterpret_cast<char*>(&sph), sizeof(sph)); 326 file.read(reinterpret_cast<char*>(&sph), sizeof(sph));
327 if (stage == Shader::Stage::Geometry) {
328 file.read(reinterpret_cast<char*>(&gp_passthrough_mask), sizeof(gp_passthrough_mask));
329 }
322 } 330 }
323} 331}
324 332