summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-12-25 23:30:05 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-02-28 20:39:44 +0100
commitd2d55542965e969a73ddd400e8290b5f4f4101a2 (patch)
tree6b2272670aba077659fe4b5f61c8bf4a4a74803e /src/video_core
parentgl_rasterizer: Add oglEnablei helper (diff)
downloadyuzu-d2d55542965e969a73ddd400e8290b5f4f4101a2.tar
yuzu-d2d55542965e969a73ddd400e8290b5f4f4101a2.tar.gz
yuzu-d2d55542965e969a73ddd400e8290b5f4f4101a2.tar.bz2
yuzu-d2d55542965e969a73ddd400e8290b5f4f4101a2.tar.lz
yuzu-d2d55542965e969a73ddd400e8290b5f4f4101a2.tar.xz
yuzu-d2d55542965e969a73ddd400e8290b5f4f4101a2.tar.zst
yuzu-d2d55542965e969a73ddd400e8290b5f4f4101a2.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp10
-rw-r--r--src/video_core/renderer_opengl/gl_state.cpp9
-rw-r--r--src/video_core/renderer_opengl/gl_state.h7
3 files changed, 4 insertions, 22 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 7cd522da0..a0b0274fb 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -428,9 +428,7 @@ void RasterizerOpenGL::Clear() {
bool use_stencil{};
OpenGLState prev_state{OpenGLState::GetCurState()};
- SCOPE_EXIT({
- prev_state.Apply();
- });
+ SCOPE_EXIT({ prev_state.Apply(); });
OpenGLState clear_state{OpenGLState::GetCurState()};
clear_state.SetDefaultViewports();
@@ -1205,9 +1203,9 @@ void RasterizerOpenGL::SyncPointState() {
const auto& regs = system.GPU().Maxwell3D().regs;
// Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid
// in OpenGL).
- state.point.program_control = regs.vp_point_size.enable != 0;
- state.point.sprite = regs.point_sprite_enable != 0;
- state.point.size = std::max(1.0f, regs.point_size);
+ 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));
}
void RasterizerOpenGL::SyncPolygonOffset() {
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp
index 732cb3a3c..02b3455cc 100644
--- a/src/video_core/renderer_opengl/gl_state.cpp
+++ b/src/video_core/renderer_opengl/gl_state.cpp
@@ -126,14 +126,6 @@ void OpenGLState::ApplyClipDistances() {
}
}
-void OpenGLState::ApplyPointSize() {
- Enable(GL_PROGRAM_POINT_SIZE, cur_state.point.program_control, point.program_control);
- Enable(GL_POINT_SPRITE, cur_state.point.sprite, point.sprite);
- if (UpdateValue(cur_state.point.size, point.size)) {
- glPointSize(point.size);
- }
-}
-
void OpenGLState::ApplyFragmentColorClamp() {
if (UpdateValue(cur_state.fragment_color_clamp.enabled, fragment_color_clamp.enabled)) {
glClampColor(GL_CLAMP_FRAGMENT_COLOR_ARB,
@@ -445,7 +437,6 @@ void OpenGLState::Apply() {
ApplyShaderProgram();
ApplyProgramPipeline();
ApplyClipDistances();
- ApplyPointSize();
ApplyFragmentColorClamp();
ApplyMultisample();
ApplyRasterizerDiscard();
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h
index 5dda9e88f..acd24c042 100644
--- a/src/video_core/renderer_opengl/gl_state.h
+++ b/src/video_core/renderer_opengl/gl_state.h
@@ -131,12 +131,6 @@ public:
std::array<Viewport, Tegra::Engines::Maxwell3D::Regs::NumViewports> viewports;
struct {
- bool program_control = false; // GL_PROGRAM_POINT_SIZE
- bool sprite = false; // GL_POINT_SPRITE
- GLfloat size = 1.0f; // GL_POINT_SIZE
- } point;
-
- struct {
bool point_enable = false;
bool line_enable = false;
bool fill_enable = false;
@@ -176,7 +170,6 @@ public:
void ApplyShaderProgram();
void ApplyProgramPipeline();
void ApplyClipDistances();
- void ApplyPointSize();
void ApplyFragmentColorClamp();
void ApplyMultisample();
void ApplySRgb();