use PRIM_2D_RECTANGLES instead PRIM_RECTANGLES
This commit is contained in:
parent
a95bd6a4b4
commit
331bcd236e
@ -14,7 +14,7 @@
|
||||
#define PRIM_TRIANGLES_ADJ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY ///<代表一个有六个顶点的Primitive,其中第1,3,5个顶点代表一个Triangle,而地2,4,6个点提供邻近信息.(由1起算)
|
||||
#define PRIM_TRIANGLE_STRIP_ADJ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY ///<4+2N个Vertices代表N个Primitive,其中1,3,5,7,9...代表原本的Triangle strip形成Triangle,而2,4,6,8,10...代表邻近提供信息的点.(由1起算)
|
||||
#define PRIM_PATCHS VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
|
||||
#define PRIM_RECTANGLES 0x100 ///<矩形(并非原生支持。以画点形式在每个点的Position中传递Left,Top,Width,Height。在Geometry Shader中转换为2个三角形。用于2D游戏或UI)
|
||||
#define PRIM_2D_RECTANGLES 0x100 ///<矩形(并非原生支持。以画点形式在每个点的Position中传递Left,Top,Width,Height。在Geometry Shader中转换为2个三角形。用于2D游戏或UI)
|
||||
#define PRIM_BEGIN VK_PRIMITIVE_TOPOLOGY_POINT_LIST
|
||||
#define PRIM_END VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
|
||||
constexpr uint32_t PRIM_RANGE =PRIM_END-PRIM_BEGIN+1;
|
||||
|
@ -220,12 +220,12 @@ PipelineCreater::PipelineCreater(Device *dev,const Material *material,const Rend
|
||||
bool PipelineCreater::Set(const uint topology,bool restart)
|
||||
{
|
||||
if(topology<PRIM_BEGIN||topology>PRIM_END)
|
||||
if(topology!=PRIM_RECTANGLES)return(false);
|
||||
if(topology!=PRIM_2D_RECTANGLES)return(false);
|
||||
|
||||
inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
|
||||
inputAssembly.pNext = nullptr;
|
||||
inputAssembly.flags = 0;
|
||||
inputAssembly.topology = VkPrimitiveTopology(topology==PRIM_RECTANGLES?VK_PRIMITIVE_TOPOLOGY_POINT_LIST:topology);
|
||||
inputAssembly.topology = VkPrimitiveTopology(topology==PRIM_2D_RECTANGLES?VK_PRIMITIVE_TOPOLOGY_POINT_LIST:topology);
|
||||
inputAssembly.primitiveRestartEnable = restart;
|
||||
|
||||
pipelineInfo.pInputAssemblyState = &inputAssembly;
|
||||
|
Loading…
x
Reference in New Issue
Block a user