mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-04 19:53:48 +01:00
GLES: Enable/disable clip distance 0.
This commit is contained in:
1 parent
046a5c548b
commit
7d00b6ca90
10 files changed
+48
-16
No files matched your search
@@ -17,6 +17,11 @@
|
||||
#include "GLRenderManager.h"
|
||||
#include "DataFormatGL.h"
|
||||
|
||||
// These are the same value, alias for simplicity.
|
||||
#if defined(GL_CLIP_DISTANCE0_EXT) && !defined(GL_CLIP_DISTANCE0)
|
||||
#define GL_CLIP_DISTANCE0 GL_CLIP_DISTANCE0_EXT
|
||||
#endif
|
||||
|
||||
static constexpr int TEXCACHE_NAME_CACHE_SIZE = 16;
|
||||
|
||||
#if PPSSPP_PLATFORM(IOS)
|
||||
@@ -798,6 +803,7 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step, bool first, bool last
|
||||
int logicOp = -1;
|
||||
bool logicEnabled = false;
|
||||
#endif
|
||||
bool clipDistance0Enabled = false;
|
||||
GLuint blendEqColor = (GLuint)-1;
|
||||
GLuint blendEqAlpha = (GLuint)-1;
|
||||
|
||||
@@ -1106,6 +1112,13 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step, bool first, bool last
|
||||
{
|
||||
if (curProgram != c.program.program) {
|
||||
glUseProgram(c.program.program->program);
|
||||
if (c.program.program->use_clip_distance0 != clipDistance0Enabled) {
|
||||
if (c.program.program->use_clip_distance0)
|
||||
glEnable(GL_CLIP_DISTANCE0);
|
||||
else
|
||||
glDisable(GL_CLIP_DISTANCE0);
|
||||
clipDistance0Enabled = c.program.program->use_clip_distance0;
|
||||
}
|
||||
curProgram = c.program.program;
|
||||
}
|
||||
CHECK_GL_ERROR_IF_DEBUG();
|
||||
@@ -1340,6 +1353,8 @@ void GLQueueRunner::PerformRenderPass(const GLRStep &step, bool first, bool last
|
||||
glDisable(GL_COLOR_LOGIC_OP);
|
||||
}
|
||||
#endif
|
||||
if (clipDistance0Enabled)
|
||||
glDisable(GL_CLIP_DISTANCE0);
|
||||
if ((colorMask & 15) != 15)
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
CHECK_GL_ERROR_IF_DEBUG();
|
||||
|
||||
Reference in new issue
Block a user