projects
/
platform
/
upstream
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c699143
)
svga: add assertions in svga_shader_type()
author
Brian Paul
<brianp@vmware.com>
Tue, 1 Mar 2011 01:24:30 +0000
(18:24 -0700)
committer
Brian Paul
<brianp@vmware.com>
Tue, 1 Mar 2011 01:24:30 +0000
(18:24 -0700)
src/gallium/drivers/svga/svga_state_constants.c
patch
|
blob
|
history
diff --git
a/src/gallium/drivers/svga/svga_state_constants.c
b/src/gallium/drivers/svga/svga_state_constants.c
index
daf1024
..
6c3275e
100644
(file)
--- 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;
}