added GetGranularity at RenderPass

This commit is contained in:
hyzboy 2021-09-29 20:53:03 +08:00
parent 3bf1f53d4f
commit 1217edccf3
2 changed files with 16 additions and 8 deletions

View File

@ -19,6 +19,8 @@ class RenderPass
List<VkFormat> color_formats; List<VkFormat> color_formats;
VkFormat depth_format; VkFormat depth_format;
VkExtent2D granularity;
protected: protected:
ObjectList<Pipeline> pipeline_list; ObjectList<Pipeline> pipeline_list;
@ -27,14 +29,7 @@ private:
friend class DeviceRenderPassManage; friend class DeviceRenderPassManage;
RenderPass(VkDevice d,VkPipelineCache pc,VkRenderPass rp,const List<VkFormat> &cf,VkFormat df) RenderPass(VkDevice d,VkPipelineCache pc,VkRenderPass rp,const List<VkFormat> &cf,VkFormat df);
{
device=d;
pipeline_cache=pc;
render_pass=rp;
color_formats=cf;
depth_format=df;
}
public: public:
@ -53,6 +48,8 @@ public:
} }
const VkFormat GetDepthFormat()const{return depth_format;} const VkFormat GetDepthFormat()const{return depth_format;}
const VkExtent2D & GetGranularity()const{return granularity;}
public: public:
Pipeline *CreatePipeline(const Material *, PipelineData *); Pipeline *CreatePipeline(const Material *, PipelineData *);

View File

@ -5,6 +5,17 @@
#include<hgl/graph/VKMaterial.h> #include<hgl/graph/VKMaterial.h>
#include<hgl/graph/VKMaterialInstance.h> #include<hgl/graph/VKMaterialInstance.h>
VK_NAMESPACE_BEGIN VK_NAMESPACE_BEGIN
RenderPass::RenderPass(VkDevice d,VkPipelineCache pc,VkRenderPass rp,const List<VkFormat> &cf,VkFormat df)
{
device=d;
pipeline_cache=pc;
render_pass=rp;
color_formats=cf;
depth_format=df;
vkGetRenderAreaGranularity(device,render_pass,&granularity);
}
RenderPass::~RenderPass() RenderPass::~RenderPass()
{ {
pipeline_list.Clear(); pipeline_list.Clear();