Merge pull request #1460 from FernandoS27/scissor_test
Implemented Scissor Testing
This commit is contained in:
commit
03ec936ca0
3 changed files with 36 additions and 1 deletions
|
@ -552,6 +552,7 @@ void RasterizerOpenGL::DrawArrays() {
|
|||
SyncLogicOpState();
|
||||
SyncCullMode();
|
||||
SyncAlphaTest();
|
||||
SyncScissorTest();
|
||||
SyncTransformFeedback();
|
||||
SyncPointState();
|
||||
|
||||
|
@ -984,6 +985,22 @@ void RasterizerOpenGL::SyncAlphaTest() {
|
|||
}
|
||||
}
|
||||
|
||||
void RasterizerOpenGL::SyncScissorTest() {
|
||||
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
|
||||
|
||||
state.scissor.enabled = (regs.scissor_test.enable != 0);
|
||||
// TODO(Blinkhawk): Figure if the hardware supports scissor testing per viewport and how it's
|
||||
// implemented.
|
||||
if (regs.scissor_test.enable != 0) {
|
||||
const u32 width = regs.scissor_test.max_x - regs.scissor_test.min_x;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void RasterizerOpenGL::SyncTransformFeedback() {
|
||||
const auto& regs = Core::System::GetInstance().GPU().Maxwell3D().regs;
|
||||
|
||||
|
|
|
@ -165,6 +165,9 @@ private:
|
|||
/// Syncs the alpha test state to match the guest state
|
||||
void SyncAlphaTest();
|
||||
|
||||
/// Syncs the scissor test state to match the guest state
|
||||
void SyncScissorTest();
|
||||
|
||||
/// Syncs the transform feedback state to match the guest state
|
||||
void SyncTransformFeedback();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue