summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-02-01 19:24:04 +0100
committerGitHub <noreply@github.com>2019-02-01 19:24:04 +0100
commiteceab45dac2b67392a896fa322af15e6aa81c242 (patch)
treeefe4c76ad073669099073c556201fb7c456807f2 /src/video_core/renderer_opengl
parentMerge pull request #2073 from lioncash/opus (diff)
parentshader_ir: Unify constant buffer offset values (diff)
downloadyuzu-eceab45dac2b67392a896fa322af15e6aa81c242.tar
yuzu-eceab45dac2b67392a896fa322af15e6aa81c242.tar.gz
yuzu-eceab45dac2b67392a896fa322af15e6aa81c242.tar.bz2
yuzu-eceab45dac2b67392a896fa322af15e6aa81c242.tar.lz
yuzu-eceab45dac2b67392a896fa322af15e6aa81c242.tar.xz
yuzu-eceab45dac2b67392a896fa322af15e6aa81c242.tar.zst
yuzu-eceab45dac2b67392a896fa322af15e6aa81c242.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index e3163389f..9f7c837d6 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -954,7 +954,7 @@ void RasterizerOpenGL::SetupConstBuffers(Tegra::Engines::Maxwell3D::Regs::Shader
}
} else {
// Buffer is accessed directly, upload just what we use
- size = used_buffer.GetSize() * sizeof(float);
+ size = used_buffer.GetSize();
}
// Align the actual size so it ends up being a multiple of vec4 to meet the OpenGL std140
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 004245431..36035d0d2 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -543,8 +543,9 @@ private:
if (const auto immediate = std::get_if<ImmediateNode>(offset)) {
// Direct access
const u32 offset_imm = immediate->GetValue();
- return fmt::format("{}[{}][{}]", GetConstBuffer(cbuf->GetIndex()), offset_imm / 4,
- offset_imm % 4);
+ ASSERT_MSG(offset_imm % 4 == 0, "Unaligned cbuf direct access");
+ return fmt::format("{}[{}][{}]", GetConstBuffer(cbuf->GetIndex()),
+ offset_imm / (4 * 4), (offset_imm / 4) % 4);
} else if (std::holds_alternative<OperationNode>(*offset)) {
// Indirect access