gl_state: Remove primitive restart tracking

This commit is contained in:
ReinUsesLisp 2019-12-25 21:00:38 -03:00
parent 42708c762e
commit 0f343d32c4
3 changed files with 2 additions and 18 deletions

View file

@ -1029,8 +1029,8 @@ void RasterizerOpenGL::SyncCullMode() {
void RasterizerOpenGL::SyncPrimitiveRestart() { void RasterizerOpenGL::SyncPrimitiveRestart() {
const auto& regs = system.GPU().Maxwell3D().regs; const auto& regs = system.GPU().Maxwell3D().regs;
state.primitive_restart.enabled = regs.primitive_restart.enabled; oglEnable(GL_PRIMITIVE_RESTART, regs.primitive_restart.enabled);
state.primitive_restart.index = regs.primitive_restart.index; glPrimitiveRestartIndex(regs.primitive_restart.index);
} }
void RasterizerOpenGL::SyncDepthTestState() { void RasterizerOpenGL::SyncDepthTestState() {

View file

@ -197,15 +197,6 @@ void OpenGLState::ApplyDepth() {
} }
} }
void OpenGLState::ApplyPrimitiveRestart() {
Enable(GL_PRIMITIVE_RESTART, cur_state.primitive_restart.enabled, primitive_restart.enabled);
if (cur_state.primitive_restart.index != primitive_restart.index) {
cur_state.primitive_restart.index = primitive_restart.index;
glPrimitiveRestartIndex(primitive_restart.index);
}
}
void OpenGLState::ApplyStencilTest() { void OpenGLState::ApplyStencilTest() {
Enable(GL_STENCIL_TEST, cur_state.stencil.test_enabled, stencil.test_enabled); Enable(GL_STENCIL_TEST, cur_state.stencil.test_enabled, stencil.test_enabled);
@ -390,7 +381,6 @@ void OpenGLState::Apply() {
ApplyStencilTest(); ApplyStencilTest();
ApplySRgb(); ApplySRgb();
ApplyDepth(); ApplyDepth();
ApplyPrimitiveRestart();
ApplyBlending(); ApplyBlending();
ApplyTextures(); ApplyTextures();
ApplySamplers(); ApplySamplers();

View file

@ -37,11 +37,6 @@ public:
GLenum test_func = GL_LESS; // GL_DEPTH_FUNC GLenum test_func = GL_LESS; // GL_DEPTH_FUNC
} depth; } depth;
struct {
bool enabled = false;
GLuint index = 0;
} primitive_restart; // GL_PRIMITIVE_RESTART
bool rasterizer_discard = false; // GL_RASTERIZER_DISCARD bool rasterizer_discard = false; // GL_RASTERIZER_DISCARD
struct ColorMask { struct ColorMask {
@ -143,7 +138,6 @@ public:
void ApplyRasterizerDiscard(); void ApplyRasterizerDiscard();
void ApplyColorMask(); void ApplyColorMask();
void ApplyDepth(); void ApplyDepth();
void ApplyPrimitiveRestart();
void ApplyStencilTest(); void ApplyStencilTest();
void ApplyViewport(); void ApplyViewport();
void ApplyTargetBlending(std::size_t target, bool force); void ApplyTargetBlending(std::size_t target, bool force);