diff options
| author | 2019-12-30 00:43:15 -0300 | |
|---|---|---|
| committer | 2020-02-28 17:56:42 -0300 | |
| commit | b727d99441e20893faf24410947e158c8faf2d09 (patch) | |
| tree | d470580b76aefd39e43bed932bc1817a5de11817 /src | |
| parent | gl_state_tracker: Implement dirty flags for alpha testing (diff) | |
| download | yuzu-b727d99441e20893faf24410947e158c8faf2d09.tar.gz yuzu-b727d99441e20893faf24410947e158c8faf2d09.tar.xz yuzu-b727d99441e20893faf24410947e158c8faf2d09.zip | |
gl_state_tracker: Implement dirty flags for multisample
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state_tracker.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state_tracker.h | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 5949f53ab..e4875608a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1130,6 +1130,13 @@ void RasterizerOpenGL::SyncColorMask() { | |||
| 1130 | } | 1130 | } |
| 1131 | 1131 | ||
| 1132 | void RasterizerOpenGL::SyncMultiSampleState() { | 1132 | void RasterizerOpenGL::SyncMultiSampleState() { |
| 1133 | auto& gpu = system.GPU().Maxwell3D(); | ||
| 1134 | auto& flags = gpu.dirty.flags; | ||
| 1135 | if (!flags[Dirty::MultisampleControl]) { | ||
| 1136 | return; | ||
| 1137 | } | ||
| 1138 | flags[Dirty::MultisampleControl] = false; | ||
| 1139 | |||
| 1133 | const auto& regs = system.GPU().Maxwell3D().regs; | 1140 | const auto& regs = system.GPU().Maxwell3D().regs; |
| 1134 | oglEnable(GL_SAMPLE_ALPHA_TO_COVERAGE, regs.multisample_control.alpha_to_coverage); | 1141 | oglEnable(GL_SAMPLE_ALPHA_TO_COVERAGE, regs.multisample_control.alpha_to_coverage); |
| 1135 | oglEnable(GL_SAMPLE_ALPHA_TO_ONE, regs.multisample_control.alpha_to_one); | 1142 | oglEnable(GL_SAMPLE_ALPHA_TO_ONE, regs.multisample_control.alpha_to_one); |
diff --git a/src/video_core/renderer_opengl/gl_state_tracker.cpp b/src/video_core/renderer_opengl/gl_state_tracker.cpp index 314d6f14d..c979046a3 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.cpp +++ b/src/video_core/renderer_opengl/gl_state_tracker.cpp | |||
| @@ -185,6 +185,10 @@ void SetupDirtyPolygonOffset(Tables& tables) { | |||
| 185 | table[OFF(polygon_offset_clamp)] = PolygonOffset; | 185 | table[OFF(polygon_offset_clamp)] = PolygonOffset; |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | void SetupDirtyMultisampleControl(Tables& tables) { | ||
| 189 | FillBlock(tables[0], OFF(multisample_control), NUM(multisample_control), MultisampleControl); | ||
| 190 | } | ||
| 191 | |||
| 188 | void SetupDirtyMisc(Tables& tables) { | 192 | void SetupDirtyMisc(Tables& tables) { |
| 189 | auto& table = tables[0]; | 193 | auto& table = tables[0]; |
| 190 | 194 | ||
| @@ -216,6 +220,7 @@ void StateTracker::Initialize() { | |||
| 216 | SetupDirtyBlend(tables); | 220 | SetupDirtyBlend(tables); |
| 217 | SetupDirtyPrimitiveRestart(tables); | 221 | SetupDirtyPrimitiveRestart(tables); |
| 218 | SetupDirtyPolygonOffset(tables); | 222 | SetupDirtyPolygonOffset(tables); |
| 223 | SetupDirtyMultisampleControl(tables); | ||
| 219 | SetupDirtyMisc(tables); | 224 | SetupDirtyMisc(tables); |
| 220 | 225 | ||
| 221 | auto& store = dirty.on_write_stores; | 226 | auto& store = dirty.on_write_stores; |
diff --git a/src/video_core/renderer_opengl/gl_state_tracker.h b/src/video_core/renderer_opengl/gl_state_tracker.h index bef4e6ce6..afa8efc28 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.h +++ b/src/video_core/renderer_opengl/gl_state_tracker.h | |||
| @@ -65,6 +65,7 @@ enum : u8 { | |||
| 65 | AlphaTest, | 65 | AlphaTest, |
| 66 | PrimitiveRestart, | 66 | PrimitiveRestart, |
| 67 | PolygonOffset, | 67 | PolygonOffset, |
| 68 | MultisampleControl, | ||
| 68 | 69 | ||
| 69 | Last | 70 | Last |
| 70 | }; | 71 | }; |