summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_setup.h
diff options
context:
space:
mode:
authorEdward O'Callaghan <[email protected]>2015-12-11 22:43:30 +1100
committerRoland Scheidegger <[email protected]>2015-12-11 20:09:21 +0100
commit00f97ad5def91d485de0e5dd79fd39fae9ed3ce1 (patch)
tree1d0b4e7a556c3a9cd00a4e641d675572ecc9f838 /src/gallium/drivers/softpipe/sp_setup.h
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 <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_setup.h')
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_setup.h b/src/gallium/drivers/softpipe/sp_setup.h
index 885be739033..191494acbb8 100644
--- a/src/gallium/drivers/softpipe/sp_setup.h
+++ b/src/gallium/drivers/softpipe/sp_setup.h
@@ -45,6 +45,11 @@ void
sp_setup_point( struct setup_context *setup,
const float (*v0)[4] );
+static inline unsigned
+sp_clamp_viewport_idx(int idx)
+{
+ return (PIPE_MAX_VIEWPORTS > idx && idx >= 0) ? idx : 0;
+}
struct setup_context *sp_setup_create_context( struct softpipe_context *softpipe );
void sp_setup_prepare( struct setup_context *setup );