Merge pull request #3305 from ReinUsesLisp/point-size-program

gl_state: Implement PROGRAM_POINT_SIZE
This commit is contained in:
bunnei 2020-01-18 01:56:32 -05:00 committed by GitHub
commit 9bf4850f74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View file

@ -1272,6 +1272,7 @@ 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 ? GL_TRUE : GL_FALSE;
state.point.size = std::max(1.0f, regs.point_size);
}

View file

@ -127,6 +127,7 @@ void OpenGLState::ApplyClipDistances() {
}
void OpenGLState::ApplyPointSize() {
Enable(GL_PROGRAM_POINT_SIZE, cur_state.point.program_control, point.program_control);
if (UpdateValue(cur_state.point.size, point.size)) {
glPointSize(point.size);
}

View file

@ -131,7 +131,8 @@ public:
std::array<Viewport, Tegra::Engines::Maxwell3D::Regs::NumViewports> viewports;
struct {
float size = 1.0f; // GL_POINT_SIZE
GLboolean program_control = GL_FALSE; // GL_PROGRAM_POINT_SIZE
GLfloat size = 1.0f; // GL_POINT_SIZE
} point;
struct {