summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_prim_assembler.h
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2013-04-18 03:08:41 -0700
committerZack Rusin <zackr@vmware.com>2013-04-18 11:51:22 -0700
commit12eab7cc564a6928197f9b87ded9e368e56976f0 (patch)
treee4d157930258f4cfe4ab173cf178ea9b7e51478f /src/gallium/auxiliary/draw/draw_prim_assembler.h
parente4752d0f56b90a5565936b1e05bb48edb1baa3ac (diff)
downloadexternal_mesa3d-12eab7cc564a6928197f9b87ded9e368e56976f0.zip
external_mesa3d-12eab7cc564a6928197f9b87ded9e368e56976f0.tar.gz
external_mesa3d-12eab7cc564a6928197f9b87ded9e368e56976f0.tar.bz2
draw: implement primitive assembler
Input assembler needs to be able to decompose adjacency primitives into something that can be understood by the rest of the pipeline. The specs say that the adjacency primitives are *only* visible in the geometry shader, for everything else they need to be decomposed. Which in most of the cases is not an issue, because the geometry shader always decomposes them for us, but without geometry shader we were passing unchanged adjacency primitives to the rest of the pipeline and causing crashes everywhere. This commit introduces a primitive assembler which, if geometry shader is missing and the input primitive is one of the adjacency primitives, decomposes them into something that the rest of the pipeline can understand. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_prim_assembler.h')
-rw-r--r--src/gallium/auxiliary/draw/draw_prim_assembler.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_prim_assembler.h b/src/gallium/auxiliary/draw/draw_prim_assembler.h
new file mode 100644
index 0000000..2ef7c51
--- /dev/null
+++ b/src/gallium/auxiliary/draw/draw_prim_assembler.h
@@ -0,0 +1,62 @@
+/**************************************************************************
+ *
+ * Copyright 2013 VMware, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/*
+ * Input assembler needs to be able to decompose adjacency primitives
+ * into something that can be understood by the rest of the pipeline.
+ * The specs say that the adjacency primitives are *only* visible
+ * in the geometry shader, for everything else they need to be
+ * decomposed. Which in most of the cases is not an issue, because the
+ * geometry shader always decomposes them for us, but without geometry
+ * shader we were passing unchanged adjacency primitives to the
+ * rest of the pipeline and causing crashes everywhere.
+ * If geometry shader is missing and the input primitive is one of
+ * the adjacency primitives we use the code from this file to
+ * decompose them into something that the rest of the pipeline can
+ * understand.
+ *
+ */
+
+#ifndef DRAW_PRIM_ASSEMBLER_H
+#define DRAW_PRIM_ASSEMBLER_H
+
+#include "draw/draw_private.h"
+
+boolean
+draw_prim_assembler_is_required(const struct draw_context *draw,
+ const struct draw_prim_info *prim_info,
+ const struct draw_vertex_info *vert_info);
+
+void
+draw_prim_assembler_run(struct draw_context *draw,
+ const struct draw_prim_info *in_prim_info,
+ const struct draw_vertex_info *in_vert_info,
+ struct draw_prim_info *out_prim_info,
+ struct draw_vertex_info *out_vert_info);
+
+
+#endif