added VKPrimitiveData.h
This commit is contained in:
parent
5391f0f4aa
commit
6dba761a80
@ -1,27 +1,11 @@
|
||||
#ifndef HGL_GRAPH_VULKAN_PRIMITIVE_INCLUDE
|
||||
#define HGL_GRAPH_VULKAN_PRIMITIVE_INCLUDE
|
||||
|
||||
#include<hgl/graph/VKIndexBuffer.h>
|
||||
#include<hgl/type/Map.h>
|
||||
#include<hgl/type/String.h>
|
||||
#include<hgl/math/Math.h>
|
||||
#include<hgl/graph/AABB.h>
|
||||
#include<hgl/graph/VKVertexAttribBuffer.h>
|
||||
#include<hgl/graph/VKPrimitiveData.h>
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
struct PrimitiveData
|
||||
{
|
||||
uint32_t vertex_count;
|
||||
|
||||
uint32_t va_count;
|
||||
|
||||
VABAccess *vab_list;
|
||||
|
||||
IndexBufferAccess ib_access;
|
||||
|
||||
AABB BoundingBox;
|
||||
};
|
||||
|
||||
/**
|
||||
* 单一图元数据
|
||||
*/
|
||||
@ -44,11 +28,6 @@ protected:
|
||||
|
||||
friend class RenderableNode;
|
||||
|
||||
uint ref_count=0;
|
||||
|
||||
uint RefInc(){return ++ref_count;}
|
||||
uint RefDec(){return --ref_count;}
|
||||
|
||||
public:
|
||||
|
||||
Primitive(GPUDevice *dev,const AnsiString &n,const uint32_t vc=0)
|
||||
@ -60,8 +39,6 @@ public:
|
||||
|
||||
virtual ~Primitive()=default;
|
||||
|
||||
const uint GetRefCount()const{return ref_count;}
|
||||
|
||||
void SetBoundingBox(const AABB &aabb){BoundingBox=aabb;}
|
||||
const AABB & GetBoundingBox()const {return BoundingBox;}
|
||||
|
||||
|
22
inc/hgl/graph/VKPrimitiveData.h
Normal file
22
inc/hgl/graph/VKPrimitiveData.h
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include<hgl/graph/VKVertexAttribBuffer.h>
|
||||
#include<hgl/graph/VKIndexBuffer.h>
|
||||
#include<hgl/graph/AABB.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
|
||||
struct PrimitiveData
|
||||
{
|
||||
uint32_t vertex_count;
|
||||
|
||||
uint32_t va_count;
|
||||
|
||||
VABAccess *vab_list;
|
||||
|
||||
IndexBufferAccess ib_access;
|
||||
|
||||
AABB BoundingBox;
|
||||
};
|
||||
|
||||
VK_NAMESPACE_END
|
@ -13,6 +13,15 @@ SET(SG_VDM_SOURCE ${SG_INCLUDE_PATH}/VertexAttribDataAccess.h
|
||||
|
||||
SOURCE_GROUP("VertexDataManager" FILES ${SG_VDM_SOURCE})
|
||||
|
||||
SET(SG_PRIMITIVE_SOURCE ${SG_INCLUDE_PATH}/VKPrimitiveData.h
|
||||
${SG_INCLUDE_PATH}/VKPrimitive.h
|
||||
Vulkan/VKPrimitive.cpp
|
||||
${SG_INCLUDE_PATH}/VKRenderablePrimitiveCreater.h
|
||||
${SG_INCLUDE_PATH}/PrimitiveCreater.h
|
||||
PrimitiveCreater.cpp)
|
||||
|
||||
SOURCE_GROUP("Primitive" FILES ${SG_PRIMITIVE_SOURCE})
|
||||
|
||||
SET(TILE_SOURCE ${SG_INCLUDE_PATH}/TileData.h
|
||||
TileData.cpp)
|
||||
|
||||
@ -23,8 +32,6 @@ SET(GEOMETRY_FILES ${SG_INCLUDE_PATH}/InlineGeometry.h
|
||||
#${SG_INCLUDE_PATH}/Spline.h
|
||||
InlineGeometry.cpp
|
||||
#Mesh.cpp
|
||||
${SG_INCLUDE_PATH}/PrimitiveCreater.h
|
||||
PrimitiveCreater.cpp
|
||||
)
|
||||
|
||||
SOURCE_GROUP("Geometry" FILES ${GEOMETRY_FILES})
|
||||
@ -86,7 +93,6 @@ IF(WIN32)
|
||||
ENDIF(WIN32)
|
||||
|
||||
SET(VK_RR_SOURCE ${SG_INCLUDE_PATH}/VKRenderResource.h
|
||||
${SG_INCLUDE_PATH}/VKRenderablePrimitiveCreater.h
|
||||
Vulkan/VKRenderResource.cpp
|
||||
Vulkan/VKRenderResourceMaterial.cpp)
|
||||
|
||||
@ -235,9 +241,7 @@ SET(VK_CMD_BUFFER_SOURCE ${SG_INCLUDE_PATH}/VKCommandBuffer.h
|
||||
|
||||
SOURCE_GROUP("Vulkan\\Command Buffer" FILES ${VK_CMD_BUFFER_SOURCE})
|
||||
|
||||
SET(VK_RENDERABLE_SOURCE ${SG_INCLUDE_PATH}/VKPrimitive.h
|
||||
${SG_INCLUDE_PATH}/VKRenderable.h
|
||||
Vulkan/VKPrimitive.cpp
|
||||
SET(VK_RENDERABLE_SOURCE ${SG_INCLUDE_PATH}/VKRenderable.h
|
||||
Vulkan/VKRenderable.cpp
|
||||
Vulkan/VKTileData.cpp
|
||||
Vulkan/VKTileFont.cpp)
|
||||
@ -297,6 +301,7 @@ SET(VULKAN_RENDER_SOURCE ${VK_RR_SOURCE}
|
||||
|
||||
add_cm_library(ULRE.SceneGraph "ULRE" ${SCENE_GRAPH_HEADER}
|
||||
${SCENE_GRAPH_SOURCE}
|
||||
${SG_PRIMITIVE_SOURCE}
|
||||
${GEOMETRY_FILES}
|
||||
${LIGHT_FILES}
|
||||
|
||||
|
@ -136,7 +136,7 @@ namespace hgl
|
||||
if(vbo_map.GetCount()>0)
|
||||
{
|
||||
const auto *sp=vbo_map.GetDataList();
|
||||
for(uint i=0;i<vbo_map.GetCount();i++)
|
||||
for(int i=0;i<vbo_map.GetCount();i++)
|
||||
{
|
||||
if((*sp)->value.vab)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user