Skip to content

Commit

Permalink
vkd3d: Get rid of obsolete descriptor set host mapping extension.
Browse files Browse the repository at this point in the history
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
  • Loading branch information
HansKristian-Work committed Sep 25, 2024
1 parent f37303b commit 0a68c67
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 39 deletions.
8 changes: 0 additions & 8 deletions libs/vkd3d/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ static const struct vkd3d_optional_extension_info optional_device_extensions[] =
VK_EXTENSION(NV_RAW_ACCESS_CHAINS, NV_raw_access_chains),
/* VALVE extensions */
VK_EXTENSION(VALVE_MUTABLE_DESCRIPTOR_TYPE, VALVE_mutable_descriptor_type),
VK_EXTENSION(VALVE_DESCRIPTOR_SET_HOST_MAPPING, VALVE_descriptor_set_host_mapping),
/* MESA extensions */
VK_EXTENSION(MESA_IMAGE_ALIGNMENT_CONTROL, MESA_image_alignment_control),
};
Expand Down Expand Up @@ -1770,13 +1769,6 @@ static void vkd3d_physical_device_info_init(struct vkd3d_physical_device_info *i
vk_prepend_struct(&info->features2, &info->shader_image_atomic_int64_features);
}

if (vulkan_info->VALVE_descriptor_set_host_mapping)
{
info->descriptor_set_host_mapping_features.sType =
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE;
vk_prepend_struct(&info->features2, &info->descriptor_set_host_mapping_features);
}

if (vulkan_info->AMD_device_coherent_memory)
{
info->device_coherent_memory_features_amd.sType =
Expand Down
36 changes: 7 additions & 29 deletions libs/vkd3d/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -6237,8 +6237,6 @@ static HRESULT vkd3d_bindless_state_add_binding(struct vkd3d_bindless_state *bin
VkDescriptorType mutable_descriptor_types[VKD3D_MAX_MUTABLE_DESCRIPTOR_TYPES];
VkDescriptorSetLayoutBindingFlagsCreateInfo vk_binding_flags_info;
const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs;
VkDescriptorSetLayoutHostMappingInfoVALVE mapping_info;
VkDescriptorSetBindingReferenceVALVE binding_reference;
VkDescriptorSetLayoutCreateInfo vk_set_layout_info;
VkMutableDescriptorTypeCreateInfoEXT mutable_info;
VkDescriptorSetLayoutBinding *vk_binding;
Expand Down Expand Up @@ -6346,34 +6344,14 @@ static HRESULT vkd3d_bindless_state_add_binding(struct vkd3d_bindless_state *bin
ERR("Failed to create descriptor set layout, vr %d.\n", vr);

/* If we're able, we should implement descriptor copies with functions we roll ourselves. */
if (d3d12_device_uses_descriptor_buffers(device) ||
device->device_info.descriptor_set_host_mapping_features.descriptorSetHostMapping)
if (d3d12_device_uses_descriptor_buffers(device))
{
if (d3d12_device_uses_descriptor_buffers(device))
{
INFO("Device supports VK_EXT_descriptor_buffer!\n");
VK_CALL(vkGetDescriptorSetLayoutBindingOffsetEXT(device->vk_device, set_info->vk_set_layout,
set_info->binding_index, &desc_offset));
set_info->host_mapping_offset = desc_offset;
set_info->host_mapping_descriptor_size = vkd3d_get_descriptor_size_for_binding(device,
&vk_set_layout_info, set_info->binding_index);
}
else
{
INFO("Device supports VK_VALVE_descriptor_set_host_mapping!\n");
binding_reference.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_BINDING_REFERENCE_VALVE;
binding_reference.pNext = NULL;
binding_reference.descriptorSetLayout = set_info->vk_set_layout;
binding_reference.binding = set_info->binding_index;
mapping_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_HOST_MAPPING_INFO_VALVE;
mapping_info.pNext = NULL;

VK_CALL(vkGetDescriptorSetLayoutHostMappingInfoVALVE(device->vk_device,
&binding_reference, &mapping_info));

set_info->host_mapping_offset = mapping_info.descriptorOffset;
set_info->host_mapping_descriptor_size = mapping_info.descriptorSize;
}
INFO("Device supports VK_EXT_descriptor_buffer!\n");
VK_CALL(vkGetDescriptorSetLayoutBindingOffsetEXT(device->vk_device, set_info->vk_set_layout,
set_info->binding_index, &desc_offset));
set_info->host_mapping_offset = desc_offset;
set_info->host_mapping_descriptor_size = vkd3d_get_descriptor_size_for_binding(device,
&vk_set_layout_info, set_info->binding_index);

set_info->host_copy_template =
vkd3d_bindless_find_copy_template(set_info->host_mapping_descriptor_size);
Expand Down
2 changes: 0 additions & 2 deletions libs/vkd3d/vkd3d_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ struct vkd3d_vulkan_info
bool NV_raw_access_chains;
/* VALVE extensions */
bool VALVE_mutable_descriptor_type;
bool VALVE_descriptor_set_host_mapping;
/* MESA extensions */
bool MESA_image_alignment_control;

Expand Down Expand Up @@ -4459,7 +4458,6 @@ struct vkd3d_physical_device_info
VkPhysicalDeviceComputeShaderDerivativesFeaturesKHR compute_shader_derivatives_features_khr;
VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT shader_image_atomic_int64_features;
VkPhysicalDeviceImageViewMinLodFeaturesEXT image_view_min_lod_features;
VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE descriptor_set_host_mapping_features;
VkPhysicalDeviceCoherentMemoryFeaturesAMD device_coherent_memory_features_amd;
VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR ray_tracing_maintenance1_features;
VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV device_generated_commands_features_nv;
Expand Down

0 comments on commit 0a68c67

Please sign in to comment.