mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-10-30 15:39:02 -05:00 
			
		
		
		
	Merge pull request #1411 from ReinUsesLisp/point-size
video_core: Implement point_size and add point state sync
This commit is contained in:
		| @@ -642,7 +642,11 @@ public: | |||||||
|  |  | ||||||
|                 u32 vb_element_base; |                 u32 vb_element_base; | ||||||
|  |  | ||||||
|                 INSERT_PADDING_WORDS(0x40); |                 INSERT_PADDING_WORDS(0x38); | ||||||
|  |  | ||||||
|  |                 float point_size; | ||||||
|  |  | ||||||
|  |                 INSERT_PADDING_WORDS(0x7); | ||||||
|  |  | ||||||
|                 u32 zeta_enable; |                 u32 zeta_enable; | ||||||
|  |  | ||||||
| @@ -1018,6 +1022,7 @@ ASSERT_REG_POSITION(stencil_front_func_mask, 0x4E6); | |||||||
| ASSERT_REG_POSITION(stencil_front_mask, 0x4E7); | ASSERT_REG_POSITION(stencil_front_mask, 0x4E7); | ||||||
| ASSERT_REG_POSITION(screen_y_control, 0x4EB); | ASSERT_REG_POSITION(screen_y_control, 0x4EB); | ||||||
| ASSERT_REG_POSITION(vb_element_base, 0x50D); | ASSERT_REG_POSITION(vb_element_base, 0x50D); | ||||||
|  | ASSERT_REG_POSITION(point_size, 0x546); | ||||||
| ASSERT_REG_POSITION(zeta_enable, 0x54E); | ASSERT_REG_POSITION(zeta_enable, 0x54E); | ||||||
| ASSERT_REG_POSITION(tsc, 0x557); | ASSERT_REG_POSITION(tsc, 0x557); | ||||||
| ASSERT_REG_POSITION(tic, 0x55D); | ASSERT_REG_POSITION(tic, 0x55D); | ||||||
|   | |||||||
| @@ -452,6 +452,7 @@ void RasterizerOpenGL::DrawArrays() { | |||||||
|     SyncCullMode(); |     SyncCullMode(); | ||||||
|     SyncAlphaTest(); |     SyncAlphaTest(); | ||||||
|     SyncTransformFeedback(); |     SyncTransformFeedback(); | ||||||
|  |     SyncPointState(); | ||||||
|  |  | ||||||
|     // TODO(bunnei): Sync framebuffer_scale uniform here |     // TODO(bunnei): Sync framebuffer_scale uniform here | ||||||
|     // TODO(bunnei): Sync scissorbox uniform(s) 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 | } // namespace OpenGL | ||||||
|   | |||||||
| @@ -164,6 +164,9 @@ private: | |||||||
|     /// Syncs the transform feedback state to match the guest state |     /// Syncs the transform feedback state to match the guest state | ||||||
|     void SyncTransformFeedback(); |     void SyncTransformFeedback(); | ||||||
|  |  | ||||||
|  |     /// Syncs the point state to match the guest state | ||||||
|  |     void SyncPointState(); | ||||||
|  |  | ||||||
|     bool has_ARB_direct_state_access = false; |     bool has_ARB_direct_state_access = false; | ||||||
|     bool has_ARB_multi_bind = false; |     bool has_ARB_multi_bind = false; | ||||||
|     bool has_ARB_separate_shader_objects = false; |     bool has_ARB_separate_shader_objects = false; | ||||||
|   | |||||||
| @@ -79,6 +79,8 @@ OpenGLState::OpenGLState() { | |||||||
|     viewport.height = 0; |     viewport.height = 0; | ||||||
|  |  | ||||||
|     clip_distance = {}; |     clip_distance = {}; | ||||||
|  |  | ||||||
|  |     point.size = 1; | ||||||
| } | } | ||||||
|  |  | ||||||
| void OpenGLState::Apply() const { | 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; |     cur_state = *this; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -142,6 +142,10 @@ public: | |||||||
|         GLsizei height; |         GLsizei height; | ||||||
|     } viewport; |     } viewport; | ||||||
|  |  | ||||||
|  |     struct { | ||||||
|  |         float size; // GL_POINT_SIZE | ||||||
|  |     } point; | ||||||
|  |  | ||||||
|     std::array<bool, 2> clip_distance; // GL_CLIP_DISTANCE |     std::array<bool, 2> clip_distance; // GL_CLIP_DISTANCE | ||||||
|  |  | ||||||
|     OpenGLState(); |     OpenGLState(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 bunnei
					bunnei