submodules update
This commit is contained in:
parent
6a472780b3
commit
004e0037a4
@ -1 +1 @@
|
|||||||
Subproject commit 35058b7f881c2a2ad00bf21c083aa88a70277864
|
Subproject commit 85ffab5f6a19bfff3fc3588d4f1656b2664ca19a
|
@ -1 +1 @@
|
|||||||
Subproject commit 74e1d564be1a9c2af21b3fc2e4ca319e23b6616a
|
Subproject commit a100a10dc8750903e5bf3779c1f337f5a940910e
|
@ -1 +1 @@
|
|||||||
Subproject commit 4ac904d834b45e6cb3edc1767726850615ca89ee
|
Subproject commit d4087fe96c0acd43d376ec660bd5f1f351755448
|
2
CMCore
2
CMCore
@ -1 +1 @@
|
|||||||
Subproject commit 6107f34e21e5f104091d28b3db17e6cbeb7dc967
|
Subproject commit 25748fde9bdb02d8d1f857838d9e7111db4103a4
|
@ -21,20 +21,22 @@ use_cm_module(AssetsManage)
|
|||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
include_directories(${ULRE_3RDPTY_ROOT_PATH}/jsoncpp/include)
|
include_directories(${ULRE_3RDPTY_ROOT_PATH}/jsoncpp/include)
|
||||||
add_subdirectory(3rdpty/jsoncpp)
|
add_subdirectory(3rdpty/jsoncpp)
|
||||||
|
SET(JSONCPP_LIBRARY jsoncpp_lib)
|
||||||
|
ELSE()
|
||||||
|
SET(JSONCPP_LIBRARY jsoncpp)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(ULRE CMCore
|
SET(ULRE CMCore
|
||||||
CMPlatform
|
CMPlatform
|
||||||
CMAssetsManage
|
CMAssetsManage
|
||||||
ULRE.Util
|
ULRE.Util
|
||||||
ULRE.Shader
|
|
||||||
ULRE.RenderDevice.Vulkan
|
ULRE.RenderDevice.Vulkan
|
||||||
ULRE.SceneGraph
|
ULRE.SceneGraph
|
||||||
MathGeoLib
|
MathGeoLib
|
||||||
spirv-cross-core
|
spirv-cross-core
|
||||||
SPIRV
|
SPIRV
|
||||||
glslang
|
glslang
|
||||||
jsoncpp_lib
|
${JSONCPP_LIBRARY}
|
||||||
${RENDER_LIBRARY}
|
${RENDER_LIBRARY}
|
||||||
${Vulkan_LIBRARIES})
|
${Vulkan_LIBRARIES})
|
||||||
|
|
||||||
@ -58,9 +60,7 @@ add_subdirectory(${SPIRV_CROSS_PATH}/external/glslang/glslang)
|
|||||||
include_directories(${SPIRV_CROSS_PATH}/external/glslang)
|
include_directories(${SPIRV_CROSS_PATH}/external/glslang)
|
||||||
add_subdirectory(${SPIRV_CROSS_PATH}/external/glslang/SPIRV)
|
add_subdirectory(${SPIRV_CROSS_PATH}/external/glslang/SPIRV)
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
add_subdirectory(${SPIRV_CROSS_PATH}/external/glslang/OGLCompilersDLL)
|
add_subdirectory(${SPIRV_CROSS_PATH}/external/glslang/OGLCompilersDLL)
|
||||||
endif()
|
|
||||||
|
|
||||||
SET(ULRE_RUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
SET(ULRE_RUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
@ -76,15 +76,15 @@ private:
|
|||||||
ubo_mvp=device->CreateUBO(sizeof(WorldMatrix),&cam.matrix);
|
ubo_mvp=device->CreateUBO(sizeof(WorldMatrix),&cam.matrix);
|
||||||
|
|
||||||
if(!ubo_mvp)
|
if(!ubo_mvp)
|
||||||
return(nullptr);
|
return(false);
|
||||||
|
|
||||||
material_instance->BindUBO("world",ubo_mvp);
|
material_instance->BindUBO("world",ubo_mvp);
|
||||||
material_instance->BindUBO("fragment_world",ubo_mvp);
|
material_instance->BindUBO("fragment_world",ubo_mvp);
|
||||||
|
|
||||||
material_instance->Update();
|
material_instance->Update();
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitVBO()
|
void InitVBO()
|
||||||
{
|
{
|
||||||
vertex_buffer =device->CreateVBO(FMT_RG32F, VERTEX_COUNT,vertex_data);
|
vertex_buffer =device->CreateVBO(FMT_RG32F, VERTEX_COUNT,vertex_data);
|
||||||
@ -94,7 +94,7 @@ private:
|
|||||||
|
|
||||||
bool InitPipeline()
|
bool InitPipeline()
|
||||||
{
|
{
|
||||||
AutoDelete<vulkan::PipelineCreater>
|
AutoDelete<vulkan::PipelineCreater>
|
||||||
pipeline_creater=new vulkan::PipelineCreater(device,material,sc_render_target);
|
pipeline_creater=new vulkan::PipelineCreater(device,material,sc_render_target);
|
||||||
pipeline_creater->CloseCullFace();
|
pipeline_creater->CloseCullFace();
|
||||||
pipeline_creater->Set(PRIM_TRIANGLE_STRIP);
|
pipeline_creater->Set(PRIM_TRIANGLE_STRIP);
|
||||||
|
@ -50,7 +50,7 @@ protected:
|
|||||||
|
|
||||||
vulkan::Device * device =nullptr;
|
vulkan::Device * device =nullptr;
|
||||||
vulkan::SwapchainRenderTarget * sc_render_target =nullptr;
|
vulkan::SwapchainRenderTarget * sc_render_target =nullptr;
|
||||||
|
|
||||||
vulkan::Semaphore * present_complete_semaphore =nullptr,
|
vulkan::Semaphore * present_complete_semaphore =nullptr,
|
||||||
* render_complete_semaphore =nullptr;
|
* render_complete_semaphore =nullptr;
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
SAFE_CLEAR(shader_manage);
|
SAFE_CLEAR(shader_manage);
|
||||||
SAFE_CLEAR(device);
|
SAFE_CLEAR(device);
|
||||||
SAFE_CLEAR(win);
|
SAFE_CLEAR(win);
|
||||||
SAFE_CLEAR(inst);
|
SAFE_CLEAR(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,8 +93,6 @@ public:
|
|||||||
return(false);
|
return(false);
|
||||||
#endif//
|
#endif//
|
||||||
|
|
||||||
InitDefaultShaderBuildResource();
|
|
||||||
|
|
||||||
InitNativeWindowSystem();
|
InitNativeWindowSystem();
|
||||||
|
|
||||||
VK_NAMESPACE::InitVulkanProperties();
|
VK_NAMESPACE::InitVulkanProperties();
|
||||||
@ -153,7 +151,7 @@ public:
|
|||||||
virtual void MouseUp(uint){}
|
virtual void MouseUp(uint){}
|
||||||
virtual void MouseMove(){}
|
virtual void MouseMove(){}
|
||||||
virtual void MouseWheel(int,int,uint){}
|
virtual void MouseWheel(int,int,uint){}
|
||||||
|
|
||||||
void OnResize(int w,int h)
|
void OnResize(int w,int h)
|
||||||
{
|
{
|
||||||
if(w>0&&h>0)
|
if(w>0&&h>0)
|
||||||
@ -167,7 +165,7 @@ public:
|
|||||||
{
|
{
|
||||||
if(cmd_buf)
|
if(cmd_buf)
|
||||||
SAFE_CLEAR_OBJECT_ARRAY(cmd_buf,swap_chain_count);
|
SAFE_CLEAR_OBJECT_ARRAY(cmd_buf,swap_chain_count);
|
||||||
|
|
||||||
sc_render_target=device->GetSwapchainRT();
|
sc_render_target=device->GetSwapchainRT();
|
||||||
|
|
||||||
swap_chain_count=sc_render_target->GetImageCount();
|
swap_chain_count=sc_render_target->GetImageCount();
|
||||||
@ -189,7 +187,7 @@ public:
|
|||||||
const vulkan::IndexBuffer *ib=r->GetIndexBuffer();
|
const vulkan::IndexBuffer *ib=r->GetIndexBuffer();
|
||||||
|
|
||||||
vulkan::CommandBuffer *cb=cmd_buf[index];
|
vulkan::CommandBuffer *cb=cmd_buf[index];
|
||||||
|
|
||||||
cb->Begin();
|
cb->Begin();
|
||||||
cb->BeginRenderPass(sc_render_target->GetRenderPass(),sc_render_target->GetFramebuffer(index));
|
cb->BeginRenderPass(sc_render_target->GetRenderPass(),sc_render_target->GetFramebuffer(index));
|
||||||
cb->Bind(p);
|
cb->Bind(p);
|
||||||
@ -204,7 +202,7 @@ public:
|
|||||||
cb->EndRenderPass();
|
cb->EndRenderPass();
|
||||||
cb->End();
|
cb->End();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildCommandBuffer(vulkan::Pipeline *p,vulkan::MaterialInstance *mi,vulkan::Renderable *r)
|
void BuildCommandBuffer(vulkan::Pipeline *p,vulkan::MaterialInstance *mi,vulkan::Renderable *r)
|
||||||
{
|
{
|
||||||
for(uint32_t i=0;i<swap_chain_count;i++)
|
for(uint32_t i=0;i<swap_chain_count;i++)
|
||||||
@ -218,7 +216,7 @@ public:
|
|||||||
|
|
||||||
void BuildCommandBuffer(uint32_t index,RenderList *rl)
|
void BuildCommandBuffer(uint32_t index,RenderList *rl)
|
||||||
{
|
{
|
||||||
if(!rl)return;
|
if(!rl)return;
|
||||||
|
|
||||||
vulkan::CommandBuffer *cb=cmd_buf[index];
|
vulkan::CommandBuffer *cb=cmd_buf[index];
|
||||||
|
|
||||||
@ -234,9 +232,9 @@ public:
|
|||||||
for(uint32_t i=0;i<swap_chain_count;i++)
|
for(uint32_t i=0;i<swap_chain_count;i++)
|
||||||
BuildCommandBuffer(i,rl);
|
BuildCommandBuffer(i,rl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildCurrentCommandBuffer(RenderList *rl)
|
void BuildCurrentCommandBuffer(RenderList *rl)
|
||||||
{
|
{
|
||||||
BuildCommandBuffer(sc_render_target->GetCurrentFrameIndices(),rl);
|
BuildCommandBuffer(sc_render_target->GetCurrentFrameIndices(),rl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +248,7 @@ public:
|
|||||||
virtual void SubmitDraw(int index)
|
virtual void SubmitDraw(int index)
|
||||||
{
|
{
|
||||||
VkCommandBuffer cb=*cmd_buf[index];
|
VkCommandBuffer cb=*cmd_buf[index];
|
||||||
|
|
||||||
sc_render_target->Submit(cb,present_complete_semaphore,render_complete_semaphore);
|
sc_render_target->Submit(cb,present_complete_semaphore,render_complete_semaphore);
|
||||||
sc_render_target->PresentBackbuffer(render_complete_semaphore);
|
sc_render_target->PresentBackbuffer(render_complete_semaphore);
|
||||||
sc_render_target->Wait();
|
sc_render_target->Wait();
|
||||||
@ -297,7 +295,7 @@ public:
|
|||||||
{
|
{
|
||||||
if(!VulkanApplicationFramework::Init(w,h))
|
if(!VulkanApplicationFramework::Init(w,h))
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
InitCamera(w,h);
|
InitCamera(w,h);
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
@ -314,7 +312,7 @@ public:
|
|||||||
|
|
||||||
camera.Refresh(); //更新矩阵计算
|
camera.Refresh(); //更新矩阵计算
|
||||||
}
|
}
|
||||||
|
|
||||||
void Resize(int w,int h)override
|
void Resize(int w,int h)override
|
||||||
{
|
{
|
||||||
camera.width=w;
|
camera.width=w;
|
||||||
|
@ -91,8 +91,8 @@ MATERIAL_NAMESPACE_BEGIN
|
|||||||
#undef MATERIAL_DATA_FORMAT_DEFINE
|
#undef MATERIAL_DATA_FORMAT_DEFINE
|
||||||
};//enum class DataFormat
|
};//enum class DataFormat
|
||||||
|
|
||||||
inline const ComponentDataType GetFormatBaseType (const enum class DataFormat &df){return ComponentDataType(uint(df)>>4);}
|
inline const ComponentDataType GetFormatBaseType (const DataFormat &df){return ComponentDataType(uint(df)>>4);}
|
||||||
inline const uint GetFormatChannels (const enum class DataFormat &df){return uint(df)&7;}
|
inline const uint GetFormatChannels (const DataFormat &df){return uint(df)&7;}
|
||||||
|
|
||||||
using ComponentBitsConfig=uint32;
|
using ComponentBitsConfig=uint32;
|
||||||
|
|
||||||
@ -110,6 +110,6 @@ MATERIAL_NAMESPACE_BEGIN
|
|||||||
bool LinearColorspace; ///<是要求线性颜色空间
|
bool LinearColorspace; ///<是要求线性颜色空间
|
||||||
};//struct ComponentConfig
|
};//struct ComponentConfig
|
||||||
|
|
||||||
const ComponentConfig *GetConfig(const enum class Component c);
|
const ComponentConfig *GetConfig(const Component c);
|
||||||
MATERIAL_NAMESPACE_END
|
MATERIAL_NAMESPACE_END
|
||||||
#endif//HGL_GRAPH_MATERIAL_COMPONENT_INCLUDE
|
#endif//HGL_GRAPH_MATERIAL_COMPONENT_INCLUDE
|
||||||
|
@ -41,7 +41,7 @@ protected:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
NodeList node_list[node::NodeType::NODE_TYPE_RANGE_SIZE];
|
NodeList node_list[(size_t)node::NodeType::NODE_TYPE_RANGE_SIZE];
|
||||||
|
|
||||||
uint in_location=0;
|
uint in_location=0;
|
||||||
uint out_location=0;
|
uint out_location=0;
|
||||||
|
@ -49,7 +49,11 @@ public:
|
|||||||
virtual bool Join(node::Node *,param::OutputParam *); ///<增加一个关联节点
|
virtual bool Join(node::Node *,param::OutputParam *); ///<增加一个关联节点
|
||||||
virtual void Break(){join_node=nullptr;join_param=nullptr;} ///<断开一个关联节点
|
virtual void Break(){join_node=nullptr;join_param=nullptr;} ///<断开一个关联节点
|
||||||
|
|
||||||
virtual bool Check(){return(must_join?join_param:true);} ///<检测当前节点是否可用
|
virtual bool Check() ///<检测当前节点是否可用
|
||||||
|
{
|
||||||
|
if(must_join&&!join_param)return(false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
};//class InputParam:public Param
|
};//class InputParam:public Param
|
||||||
SHADER_PARAM_NAMESPACE_END
|
SHADER_PARAM_NAMESPACE_END
|
||||||
#endif//#ifndef HGL_GRAPH_SHADER_PARAM_INPUT_INCLUDE
|
#endif//#ifndef HGL_GRAPH_SHADER_PARAM_INPUT_INCLUDE
|
||||||
|
@ -163,18 +163,18 @@ VK_NAMESPACE_BEGIN
|
|||||||
#define FMT_D32F_S8U VK_FORMAT_D32_SFLOAT_S8_UINT
|
#define FMT_D32F_S8U VK_FORMAT_D32_SFLOAT_S8_UINT
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of data bytes/pixel Palette size Line Segments User For Compressed components/Description
|
* Type of data bytes/pixel Palette size Line Segments User For Compressed components/Description
|
||||||
* ----------------+----------------+--------------+-----------------+--------------------+----------------------------------------------------+--------------------------------------
|
* ---------------+----------------+---------------+-----------------+-------------------+-----------------------------+--------------------------------------
|
||||||
* BC1(S3TC1) RGB5/RGB5A1 0.5 4 1 Color maps,Normal maps
|
* BC1(S3TC1) RGB5/RGB5A1 0.5 4 1 Color maps,Normal maps
|
||||||
* BC2(S3TC3) RGBA4 1 4 1 BC1+uncompress 4-bit alpha
|
* BC2(S3TC3) RGBA4 1 4 1 BC1+uncompress 4-bit alpha
|
||||||
* BC3(S3TC5) RGBA4 1 4 1Color+1Alpha Color maps BC1+BC4 compress alpha
|
* BC3(S3TC5) RGBA4 1 4 1 Color+1Alpha Color maps BC1+BC4 compress alpha
|
||||||
* BC4(ATI1/3Dc+) Grayscale 0.5 8 1
|
* BC4(ATI1/3Dc+) Grayscale 0.5 8 1
|
||||||
* BC5(ATI2/3Dc) 2xGrayscale 1 8 per channel 1 per channel Tangent-space normal maps
|
* BC5(ATI2/3Dc) 2xGrayscale 1 8 per channel 1 per channel Tangent-space normal maps
|
||||||
* BC6H FloatRGB 1 8-16 1-2 HDR images
|
* BC6H FloatRGB 1 8-16 1-2 HDR images
|
||||||
* BC7 RGB/RGBA 1 4-16 1-3 High-quality color maps
|
* BC7 RGB/RGBA 1 4-16 1-3 High-quality color maps
|
||||||
*
|
*
|
||||||
* ETC RGB
|
* ETC RGB
|
||||||
* ETC2 RGB/RGBA1 Color maps,Normals
|
* ETC2 RGB/RGBA1 Color maps,Normals
|
||||||
* EAC Grayscale
|
* EAC Grayscale
|
||||||
* 2xEAC RG
|
* 2xEAC RG
|
||||||
* ETC2+EAC RGBA
|
* ETC2+EAC RGBA
|
||||||
@ -183,7 +183,7 @@ VK_NAMESPACE_BEGIN
|
|||||||
* PVRTC2 RGB/RGBA1/RGBA
|
* PVRTC2 RGB/RGBA1/RGBA
|
||||||
*
|
*
|
||||||
* ASTC R/RG/RGB/RGBA
|
* ASTC R/RG/RGB/RGBA
|
||||||
* ----------------+----------------+--------------+-----------------+--------------------+----------------------------------------------------+
|
* ---------------+----------------+---------------+-----------------+-------------------+-----------------------------+--------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define FMT_BC1_RGBUN VK_FORMAT_BC1_RGB_UNORM_BLOCK
|
#define FMT_BC1_RGBUN VK_FORMAT_BC1_RGB_UNORM_BLOCK
|
||||||
|
@ -62,21 +62,7 @@ public:
|
|||||||
|
|
||||||
~RenderpassCreater()=default;
|
~RenderpassCreater()=default;
|
||||||
|
|
||||||
int AddSwapchainImage()
|
int AddSwapchainImage();
|
||||||
{
|
|
||||||
VkAttachmentDescription desc;
|
|
||||||
|
|
||||||
desc.format = device->GetSurfaceFormat();
|
|
||||||
desc.samples = VK_SAMPLE_COUNT_1_BIT;
|
|
||||||
desc.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
|
||||||
desc.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
|
||||||
desc.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
|
||||||
desc.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
|
||||||
desc.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
|
||||||
desc.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
|
|
||||||
|
|
||||||
return atta_desc_list.Add(desc);
|
|
||||||
}
|
|
||||||
};//class RenderpassCreater
|
};//class RenderpassCreater
|
||||||
VK_NAMESPACE_END
|
VK_NAMESPACE_END
|
||||||
#endif//HGL_GRAPH_VULKAN_RENDER_PASS_INCLUDE
|
#endif//HGL_GRAPH_VULKAN_RENDER_PASS_INCLUDE
|
||||||
|
@ -24,7 +24,7 @@ public:
|
|||||||
SubmitQueue(Device *dev,VkQueue q,const uint32_t fence_count=1);
|
SubmitQueue(Device *dev,VkQueue q,const uint32_t fence_count=1);
|
||||||
virtual ~SubmitQueue();
|
virtual ~SubmitQueue();
|
||||||
|
|
||||||
bool Wait(const bool wait_wall=true,const uint64 time_out=HGL_NANO_SEC_PER_SEC);
|
bool Wait(const bool wait_wall=true,const uint64_t time_out=HGL_NANO_SEC_PER_SEC);
|
||||||
bool Submit(const VkCommandBuffer &cmd_buf,vulkan::Semaphore *wait_sem,vulkan::Semaphore *complete_sem);
|
bool Submit(const VkCommandBuffer &cmd_buf,vulkan::Semaphore *wait_sem,vulkan::Semaphore *complete_sem);
|
||||||
bool Submit(const VkCommandBuffer *cmd_buf,const uint32_t count,vulkan::Semaphore *wait_sem,vulkan::Semaphore *complete_sem);
|
bool Submit(const VkCommandBuffer *cmd_buf,const uint32_t count,vulkan::Semaphore *wait_sem,vulkan::Semaphore *complete_sem);
|
||||||
};//class SumbitQueue
|
};//class SumbitQueue
|
||||||
|
@ -1,2 +1 @@
|
|||||||
add_subdirectory(Vulkan)
|
add_subdirectory(Vulkan)
|
||||||
add_subdirectory(Shader)
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
SHADER_PARAM_NAMESPACE_BEGIN
|
SHADER_PARAM_NAMESPACE_BEGIN
|
||||||
const char *GetTypename(const ParamType pt)
|
const char *GetTypename(const ParamType pt)
|
||||||
{
|
{
|
||||||
constexpr char *name[]=
|
const char *name[]=
|
||||||
{
|
{
|
||||||
"?boolean?",
|
"?boolean?",
|
||||||
"?float?",
|
"?float?",
|
||||||
@ -83,4 +83,4 @@ const char *GetTypename(const ParamType pt)
|
|||||||
|
|
||||||
return name[size_t(pt)-size_t(ParamType::BEGIN_RANGE)];
|
return name[size_t(pt)-size_t(ParamType::BEGIN_RANGE)];
|
||||||
}
|
}
|
||||||
SHADER_PARAM_NAMESPACE_END
|
SHADER_PARAM_NAMESPACE_END
|
||||||
|
@ -42,8 +42,8 @@ SET(RENDER_DEVICE_VULKAN_SOURCE VKFormat.cpp
|
|||||||
VKRenderable.cpp
|
VKRenderable.cpp
|
||||||
VKSampler.cpp)
|
VKSampler.cpp)
|
||||||
|
|
||||||
SET(RENDER_DEVICE_VULKAN_POD_SOURCE pod/VKPipelineCreateInfo.POD.cpp
|
SET(RENDER_DEVICE_VULKAN_POD_SOURCE POD/VKPipelineCreateInfo.POD.cpp
|
||||||
pod/VKTextureLoader.cpp)
|
POD/VKTextureLoader.cpp)
|
||||||
|
|
||||||
SOURCE_GROUP("Device" FILES ${VK_DEVICE_SOURCE})
|
SOURCE_GROUP("Device" FILES ${VK_DEVICE_SOURCE})
|
||||||
SOURCE_GROUP("Descriptor Sets" FILES ${VK_DESCRIPTOR_SETS_SOURCE})
|
SOURCE_GROUP("Descriptor Sets" FILES ${VK_DESCRIPTOR_SETS_SOURCE})
|
||||||
|
@ -140,11 +140,11 @@ bool LoadFromFile(const OSString &filename,VK_NAMESPACE::PipelineCreater *pc)
|
|||||||
if(filename.IsEmpty()||!pc)
|
if(filename.IsEmpty()||!pc)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
void *data;
|
char *data;
|
||||||
uint size=filesystem::LoadFileToMemory(filename,(void **)&data);
|
uint size=filesystem::LoadFileToMemory(filename,(void **)&data);
|
||||||
|
|
||||||
bool result=pc->LoadFromMemory((uchar *)data,size);
|
bool result=pc->LoadFromMemory((uchar *)data,size);
|
||||||
|
|
||||||
delete[] data;
|
delete[] data;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,8 @@
|
|||||||
#include<hgl/graph/vulkan/VKTexture.h>
|
#include<hgl/graph/vulkan/VKTexture.h>
|
||||||
#include<hgl/graph/vulkan/VKDevice.h>
|
#include<hgl/graph/vulkan/VKDevice.h>
|
||||||
|
|
||||||
#ifdef _DEBUG
|
|
||||||
#include<iostream>
|
#include<iostream>
|
||||||
#include<iomanip>
|
#include<iomanip>
|
||||||
#endif//_DEBUG
|
|
||||||
|
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
Swapchain *CreateSwapchain(const DeviceAttribute *attr,const VkExtent2D &acquire_extent);
|
Swapchain *CreateSwapchain(const DeviceAttribute *attr,const VkExtent2D &acquire_extent);
|
||||||
|
@ -218,7 +218,7 @@ RenderPass *Device::CreateRenderPass( const List<VkAttachmentDescription> &des
|
|||||||
{
|
{
|
||||||
if(!attr->physical_device->IsColorAttachmentOptimal(*cf)
|
if(!attr->physical_device->IsColorAttachmentOptimal(*cf)
|
||||||
&&!attr->physical_device->IsColorAttachmentLinear(*cf))
|
&&!attr->physical_device->IsColorAttachmentLinear(*cf))
|
||||||
return(false);
|
return(nullptr);
|
||||||
|
|
||||||
++cf;
|
++cf;
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ RenderPass *Device::CreateRenderPass( const List<VkAttachmentDescription> &des
|
|||||||
|
|
||||||
if(!attr->physical_device->IsDepthAttachmentOptimal(depth_format)
|
if(!attr->physical_device->IsDepthAttachmentOptimal(depth_format)
|
||||||
&&!attr->physical_device->IsDepthAttachmentLinear(depth_format))
|
&&!attr->physical_device->IsDepthAttachmentLinear(depth_format))
|
||||||
return(false);
|
return(nullptr);
|
||||||
|
|
||||||
VkRenderPassCreateInfo rp_info;
|
VkRenderPassCreateInfo rp_info;
|
||||||
rp_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
|
rp_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
|
||||||
@ -250,10 +250,10 @@ RenderPass *Device::CreateRenderPass( const List<VkAttachmentDescription> &des
|
|||||||
RenderPass *Device::CreateRenderPass(VkFormat color_format,VkFormat depth_format,VkImageLayout color_final_layout,VkImageLayout depth_final_layout) const
|
RenderPass *Device::CreateRenderPass(VkFormat color_format,VkFormat depth_format,VkImageLayout color_final_layout,VkImageLayout depth_final_layout) const
|
||||||
{
|
{
|
||||||
if(!attr->physical_device->IsColorAttachmentOptimal(color_format))
|
if(!attr->physical_device->IsColorAttachmentOptimal(color_format))
|
||||||
return(false);
|
return(nullptr);
|
||||||
|
|
||||||
if(!attr->physical_device->IsDepthAttachmentOptimal(depth_format))
|
if(!attr->physical_device->IsDepthAttachmentOptimal(depth_format))
|
||||||
return(false);
|
return(nullptr);
|
||||||
|
|
||||||
List<VkAttachmentReference> color_ref;
|
List<VkAttachmentReference> color_ref;
|
||||||
VkAttachmentReference depth_ref;
|
VkAttachmentReference depth_ref;
|
||||||
|
@ -76,10 +76,7 @@ bool Device::CreateSwapchainColorTexture()
|
|||||||
AutoDeleteArray<VkImage> sc_images=new VkImage[swapchain->swap_chain_count];
|
AutoDeleteArray<VkImage> sc_images=new VkImage[swapchain->swap_chain_count];
|
||||||
|
|
||||||
if(vkGetSwapchainImagesKHR(attr->device,swapchain->swap_chain,&(swapchain->swap_chain_count),sc_images)!=VK_SUCCESS)
|
if(vkGetSwapchainImagesKHR(attr->device,swapchain->swap_chain,&(swapchain->swap_chain_count),sc_images)!=VK_SUCCESS)
|
||||||
{
|
|
||||||
delete sc_images;
|
|
||||||
return(false);
|
return(false);
|
||||||
}
|
|
||||||
|
|
||||||
VkImage *ip=sc_images;
|
VkImage *ip=sc_images;
|
||||||
Texture2D *tex;
|
Texture2D *tex;
|
||||||
|
@ -7,7 +7,7 @@ Memory *Device::CreateMemory(const VkMemoryRequirements &req,uint32_t properties
|
|||||||
uint32_t index;
|
uint32_t index;
|
||||||
|
|
||||||
if(!attr->physical_device->CheckMemoryType(req.memoryTypeBits,properties,&index))
|
if(!attr->physical_device->CheckMemoryType(req.memoryTypeBits,properties,&index))
|
||||||
return(false);
|
return(nullptr);
|
||||||
|
|
||||||
VkMemoryAllocateInfo alloc_info;
|
VkMemoryAllocateInfo alloc_info;
|
||||||
|
|
||||||
|
@ -1,7 +1,24 @@
|
|||||||
#include<hgl/graph/vulkan/VKRenderPass.h>
|
#include<hgl/graph/vulkan/VKRenderPass.h>
|
||||||
|
#include<hgl/graph/vulkan/VKDevice.h>
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
RenderPass::~RenderPass()
|
RenderPass::~RenderPass()
|
||||||
{
|
{
|
||||||
vkDestroyRenderPass(device,render_pass,nullptr);
|
vkDestroyRenderPass(device,render_pass,nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int RenderpassCreater::AddSwapchainImage()
|
||||||
|
{
|
||||||
|
VkAttachmentDescription desc;
|
||||||
|
|
||||||
|
desc.format = device->GetSurfaceFormat();
|
||||||
|
desc.samples = VK_SAMPLE_COUNT_1_BIT;
|
||||||
|
desc.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
||||||
|
desc.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
||||||
|
desc.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||||
|
desc.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||||
|
desc.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
|
desc.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
|
||||||
|
|
||||||
|
return atta_desc_list.Add(desc);
|
||||||
|
}
|
||||||
VK_NAMESPACE_END
|
VK_NAMESPACE_END
|
||||||
|
@ -66,8 +66,8 @@ const ShaderModule *ShaderModuleManage::CreateShader(const VkShaderStageFlagBits
|
|||||||
|
|
||||||
const ShaderModule *ShaderModuleManage::CreateShader(const VkShaderStageFlagBits shader_stage_bit,const OSString &filename)
|
const ShaderModule *ShaderModuleManage::CreateShader(const VkShaderStageFlagBits shader_stage_bit,const OSString &filename)
|
||||||
{
|
{
|
||||||
void *spv_data;
|
char *spv_data;
|
||||||
int64 spv_size=hgl::filesystem::LoadFileToMemory(filename,&spv_data);
|
int64 spv_size=hgl::filesystem::LoadFileToMemory(filename,(void **)&spv_data);
|
||||||
|
|
||||||
if(spv_size<=0)
|
if(spv_size<=0)
|
||||||
return(nullptr);
|
return(nullptr);
|
||||||
|
@ -1194,7 +1194,7 @@ namespace hgl
|
|||||||
GeometryCreater3D gc(db,mtl);
|
GeometryCreater3D gc(db,mtl);
|
||||||
|
|
||||||
if(!gc.Init(6))
|
if(!gc.Init(6))
|
||||||
return(false);
|
return(nullptr);
|
||||||
|
|
||||||
VB3f *vertex=gc.GetVertex();
|
VB3f *vertex=gc.GetVertex();
|
||||||
VB4f *color=gc.GetColor();
|
VB4f *color=gc.GetColor();
|
||||||
@ -1239,7 +1239,7 @@ namespace hgl
|
|||||||
GeometryCreater3D gc(db,mtl);
|
GeometryCreater3D gc(db,mtl);
|
||||||
|
|
||||||
if(!gc.Init(8))
|
if(!gc.Init(8))
|
||||||
return(false);
|
return(nullptr);
|
||||||
|
|
||||||
VB3f *vertex=gc.GetVertex();
|
VB3f *vertex=gc.GetVertex();
|
||||||
|
|
||||||
@ -1268,4 +1268,4 @@ namespace hgl
|
|||||||
return gc.Finish();
|
return gc.Finish();
|
||||||
}
|
}
|
||||||
}//namespace graph
|
}//namespace graph
|
||||||
}//namespace hgl
|
}//namespace hgl
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include<hgl/graph/Mesh.h>
|
#include<hgl/graph/Mesh.h>
|
||||||
#include<hgl/graph/Material.h>
|
#include<hgl/graph/Material.h>
|
||||||
#include<hgl/graph/VertexBuffer.h>
|
#include<hgl/graph/VertexBuffer.h>
|
||||||
#include<hgl/io/FileInputStream.h>
|
#include<hgl/io/FileInputStream.h>
|
||||||
#include<hgl/io/DataInputStream.h>
|
#include<hgl/io/DataInputStream.h>
|
||||||
#include<hgl/LogInfo.h>
|
#include<hgl/log/LogInfo.h>
|
||||||
|
|
||||||
namespace hgl
|
namespace hgl
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include<hgl/graph/SceneDB.h>
|
#include<hgl/graph/SceneDB.h>
|
||||||
#include<hgl/graph/SceneNode.h>
|
#include<hgl/graph/SceneNode.h>
|
||||||
#include<hgl/graph/Material.h>
|
#include<hgl/graph/Material.h>
|
||||||
#include<hgl/graph/Mesh.h>
|
#include<hgl/graph/Mesh.h>
|
||||||
#include<hgl/io/FileInputStream.h>
|
#include<hgl/io/FileInputStream.h>
|
||||||
#include<hgl/io/DataInputStream.h>
|
#include<hgl/io/DataInputStream.h>
|
||||||
#include<hgl/filesystem/FileSystem.h>
|
#include<hgl/filesystem/FileSystem.h>
|
||||||
#include<hgl/LogInfo.h>
|
#include<hgl/log/LogInfo.h>
|
||||||
|
|
||||||
namespace hgl
|
namespace hgl
|
||||||
{
|
{
|
||||||
|
@ -32,7 +32,7 @@ MATERIAL_NAMESPACE_BEGIN
|
|||||||
};
|
};
|
||||||
};//namespace
|
};//namespace
|
||||||
|
|
||||||
const ComponentConfig *GetConfig(const enum class Component c)
|
const ComponentConfig *GetConfig(const Component c)
|
||||||
{
|
{
|
||||||
if(c<=Component::BEGIN_RANGE
|
if(c<=Component::BEGIN_RANGE
|
||||||
||c>=Component::END_RANGE)return(nullptr);
|
||c>=Component::END_RANGE)return(nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user