used short funcname.

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-03-18 17:58:57 +08:00
parent 529d6b7939
commit 9872f74160
12 changed files with 33 additions and 38 deletions

@ -1 +1 @@
Subproject commit 17790c141d4a2a7e9c15a90216c3060469c40258
Subproject commit 80202ff30e6e91f84e890ff641a2c132a086aff4

View File

@ -160,7 +160,7 @@ private:
fbi.SetExtent(SCREEN_WIDTH,SCREEN_HEIGHT);
gbuffer.rt=device->CreateRenderTarget(&fbi);
gbuffer.rt=device->CreateRT(&fbi);
if(!gbuffer.rt)return(false);

View File

@ -80,7 +80,7 @@ public:
{
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);
os.command_buffer=device->CreateRenderCommandBuffer();

View File

@ -220,7 +220,7 @@ public: //shader & material
PipelineLayoutData *CreatePipelineLayoutData(const MaterialDescriptorSets *);
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(Material *,const DescriptorSetType &);
@ -248,21 +248,21 @@ public:
public: //FrameBuffer相关
Framebuffer *CreateFramebuffer(RenderPass *rp,ImageView **color_list,const uint color_count,ImageView *depth);
// Framebuffer *CreateFramebuffer(RenderPass *,List<ImageView *> &color,ImageView *depth);
Framebuffer *CreateFramebuffer(RenderPass *,ImageView *color,ImageView *depth);
Framebuffer *CreateFramebuffer(RenderPass *,ImageView *);
Framebuffer *CreateFBO(RenderPass *rp,ImageView **color_list,const uint color_count,ImageView *depth);
// Framebuffer *CreateFBO(RenderPass *,List<ImageView *> &color,ImageView *depth);
Framebuffer *CreateFBO(RenderPass *,ImageView *color,ImageView *depth);
Framebuffer *CreateFBO(RenderPass *,ImageView *);
public:
RenderTarget *CreateRenderTarget( 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,RenderPass *,const uint32_t fence_count=1);
RenderTarget *CreateRT( const FramebufferInfo *fbi,const uint32_t fence_count=1);
public:
TileData *CreateTileData(const VkFormat video_format,const uint width,const uint height,const uint count); ///<创建一个Tile数据集
TileFont *CreateTileFont(FontSource *fs,int limit_count=-1); ///<创建一个Tile字体
TileFont *CreateTileFont(FontSource *fs,int limit_count=-1); ///<创建一个Tile字体
};//class GPUDevice
GPUDevice *CreateRenderDevice(VulkanInstance *inst,Window *win,const GPUPhysicalDevice *physical_device=nullptr);

View File

@ -35,5 +35,7 @@ public:
const uint32_t GetColorCount ()const{return color_count;} ///<取得颜色成分数量
const bool HasDepth ()const{return has_depth;} ///<是否包含深度成分
};//class Framebuffer
using FBO=Framebuffer;
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_FRAMEBUFFER_INCLUDE

View File

@ -23,7 +23,7 @@ namespace hgl
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:

View File

@ -101,11 +101,4 @@ public:
hgl_zero(*this);
}
};//struct Standard2DMaterial:public StandardMaterial
class MaterialCreateInfo;
Material *CreateMaterial()
{
return nullptr;
}
SHADERGEN_NAMESPACE_END

View File

@ -27,14 +27,14 @@ namespace hgl
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 height=power_to_2(h);
FramebufferInfo fbi(format,w,h);
return device->CreateRenderTarget(&fbi);
return device->CreateRT(&fbi);
}
bool ThemeEngine::Registry(Form *f,const VkFormat format)
@ -46,7 +46,7 @@ namespace hgl
Vector2f size=f->GetSize();
RenderTarget *rt=CreateRenderTarget(size.x,size.y,format);
RenderTarget *rt=CreateRT(size.x,size.y,format);
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);

View File

@ -20,7 +20,7 @@ VkFramebuffer CreateVulkanFramebuffer(VkDevice device,RenderPass *rp,const VkExt
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;
@ -78,7 +78,7 @@ Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,ImageView **color_list,
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);
//
@ -86,27 +86,27 @@ Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,ImageView **color_list,
//
// 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(!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(!iv)return(nullptr);
if(iv->hasColor())
return CreateFramebuffer(rp,&iv,1,nullptr);
return CreateFBO(rp,&iv,1,nullptr);
else
if(iv->hasDepth())
return CreateFramebuffer(rp,nullptr,0,iv);
return CreateFBO(rp,nullptr,0,iv);
else
return nullptr;
}

View File

@ -8,7 +8,7 @@
#include"VKPipelineLayoutData.h"
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);
@ -37,7 +37,7 @@ MaterialParameters *GPUDevice::CreateMP(const MaterialDescriptorSets *mds,const
if(!RangeCheck<DescriptorSetType>(desc_set_type))
return(nullptr);
DescriptorSet *ds=CreateDescriptorSets(pld,desc_set_type);
DescriptorSet *ds=CreateDS(pld,desc_set_type);
if(!ds)return(nullptr);

View File

@ -1,7 +1,7 @@
#include<hgl/graph/VKDevice.h>
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(!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;
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)
{
@ -46,7 +46,7 @@ RenderTarget *GPUDevice::CreateRenderTarget(const FramebufferInfo *fbi,RenderPas
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);
@ -54,7 +54,7 @@ RenderTarget *GPUDevice::CreateRenderTarget(const FramebufferInfo *fbi,const uin
if(!rp)return(nullptr);
return CreateRenderTarget(fbi,rp,fence_count);
return CreateRT(fbi,rp,fence_count);
}
SwapchainRenderTarget *GPUDevice::CreateSwapchainRenderTarget()

View File

@ -93,7 +93,7 @@ bool GPUDevice::CreateSwapchainFBO(Swapchain *swapchain)
if(!swapchain->sc_color[i])
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_depth->GetImageView());
}