Skip to content

Commit 2a6f9b8

Browse files
authored
Merge pull request #288 from fjtrujy/missingRegions
`scissor` misses `REGION1` and `REGION2` commands
2 parents ee208d2 + a47fce5 commit 2a6f9b8

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

src/gu/sceGuDisable.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ void sceGuDisable(int state)
2121
case GU_SCISSOR_TEST:
2222
{
2323
GuContext *context = &gu_contexts[gu_curr_context];
24+
int orig = 0;
25+
int end = ((gu_draw_buffer.height - 1) << 10) | (gu_draw_buffer.width - 1);
26+
2427
context->scissor_enable = 0;
25-
sendCommandi(SCISSOR1, 0);
26-
sendCommandi(SCISSOR2, ((gu_draw_buffer.height - 1) << 10) | (gu_draw_buffer.width - 1));
28+
sendCommandi(SCISSOR1, orig);
29+
sendCommandi(SCISSOR2, end);
30+
sendCommandi(REGION1, orig);
31+
sendCommandi(REGION2, end);
2732
}
2833
break;
2934
case GU_STENCIL_TEST:

src/gu/sceGuEnable.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ void sceGuEnable(int state)
2121
case GU_SCISSOR_TEST:
2222
{
2323
GuContext *context = &gu_contexts[gu_curr_context];
24+
int orig = (context->scissor_start[1] << 10) | context->scissor_start[0];
25+
int end = (context->scissor_end[1] << 10) | context->scissor_end[0];
26+
2427
context->scissor_enable = 1;
25-
sendCommandi(SCISSOR1, (context->scissor_start[1] << 10) | context->scissor_start[0]);
26-
sendCommandi(SCISSOR2, (context->scissor_end[1] << 10) | context->scissor_end[0]);
28+
sendCommandi(SCISSOR1, orig);
29+
sendCommandi(SCISSOR2, end);
30+
sendCommandi(REGION1, orig);
31+
sendCommandi(REGION2, end);
2732
}
2833
break;
2934
case GU_STENCIL_TEST:

src/gu/sceGuScissor.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ void sceGuScissor(int x, int y, int w, int h)
1919

2020
if (context->scissor_enable)
2121
{
22-
sendCommandi(SCISSOR1, (context->scissor_start[1] << 10) | context->scissor_start[0]);
23-
sendCommandi(SCISSOR2, (context->scissor_end[1] << 10) | context->scissor_end[0]);
22+
int orig = (context->scissor_start[1] << 10) | context->scissor_start[0];
23+
int end = (context->scissor_end[1] << 10) | context->scissor_end[0];
24+
25+
sendCommandi(SCISSOR1, orig);
26+
sendCommandi(SCISSOR2, end);
27+
sendCommandi(REGION1, orig);
28+
sendCommandi(REGION2, end);
2429
}
2530
}

0 commit comments

Comments
 (0)