svga: implement support for signed byte vertex attributes

Graphics / Mesa 3D Graphics Library / Mesa - Brian Paul [vmware.com] - 17 April 2014 13:29 UTC

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.

615a356 svga: implement support for signed byte vertex attributes
src/gallium/drivers/svga/svga_context.h | 1 +
src/gallium/drivers/svga/svga_pipe_vertex.c | 29 +++++-
src/gallium/drivers/svga/svga_state_vs.c | 4 +
src/gallium/drivers/svga/svga_tgsi.h | 1 +
src/gallium/drivers/svga/svga_tgsi_emit.h | 2 +-
src/gallium/drivers/svga/svga_tgsi_insn.c | 128 ++++++++++++++++++++++++---
6 files changed, 151 insertions(+), 14 deletions(-)

Upstream: cgit.freedesktop.org


  • Share