summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-09-29 17:58:39 +0200
committerGitHub <noreply@github.com>2018-09-29 17:58:39 +0200
commitfe5962e073245bee0e7204cca68c5f686c8e6625 (patch)
tree4fb852dd52022f1f24b1b31bbc95f5acd09e3851 /src/video_core/renderer_opengl
parentMerge pull request #1406 from ReinUsesLisp/multibind-samplers (diff)
parentvideo_core: Implement point_size and add point state sync (diff)
downloadyuzu-fe5962e073245bee0e7204cca68c5f686c8e6625.tar
yuzu-fe5962e073245bee0e7204cca68c5f686c8e6625.tar.gz
yuzu-fe5962e073245bee0e7204cca68c5f686c8e6625.tar.bz2
yuzu-fe5962e073245bee0e7204cca68c5f686c8e6625.tar.lz
yuzu-fe5962e073245bee0e7204cca68c5f686c8e6625.tar.xz
yuzu-fe5962e073245bee0e7204cca68c5f686c8e6625.tar.zst
yuzu-fe5962e073245bee0e7204cca68c5f686c8e6625.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp7
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h3
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp7
-rw-r--r--src/video_core/renderer_opengl/gl_state.h4
4 files changed, 21 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 44850d193..1fcd13f04 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -452,6 +452,7 @@ void RasterizerOpenGL::DrawArrays() {
SyncCullMode();
SyncAlphaTest();
SyncTransformFeedback();
+ SyncPointState();
// TODO(bunnei): Sync framebuffer_scale uniform here
// TODO(bunnei): Sync scissorbox uniform(s) here
@@ -905,4 +906,10 @@ void RasterizerOpenGL::SyncTransformFeedback() {
}
}
+void RasterizerOpenGL::SyncPointState() {
+ const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
+
+ state.point.size = regs.point_size;
+}
+
} // namespace OpenGL
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index b64c93b81..4c8ecbd1c 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -164,6 +164,9 @@ private:
/// Syncs the transform feedback state to match the guest state
void SyncTransformFeedback();
+ /// Syncs the point state to match the guest state
+ void SyncPointState();
+
bool has_ARB_direct_state_access = false;
bool has_ARB_multi_bind = false;
bool has_ARB_separate_shader_objects = false;
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index e494b3f16..1fe26a2a9 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -79,6 +79,8 @@ OpenGLState::OpenGLState() {
viewport.height = 0;
clip_distance = {};
+
+ point.size = 1;
}
void OpenGLState::Apply() const {
@@ -301,6 +303,11 @@ void OpenGLState::Apply() const {
}
}
+ // Point
+ if (point.size != cur_state.point.size) {
+ glPointSize(point.size);
+ }
+
cur_state = *this;
}
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h
index 49f30b111..dc21a2ee3 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -142,6 +142,10 @@ public:
GLsizei height;
} viewport;
+ struct {
+ float size; // GL_POINT_SIZE
+ } point;
+
std::array<bool, 2> clip_distance; // GL_CLIP_DISTANCE
OpenGLState();