diff options
author | José Fonseca <[email protected]> | 2012-02-27 11:21:32 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2012-02-27 19:24:42 +0000 |
commit | e567b34f0d67a184ee17013f5262122fcd1380c0 (patch) | |
tree | aada589514103a417aac638ed5af141e16a9bb11 | |
parent | bf4fedcef3e345f5117232d58bd9000c2441de74 (diff) |
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 <[email protected]>
-rw-r--r-- | src/gallium/drivers/svga/svga_screen.c | 4 |
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: |