diff options
Diffstat (limited to 'src')
4 files changed, 17 insertions, 13 deletions
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp index c85fbd306..0b5d18bcb 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp @@ -2,8 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <cstring> +#include <memory> + #include "common/alignment.h" -#include "common/assert.h" #include "core/core.h" #include "core/memory.h" #include "video_core/renderer_opengl/gl_buffer_cache.h" @@ -75,7 +77,7 @@ void OGLBufferCache::Unmap() { stream_buffer.Unmap(buffer_offset - buffer_offset_base); } -GLuint OGLBufferCache::GetHandle() { +GLuint OGLBufferCache::GetHandle() const { return stream_buffer.GetHandle(); } diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.h b/src/video_core/renderer_opengl/gl_buffer_cache.h index 9c7ad27e6..6da862902 100644 --- a/src/video_core/renderer_opengl/gl_buffer_cache.h +++ b/src/video_core/renderer_opengl/gl_buffer_cache.h @@ -4,8 +4,8 @@ #pragma once +#include <cstddef> #include <memory> -#include <unordered_map> #include "common/common_types.h" #include "video_core/rasterizer_cache.h" @@ -31,7 +31,7 @@ struct CachedBufferEntry final { class OGLBufferCache final : public RasterizerCache<std::shared_ptr<CachedBufferEntry>> { public: - OGLBufferCache(size_t size); + explicit OGLBufferCache(size_t size); GLintptr UploadMemory(Tegra::GPUVAddr gpu_addr, size_t size, size_t alignment = 4, bool cache = true); @@ -41,7 +41,7 @@ public: void Map(size_t max_size); void Unmap(); - GLuint GetHandle(); + GLuint GetHandle() const; protected: void AlignBuffer(size_t alignment); @@ -49,9 +49,9 @@ protected: private: OGLStreamBuffer stream_buffer; - u8* buffer_ptr; - GLintptr buffer_offset; - GLintptr buffer_offset_base; + u8* buffer_ptr = nullptr; + GLintptr buffer_offset = 0; + GLintptr buffer_offset_base = 0; }; } // namespace OpenGL diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 5d493a2b2..6e89fa6e3 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -237,6 +237,8 @@ void RasterizerOpenGL::SetupShaders() { } } + state.Apply(); + shader_program_manager->UseTrivialGeometryShader(); } @@ -666,8 +668,6 @@ u32 RasterizerOpenGL::SetupConstBuffers(Maxwell::ShaderStage stage, Shader& shad current_bindpoint + bindpoint); } - state.Apply(); - return current_bindpoint + static_cast<u32>(entries.size()); } @@ -714,8 +714,6 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, Shader& shader, } } - state.Apply(); - return current_unit + static_cast<u32>(entries.size()); } diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 781ddb073..841647ebe 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -2197,11 +2197,15 @@ private: case OpCode::Id::IPA: { const auto& attribute = instr.attribute.fmt28; const auto& reg = instr.gpr0; - ASSERT_MSG(instr.ipa.saturate == 0, "IPA saturate not implemented"); + Tegra::Shader::IpaMode input_mode{instr.ipa.interp_mode.Value(), instr.ipa.sample_mode.Value()}; regs.SetRegisterToInputAttibute(reg, attribute.element, attribute.index, input_mode); + + if (instr.ipa.saturate) { + regs.SetRegisterToFloat(reg, 0, regs.GetRegisterAsFloat(reg), 1, 1, true); + } break; } case OpCode::Id::SSY: { |