summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-02-28 18:24:30 -0700
committerBrian Paul <[email protected]>2011-02-28 18:24:30 -0700
commit7e161bcf11d539ecc2482b71b21783a23e36f596 (patch)
tree9ed63bf0faf158efe94aebe2cb1b75bedf5b51c2 /src/gallium/drivers
parentc6991433ef343a8cbaf3f4cfacb74ddcd049c6a4 (diff)
svga: add assertions in svga_shader_type()
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/svga/svga_state_constants.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c
index daf1024fd02..6c3275e74c0 100644
--- a/src/gallium/drivers/svga/svga_state_constants.c
+++ b/src/gallium/drivers/svga/svga_state_constants.c
@@ -40,9 +40,12 @@
/* Convert from PIPE_SHADER_* to SVGA3D_SHADERTYPE_*
*/
-static int svga_shader_type( int unit )
+static int svga_shader_type( int shader )
{
- return unit + 1;
+ assert(PIPE_SHADER_VERTEX + 1 == SVGA3D_SHADERTYPE_VS);
+ assert(PIPE_SHADER_FRAGMENT + 1 == SVGA3D_SHADERTYPE_PS);
+ assert(shader <= PIPE_SHADER_FRAGMENT);
+ return shader + 1;
}