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.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/video_core/shader_environment.cpp b/src/video_core/shader_environment.cpp
index fbabb3219..63bcf9337 100644
--- a/src/video_core/shader_environment.cpp
+++ b/src/video_core/shader_environment.cpp
@@ -188,6 +188,8 @@ void GenericEnvironment::Serialize(std::ofstream& file) const {
188 .write(reinterpret_cast<const char*>(&start_address), sizeof(start_address)) 188 .write(reinterpret_cast<const char*>(&start_address), sizeof(start_address))
189 .write(reinterpret_cast<const char*>(&cached_lowest), sizeof(cached_lowest)) 189 .write(reinterpret_cast<const char*>(&cached_lowest), sizeof(cached_lowest))
190 .write(reinterpret_cast<const char*>(&cached_highest), sizeof(cached_highest)) 190 .write(reinterpret_cast<const char*>(&cached_highest), sizeof(cached_highest))
191 .write(reinterpret_cast<const char*>(&viewport_transform_state),
192 sizeof(viewport_transform_state))
191 .write(reinterpret_cast<const char*>(&stage), sizeof(stage)) 193 .write(reinterpret_cast<const char*>(&stage), sizeof(stage))
192 .write(reinterpret_cast<const char*>(code.data()), code_size); 194 .write(reinterpret_cast<const char*>(code.data()), code_size);
193 for (const auto& [key, type] : texture_types) { 195 for (const auto& [key, type] : texture_types) {
@@ -309,6 +311,12 @@ Shader::TextureType GraphicsEnvironment::ReadTextureType(u32 handle) {
309 handle); 311 handle);
310} 312}
311 313
314u32 GraphicsEnvironment::ReadViewportTransformState() {
315 const auto& regs{maxwell3d->regs};
316 viewport_transform_state = regs.viewport_transform_enabled;
317 return viewport_transform_state;
318}
319
312ComputeEnvironment::ComputeEnvironment(Tegra::Engines::KeplerCompute& kepler_compute_, 320ComputeEnvironment::ComputeEnvironment(Tegra::Engines::KeplerCompute& kepler_compute_,
313 Tegra::MemoryManager& gpu_memory_, GPUVAddr program_base_, 321 Tegra::MemoryManager& gpu_memory_, GPUVAddr program_base_,
314 u32 start_address_) 322 u32 start_address_)
@@ -340,6 +348,10 @@ Shader::TextureType ComputeEnvironment::ReadTextureType(u32 handle) {
340 return ReadTextureTypeImpl(regs.tic.Address(), regs.tic.limit, qmd.linked_tsc != 0, handle); 348 return ReadTextureTypeImpl(regs.tic.Address(), regs.tic.limit, qmd.linked_tsc != 0, handle);
341} 349}
342 350
351u32 ComputeEnvironment::ReadViewportTransformState() {
352 return viewport_transform_state;
353}
354
343void FileEnvironment::Deserialize(std::ifstream& file) { 355void FileEnvironment::Deserialize(std::ifstream& file) {
344 u64 code_size{}; 356 u64 code_size{};
345 u64 num_texture_types{}; 357 u64 num_texture_types{};
@@ -352,6 +364,7 @@ void FileEnvironment::Deserialize(std::ifstream& file) {
352 .read(reinterpret_cast<char*>(&start_address), sizeof(start_address)) 364 .read(reinterpret_cast<char*>(&start_address), sizeof(start_address))
353 .read(reinterpret_cast<char*>(&read_lowest), sizeof(read_lowest)) 365 .read(reinterpret_cast<char*>(&read_lowest), sizeof(read_lowest))
354 .read(reinterpret_cast<char*>(&read_highest), sizeof(read_highest)) 366 .read(reinterpret_cast<char*>(&read_highest), sizeof(read_highest))
367 .read(reinterpret_cast<char*>(&viewport_transform_state), sizeof(viewport_transform_state))
355 .read(reinterpret_cast<char*>(&stage), sizeof(stage)); 368 .read(reinterpret_cast<char*>(&stage), sizeof(stage));
356 code = std::make_unique<u64[]>(Common::DivCeil(code_size, sizeof(u64))); 369 code = std::make_unique<u64[]>(Common::DivCeil(code_size, sizeof(u64)));
357 file.read(reinterpret_cast<char*>(code.get()), code_size); 370 file.read(reinterpret_cast<char*>(code.get()), code_size);
@@ -409,6 +422,10 @@ Shader::TextureType FileEnvironment::ReadTextureType(u32 handle) {
409 return it->second; 422 return it->second;
410} 423}
411 424
425u32 FileEnvironment::ReadViewportTransformState() {
426 return viewport_transform_state;
427}
428
412u32 FileEnvironment::LocalMemorySize() const { 429u32 FileEnvironment::LocalMemorySize() const {
413 return local_memory_size; 430 return local_memory_size;
414} 431}