From e567b34f0d67a184ee17013f5262122fcd1380c0 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 27 Feb 2012 11:21:32 +0000 Subject: svga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX. Some backends may advertise more temps than SVGA3D_TEMPREG_MAX, but the driver is hardwired to only support up to the value defined by SVGA3D_TEMPREG_MAX, so clamp to it. Reviewed-by: Brian Paul --- src/gallium/drivers/svga/svga_screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index fe6e6a030b0..d29a5049e30 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -238,7 +238,7 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en case PIPE_SHADER_CAP_MAX_TEMPS: if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS, &result)) return 32; - return result.u; + return MIN2(result.u, SVGA3D_TEMPREG_MAX); case PIPE_SHADER_CAP_MAX_ADDRS: case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR: /* @@ -287,7 +287,7 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en case PIPE_SHADER_CAP_MAX_TEMPS: if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS, &result)) return 32; - return result.u; + return MIN2(result.u, SVGA3D_TEMPREG_MAX); case PIPE_SHADER_CAP_MAX_ADDRS: return 1; case PIPE_SHADER_CAP_MAX_PREDS: -- cgit v1.2.3