mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
vc4: Fix triangle-guardband-viewport piglit test.
The original Broadcom driver also did this with the viewport.
This commit is contained in:
parent
87db578268
commit
0ae5e002e0
1 changed files with 14 additions and 5 deletions
|
|
@ -28,12 +28,21 @@ vc4_emit_state(struct pipe_context *pctx)
|
|||
{
|
||||
struct vc4_context *vc4 = vc4_context(pctx);
|
||||
|
||||
if (vc4->dirty & VC4_DIRTY_SCISSOR) {
|
||||
if (vc4->dirty & (VC4_DIRTY_SCISSOR | VC4_DIRTY_VIEWPORT)) {
|
||||
float *vpscale = vc4->viewport.scale;
|
||||
float *vptranslate = vc4->viewport.translate;
|
||||
float vp_minx = -fabs(vpscale[0]) + vptranslate[0];
|
||||
float vp_maxx = fabs(vpscale[0]) + vptranslate[0];
|
||||
float vp_miny = -fabs(vpscale[1]) + vptranslate[1];
|
||||
float vp_maxy = fabs(vpscale[1]) + vptranslate[1];
|
||||
uint32_t minx = MAX2(vc4->scissor.minx, vp_minx);
|
||||
uint32_t miny = MAX2(vc4->scissor.miny, vp_miny);
|
||||
|
||||
cl_u8(&vc4->bcl, VC4_PACKET_CLIP_WINDOW);
|
||||
cl_u16(&vc4->bcl, vc4->scissor.minx);
|
||||
cl_u16(&vc4->bcl, vc4->scissor.miny);
|
||||
cl_u16(&vc4->bcl, vc4->scissor.maxx - vc4->scissor.minx);
|
||||
cl_u16(&vc4->bcl, vc4->scissor.maxy - vc4->scissor.miny);
|
||||
cl_u16(&vc4->bcl, minx);
|
||||
cl_u16(&vc4->bcl, miny);
|
||||
cl_u16(&vc4->bcl, MIN2(vc4->scissor.maxx, vp_maxx) - minx);
|
||||
cl_u16(&vc4->bcl, MIN2(vc4->scissor.maxy, vp_maxy) - miny);
|
||||
}
|
||||
|
||||
if (vc4->dirty & (VC4_DIRTY_RASTERIZER | VC4_DIRTY_ZSA)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue