summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-12-30 01:27:42 -0300
committerGravatar ReinUsesLisp2020-02-28 17:56:42 -0300
commit4f8d152b1810bbfb2900de6520dbf9df93f9a67d (patch)
tree86fd5b428ec49cc968b6f6f7e61afed5b6099384 /src
parentgl_state_tracker: Implement dirty flags for fragment color clamp (diff)
downloadyuzu-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.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() {
1267} 1267}
1268 1268
1269void RasterizerOpenGL::SyncPointState() { 1269void 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
1278void RasterizerOpenGL::SyncPolygonOffset() { 1291void 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
208void 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
208void SetupDirtyMisc(Tables& tables) { 214void 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};