mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 08:59:03 -06:00 
			
		
		
		
	gl_state: Remove clip distances tracking
This commit is contained in:
		@@ -872,16 +872,7 @@ public:
 | 
			
		||||
 | 
			
		||||
                INSERT_UNION_PADDING_WORDS(0x35);
 | 
			
		||||
 | 
			
		||||
                union {
 | 
			
		||||
                    BitField<0, 1, u32> c0;
 | 
			
		||||
                    BitField<1, 1, u32> c1;
 | 
			
		||||
                    BitField<2, 1, u32> c2;
 | 
			
		||||
                    BitField<3, 1, u32> c3;
 | 
			
		||||
                    BitField<4, 1, u32> c4;
 | 
			
		||||
                    BitField<5, 1, u32> c5;
 | 
			
		||||
                    BitField<6, 1, u32> c6;
 | 
			
		||||
                    BitField<7, 1, u32> c7;
 | 
			
		||||
                } clip_distance_enabled;
 | 
			
		||||
                u32 clip_distance_enabled;
 | 
			
		||||
 | 
			
		||||
                u32 samplecnt_enable;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -969,16 +969,10 @@ void RasterizerOpenGL::SyncDepthClamp() {
 | 
			
		||||
 | 
			
		||||
void RasterizerOpenGL::SyncClipEnabled(
 | 
			
		||||
    const std::array<bool, Maxwell::Regs::NumClipDistances>& clip_mask) {
 | 
			
		||||
 | 
			
		||||
    const auto& regs = system.GPU().Maxwell3D().regs;
 | 
			
		||||
    const std::array<bool, Maxwell::Regs::NumClipDistances> reg_state{
 | 
			
		||||
        regs.clip_distance_enabled.c0 != 0, regs.clip_distance_enabled.c1 != 0,
 | 
			
		||||
        regs.clip_distance_enabled.c2 != 0, regs.clip_distance_enabled.c3 != 0,
 | 
			
		||||
        regs.clip_distance_enabled.c4 != 0, regs.clip_distance_enabled.c5 != 0,
 | 
			
		||||
        regs.clip_distance_enabled.c6 != 0, regs.clip_distance_enabled.c7 != 0};
 | 
			
		||||
 | 
			
		||||
    for (std::size_t i = 0; i < Maxwell::Regs::NumClipDistances; ++i) {
 | 
			
		||||
        state.clip_distance[i] = reg_state[i] && clip_mask[i];
 | 
			
		||||
        oglEnable(static_cast<GLenum>(GL_CLIP_DISTANCE0 + i),
 | 
			
		||||
                  clip_mask[i] && ((regs.clip_distance_enabled >> i) & 1));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -106,13 +106,6 @@ void OpenGLState::ApplyProgramPipeline() {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OpenGLState::ApplyClipDistances() {
 | 
			
		||||
    for (std::size_t i = 0; i < clip_distance.size(); ++i) {
 | 
			
		||||
        Enable(GL_CLIP_DISTANCE0 + static_cast<GLenum>(i), cur_state.clip_distance[i],
 | 
			
		||||
               clip_distance[i]);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void OpenGLState::ApplyStencilTest() {
 | 
			
		||||
    Enable(GL_STENCIL_TEST, cur_state.stencil.test_enabled, stencil.test_enabled);
 | 
			
		||||
 | 
			
		||||
@@ -249,7 +242,6 @@ void OpenGLState::Apply() {
 | 
			
		||||
    ApplyFramebufferState();
 | 
			
		||||
    ApplyShaderProgram();
 | 
			
		||||
    ApplyProgramPipeline();
 | 
			
		||||
    ApplyClipDistances();
 | 
			
		||||
    ApplyStencilTest();
 | 
			
		||||
    ApplyBlending();
 | 
			
		||||
    ApplyTextures();
 | 
			
		||||
 
 | 
			
		||||
@@ -54,8 +54,6 @@ public:
 | 
			
		||||
        GLuint program_pipeline = 0; // GL_PROGRAM_PIPELINE_BINDING
 | 
			
		||||
    } draw;
 | 
			
		||||
 | 
			
		||||
    std::array<bool, 8> clip_distance = {}; // GL_CLIP_DISTANCE
 | 
			
		||||
 | 
			
		||||
    struct {
 | 
			
		||||
        GLenum origin = GL_LOWER_LEFT;
 | 
			
		||||
        GLenum depth_mode = GL_NEGATIVE_ONE_TO_ONE;
 | 
			
		||||
@@ -76,7 +74,6 @@ public:
 | 
			
		||||
    void ApplyFramebufferState();
 | 
			
		||||
    void ApplyShaderProgram();
 | 
			
		||||
    void ApplyProgramPipeline();
 | 
			
		||||
    void ApplyClipDistances();
 | 
			
		||||
    void ApplyStencilTest();
 | 
			
		||||
    void ApplyTargetBlending(std::size_t target, bool force);
 | 
			
		||||
    void ApplyGlobalBlending();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user