git.s-ol.nu ~forks/DiligentCore / fb2c370
GL backend: fixed issue with immutable sampler stages in default signature with non-separable programs assiduous 6 months ago
2 changed file(s) with 19 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
160160 ResSignDesc.Name = SignName.c_str();
161161 ResSignDesc.Resources = Resources.data();
162162 ResSignDesc.NumResources = static_cast<Uint32>(Resources.size());
163 ResSignDesc.ImmutableSamplers = LayoutDesc.ImmutableSamplers;
164 ResSignDesc.NumImmutableSamplers = LayoutDesc.NumImmutableSamplers;
165163 ResSignDesc.BindingIndex = 0;
166164 ResSignDesc.SRBAllocationGranularity = CreateInfo.PSODesc.SRBAllocationGranularity;
167165 ResSignDesc.UseCombinedTextureSamplers = true;
166
167 std::vector<ImmutableSamplerDesc> ImmutableSamplers;
168 if (m_IsProgramPipelineSupported)
169 {
170 ResSignDesc.ImmutableSamplers = LayoutDesc.ImmutableSamplers;
171 }
172 else
173 {
174 // Apply each immutable sampler to all shader stages
175 ImmutableSamplers.resize(LayoutDesc.NumImmutableSamplers);
176 for (Uint32 i = 0; i < LayoutDesc.NumImmutableSamplers; ++i)
177 {
178 ImmutableSamplers[i] = LayoutDesc.ImmutableSamplers[i];
179 ImmutableSamplers[i].ShaderStages = ActiveStages;
180 }
181 ResSignDesc.ImmutableSamplers = ImmutableSamplers.data();
182 }
183 ResSignDesc.NumImmutableSamplers = LayoutDesc.NumImmutableSamplers;
168184
169185 // Always initialize default resource signature as internal device object.
170186 // This is necessary to avoud cyclic references from TexRegionRenderer.
171171
172172 void FreeDescriptorSet(VkDescriptorPool Pool, VkDescriptorSet Set) const;
173173 void FreeCommandBuffer(VkCommandPool Pool, VkCommandBuffer CmdBuffer) const;
174
174
175175 VkMemoryRequirements GetBufferMemoryRequirements(VkBuffer vkBuffer) const;
176176 VkMemoryRequirements GetImageMemoryRequirements (VkImage vkImage ) const;
177177 VkDeviceAddress GetAccelerationStructureDeviceAddress(VkAccelerationStructureKHR AS) const;