summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.h b/src/gallium/drivers/llvmpipe/lp_setup.h
index 1f55aa41c7f..712ed145d8e 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.h
+++ b/src/gallium/drivers/llvmpipe/lp_setup.h
@@ -154,4 +154,10 @@ void
lp_setup_end_query(struct lp_setup_context *setup,
struct llvmpipe_query *pq);
+static INLINE unsigned
+lp_clamp_scissor_idx(int idx)
+{
+ return (PIPE_MAX_VIEWPORTS > idx && idx >= 0) ? idx : 0;
+}
+
#endif