mirror of
https://github.com/libretro/ppsspp.git
synced 2025-03-02 05:36:43 +00:00
Merge pull request #3065 from raven02/patch-8
Add preliminary LogicOp support
This commit is contained in:
commit
5468637278
@ -92,6 +92,25 @@ static const GLushort stencilOps[] = {
|
||||
GL_KEEP, // reserved
|
||||
};
|
||||
|
||||
static const GLushort logicOps[] = {
|
||||
GL_CLEAR,
|
||||
GL_AND,
|
||||
GL_AND_REVERSE,
|
||||
GL_COPY,
|
||||
GL_AND_INVERTED,
|
||||
GL_NOOP,
|
||||
GL_XOR,
|
||||
GL_OR,
|
||||
GL_NOR,
|
||||
GL_EQUIV,
|
||||
GL_INVERT,
|
||||
GL_OR_REVERSE,
|
||||
GL_COPY_INVERTED,
|
||||
GL_OR_INVERTED,
|
||||
GL_NAND,
|
||||
GL_SET,
|
||||
};
|
||||
|
||||
static GLenum blendColor2Func(u32 fix) {
|
||||
if (fix == 0xFFFFFF)
|
||||
return GL_ONE;
|
||||
@ -200,6 +219,11 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
||||
glstate.blendEquation.set(eqLookup[blendFuncEq]);
|
||||
}
|
||||
|
||||
bool wantLogicOps = !gstate.isModeClear() && gstate.isLogicOpEnabled();
|
||||
glstate.colorLogicOp.set(wantLogicOps);
|
||||
if(wantLogicOps)
|
||||
glstate.logicOp.set(logicOps[gstate.getLogicOp()]);
|
||||
|
||||
// Set Dither
|
||||
if (gstate.isDitherEnabled()) {
|
||||
glstate.dither.enable();
|
||||
|
@ -464,10 +464,22 @@ enum GEPrimitiveType
|
||||
|
||||
enum GELogicOp
|
||||
{
|
||||
GE_LOGIC_AND = 1,
|
||||
GE_LOGIC_XOR = 6,
|
||||
GE_LOGIC_INVERT = 10,
|
||||
GE_LOGIC_DRAWINVERTED = 12,
|
||||
GE_LOGIC_CLEAR=0,
|
||||
GE_LOGIC_AND=1,
|
||||
GE_LOGIC_AND_REVERSE=2,
|
||||
GE_LOGIC_COPY=3,
|
||||
GE_LOGIC_AND_INVERTED=4,
|
||||
GE_LOGIC_NOOP=5,
|
||||
GE_LOGIC_XOR=6,
|
||||
GE_LOGIC_OR=7,
|
||||
GE_LOGIC_NOR=8,
|
||||
GE_LOGIC_EQUIV=9,
|
||||
GE_LOGIC_INVERTED=10,
|
||||
GE_LOGIC_OR_REVERSE=11,
|
||||
GE_LOGIC_COPY_INVERTED=12,
|
||||
GE_LOGIC_OR_INVERTED=13,
|
||||
GE_LOGIC_NAND=14,
|
||||
GE_LOGIC_SET=15
|
||||
};
|
||||
|
||||
enum GEPaletteFormat
|
||||
|
Loading…
x
Reference in New Issue
Block a user