radv: Implement VK_VALVE_descriptor_set_host_mapping.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15363>
This commit is contained in:
Hans-Kristian Arntzen 2022-02-22 11:42:54 +01:00 committed by Marge Bot
parent 6c0bc7eb07
commit 86a7b5e276
2 changed files with 32 additions and 1 deletions

View File

@ -1552,6 +1552,29 @@ radv_UpdateDescriptorSetWithTemplate(VkDevice _device, VkDescriptorSet descripto
radv_update_descriptor_set_with_template_impl(device, NULL, set, descriptorUpdateTemplate, pData);
}
VKAPI_ATTR void VKAPI_CALL
radv_GetDescriptorSetLayoutHostMappingInfoVALVE(
VkDevice _device, const VkDescriptorSetBindingReferenceVALVE *pBindingReference,
VkDescriptorSetLayoutHostMappingInfoVALVE *pHostMapping)
{
struct radv_descriptor_set_layout *set_layout =
radv_descriptor_set_layout_from_handle(pBindingReference->descriptorSetLayout);
const struct radv_descriptor_set_binding_layout *binding_layout =
set_layout->binding + pBindingReference->binding;
pHostMapping->descriptorOffset = binding_layout->offset;
pHostMapping->descriptorSize = binding_layout->size;
}
VKAPI_ATTR void VKAPI_CALL
radv_GetDescriptorSetHostMappingVALVE(VkDevice _device, VkDescriptorSet descriptorSet,
void **ppData)
{
RADV_FROM_HANDLE(radv_descriptor_set, set, descriptorSet);
*ppData = set->header.mapped_ptr;
}
VKAPI_ATTR VkResult VKAPI_CALL
radv_CreateSamplerYcbcrConversion(VkDevice _device,
const VkSamplerYcbcrConversionCreateInfo *pCreateInfo,

View File

@ -557,6 +557,7 @@ radv_physical_device_get_supported_extensions(const struct radv_physical_device
.NV_compute_shader_derivatives = true,
.NV_mesh_shader = device->use_ngg && device->rad_info.chip_class >= GFX10_3 &&
device->instance->perftest_flags & RADV_PERFTEST_NV_MS && !device->use_llvm,
.VALVE_descriptor_set_host_mapping = true,
.VALVE_mutable_descriptor_type = true,
};
}
@ -1700,6 +1701,12 @@ radv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
features->textureCompressionASTC_HDR = false;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_SET_HOST_MAPPING_FEATURES_VALVE: {
VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *features =
(VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE *)ext;
features->descriptorSetHostMapping = true;
break;
}
default:
break;
}
@ -3228,7 +3235,8 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
device->vk.enabled_extensions.EXT_buffer_device_address ||
device->vk.enabled_extensions.KHR_buffer_device_address ||
device->vk.enabled_extensions.KHR_ray_tracing_pipeline ||
device->vk.enabled_extensions.KHR_acceleration_structure;
device->vk.enabled_extensions.KHR_acceleration_structure ||
device->vk.enabled_extensions.VALVE_descriptor_set_host_mapping;
device->robust_buffer_access = robust_buffer_access || robust_buffer_access2;
device->robust_buffer_access2 = robust_buffer_access2;