summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp21
-rw-r--r--src/video_core/renderer_opengl/gl_state_tracker.cpp7
-rw-r--r--src/video_core/renderer_opengl/gl_state_tracker.h1
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() {
}
void RasterizerOpenGL::SyncPointState() {
- const auto& regs = system.GPU().Maxwell3D().regs;
+ auto& gpu = system.GPU().Maxwell3D();
+ auto& flags = gpu.dirty.flags;
+ if (!flags[Dirty::PointSize]) {
+ return;
+ }
+ flags[Dirty::PointSize] = false;
+
+ oglEnable(GL_POINT_SPRITE, gpu.regs.point_sprite_enable);
+
+ if (gpu.regs.vp_point_size.enable) {
+ // By definition of GL_POINT_SIZE, it only matters if GL_PROGRAM_POINT_SIZE is disabled.
+ glEnable(GL_PROGRAM_POINT_SIZE);
+ return;
+ }
+
// Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid
// in OpenGL).
- oglEnable(GL_PROGRAM_POINT_SIZE, regs.vp_point_size.enable);
- oglEnable(GL_POINT_SPRITE, regs.point_sprite_enable);
- glPointSize(std::max(1.0f, regs.point_size));
+ glPointSize(std::max(1.0f, gpu.regs.point_size));
+ glDisable(GL_PROGRAM_POINT_SIZE);
}
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) {
tables[0][OFF(frag_color_clamp)] = FragmentClampColor;
}
+void SetupDirtyPointSize(Tables& tables) {
+ tables[0][OFF(vp_point_size)] = PointSize;
+ tables[0][OFF(point_size)] = PointSize;
+ tables[0][OFF(point_sprite_enable)] = PointSize;
+}
+
void SetupDirtyMisc(Tables& tables) {
auto& table = tables[0];
@@ -241,6 +247,7 @@ void StateTracker::Initialize() {
SetupDirtyFramebufferSRGB(tables);
SetupDirtyLogicOp(tables);
SetupDirtyFragmentClampColor(tables);
+ SetupDirtyPointSize(tables);
SetupDirtyMisc(tables);
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 {
FramebufferSRGB,
LogicOp,
FragmentClampColor,
+ PointSize,
Last
};