diff options
| author | 2019-12-30 01:27:42 -0300 | |
|---|---|---|
| committer | 2020-02-28 17:56:42 -0300 | |
| commit | 4f8d152b1810bbfb2900de6520dbf9df93f9a67d (patch) | |
| tree | 86fd5b428ec49cc968b6f6f7e61afed5b6099384 /src | |
| parent | gl_state_tracker: Implement dirty flags for fragment color clamp (diff) | |
| download | yuzu-4f8d152b1810bbfb2900de6520dbf9df93f9a67d.tar.gz yuzu-4f8d152b1810bbfb2900de6520dbf9df93f9a67d.tar.xz yuzu-4f8d152b1810bbfb2900de6520dbf9df93f9a67d.zip | |
gl_state_tracker: Implement dirty flags for point sizes
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 21 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state_tracker.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state_tracker.h | 1 |
3 files changed, 25 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 7ffb8fa09..ec1936927 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1267,12 +1267,25 @@ void RasterizerOpenGL::SyncTransformFeedback() { | |||
| 1267 | } | 1267 | } |
| 1268 | 1268 | ||
| 1269 | void RasterizerOpenGL::SyncPointState() { | 1269 | void RasterizerOpenGL::SyncPointState() { |
| 1270 | const auto& regs = system.GPU().Maxwell3D().regs; | 1270 | auto& gpu = system.GPU().Maxwell3D(); |
| 1271 | auto& flags = gpu.dirty.flags; | ||
| 1272 | if (!flags[Dirty::PointSize]) { | ||
| 1273 | return; | ||
| 1274 | } | ||
| 1275 | flags[Dirty::PointSize] = false; | ||
| 1276 | |||
| 1277 | oglEnable(GL_POINT_SPRITE, gpu.regs.point_sprite_enable); | ||
| 1278 | |||
| 1279 | if (gpu.regs.vp_point_size.enable) { | ||
| 1280 | // By definition of GL_POINT_SIZE, it only matters if GL_PROGRAM_POINT_SIZE is disabled. | ||
| 1281 | glEnable(GL_PROGRAM_POINT_SIZE); | ||
| 1282 | return; | ||
| 1283 | } | ||
| 1284 | |||
| 1271 | // Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid | 1285 | // Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid |
| 1272 | // in OpenGL). | 1286 | // in OpenGL). |
| 1273 | oglEnable(GL_PROGRAM_POINT_SIZE, regs.vp_point_size.enable); | 1287 | glPointSize(std::max(1.0f, gpu.regs.point_size)); |
| 1274 | oglEnable(GL_POINT_SPRITE, regs.point_sprite_enable); | 1288 | glDisable(GL_PROGRAM_POINT_SIZE); |
| 1275 | glPointSize(std::max(1.0f, regs.point_size)); | ||
| 1276 | } | 1289 | } |
| 1277 | 1290 | ||
| 1278 | void RasterizerOpenGL::SyncPolygonOffset() { | 1291 | void RasterizerOpenGL::SyncPolygonOffset() { |
diff --git a/src/video_core/renderer_opengl/gl_state_tracker.cpp b/src/video_core/renderer_opengl/gl_state_tracker.cpp index 538ab97e0..8bb827ac5 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.cpp +++ b/src/video_core/renderer_opengl/gl_state_tracker.cpp | |||
| @@ -205,6 +205,12 @@ void SetupDirtyFragmentClampColor(Tables& tables) { | |||
| 205 | tables[0][OFF(frag_color_clamp)] = FragmentClampColor; | 205 | tables[0][OFF(frag_color_clamp)] = FragmentClampColor; |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | void SetupDirtyPointSize(Tables& tables) { | ||
| 209 | tables[0][OFF(vp_point_size)] = PointSize; | ||
| 210 | tables[0][OFF(point_size)] = PointSize; | ||
| 211 | tables[0][OFF(point_sprite_enable)] = PointSize; | ||
| 212 | } | ||
| 213 | |||
| 208 | void SetupDirtyMisc(Tables& tables) { | 214 | void SetupDirtyMisc(Tables& tables) { |
| 209 | auto& table = tables[0]; | 215 | auto& table = tables[0]; |
| 210 | 216 | ||
| @@ -241,6 +247,7 @@ void StateTracker::Initialize() { | |||
| 241 | SetupDirtyFramebufferSRGB(tables); | 247 | SetupDirtyFramebufferSRGB(tables); |
| 242 | SetupDirtyLogicOp(tables); | 248 | SetupDirtyLogicOp(tables); |
| 243 | SetupDirtyFragmentClampColor(tables); | 249 | SetupDirtyFragmentClampColor(tables); |
| 250 | SetupDirtyPointSize(tables); | ||
| 244 | SetupDirtyMisc(tables); | 251 | SetupDirtyMisc(tables); |
| 245 | 252 | ||
| 246 | auto& store = dirty.on_write_stores; | 253 | 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 db92a2e5c..90b17a7d6 100644 --- a/src/video_core/renderer_opengl/gl_state_tracker.h +++ b/src/video_core/renderer_opengl/gl_state_tracker.h | |||
| @@ -70,6 +70,7 @@ enum : u8 { | |||
| 70 | FramebufferSRGB, | 70 | FramebufferSRGB, |
| 71 | LogicOp, | 71 | LogicOp, |
| 72 | FragmentClampColor, | 72 | FragmentClampColor, |
| 73 | PointSize, | ||
| 73 | 74 | ||
| 74 | Last | 75 | Last |
| 75 | }; | 76 | }; |