diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-06-24 02:41:09 -0300 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-22 21:51:39 -0400 |
commit | 7dafa96ab59892b7f1fbffdb61e4326e6443955f (patch) | |
tree | 5ab58d56860db635542ea1ec24be258bd86b40b9 /src/video_core/shader_environment.cpp | |
parent | 4f052a1f393d45843eabc237e21757be15f20062 (diff) |
shader: Rework varyings and implement passthrough geometry shaders
Put all varyings into a single std::bitset with helpers to access it.
Implement passthrough geometry shaders using host's.
Diffstat (limited to 'src/video_core/shader_environment.cpp')
-rw-r--r-- | src/video_core/shader_environment.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/shader_environment.cpp b/src/video_core/shader_environment.cpp index d463e2b560..429cab30de 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)); + } } } |