mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-12-14 23:05:17 +00:00
Merge pull request #611 from Subv/enabled_depth_test
GPU: Don't try to parse the depth test function if the depth test is disabled and use only the least significant 3 bits in the depth test func
This commit is contained in:
commit
ddb767f1b6
|
@ -281,14 +281,14 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ComparisonOp : u32 {
|
enum class ComparisonOp : u32 {
|
||||||
Never = 0x200,
|
Never = 0,
|
||||||
Less = 0x201,
|
Less = 1,
|
||||||
Equal = 0x202,
|
Equal = 2,
|
||||||
LessEqual = 0x203,
|
LessEqual = 3,
|
||||||
Greater = 0x204,
|
Greater = 4,
|
||||||
NotEqual = 0x205,
|
NotEqual = 5,
|
||||||
GreaterEqual = 0x206,
|
GreaterEqual = 6,
|
||||||
Always = 0x207,
|
Always = 7,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Cull {
|
struct Cull {
|
||||||
|
@ -475,7 +475,7 @@ public:
|
||||||
|
|
||||||
INSERT_PADDING_WORDS(0x8);
|
INSERT_PADDING_WORDS(0x8);
|
||||||
|
|
||||||
ComparisonOp depth_test_func;
|
BitField<0, 3, ComparisonOp> depth_test_func;
|
||||||
|
|
||||||
INSERT_PADDING_WORDS(0xB);
|
INSERT_PADDING_WORDS(0xB);
|
||||||
|
|
||||||
|
|
|
@ -735,6 +735,10 @@ void RasterizerOpenGL::SyncDepthTestState() {
|
||||||
|
|
||||||
state.depth.test_enabled = regs.depth_test_enable != 0;
|
state.depth.test_enabled = regs.depth_test_enable != 0;
|
||||||
state.depth.write_mask = regs.depth_write_enabled ? GL_TRUE : GL_FALSE;
|
state.depth.write_mask = regs.depth_write_enabled ? GL_TRUE : GL_FALSE;
|
||||||
|
|
||||||
|
if (!state.depth.test_enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
state.depth.test_func = MaxwellToGL::ComparisonOp(regs.depth_test_func);
|
state.depth.test_func = MaxwellToGL::ComparisonOp(regs.depth_test_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue