svga: add VS code to set attribute W component to 1

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

There's a few 3-component vertex attribute formats that have no equivalent SVGA3D_DECLTYPE_x format. Previously, we had to use the swtnl code to handle them. This patch lets us use hwtnl for more vertex attribute types by fetching 3-component attributes as 4-component attributes and explicitly setting the W component to 1.

This lets us handle PIPE_FORMAT_R16G16B16_SNORM/UNORM and PIPE_FORMAT_R8G8B8_UNORM vertex attribs without using the swtnl path.

Fixes piglit normal3b3s GL_SHORT test.

851645a svga: add VS code to set attribute W component to 1
src/gallium/drivers/svga/svga_context.h | 1 +
src/gallium/drivers/svga/svga_pipe_vertex.c | 30 ++++++-
src/gallium/drivers/svga/svga_state_vs.c | 1 +
src/gallium/drivers/svga/svga_tgsi.h | 1 +
src/gallium/drivers/svga/svga_tgsi_insn.c | 113 ++++++++++++++++-----------
5 files changed, 100 insertions(+), 46 deletions(-)

Upstream: cgit.freedesktop.org


  • Share