mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- bind a texture in all descriptor slots
This commit is contained in:
parent
ec7a874a61
commit
b62d5784af
1 changed files with 9 additions and 1 deletions
|
@ -121,14 +121,22 @@ VulkanDescriptorSet *VkHardwareTexture::GetDescriptorSet(const FMaterialState &s
|
|||
VulkanSampler *sampler = fb->GetSamplerManager()->Get(clampmode);
|
||||
int numLayers = mat->GetLayers();
|
||||
|
||||
int maxTextures = 6;
|
||||
auto baseView = GetImageView(tex, translation, flags);
|
||||
numLayers = clamp(numLayers, 1, maxTextures);
|
||||
|
||||
WriteDescriptors update;
|
||||
update.addCombinedImageSampler(descriptorSet.get(), 0, GetImageView(tex, translation, flags), sampler, mImageLayout);
|
||||
update.addCombinedImageSampler(descriptorSet.get(), 0, baseView, sampler, mImageLayout);
|
||||
for (int i = 1; i < numLayers; i++)
|
||||
{
|
||||
FTexture *layer;
|
||||
auto systex = static_cast<VkHardwareTexture*>(mat->GetLayer(i, 0, &layer));
|
||||
update.addCombinedImageSampler(descriptorSet.get(), i, systex->GetImageView(layer, 0, mat->isExpanded() ? CTF_Expand : 0), sampler, systex->mImageLayout);
|
||||
}
|
||||
for (int i = numLayers; i < maxTextures; i++)
|
||||
{
|
||||
update.addCombinedImageSampler(descriptorSet.get(), i, baseView, sampler, mImageLayout);
|
||||
}
|
||||
update.updateSets(fb->device);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue