diff options
| author | 2020-01-18 01:56:32 -0500 | |
|---|---|---|
| committer | 2020-01-18 01:56:32 -0500 | |
| commit | 9bf4850f7492bf9370acedb6135a79b944eb942f (patch) | |
| tree | 93c1e266c2412d19bb6760227c1238151d3c219b | |
| parent | Merge pull request #3312 from ReinUsesLisp/atoms-u32 (diff) | |
| parent | gl_state: Implement PROGRAM_POINT_SIZE (diff) | |
| download | yuzu-9bf4850f7492bf9370acedb6135a79b944eb942f.tar.gz yuzu-9bf4850f7492bf9370acedb6135a79b944eb942f.tar.xz yuzu-9bf4850f7492bf9370acedb6135a79b944eb942f.zip | |
Merge pull request #3305 from ReinUsesLisp/point-size-program
gl_state: Implement PROGRAM_POINT_SIZE
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 10 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_state.h | 3 |
4 files changed, 13 insertions, 2 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 16f95b77d..ee79260fc 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -1018,7 +1018,14 @@ public: | |||
| 1018 | } | 1018 | } |
| 1019 | } instanced_arrays; | 1019 | } instanced_arrays; |
| 1020 | 1020 | ||
| 1021 | INSERT_UNION_PADDING_WORDS(0x6); | 1021 | INSERT_UNION_PADDING_WORDS(0x4); |
| 1022 | |||
| 1023 | union { | ||
| 1024 | BitField<0, 1, u32> enable; | ||
| 1025 | BitField<4, 8, u32> unk4; | ||
| 1026 | } vp_point_size; | ||
| 1027 | |||
| 1028 | INSERT_UNION_PADDING_WORDS(1); | ||
| 1022 | 1029 | ||
| 1023 | Cull cull; | 1030 | Cull cull; |
| 1024 | 1031 | ||
| @@ -1503,6 +1510,7 @@ ASSERT_REG_POSITION(primitive_restart, 0x591); | |||
| 1503 | ASSERT_REG_POSITION(index_array, 0x5F2); | 1510 | ASSERT_REG_POSITION(index_array, 0x5F2); |
| 1504 | ASSERT_REG_POSITION(polygon_offset_clamp, 0x61F); | 1511 | ASSERT_REG_POSITION(polygon_offset_clamp, 0x61F); |
| 1505 | ASSERT_REG_POSITION(instanced_arrays, 0x620); | 1512 | ASSERT_REG_POSITION(instanced_arrays, 0x620); |
| 1513 | ASSERT_REG_POSITION(vp_point_size, 0x644); | ||
| 1506 | ASSERT_REG_POSITION(cull, 0x646); | 1514 | ASSERT_REG_POSITION(cull, 0x646); |
| 1507 | ASSERT_REG_POSITION(pixel_center_integer, 0x649); | 1515 | ASSERT_REG_POSITION(pixel_center_integer, 0x649); |
| 1508 | ASSERT_REG_POSITION(viewport_transform_enabled, 0x64B); | 1516 | ASSERT_REG_POSITION(viewport_transform_enabled, 0x64B); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 672051102..926bccd42 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1272,6 +1272,7 @@ void RasterizerOpenGL::SyncPointState() { | |||
| 1272 | const auto& regs = system.GPU().Maxwell3D().regs; | 1272 | const auto& regs = system.GPU().Maxwell3D().regs; |
| 1273 | // Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid | 1273 | // Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid |
| 1274 | // in OpenGL). | 1274 | // in OpenGL). |
| 1275 | state.point.program_control = regs.vp_point_size.enable ? GL_TRUE : GL_FALSE; | ||
| 1275 | state.point.size = std::max(1.0f, regs.point_size); | 1276 | state.point.size = std::max(1.0f, regs.point_size); |
| 1276 | } | 1277 | } |
| 1277 | 1278 | ||
diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index df2e2395a..cc185e9e1 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp | |||
| @@ -127,6 +127,7 @@ void OpenGLState::ApplyClipDistances() { | |||
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | void OpenGLState::ApplyPointSize() { | 129 | void OpenGLState::ApplyPointSize() { |
| 130 | Enable(GL_PROGRAM_POINT_SIZE, cur_state.point.program_control, point.program_control); | ||
| 130 | if (UpdateValue(cur_state.point.size, point.size)) { | 131 | if (UpdateValue(cur_state.point.size, point.size)) { |
| 131 | glPointSize(point.size); | 132 | glPointSize(point.size); |
| 132 | } | 133 | } |
diff --git a/src/video_core/renderer_opengl/gl_state.h b/src/video_core/renderer_opengl/gl_state.h index fb180f302..71d418776 100644 --- a/src/video_core/renderer_opengl/gl_state.h +++ b/src/video_core/renderer_opengl/gl_state.h | |||
| @@ -131,7 +131,8 @@ public: | |||
| 131 | std::array<Viewport, Tegra::Engines::Maxwell3D::Regs::NumViewports> viewports; | 131 | std::array<Viewport, Tegra::Engines::Maxwell3D::Regs::NumViewports> viewports; |
| 132 | 132 | ||
| 133 | struct { | 133 | struct { |
| 134 | float size = 1.0f; // GL_POINT_SIZE | 134 | GLboolean program_control = GL_FALSE; // GL_PROGRAM_POINT_SIZE |
| 135 | GLfloat size = 1.0f; // GL_POINT_SIZE | ||
| 135 | } point; | 136 | } point; |
| 136 | 137 | ||
| 137 | struct { | 138 | struct { |