summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-03-26 23:46:46 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2019-04-08 17:23:47 +0200
commit90d06acfedb4c58b7b62153059c97b05035fc979 (patch)
treecc0ee31976198ade852f45cf45741f1e7ff1dfb2
parentImplement Bindless Handling on SetupTexture (diff)
downloadyuzu-90d06acfedb4c58b7b62153059c97b05035fc979.tar
yuzu-90d06acfedb4c58b7b62153059c97b05035fc979.tar.gz
yuzu-90d06acfedb4c58b7b62153059c97b05035fc979.tar.bz2
yuzu-90d06acfedb4c58b7b62153059c97b05035fc979.tar.lz
yuzu-90d06acfedb4c58b7b62153059c97b05035fc979.tar.xz
yuzu-90d06acfedb4c58b7b62153059c97b05035fc979.tar.zst
yuzu-90d06acfedb4c58b7b62153059c97b05035fc979.zip
-rw-r--r--src/video_core/const_buffer_accessor.cpp12
-rw-r--r--src/video_core/const_buffer_accessor.h5
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp3
3 files changed, 10 insertions, 10 deletions
diff --git a/src/video_core/const_buffer_accessor.cpp b/src/video_core/const_buffer_accessor.cpp
index c89ab91c7..0e613e1f9 100644
--- a/src/video_core/const_buffer_accessor.cpp
+++ b/src/video_core/const_buffer_accessor.cpp
@@ -14,21 +14,25 @@ namespace Tegra {
u32 ConstBufferAccessor::access32(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage,
u64 const_buffer, u64 offset) {
- auto& memory_manager = Core::System::GetInstance().GPU().MemoryManager();
+ auto& gpu = Core::System::GetInstance().GPU();
+ auto& memory_manager = gpu.MemoryManager();
+ auto& maxwell3d = gpu.Maxwell3D();
const auto& shader_stage = maxwell3d.state.shader_stages[static_cast<std::size_t>(stage)];
const auto& buffer = shader_stage.const_buffers[const_buffer];
u32 result;
- std::memcpy(&result, memory_manager.GetPointer(buffer.address + offset * 4), sizeof(u32));
+ std::memcpy(&result, memory_manager.GetPointer(buffer.address + offset), sizeof(u32));
return result;
}
u64 ConstBufferAccessor::access64(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage,
u64 const_buffer, u64 offset) {
- auto& memory_manager = Core::System::GetInstance().GPU().MemoryManager();
+ auto& gpu = Core::System::GetInstance().GPU();
+ auto& memory_manager = gpu.MemoryManager();
+ auto& maxwell3d = gpu.Maxwell3D();
const auto& shader_stage = maxwell3d.state.shader_stages[static_cast<std::size_t>(stage)];
const auto& buffer = shader_stage.const_buffers[const_buffer];
u64 result;
- std::memcpy(&result, memory_manager.GetPointer(buffer.address + offset * 4), sizeof(u64));
+ std::memcpy(&result, memory_manager.GetPointer(buffer.address + offset), sizeof(u64));
return result;
}
diff --git a/src/video_core/const_buffer_accessor.h b/src/video_core/const_buffer_accessor.h
index 2410f1483..37d1ca767 100644
--- a/src/video_core/const_buffer_accessor.h
+++ b/src/video_core/const_buffer_accessor.h
@@ -7,15 +7,12 @@ namespace Tegra {
class ConstBufferAccessor {
public:
- ConstBufferAccessor(Tegra::Engines::Maxwell3D& maxwell3d) : maxwell3d(maxwell3d) {}
+ ConstBufferAccessor() {}
~ConstBufferAccessor() = default;
u32 access32(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage, u64 const_buffer, u64 offset);
u64 access64(Tegra::Engines::Maxwell3D::Regs::ShaderStage stage, u64 const_buffer, u64 offset);
-
-private:
- Tegra::Engines::Maxwell3D& maxwell3d;
};
} // namespace Tegra
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index a20acfe8e..e847b75fb 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -101,8 +101,7 @@ struct FramebufferCacheKey {
RasterizerOpenGL::RasterizerOpenGL(Core::Frontend::EmuWindow& window, Core::System& system,
ScreenInfo& info)
: res_cache{*this}, shader_cache{*this, system}, global_cache{*this}, system{system},
- screen_info{info}, buffer_cache(*this, STREAM_BUFFER_SIZE),
- const_buffer_accessor(system.GPU().Maxwell3D()) {
+ screen_info{info}, buffer_cache(*this, STREAM_BUFFER_SIZE), const_buffer_accessor() {
// Create sampler objects
for (std::size_t i = 0; i < texture_samplers.size(); ++i) {
texture_samplers[i].Create();