mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 18:19:36 +01:00
gl-render-manager: Implement logic ops
This commit is contained in:
1 parent
acb692677b
commit
e531a7da43
4 files changed
+41
-9
No files matched your search
@@ -405,6 +405,9 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DITHER);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
#ifndef USING_GLES2
|
||||
glDisable(GL_COLOR_LOGIC_OP);
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef USING_GLES2
|
||||
@@ -430,12 +433,14 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
|
||||
int colorMask = -1;
|
||||
int depthMask = -1;
|
||||
int depthFunc = -1;
|
||||
int logicOp = -1;
|
||||
GLuint curArrayBuffer = (GLuint)-1;
|
||||
GLuint curElemArrayBuffer = (GLuint)-1;
|
||||
bool depthEnabled = false;
|
||||
bool blendEnabled = false;
|
||||
bool cullEnabled = false;
|
||||
bool ditherEnabled = false;
|
||||
bool logicEnabled = false;
|
||||
GLuint blendEqColor = (GLuint)-1;
|
||||
GLuint blendEqAlpha = (GLuint)-1;
|
||||
|
||||
@@ -496,6 +501,22 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
|
||||
colorMask = c.blend.mask;
|
||||
}
|
||||
break;
|
||||
case GLRRenderCommand::LOGICOP:
|
||||
#ifndef USING_GLES2
|
||||
if (c.logic.enabled) {
|
||||
if (!logicEnabled) {
|
||||
glEnable(GL_COLOR_LOGIC_OP);
|
||||
logicEnabled = true;
|
||||
}
|
||||
if (logicOp != c.logic.logicOp) {
|
||||
glLogicOp(c.logic.logicOp);
|
||||
}
|
||||
} else if (!c.logic.enabled && logicEnabled) {
|
||||
glDisable(GL_COLOR_LOGIC_OP);
|
||||
logicEnabled = false;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case GLRRenderCommand::CLEAR:
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
if (c.clear.colorMask != colorMask) {
|
||||
@@ -814,6 +835,9 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step) {
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_CULL_FACE);
|
||||
#ifndef USING_GLES2
|
||||
glDisable(GL_COLOR_LOGIC_OP);
|
||||
#endif
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user