aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
index e725df8c9c6..e0ce20711da 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
@@ -598,6 +598,7 @@ gen6_pipeline_clip(struct ilo_3d_pipeline *p,
/* 3DSTATE_CLIP */
if (DIRTY(RASTERIZER) || DIRTY(FS) ||
DIRTY(VIEWPORT) || DIRTY(FRAMEBUFFER)) {
+ const struct pipe_viewport_state *vp = &ilo->viewport.states[0];
bool enable_guardband;
float x1, x2, y1, y2;
@@ -605,10 +606,10 @@ gen6_pipeline_clip(struct ilo_3d_pipeline *p,
* We do not do 2D clipping yet. Guard band test should only be enabled
* when the viewport is larger than the framebuffer.
*/
- x1 = fabs(ilo->viewport.scale[0]) * -1.0f + ilo->viewport.translate[0];
- x2 = fabs(ilo->viewport.scale[0]) * 1.0f + ilo->viewport.translate[0];
- y1 = fabs(ilo->viewport.scale[1]) * -1.0f + ilo->viewport.translate[1];
- y2 = fabs(ilo->viewport.scale[1]) * 1.0f + ilo->viewport.translate[1];
+ x1 = fabs(vp->scale[0]) * -1.0f + vp->translate[0];
+ x2 = fabs(vp->scale[0]) * 1.0f + vp->translate[0];
+ y1 = fabs(vp->scale[1]) * -1.0f + vp->translate[1];
+ y2 = fabs(vp->scale[1]) * 1.0f + vp->translate[1];
enable_guardband =
(x1 <= 0.0f && x2 >= (float) ilo->framebuffer.width &&
y1 <= 0.0f && y2 >= (float) ilo->framebuffer.height);
@@ -778,23 +779,23 @@ gen6_pipeline_state_viewports(struct ilo_3d_pipeline *p,
/* SF_CLIP_VIEWPORT and CC_VIEWPORT */
if (p->dev->gen >= ILO_GEN(7) && DIRTY(VIEWPORT)) {
p->state.SF_CLIP_VIEWPORT = p->gen7_SF_CLIP_VIEWPORT(p->dev,
- &ilo->viewport, 1, p->cp);
+ ilo->viewport.states, ilo->viewport.count, p->cp);
p->state.CC_VIEWPORT = p->gen6_CC_VIEWPORT(p->dev,
- &ilo->viewport, 1, p->cp);
+ ilo->viewport.states, ilo->viewport.count, p->cp);
session->viewport_state_changed = true;
}
/* SF_VIEWPORT, CLIP_VIEWPORT, and CC_VIEWPORT */
else if (DIRTY(VIEWPORT)) {
p->state.CLIP_VIEWPORT = p->gen6_CLIP_VIEWPORT(p->dev,
- &ilo->viewport, 1, p->cp);
+ ilo->viewport.states, ilo->viewport.count, p->cp);
p->state.SF_VIEWPORT = p->gen6_SF_VIEWPORT(p->dev,
- &ilo->viewport, 1, p->cp);
+ ilo->viewport.states, ilo->viewport.count, p->cp);
p->state.CC_VIEWPORT = p->gen6_CC_VIEWPORT(p->dev,
- &ilo->viewport, 1, p->cp);
+ ilo->viewport.states, ilo->viewport.count, p->cp);
session->viewport_state_changed = true;
}
@@ -840,9 +841,10 @@ gen6_pipeline_state_scissors(struct ilo_3d_pipeline *p,
struct gen6_pipeline_session *session)
{
/* SCISSOR_RECT */
- if (DIRTY(SCISSOR)) {
+ if (DIRTY(SCISSOR) || DIRTY(VIEWPORT)) {
+ /* there should be as many scissors as there are viewports */
p->state.SCISSOR_RECT = p->gen6_SCISSOR_RECT(p->dev,
- &ilo->scissor, 1, p->cp);
+ ilo->scissor.states, ilo->viewport.count, p->cp);
session->scissor_state_changed = true;
}