ShaderModuleManage增加析构函数
This commit is contained in:
parent
9d8da06a3e
commit
684182a0d8
@ -6,6 +6,23 @@
|
|||||||
#include"VKShaderParse.h"
|
#include"VKShaderParse.h"
|
||||||
|
|
||||||
VK_NAMESPACE_BEGIN
|
VK_NAMESPACE_BEGIN
|
||||||
|
ShaderModuleManage::~ShaderModuleManage()
|
||||||
|
{
|
||||||
|
const int count=shader_list.GetCount();
|
||||||
|
|
||||||
|
if(count>0)
|
||||||
|
{
|
||||||
|
auto **p=shader_list.GetDataList();
|
||||||
|
|
||||||
|
for(int i=0;i<count;i++)
|
||||||
|
{
|
||||||
|
delete (*p)->right;
|
||||||
|
|
||||||
|
++p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const ShaderModule *ShaderModuleManage::CreateShader(const VkShaderStageFlagBits shader_stage_bit,const void *spv_data,const uint32_t spv_size)
|
const ShaderModule *ShaderModuleManage::CreateShader(const VkShaderStageFlagBits shader_stage_bit,const void *spv_data,const uint32_t spv_size)
|
||||||
{
|
{
|
||||||
VkPipelineShaderStageCreateInfo *shader_stage=new VkPipelineShaderStageCreateInfo;
|
VkPipelineShaderStageCreateInfo *shader_stage=new VkPipelineShaderStageCreateInfo;
|
||||||
@ -85,7 +102,7 @@ bool ShaderModuleManage::ReleaseShader(const ShaderModule *const_sm)
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Material *ShaderModuleManage::CreateMaterial(const VertexShaderModule *vertex_shader_module,const ShaderModule *fragment_shader_module)const
|
Material *ShaderModuleManage::CreateMaterial(const VertexShaderModule *vertex_shader_module,const ShaderModule *fragment_shader_module)const
|
||||||
{
|
{
|
||||||
if(!vertex_shader_module||!fragment_shader_module)
|
if(!vertex_shader_module||!fragment_shader_module)
|
||||||
return(nullptr);
|
return(nullptr);
|
||||||
|
@ -58,8 +58,8 @@ public:
|
|||||||
const ShaderModule *GetShader (int);
|
const ShaderModule *GetShader (int);
|
||||||
bool ReleaseShader (const ShaderModule *);
|
bool ReleaseShader (const ShaderModule *);
|
||||||
|
|
||||||
const Material * CreateMaterial(const VertexShaderModule *vertex_shader_module,const ShaderModule *fragment_shader_module)const;
|
Material * CreateMaterial(const VertexShaderModule *vertex_shader_module,const ShaderModule *fragment_shader_module)const;
|
||||||
const Material * CreateMaterial(const UTF8String &vertex_shader_filename,const UTF8String &fragment_shader_filename)
|
Material * CreateMaterial(const UTF8String &vertex_shader_filename,const UTF8String &fragment_shader_filename)
|
||||||
{
|
{
|
||||||
const ShaderModule *vs=CreateShader(VK_SHADER_STAGE_VERTEX_BIT,vertex_shader_filename);
|
const ShaderModule *vs=CreateShader(VK_SHADER_STAGE_VERTEX_BIT,vertex_shader_filename);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user