From 00f97ad5def91d485de0e5dd79fd39fae9ed3ce1 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Fri, 11 Dec 2015 22:43:30 +1100 Subject: 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 Reviewed-by: Roland Scheidegger --- src/gallium/drivers/softpipe/sp_setup.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gallium/drivers/softpipe/sp_setup.h') 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 ); -- cgit v1.2.3