summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_quad_depth_test.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>2015-12-11 22:43:30 +1100
committerRoland Scheidegger <sroland@vmware.com>2015-12-11 20:09:21 +0100
commit00f97ad5def91d485de0e5dd79fd39fae9ed3ce1 (patch)
tree1d0b4e7a556c3a9cd00a4e641d675572ecc9f838 /src/gallium/drivers/softpipe/sp_quad_depth_test.c
parent6c2c1e0ffeb265aa508e0ce8e552e10b0b5c5962 (diff)
softpipe: implement some support for multiple viewports
Mostly related to making sure the rasterizer can correctly pick out the correct scissor box for the current viewport. Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_quad_depth_test.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_depth_test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
index bac40c013b3..4cce9e9bc12 100644
--- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c
+++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c
@@ -785,6 +785,7 @@ depth_test_quads_fallback(struct quad_stage *qs,
boolean interp_depth = !fsInfo->writes_z;
boolean shader_stencil_ref = fsInfo->writes_stencil;
struct depth_data data;
+ unsigned vp_idx = quads[0]->input.viewport_index;
data.use_shader_stencil_refs = FALSE;
@@ -804,8 +805,8 @@ depth_test_quads_fallback(struct quad_stage *qs,
quads[0]->input.y0, quads[0]->input.layer);
data.clamp = !qs->softpipe->rasterizer->depth_clip;
- near_val = qs->softpipe->viewport.translate[2] - qs->softpipe->viewport.scale[2];
- far_val = near_val + (qs->softpipe->viewport.scale[2] * 2.0);
+ near_val = qs->softpipe->viewports[vp_idx].translate[2] - qs->softpipe->viewports[vp_idx].scale[2];
+ far_val = near_val + (qs->softpipe->viewports[vp_idx].scale[2] * 2.0);
data.minval = MIN2(near_val, far_val);
data.maxval = MAX2(near_val, far_val);