mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-24 10:23:01 -06:00
Implement Scissor Test
This commit is contained in:
parent
30ff42b8cc
commit
be97fc884d
1 changed files with 9 additions and 4 deletions
|
@ -976,11 +976,16 @@ void RasterizerOpenGL::SyncAlphaTest() {
|
||||||
void RasterizerOpenGL::SyncScissorTest() {
|
void RasterizerOpenGL::SyncScissorTest() {
|
||||||
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
|
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
|
||||||
|
|
||||||
// TODO(Rodrigo): Alpha testing is a legacy OpenGL feature, but it can be
|
state.scissor.enabled = (regs.scissor_test.enable != 0);
|
||||||
// implemented with a test+discard in fragment shaders.
|
// TODO(Blinkhawk): Figure if the hardware supports scissor testing per viewport and how it's
|
||||||
|
// implemented.
|
||||||
if (regs.scissor_test.enable != 0) {
|
if (regs.scissor_test.enable != 0) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Scissor testing is not implemented");
|
const u32 width = regs.scissor_test.max_x - regs.scissor_test.min_x;
|
||||||
UNREACHABLE();
|
const u32 height = regs.scissor_test.max_y - regs.scissor_test.min_y;
|
||||||
|
state.scissor.x = regs.scissor_test.min_x;
|
||||||
|
state.scissor.y = regs.scissor_test.min_y;
|
||||||
|
state.scissor.width = width;
|
||||||
|
state.scissor.height = height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue