1
0
Fork 0
forked from suyu/suyu

gl_state: Remove point size tracking

This commit is contained in:
ReinUsesLisp 2019-12-25 19:30:05 -03:00
parent b95f064b51
commit d2d5554296
3 changed files with 4 additions and 22 deletions

View file

@ -428,9 +428,7 @@ void RasterizerOpenGL::Clear() {
bool use_stencil{}; bool use_stencil{};
OpenGLState prev_state{OpenGLState::GetCurState()}; OpenGLState prev_state{OpenGLState::GetCurState()};
SCOPE_EXIT({ SCOPE_EXIT({ prev_state.Apply(); });
prev_state.Apply();
});
OpenGLState clear_state{OpenGLState::GetCurState()}; OpenGLState clear_state{OpenGLState::GetCurState()};
clear_state.SetDefaultViewports(); clear_state.SetDefaultViewports();
@ -1205,9 +1203,9 @@ void RasterizerOpenGL::SyncPointState() {
const auto& regs = system.GPU().Maxwell3D().regs; 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 // Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid
// in OpenGL). // in OpenGL).
state.point.program_control = regs.vp_point_size.enable != 0; oglEnable(GL_PROGRAM_POINT_SIZE, regs.vp_point_size.enable);
state.point.sprite = regs.point_sprite_enable != 0; oglEnable(GL_POINT_SPRITE, regs.point_sprite_enable);
state.point.size = std::max(1.0f, regs.point_size); glPointSize(std::max(1.0f, regs.point_size));
} }
void RasterizerOpenGL::SyncPolygonOffset() { void RasterizerOpenGL::SyncPolygonOffset() {

View file

@ -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() { void OpenGLState::ApplyFragmentColorClamp() {
if (UpdateValue(cur_state.fragment_color_clamp.enabled, fragment_color_clamp.enabled)) { if (UpdateValue(cur_state.fragment_color_clamp.enabled, fragment_color_clamp.enabled)) {
glClampColor(GL_CLAMP_FRAGMENT_COLOR_ARB, glClampColor(GL_CLAMP_FRAGMENT_COLOR_ARB,
@ -445,7 +437,6 @@ void OpenGLState::Apply() {
ApplyShaderProgram(); ApplyShaderProgram();
ApplyProgramPipeline(); ApplyProgramPipeline();
ApplyClipDistances(); ApplyClipDistances();
ApplyPointSize();
ApplyFragmentColorClamp(); ApplyFragmentColorClamp();
ApplyMultisample(); ApplyMultisample();
ApplyRasterizerDiscard(); ApplyRasterizerDiscard();

View file

@ -130,12 +130,6 @@ public:
}; };
std::array<Viewport, Tegra::Engines::Maxwell3D::Regs::NumViewports> viewports; 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 { struct {
bool point_enable = false; bool point_enable = false;
bool line_enable = false; bool line_enable = false;
@ -176,7 +170,6 @@ public:
void ApplyShaderProgram(); void ApplyShaderProgram();
void ApplyProgramPipeline(); void ApplyProgramPipeline();
void ApplyClipDistances(); void ApplyClipDistances();
void ApplyPointSize();
void ApplyFragmentColorClamp(); void ApplyFragmentColorClamp();
void ApplyMultisample(); void ApplyMultisample();
void ApplySRgb(); void ApplySRgb();