svga: implement support for signed byte vertex attributes
authorBrian Paul <brianp@vmware.com>
Thu, 17 Apr 2014 15:54:47 +0000 (08:54 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 17 Apr 2014 18:29:33 +0000 (11:29 -0700)
commit615a356ee38d882e9f073dba0b8918a903094124
treeb1950dc8b9eb0c612161ff371ef280dc083cd119
parent52faafa17424a3842f150019a9d76ce626019d9f
svga: implement support for signed byte vertex attributes

There's no SVGA3D_DECLTYPE that directly corresponds to
PIPE_FORMAT_R8G8B8_SNORM.  Previously, we used the swtnl fallback
path to handle this but that's slow and causes invariance issues.
Now we fetch the attribute as SVGA3D_DECLTYPE_UBYTE4N and insert
some extra VS instructions to remap the attributes from the range
[0,1] to the range[-1,1].

Fixes Sauerbraten sw fallback.
Fixes piglit normal3b3s-invariance test.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_pipe_vertex.c
src/gallium/drivers/svga/svga_state_vs.c
src/gallium/drivers/svga/svga_tgsi.h
src/gallium/drivers/svga/svga_tgsi_emit.h
src/gallium/drivers/svga/svga_tgsi_insn.c