diff options
author | Mat M <mathew1800@gmail.com> | 2020-04-13 16:19:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-13 16:19:59 +0200 |
commit | fbf13d3f48c1a75edbdf1a33bc5f29c1483a5099 (patch) | |
tree | 321ded876262082f12dfeab470589c3cfc64ac2d /src/video_core/renderer_opengl/gl_rasterizer.cpp | |
parent | Merge pull request #3638 from ReinUsesLisp/remove-preserve-contents (diff) | |
parent | gl_rasterizer: Implement line widths and smooth lines (diff) | |
download | yuzu-fbf13d3f48c1a75edbdf1a33bc5f29c1483a5099.tar yuzu-fbf13d3f48c1a75edbdf1a33bc5f29c1483a5099.tar.gz yuzu-fbf13d3f48c1a75edbdf1a33bc5f29c1483a5099.tar.bz2 yuzu-fbf13d3f48c1a75edbdf1a33bc5f29c1483a5099.tar.lz yuzu-fbf13d3f48c1a75edbdf1a33bc5f29c1483a5099.tar.xz yuzu-fbf13d3f48c1a75edbdf1a33bc5f29c1483a5099.tar.zst yuzu-fbf13d3f48c1a75edbdf1a33bc5f29c1483a5099.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index c6ff4e27f..f31d960c7 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -496,6 +496,7 @@ void RasterizerOpenGL::Draw(bool is_indexed, bool is_instanced) { SyncPrimitiveRestart(); SyncScissorTest(); SyncPointState(); + SyncLineState(); SyncPolygonOffset(); SyncAlphaTest(); SyncFramebufferSRGB(); @@ -1311,6 +1312,19 @@ void RasterizerOpenGL::SyncPointState() { glDisable(GL_PROGRAM_POINT_SIZE); } +void RasterizerOpenGL::SyncLineState() { + auto& gpu = system.GPU().Maxwell3D(); + auto& flags = gpu.dirty.flags; + if (!flags[Dirty::LineWidth]) { + return; + } + flags[Dirty::LineWidth] = false; + + const auto& regs = gpu.regs; + oglEnable(GL_LINE_SMOOTH, regs.line_smooth_enable); + glLineWidth(regs.line_smooth_enable ? regs.line_width_smooth : regs.line_width_aliased); +} + void RasterizerOpenGL::SyncPolygonOffset() { auto& gpu = system.GPU().Maxwell3D(); auto& flags = gpu.dirty.flags; |