mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Use stencil GE state accessors.
This commit is contained in:
parent
46805b37cb
commit
b2927213c7
2 changed files with 10 additions and 10 deletions
|
@ -267,12 +267,12 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
|||
// Stencil Test
|
||||
if (gstate.isStencilTestEnabled()) {
|
||||
glstate.stencilTest.enable();
|
||||
glstate.stencilFunc.set(ztests[gstate.stenciltest & 0x7],// comparison function
|
||||
(gstate.stenciltest >> 8) & 0xFF, // reference value
|
||||
(gstate.stenciltest >> 16) & 0xFF); // mask
|
||||
glstate.stencilOp.set(stencilOps[gstate.stencilop & 0x7], // stencil fail
|
||||
stencilOps[(gstate.stencilop >> 8) & 0x7], // depth fail
|
||||
stencilOps[(gstate.stencilop >> 16) & 0x7]); // depth pass
|
||||
glstate.stencilFunc.set(ztests[gstate.getStencilTestFunction()],
|
||||
gstate.getStencilTestRef(),
|
||||
gstate.getStencilTestMask());
|
||||
glstate.stencilOp.set(stencilOps[gstate.getStencilOpSFail()], // stencil fail
|
||||
stencilOps[gstate.getStencilOpZFail()], // depth fail
|
||||
stencilOps[gstate.getStencilOpZPass()]); // depth pass
|
||||
} else
|
||||
glstate.stencilTest.disable();
|
||||
|
||||
|
|
|
@ -215,12 +215,12 @@ struct GPUgstate
|
|||
GELogicOp getLogicOp() const { return static_cast<GELogicOp>(lop & 0xF); }
|
||||
|
||||
bool isStencilTestEnabled() const { return stencilTestEnable & 1; }
|
||||
int getStencilTestFunction() const { return stenciltest & 0x7; }
|
||||
GEComparison getStencilTestFunction() const { return static_cast<GEComparison>(stenciltest & 0x7); }
|
||||
int getStencilTestRef() const { return (stenciltest>>8) & 0xFF; }
|
||||
int getStencilTestMask() const { return (stenciltest>>16) & 0xFF; }
|
||||
int getStencilOpSFail() const { return stencilop & 0x7; }
|
||||
int getStencilOpZFail() const { return (stencilop>>8) & 0x7; }
|
||||
int getStencilOpZPass() const { return (stencilop>>16) & 0x7; }
|
||||
GEStencilOp getStencilOpSFail() const { return static_cast<GEStencilOp>(stencilop & 0x7); }
|
||||
GEStencilOp getStencilOpZFail() const { return static_cast<GEStencilOp>((stencilop>>8) & 0x7); }
|
||||
GEStencilOp getStencilOpZPass() const { return static_cast<GEStencilOp>((stencilop>>16) & 0x7); }
|
||||
|
||||
bool isAlphaTestEnabled() const { return alphaTestEnable & 1; }
|
||||
GEComparison getAlphaTestFunction() { return static_cast<GEComparison>(alphatest & 0x7); }
|
||||
|
|
Loading…
Add table
Reference in a new issue