summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/svga/svga_screen.c')
-rw-r--r--src/gallium/drivers/svga/svga_screen.c4
1 files changed, 2 insertions, 2 deletions
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: