2
0
Эх сурвалжийг харах

vulkan: add adjacency primitive support

rdb 7 жил өмнө
parent
commit
00bbcc2ece

+ 32 - 0
panda/src/vulkandisplay/vulkanGraphicsStateGuardian.cxx

@@ -1829,6 +1829,14 @@ draw_triangles(const GeomPrimitivePipelineReader *reader, bool force) {
   return do_draw_primitive(reader, force, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST);
 }
 
+/**
+ * Draws a series of disconnected triangles with adjacency information.
+ */
+bool VulkanGraphicsStateGuardian::
+draw_triangles_adj(const GeomPrimitivePipelineReader *reader, bool force) {
+  return do_draw_primitive(reader, force, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY);
+}
+
 /**
  * Draws a series of triangle strips.
  */
@@ -1837,6 +1845,14 @@ draw_tristrips(const GeomPrimitivePipelineReader *reader, bool force) {
   return do_draw_primitive(reader, force, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP);
 }
 
+/**
+ * Draws a series of triangle strips with adjacency information.
+ */
+bool VulkanGraphicsStateGuardian::
+draw_tristrips_adj(const GeomPrimitivePipelineReader *reader, bool force) {
+  return do_draw_primitive(reader, force, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY);
+}
+
 /**
  * Draws a series of triangle fans.
  */
@@ -1862,6 +1878,14 @@ draw_lines(const GeomPrimitivePipelineReader *reader, bool force) {
   return do_draw_primitive(reader, force, VK_PRIMITIVE_TOPOLOGY_LINE_LIST);
 }
 
+/**
+ * Draws a series of disconnected line segments with adjacency information.
+ */
+bool VulkanGraphicsStateGuardian::
+draw_lines_adj(const GeomPrimitivePipelineReader *reader, bool force) {
+  return do_draw_primitive(reader, force, VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY);
+}
+
 /**
  * Draws a series of line strips.
  */
@@ -1870,6 +1894,14 @@ draw_linestrips(const GeomPrimitivePipelineReader *reader, bool force) {
   return do_draw_primitive(reader, force, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP);
 }
 
+/**
+ * Draws a series of line strips with adjacency information.
+ */
+bool VulkanGraphicsStateGuardian::
+draw_linestrips_adj(const GeomPrimitivePipelineReader *reader, bool force) {
+  return do_draw_primitive(reader, force, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY);
+}
+
 /**
  * Draws a series of disconnected points.
  */

+ 8 - 0
panda/src/vulkandisplay/vulkanGraphicsStateGuardian.h

@@ -85,16 +85,24 @@ public:
                                      bool force);
   virtual bool draw_triangles(const GeomPrimitivePipelineReader *reader,
                               bool force);
+  virtual bool draw_triangles_adj(const GeomPrimitivePipelineReader *reader,
+                                  bool force);
   virtual bool draw_tristrips(const GeomPrimitivePipelineReader *reader,
                               bool force);
+  virtual bool draw_tristrips_adj(const GeomPrimitivePipelineReader *reader,
+                                  bool force);
   virtual bool draw_trifans(const GeomPrimitivePipelineReader *reader,
                             bool force);
   virtual bool draw_patches(const GeomPrimitivePipelineReader *reader,
                             bool force);
   virtual bool draw_lines(const GeomPrimitivePipelineReader *reader,
                           bool force);
+  virtual bool draw_lines_adj(const GeomPrimitivePipelineReader *reader,
+                              bool force);
   virtual bool draw_linestrips(const GeomPrimitivePipelineReader *reader,
                                bool force);
+  virtual bool draw_linestrips_adj(const GeomPrimitivePipelineReader *reader,
+                                   bool force);
   virtual bool draw_points(const GeomPrimitivePipelineReader *reader,
                            bool force);
   virtual void end_draw_primitives();