svga: handle TGSI_SEMANTIC_CLIPDIST/VERTEX semantics
authorBrian Paul <brianp@vmware.com>
Mon, 2 Apr 2012 18:05:50 +0000 (20:05 +0200)
committerBrian Paul <brianp@vmware.com>
Fri, 6 Apr 2012 20:10:50 +0000 (14:10 -0600)
We can't support these vertex attributes, but don't die in an assertion.
Issue a warning instead.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48142

src/gallium/drivers/svga/svga_tgsi_decl_sm30.c

index a4e80b5571d77b7495972460affe571956c1a051..e9adf3a0cbb25add502e032f41ffccf2c2b095e1 100644 (file)
@@ -72,6 +72,13 @@ translate_vs_ps_semantic(struct svga_shader_emitter *emit,
       *idx = semantic.Index;
       *usage = SVGA3D_DECLUSAGE_NORMAL;
       break;
+   case TGSI_SEMANTIC_CLIPDIST:
+   case TGSI_SEMANTIC_CLIPVERTEX:
+      /* XXX at this time we don't support clip distance or clip vertices */
+      debug_warn_once("unsupported clip distance/vertex attribute\n");
+      *usage = SVGA3D_DECLUSAGE_TEXCOORD;
+      *idx = 0;
+      return TRUE;
    default:
       assert(0);
       *usage = SVGA3D_DECLUSAGE_TEXCOORD;