improved BindInputAttachment at DescriptorSets, added BindInputAttachment at MaterialParameters
This commit is contained in:
@@ -57,6 +57,13 @@ namespace
|
||||
imageView=tex->GetVulkanImageView();
|
||||
imageLayout=VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||
}
|
||||
|
||||
DescriptorImageInfo(VkImageView iv)
|
||||
{
|
||||
sampler=VK_NULL_HANDLE;
|
||||
imageView=iv;
|
||||
imageLayout=VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
|
||||
}
|
||||
};//struct DescriptorImageInfo:public VkDescriptorImageInfo
|
||||
}//namespace
|
||||
|
||||
@@ -159,14 +166,14 @@ bool DescriptorSets::BindSampler(const int binding,Texture *tex,Sampler *sampler
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool DescriptorSets::BindInputAttachment(const int binding,Texture *tex)
|
||||
bool DescriptorSets::BindInputAttachment(const int binding,ImageView *iv)
|
||||
{
|
||||
if(binding<0||!tex)
|
||||
if(binding<0||!iv)
|
||||
return(false);
|
||||
|
||||
if(binded_sets.IsMember(binding))return(false);
|
||||
|
||||
DescriptorImageInfo *image_info=new DescriptorImageInfo(tex,nullptr);
|
||||
DescriptorImageInfo *image_info=new DescriptorImageInfo(iv->GetImageView());
|
||||
|
||||
image_list.Add(image_info);
|
||||
|
||||
|
@@ -41,7 +41,7 @@ Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,ImageView **color_list,
|
||||
if(*cf!=(*iv)->GetFormat())
|
||||
return(nullptr);
|
||||
|
||||
*ap=**iv;
|
||||
*ap=(*iv)->GetImageView();
|
||||
|
||||
++ap;
|
||||
++cf;
|
||||
@@ -59,7 +59,7 @@ Framebuffer *GPUDevice::CreateFramebuffer(RenderPass *rp,ImageView **color_list,
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
attachments[color_count]=*depth;
|
||||
attachments[color_count]=depth->GetImageView();
|
||||
|
||||
extent.width=depth->GetExtent().width;
|
||||
extent.height=depth->GetExtent().height;
|
||||
|
@@ -64,6 +64,22 @@ bool MaterialParameters::BindSampler(const AnsiString &name,Texture *tex,Sampler
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool MaterialParameters::BindInputAttachment(const AnsiString &name,ImageView *iv)
|
||||
{
|
||||
if(name.IsEmpty()||!iv)
|
||||
return(false);
|
||||
|
||||
const int index=mds->GetSampler(name);
|
||||
|
||||
if(index<0)
|
||||
return(false);
|
||||
|
||||
if(!descriptor_sets->BindInputAttachment(index,iv))
|
||||
return(false);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
void MaterialParameters::Update()
|
||||
{
|
||||
descriptor_sets->Update();
|
||||
|
Reference in New Issue
Block a user