mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-18 14:41:40 +00:00
- the material descriptor set must be bound again if the pipeline changes and the new shader uses more textures than the old one
This commit is contained in:
parent
b62d5784af
commit
7b3350ae1e
2 changed files with 4 additions and 6 deletions
|
@ -627,6 +627,8 @@ void VkRenderState::BeginRenderPass(const VkRenderPassKey &key, VulkanCommandBuf
|
|||
beginInfo.addClearDepthStencil(1.0f, 0);
|
||||
cmdbuffer->beginRenderPass(beginInfo);
|
||||
cmdbuffer->bindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, passSetup->Pipeline.get());
|
||||
|
||||
mMaterial.mChanged = true;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -121,9 +121,9 @@ VulkanDescriptorSet *VkHardwareTexture::GetDescriptorSet(const FMaterialState &s
|
|||
VulkanSampler *sampler = fb->GetSamplerManager()->Get(clampmode);
|
||||
int numLayers = mat->GetLayers();
|
||||
|
||||
int maxTextures = 6;
|
||||
//int maxTextures = 6;
|
||||
auto baseView = GetImageView(tex, translation, flags);
|
||||
numLayers = clamp(numLayers, 1, maxTextures);
|
||||
//numLayers = clamp(numLayers, 1, maxTextures);
|
||||
|
||||
WriteDescriptors update;
|
||||
update.addCombinedImageSampler(descriptorSet.get(), 0, baseView, sampler, mImageLayout);
|
||||
|
@ -133,10 +133,6 @@ VulkanDescriptorSet *VkHardwareTexture::GetDescriptorSet(const FMaterialState &s
|
|||
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