used short funcname.
This commit is contained in:
parent
529d6b7939
commit
9872f74160
@ -1 +1 @@
|
|||||||
Subproject commit 17790c141d4a2a7e9c15a90216c3060469c40258
|
Subproject commit 80202ff30e6e91f84e890ff641a2c132a086aff4
|
@ -160,7 +160,7 @@ private:
|
|||||||
|
|
||||||
fbi.SetExtent(SCREEN_WIDTH,SCREEN_HEIGHT);
|
fbi.SetExtent(SCREEN_WIDTH,SCREEN_HEIGHT);
|
||||||
|
|
||||||
gbuffer.rt=device->CreateRenderTarget(&fbi);
|
gbuffer.rt=device->CreateRT(&fbi);
|
||||||
|
|
||||||
if(!gbuffer.rt)return(false);
|
if(!gbuffer.rt)return(false);
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
{
|
{
|
||||||
FramebufferInfo fbi(UPF_RGBA8,OFFSCREEN_SIZE,OFFSCREEN_SIZE);
|
FramebufferInfo fbi(UPF_RGBA8,OFFSCREEN_SIZE,OFFSCREEN_SIZE);
|
||||||
|
|
||||||
os.render_taget=device->CreateRenderTarget(&fbi);
|
os.render_taget=device->CreateRT(&fbi);
|
||||||
if(!os.render_taget)return(false);
|
if(!os.render_taget)return(false);
|
||||||
|
|
||||||
os.command_buffer=device->CreateRenderCommandBuffer();
|
os.command_buffer=device->CreateRenderCommandBuffer();
|
||||||
|
@ -220,7 +220,7 @@ public: //shader & material
|
|||||||
PipelineLayoutData *CreatePipelineLayoutData(const MaterialDescriptorSets *);
|
PipelineLayoutData *CreatePipelineLayoutData(const MaterialDescriptorSets *);
|
||||||
void Destroy(PipelineLayoutData *);
|
void Destroy(PipelineLayoutData *);
|
||||||
|
|
||||||
DescriptorSet * CreateDescriptorSets(const PipelineLayoutData *,const DescriptorSetType &type)const;
|
DescriptorSet * CreateDS(const PipelineLayoutData *,const DescriptorSetType &type)const;
|
||||||
MaterialParameters *CreateMP(const MaterialDescriptorSets *,const PipelineLayoutData *,const DescriptorSetType &);
|
MaterialParameters *CreateMP(const MaterialDescriptorSets *,const PipelineLayoutData *,const DescriptorSetType &);
|
||||||
MaterialParameters *CreateMP(Material *,const DescriptorSetType &);
|
MaterialParameters *CreateMP(Material *,const DescriptorSetType &);
|
||||||
|
|
||||||
@ -248,15 +248,15 @@ public:
|
|||||||
|
|
||||||
public: //FrameBuffer相关
|
public: //FrameBuffer相关
|
||||||
|
|
||||||
Framebuffer *CreateFramebuffer(RenderPass *rp,ImageView **color_list,const uint color_count,ImageView *depth);
|
Framebuffer *CreateFBO(RenderPass *rp,ImageView **color_list,const uint color_count,ImageView *depth);
|
||||||
// Framebuffer *CreateFramebuffer(RenderPass *,List<ImageView *> &color,ImageView *depth);
|
// Framebuffer *CreateFBO(RenderPass *,List<ImageView *> &color,ImageView *depth);
|
||||||
Framebuffer *CreateFramebuffer(RenderPass *,ImageView *color,ImageView *depth);
|
Framebuffer *CreateFBO(RenderPass *,ImageView *color,ImageView *depth);
|
||||||
Framebuffer *CreateFramebuffer(RenderPass *,ImageView *);
|
Framebuffer *CreateFBO(RenderPass *,ImageView *);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
RenderTarget *CreateRenderTarget( const FramebufferInfo *fbi,RenderPass *,const uint32_t fence_count=1);
|
RenderTarget *CreateRT( const FramebufferInfo *fbi,RenderPass *,const uint32_t fence_count=1);
|
||||||
RenderTarget *CreateRenderTarget( const FramebufferInfo *fbi,const uint32_t fence_count=1);
|
RenderTarget *CreateRT( const FramebufferInfo *fbi,const uint32_t fence_count=1);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -35,5 +35,7 @@ public:
|
|||||||
const uint32_t GetColorCount ()const{return color_count;} ///<取得颜色成分数量
|
const uint32_t GetColorCount ()const{return color_count;} ///<取得颜色成分数量
|
||||||
const bool HasDepth ()const{return has_depth;} ///<是否包含深度成分
|
const bool HasDepth ()const{return has_depth;} ///<是否包含深度成分
|
||||||
};//class Framebuffer
|
};//class Framebuffer
|
||||||
|
|
||||||
|
using FBO=Framebuffer;
|
||||||
VK_NAMESPACE_END
|
VK_NAMESPACE_END
|
||||||
#endif//HGL_GRAPH_VULKAN_FRAMEBUFFER_INCLUDE
|
#endif//HGL_GRAPH_VULKAN_FRAMEBUFFER_INCLUDE
|
||||||
|
@ -23,7 +23,7 @@ namespace hgl
|
|||||||
|
|
||||||
ObjectMap<Form *,ThemeForm> form_list;
|
ObjectMap<Form *,ThemeForm> form_list;
|
||||||
|
|
||||||
RenderTarget *CreateRenderTarget(const uint32_t,const uint32_t,const VkFormat);
|
RenderTarget *CreateRT(const uint32_t,const uint32_t,const VkFormat);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -101,11 +101,4 @@ public:
|
|||||||
hgl_zero(*this);
|
hgl_zero(*this);
|
||||||
}
|
}
|
||||||
};//struct Standard2DMaterial:public StandardMaterial
|
};//struct Standard2DMaterial:public StandardMaterial
|
||||||
|
|
||||||
class MaterialCreateInfo;
|
|
||||||
|
|
||||||
Material *CreateMaterial()
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
SHADERGEN_NAMESPACE_END
|
SHADERGEN_NAMESPACE_END
|
||||||
|
@ -27,14 +27,14 @@ namespace hgl
|
|||||||
return GetDefaultThemeEngine();
|
return GetDefaultThemeEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderTarget *ThemeEngine::CreateRenderTarget(const uint32_t w,const uint32_t h,const VkFormat format)
|
RenderTarget *ThemeEngine::CreateRT(const uint32_t w,const uint32_t h,const VkFormat format)
|
||||||
{
|
{
|
||||||
const uint width=power_to_2(w);
|
const uint width=power_to_2(w);
|
||||||
const uint height=power_to_2(h);
|
const uint height=power_to_2(h);
|
||||||
|
|
||||||
FramebufferInfo fbi(format,w,h);
|
FramebufferInfo fbi(format,w,h);
|
||||||
|
|
||||||
return device->CreateRenderTarget(&fbi);
|
return device->CreateRT(&fbi);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ThemeEngine::Registry(Form *f,const VkFormat format)
|
bool ThemeEngine::Registry(Form *f,const VkFormat format)
|
||||||
@ -46,7 +46,7 @@ namespace hgl
|
|||||||
|
|
||||||
Vector2f size=f->GetSize();
|
Vector2f size=f->GetSize();
|
||||||
|
|
||||||
RenderTarget *rt=CreateRenderTarget(size.x,size.y,format);
|
RenderTarget *rt=CreateRT(size.x,size.y,format);
|
||||||
|
|
||||||
if(!rt)return(false);
|
if(!rt)return(false);
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ namespace hgl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
graph::RenderTarget *rt=CreateRenderTarget(w,h,format);
|
graph::RenderTarget *rt=CreateRT(w,h,format);
|
||||||
|
|
||||||
if(!rt)return(false);
|
if(!rt)return(false);
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ VkFramebuffer CreateVulkanFramebuffer(VkDevice device,RenderPass *rp,const VkExt
|
|||||||
return fb;
|
return fb;
|
||||||
}
|
}
|
||||||
|
|
||||||
Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,ImageView **color_list,const uint color_count,ImageView *depth)
|
Framebuffer *GPUDevice::CreateFBO(RenderPass *rp,ImageView **color_list,const uint color_count,ImageView *depth)
|
||||||
{
|
{
|
||||||
uint att_count=color_count;
|
uint att_count=color_count;
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,ImageView **color_list,
|
|||||||
return(new Framebuffer(GetDevice(),fbo,extent,rp->GetVkRenderPass(),color_count,depth));
|
return(new Framebuffer(GetDevice(),fbo,extent,rp->GetVkRenderPass(),color_count,depth));
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,List<ImageView *> &color,ImageView *depth)
|
//Framebuffer *GPUDevice::CreateFBO(RenderPass *rp,List<ImageView *> &color,ImageView *depth)
|
||||||
//{
|
//{
|
||||||
// if(!rp)return(nullptr);
|
// if(!rp)return(nullptr);
|
||||||
//
|
//
|
||||||
@ -86,27 +86,27 @@ Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,ImageView **color_list,
|
|||||||
//
|
//
|
||||||
// if(color.GetCount()==0&&!depth)return(nullptr);
|
// if(color.GetCount()==0&&!depth)return(nullptr);
|
||||||
//
|
//
|
||||||
// return CreateFramebuffer(rp,color.GetData(),color.GetCount(),depth);
|
// return CreateFBO(rp,color.GetData(),color.GetCount(),depth);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,ImageView *color,ImageView *depth)
|
Framebuffer *GPUDevice::CreateFBO(RenderPass *rp,ImageView *color,ImageView *depth)
|
||||||
{
|
{
|
||||||
if(!rp)return(nullptr);
|
if(!rp)return(nullptr);
|
||||||
if(!color&&!depth)return(nullptr);
|
if(!color&&!depth)return(nullptr);
|
||||||
|
|
||||||
return CreateFramebuffer(rp,&color,1,depth);
|
return CreateFBO(rp,&color,1,depth);
|
||||||
}
|
}
|
||||||
|
|
||||||
Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,ImageView *iv)
|
Framebuffer *GPUDevice::CreateFBO(RenderPass *rp,ImageView *iv)
|
||||||
{
|
{
|
||||||
if(!rp)return(nullptr);
|
if(!rp)return(nullptr);
|
||||||
if(!iv)return(nullptr);
|
if(!iv)return(nullptr);
|
||||||
|
|
||||||
if(iv->hasColor())
|
if(iv->hasColor())
|
||||||
return CreateFramebuffer(rp,&iv,1,nullptr);
|
return CreateFBO(rp,&iv,1,nullptr);
|
||||||
else
|
else
|
||||||
if(iv->hasDepth())
|
if(iv->hasDepth())
|
||||||
return CreateFramebuffer(rp,nullptr,0,iv);
|
return CreateFBO(rp,nullptr,0,iv);
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include"VKPipelineLayoutData.h"
|
#include"VKPipelineLayoutData.h"
|
||||||
|
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
DescriptorSet *GPUDevice::CreateDescriptorSets(const PipelineLayoutData *pld,const DescriptorSetType &type)const
|
DescriptorSet *GPUDevice::CreateDS(const PipelineLayoutData *pld,const DescriptorSetType &type)const
|
||||||
{
|
{
|
||||||
RANGE_CHECK_RETURN_NULLPTR(type);
|
RANGE_CHECK_RETURN_NULLPTR(type);
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ MaterialParameters *GPUDevice::CreateMP(const MaterialDescriptorSets *mds,const
|
|||||||
if(!RangeCheck<DescriptorSetType>(desc_set_type))
|
if(!RangeCheck<DescriptorSetType>(desc_set_type))
|
||||||
return(nullptr);
|
return(nullptr);
|
||||||
|
|
||||||
DescriptorSet *ds=CreateDescriptorSets(pld,desc_set_type);
|
DescriptorSet *ds=CreateDS(pld,desc_set_type);
|
||||||
|
|
||||||
if(!ds)return(nullptr);
|
if(!ds)return(nullptr);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include<hgl/graph/VKDevice.h>
|
#include<hgl/graph/VKDevice.h>
|
||||||
|
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
RenderTarget *GPUDevice::CreateRenderTarget(const FramebufferInfo *fbi,RenderPass *rp,const uint32_t fence_count)
|
RenderTarget *GPUDevice::CreateRT(const FramebufferInfo *fbi,RenderPass *rp,const uint32_t fence_count)
|
||||||
{
|
{
|
||||||
if(!fbi)return(nullptr);
|
if(!fbi)return(nullptr);
|
||||||
if(!rp)return(nullptr);
|
if(!rp)return(nullptr);
|
||||||
@ -29,7 +29,7 @@ RenderTarget *GPUDevice::CreateRenderTarget(const FramebufferInfo *fbi,RenderPas
|
|||||||
|
|
||||||
Texture2D *depth_texture=(depth_format!=PF_UNDEFINED)?CreateTexture2D(new DepthAttachmentTextureCreateInfo(depth_format,extent)):nullptr;
|
Texture2D *depth_texture=(depth_format!=PF_UNDEFINED)?CreateTexture2D(new DepthAttachmentTextureCreateInfo(depth_format,extent)):nullptr;
|
||||||
|
|
||||||
Framebuffer *fb=CreateFramebuffer(rp,color_iv_list,color_count,depth_texture?depth_texture->GetImageView():nullptr);
|
Framebuffer *fb=CreateFBO(rp,color_iv_list,color_count,depth_texture?depth_texture->GetImageView():nullptr);
|
||||||
|
|
||||||
if(fb)
|
if(fb)
|
||||||
{
|
{
|
||||||
@ -46,7 +46,7 @@ RenderTarget *GPUDevice::CreateRenderTarget(const FramebufferInfo *fbi,RenderPas
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderTarget *GPUDevice::CreateRenderTarget(const FramebufferInfo *fbi,const uint32_t fence_count)
|
RenderTarget *GPUDevice::CreateRT(const FramebufferInfo *fbi,const uint32_t fence_count)
|
||||||
{
|
{
|
||||||
if(!fbi)return(nullptr);
|
if(!fbi)return(nullptr);
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ RenderTarget *GPUDevice::CreateRenderTarget(const FramebufferInfo *fbi,const uin
|
|||||||
|
|
||||||
if(!rp)return(nullptr);
|
if(!rp)return(nullptr);
|
||||||
|
|
||||||
return CreateRenderTarget(fbi,rp,fence_count);
|
return CreateRT(fbi,rp,fence_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
SwapchainRenderTarget *GPUDevice::CreateSwapchainRenderTarget()
|
SwapchainRenderTarget *GPUDevice::CreateSwapchainRenderTarget()
|
||||||
|
@ -93,7 +93,7 @@ bool GPUDevice::CreateSwapchainFBO(Swapchain *swapchain)
|
|||||||
if(!swapchain->sc_color[i])
|
if(!swapchain->sc_color[i])
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
swapchain->render_frame[i]=CreateFramebuffer( device_render_pass,
|
swapchain->render_frame[i]=CreateFBO( device_render_pass,
|
||||||
swapchain->sc_color[i]->GetImageView(),
|
swapchain->sc_color[i]->GetImageView(),
|
||||||
swapchain->sc_depth->GetImageView());
|
swapchain->sc_depth->GetImageView());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user