From 8a354b07857843dc33938561630d24676c52e8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 22 Oct 2014 19:19:33 -0700 Subject: [PATCH] Added line strip primitive type. --- include/bgfxdefines.h | 5 +++-- src/renderer_d3d11.cpp | 2 ++ src/renderer_d3d9.cpp | 2 ++ src/renderer_gl.cpp | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/bgfxdefines.h b/include/bgfxdefines.h index 24ae5b73..1159a975 100644 --- a/include/bgfxdefines.h +++ b/include/bgfxdefines.h @@ -57,9 +57,10 @@ #define BGFX_STATE_PT_TRISTRIP UINT64_C(0x0001000000000000) #define BGFX_STATE_PT_LINES UINT64_C(0x0002000000000000) -#define BGFX_STATE_PT_POINTS UINT64_C(0x0003000000000000) +#define BGFX_STATE_PT_LINESTRIP UINT64_C(0x0003000000000000) +#define BGFX_STATE_PT_POINTS UINT64_C(0x0004000000000000) #define BGFX_STATE_PT_SHIFT 48 -#define BGFX_STATE_PT_MASK UINT64_C(0x0003000000000000) +#define BGFX_STATE_PT_MASK UINT64_C(0x0007000000000000) #define BGFX_STATE_POINT_SIZE_SHIFT 52 #define BGFX_STATE_POINT_SIZE_MASK UINT64_C(0x0ff0000000000000) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index b5180194..8a4afe35 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -30,6 +30,7 @@ namespace bgfx { D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST, 3, 3, 0 }, { D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, 3, 1, 2 }, { D3D11_PRIMITIVE_TOPOLOGY_LINELIST, 2, 2, 0 }, + { D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP, 2, 1, 1 }, { D3D11_PRIMITIVE_TOPOLOGY_POINTLIST, 1, 1, 0 }, { D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED, 0, 0, 0 }, }; @@ -39,6 +40,7 @@ namespace bgfx "TriList", "TriStrip", "Line", + "LineStrip", "Point", }; BX_STATIC_ASSERT(BX_COUNTOF(s_primInfo) == BX_COUNTOF(s_primName)+1); diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index f00f3b4f..48cd6bf3 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -25,6 +25,7 @@ namespace bgfx { D3DPT_TRIANGLELIST, 3, 3, 0 }, { D3DPT_TRIANGLESTRIP, 3, 1, 2 }, { D3DPT_LINELIST, 2, 2, 0 }, + { D3DPT_LINESTRIP, 2, 1, 1 }, { D3DPT_POINTLIST, 1, 1, 0 }, { D3DPRIMITIVETYPE(0), 0, 0, 0 }, }; @@ -34,6 +35,7 @@ namespace bgfx "TriList", "TriStrip", "Line", + "LineStrip", "Point", }; BX_STATIC_ASSERT(BX_COUNTOF(s_primInfo) == BX_COUNTOF(s_primName)+1); diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 9f179e51..13b41788 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -27,6 +27,7 @@ namespace bgfx { GL_TRIANGLES, 3, 3, 0 }, { GL_TRIANGLE_STRIP, 3, 1, 2 }, { GL_LINES, 2, 2, 0 }, + { GL_LINE_STRIP, 2, 1, 1 }, { GL_POINTS, 1, 1, 0 }, }; @@ -35,6 +36,7 @@ namespace bgfx "TriList", "TriStrip", "Line", + "LineStrip", "Point", };