diff options
| author | 2019-12-30 01:20:08 -0300 | |
|---|---|---|
| committer | 2020-02-28 17:56:42 -0300 | |
| commit | 231601763c4717f8d7978341994a479e4283fa3d (patch) | |
| tree | 2728608710280f5ca4cb24948bf195ebe3f2d540 /src | |
| parent | gl_state_tracker: Implement dirty flags for logic op (diff) | |
| download | yuzu-231601763c4717f8d7978341994a479e4283fa3d.tar.gz yuzu-231601763c4717f8d7978341994a479e4283fa3d.tar.xz yuzu-231601763c4717f8d7978341994a479e4283fa3d.zip | |
gl_state_tracker: Implement dirty flags for fragment color clamp
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 | ||||
| -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, 14 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 4cb050da6..7ffb8fa09 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1149,8 +1149,14 @@ void RasterizerOpenGL::SyncMultiSampleState() { | |||
| 1149 | } | 1149 | } |
| 1150 | 1150 | ||
| 1151 | void RasterizerOpenGL::SyncFragmentColorClampState() { | 1151 | void RasterizerOpenGL::SyncFragmentColorClampState() { |
| 1152 | const auto& regs = system.GPU().Maxwell3D().regs; | 1152 | auto& gpu = system.GPU().Maxwell3D(); |
| 1153 | glClampColor(GL_CLAMP_FRAGMENT_COLOR, regs.frag_color_clamp ? GL_TRUE : GL_FALSE); | 1153 | auto& flags = gpu.dirty.flags; |
| 1154 | if (!flags[Dirty::FragmentClampColor]) { | ||
| 1155 | return; | ||
| 1156 | } | ||
| 1157 | flags[Dirty::FragmentClampColor] = false; | ||
| 1158 | |||
| 1159 | glClampColor(GL_CLAMP_FRAGMENT_COLOR, gpu.regs.frag_color_clamp ? GL_TRUE : GL_FALSE); | ||
| 1154 | } | 1160 | } |
| 1155 | 1161 | ||
| 1156 | void RasterizerOpenGL::SyncBlendState() { | 1162 | void RasterizerOpenGL::SyncBlendState() { |
diff --git a/src/video_core/renderer_opengl/gl_state_tracker.cpp b/src/video_core/renderer_opengl/gl_state_tracker.cpp index d6ad25ee9..538ab97e0 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.cpp +++ b/src/video_core/renderer_opengl/gl_state_tracker.cpp | |||
| @@ -201,6 +201,10 @@ void SetupDirtyLogicOp(Tables& tables) { | |||
| 201 | FillBlock(tables[0], OFF(logic_op), NUM(logic_op), LogicOp); | 201 | FillBlock(tables[0], OFF(logic_op), NUM(logic_op), LogicOp); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | void SetupDirtyFragmentClampColor(Tables& tables) { | ||
| 205 | tables[0][OFF(frag_color_clamp)] = FragmentClampColor; | ||
| 206 | } | ||
| 207 | |||
| 204 | void SetupDirtyMisc(Tables& tables) { | 208 | void SetupDirtyMisc(Tables& tables) { |
| 205 | auto& table = tables[0]; | 209 | auto& table = tables[0]; |
| 206 | 210 | ||
| @@ -236,6 +240,7 @@ void StateTracker::Initialize() { | |||
| 236 | SetupDirtyRasterizeEnable(tables); | 240 | SetupDirtyRasterizeEnable(tables); |
| 237 | SetupDirtyFramebufferSRGB(tables); | 241 | SetupDirtyFramebufferSRGB(tables); |
| 238 | SetupDirtyLogicOp(tables); | 242 | SetupDirtyLogicOp(tables); |
| 243 | SetupDirtyFragmentClampColor(tables); | ||
| 239 | SetupDirtyMisc(tables); | 244 | SetupDirtyMisc(tables); |
| 240 | 245 | ||
| 241 | auto& store = dirty.on_write_stores; | 246 | 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 9901d2b0d..db92a2e5c 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.h +++ b/src/video_core/renderer_opengl/gl_state_tracker.h | |||
| @@ -69,6 +69,7 @@ enum : u8 { | |||
| 69 | RasterizeEnable, | 69 | RasterizeEnable, |
| 70 | FramebufferSRGB, | 70 | FramebufferSRGB, |
| 71 | LogicOp, | 71 | LogicOp, |
| 72 | FragmentClampColor, | ||
| 72 | 73 | ||
| 73 | Last | 74 | Last |
| 74 | }; | 75 | }; |