some changes to try

This commit is contained in:
Turánszki János
2026-01-28 08:43:33 +01:00
parent faca132906
commit 53e79ff3ed
3 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -404,8 +404,8 @@ static const BindlessResource<RaytracingAccelerationStructure> bindless_accelera
// But vk::binding works correctly in this case.
// HLSL register space declaration is working well with Vulkan when spaces are not overlapping.
// This layout with two descriptor sets can be implemented onn Vulkan side with mutable descriptors.
static const uint DESCRIPTOR_SET_BINDLESS_RESOURCE = 1;
static const uint DESCRIPTOR_SET_BINDLESS_SAMPLER = 2;
static const uint DESCRIPTOR_SET_BINDLESS_SAMPLER = 1;
static const uint DESCRIPTOR_SET_BINDLESS_RESOURCE = 2;
[[vk::binding(0, DESCRIPTOR_SET_BINDLESS_SAMPLER)]] SamplerState bindless_samplers[];
[[vk::binding(0, DESCRIPTOR_SET_BINDLESS_RESOURCE)]] ByteAddressBuffer bindless_buffers[];
+5 -5
View File
@@ -3222,15 +3222,15 @@ using namespace vulkan_internal;
assert(features_1_2.descriptorBindingStorageTexelBufferUpdateAfterBind == VK_TRUE);
// Note: bindless uniform buffer is not used, don't need to check it
allocationhandler->bindless_samplers.init(this, VK_DESCRIPTOR_TYPE_SAMPLER, std::min(BINDLESS_SAMPLER_CAPACITY, properties_1_2.maxDescriptorSetUpdateAfterBindSampledImages));
descriptor_set_layouts[DESCRIPTOR_SET_BINDLESS_SAMPLER] = allocationhandler->bindless_samplers.descriptorSetLayout;
uint32_t bindless_resource_capacity_real = BINDLESS_RESOURCE_CAPACITY;
bindless_resource_capacity_real = std::min(bindless_resource_capacity_real, properties_1_2.maxDescriptorSetUpdateAfterBindSampledImages);
bindless_resource_capacity_real = std::min(bindless_resource_capacity_real, properties_1_2.maxDescriptorSetUpdateAfterBindStorageImages);
bindless_resource_capacity_real = std::min(bindless_resource_capacity_real, properties_1_2.maxDescriptorSetUpdateAfterBindStorageBuffers);
allocationhandler->bindless_resources.init(this, VK_DESCRIPTOR_TYPE_MUTABLE_EXT, bindless_resource_capacity_real);
descriptor_set_layouts[DESCRIPTOR_SET_BINDLESS_RESOURCE] = allocationhandler->bindless_resources.descriptorSetLayout;
allocationhandler->bindless_samplers.init(this, VK_DESCRIPTOR_TYPE_SAMPLER, std::min(BINDLESS_SAMPLER_CAPACITY, properties_1_2.maxDescriptorSetUpdateAfterBindSampledImages));
descriptor_set_layouts[DESCRIPTOR_SET_BINDLESS_SAMPLER] = allocationhandler->bindless_samplers.descriptorSetLayout;
}
// Pipeline layouts:
@@ -6392,8 +6392,8 @@ using namespace vulkan_internal;
vulkan_check(vkBeginCommandBuffer(commandlist.GetCommandBuffer(), &beginInfo));
const VkDescriptorSet descriptor_sets[] = {
allocationhandler->bindless_resources.descriptorSet,
allocationhandler->bindless_samplers.descriptorSet,
allocationhandler->bindless_resources.descriptorSet,
};
if (queue == QUEUE_GRAPHICS)
@@ -8483,8 +8483,8 @@ using namespace vulkan_internal;
// Note: bind descriptor set for RT here instead of BeginCommandList to not set it needlessly
const VkDescriptorSet descriptor_sets[] = {
allocationhandler->bindless_resources.descriptorSet,
allocationhandler->bindless_samplers.descriptorSet,
allocationhandler->bindless_resources.descriptorSet,
};
vkCmdBindDescriptorSets(
commandlist.GetCommandBuffer(),
+3 -2
View File
@@ -114,8 +114,8 @@ namespace wi::graphics
enum DESCRIPTOR_SET
{
DESCRIPTOR_SET_BINDINGS,
DESCRIPTOR_SET_BINDLESS_RESOURCE,
DESCRIPTOR_SET_BINDLESS_SAMPLER,
DESCRIPTOR_SET_BINDLESS_RESOURCE,
DESCRIPTOR_SET_COUNT,
};
VkDescriptorSetLayout descriptor_set_layouts[DESCRIPTOR_SET_COUNT] = {};
@@ -619,7 +619,8 @@ namespace wi::graphics
const VkDescriptorBindingFlags bindingFlags =
VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT |
VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT |
VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT;
VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT |
VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT;
VkDescriptorSetLayoutBindingFlagsCreateInfo bindingFlagsInfo = {};
bindingFlagsInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO;
bindingFlagsInfo.bindingCount = 1;