Commit bd1279bd authored by Jason Ekstrand's avatar Jason Ekstrand

Get rid of a bunch of KHR suffixes

Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez's avatarSamuel Iglesias Gonsálvez <siglesias@igalia.com>
parent af461986
...@@ -1480,7 +1480,7 @@ anv_cmd_buffer_execbuf(struct anv_device *device, ...@@ -1480,7 +1480,7 @@ anv_cmd_buffer_execbuf(struct anv_device *device,
} else { } else {
int merge = anv_gem_sync_file_merge(device, in_fence, impl->fd); int merge = anv_gem_sync_file_merge(device, in_fence, impl->fd);
if (merge == -1) if (merge == -1)
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR); return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE);
close(impl->fd); close(impl->fd);
close(in_fence); close(in_fence);
......
...@@ -878,7 +878,7 @@ VkResult anv_ResetCommandPool( ...@@ -878,7 +878,7 @@ VkResult anv_ResetCommandPool(
void anv_TrimCommandPool( void anv_TrimCommandPool(
VkDevice device, VkDevice device,
VkCommandPool commandPool, VkCommandPool commandPool,
VkCommandPoolTrimFlagsKHR flags) VkCommandPoolTrimFlags flags)
{ {
/* Nothing for us to do here. Our pools stay pretty tidy. */ /* Nothing for us to do here. Our pools stay pretty tidy. */
} }
...@@ -1026,7 +1026,7 @@ void anv_CmdPushDescriptorSetKHR( ...@@ -1026,7 +1026,7 @@ void anv_CmdPushDescriptorSetKHR(
void anv_CmdPushDescriptorSetWithTemplateKHR( void anv_CmdPushDescriptorSetWithTemplateKHR(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
VkPipelineLayout _layout, VkPipelineLayout _layout,
uint32_t _set, uint32_t _set,
const void* pData) const void* pData)
......
...@@ -460,7 +460,7 @@ anv_descriptor_set_create(struct anv_device *device, ...@@ -460,7 +460,7 @@ anv_descriptor_set_create(struct anv_device *device,
if (pool->free_list != EMPTY) { if (pool->free_list != EMPTY) {
return vk_error(VK_ERROR_FRAGMENTED_POOL); return vk_error(VK_ERROR_FRAGMENTED_POOL);
} else { } else {
return vk_error(VK_ERROR_OUT_OF_POOL_MEMORY_KHR); return vk_error(VK_ERROR_OUT_OF_POOL_MEMORY);
} }
} }
...@@ -892,9 +892,9 @@ anv_descriptor_set_write_template(struct anv_descriptor_set *set, ...@@ -892,9 +892,9 @@ anv_descriptor_set_write_template(struct anv_descriptor_set *set,
VkResult anv_CreateDescriptorUpdateTemplate( VkResult anv_CreateDescriptorUpdateTemplate(
VkDevice _device, VkDevice _device,
const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate) VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate)
{ {
ANV_FROM_HANDLE(anv_device, device, _device); ANV_FROM_HANDLE(anv_device, device, _device);
struct anv_descriptor_update_template *template; struct anv_descriptor_update_template *template;
...@@ -908,7 +908,7 @@ VkResult anv_CreateDescriptorUpdateTemplate( ...@@ -908,7 +908,7 @@ VkResult anv_CreateDescriptorUpdateTemplate(
template->bind_point = pCreateInfo->pipelineBindPoint; template->bind_point = pCreateInfo->pipelineBindPoint;
if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR) if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET)
template->set = pCreateInfo->set; template->set = pCreateInfo->set;
template->entry_count = pCreateInfo->descriptorUpdateEntryCount; template->entry_count = pCreateInfo->descriptorUpdateEntryCount;
...@@ -934,7 +934,7 @@ VkResult anv_CreateDescriptorUpdateTemplate( ...@@ -934,7 +934,7 @@ VkResult anv_CreateDescriptorUpdateTemplate(
void anv_DestroyDescriptorUpdateTemplate( void anv_DestroyDescriptorUpdateTemplate(
VkDevice _device, VkDevice _device,
VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const VkAllocationCallbacks* pAllocator) const VkAllocationCallbacks* pAllocator)
{ {
ANV_FROM_HANDLE(anv_device, device, _device); ANV_FROM_HANDLE(anv_device, device, _device);
...@@ -947,7 +947,7 @@ void anv_DestroyDescriptorUpdateTemplate( ...@@ -947,7 +947,7 @@ void anv_DestroyDescriptorUpdateTemplate(
void anv_UpdateDescriptorSetWithTemplate( void anv_UpdateDescriptorSetWithTemplate(
VkDevice _device, VkDevice _device,
VkDescriptorSet descriptorSet, VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const void* pData) const void* pData)
{ {
ANV_FROM_HANDLE(anv_device, device, _device); ANV_FROM_HANDLE(anv_device, device, _device);
......
...@@ -761,31 +761,31 @@ void anv_GetPhysicalDeviceFeatures( ...@@ -761,31 +761,31 @@ void anv_GetPhysicalDeviceFeatures(
void anv_GetPhysicalDeviceFeatures2( void anv_GetPhysicalDeviceFeatures2(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures2KHR* pFeatures) VkPhysicalDeviceFeatures2* pFeatures)
{ {
anv_GetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features); anv_GetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features);
vk_foreach_struct(ext, pFeatures->pNext) { vk_foreach_struct(ext, pFeatures->pNext) {
switch (ext->sType) { switch (ext->sType) {
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR: { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: {
VkPhysicalDeviceMultiviewFeaturesKHR *features = VkPhysicalDeviceMultiviewFeatures *features =
(VkPhysicalDeviceMultiviewFeaturesKHR *)ext; (VkPhysicalDeviceMultiviewFeatures *)ext;
features->multiview = true; features->multiview = true;
features->multiviewGeometryShader = true; features->multiviewGeometryShader = true;
features->multiviewTessellationShader = true; features->multiviewTessellationShader = true;
break; break;
} }
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES_KHR: { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES: {
VkPhysicalDeviceVariablePointerFeaturesKHR *features = (void *)ext; VkPhysicalDeviceVariablePointerFeatures *features = (void *)ext;
features->variablePointersStorageBuffer = true; features->variablePointersStorageBuffer = true;
features->variablePointers = true; features->variablePointers = true;
break; break;
} }
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES_KHR: { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: {
VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR *features = VkPhysicalDeviceSamplerYcbcrConversionFeatures *features =
(VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR *) ext; (VkPhysicalDeviceSamplerYcbcrConversionFeatures *) ext;
features->samplerYcbcrConversion = true; features->samplerYcbcrConversion = true;
break; break;
} }
...@@ -958,7 +958,7 @@ void anv_GetPhysicalDeviceProperties( ...@@ -958,7 +958,7 @@ void anv_GetPhysicalDeviceProperties(
void anv_GetPhysicalDeviceProperties2( void anv_GetPhysicalDeviceProperties2(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties2KHR* pProperties) VkPhysicalDeviceProperties2* pProperties)
{ {
ANV_FROM_HANDLE(anv_physical_device, pdevice, physicalDevice); ANV_FROM_HANDLE(anv_physical_device, pdevice, physicalDevice);
...@@ -974,9 +974,9 @@ void anv_GetPhysicalDeviceProperties2( ...@@ -974,9 +974,9 @@ void anv_GetPhysicalDeviceProperties2(
break; break;
} }
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES_KHR: { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES: {
VkPhysicalDeviceIDPropertiesKHR *id_props = VkPhysicalDeviceIDProperties *id_props =
(VkPhysicalDeviceIDPropertiesKHR *)ext; (VkPhysicalDeviceIDProperties *)ext;
memcpy(id_props->deviceUUID, pdevice->device_uuid, VK_UUID_SIZE); memcpy(id_props->deviceUUID, pdevice->device_uuid, VK_UUID_SIZE);
memcpy(id_props->driverUUID, pdevice->driver_uuid, VK_UUID_SIZE); memcpy(id_props->driverUUID, pdevice->driver_uuid, VK_UUID_SIZE);
/* The LUID is for Windows. */ /* The LUID is for Windows. */
...@@ -984,18 +984,18 @@ void anv_GetPhysicalDeviceProperties2( ...@@ -984,18 +984,18 @@ void anv_GetPhysicalDeviceProperties2(
break; break;
} }
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR: { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES: {
VkPhysicalDeviceMultiviewPropertiesKHR *properties = VkPhysicalDeviceMultiviewProperties *properties =
(VkPhysicalDeviceMultiviewPropertiesKHR *)ext; (VkPhysicalDeviceMultiviewProperties *)ext;
properties->maxMultiviewViewCount = 16; properties->maxMultiviewViewCount = 16;
properties->maxMultiviewInstanceIndex = UINT32_MAX / 16; properties->maxMultiviewInstanceIndex = UINT32_MAX / 16;
break; break;
} }
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES_KHR: { case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES: {
VkPhysicalDevicePointClippingPropertiesKHR *properties = VkPhysicalDevicePointClippingProperties *properties =
(VkPhysicalDevicePointClippingPropertiesKHR *) ext; (VkPhysicalDevicePointClippingProperties *) ext;
properties->pointClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR; properties->pointClippingBehavior = VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES;
anv_finishme("Implement pop-free point clipping"); anv_finishme("Implement pop-free point clipping");
break; break;
} }
...@@ -1033,7 +1033,7 @@ void anv_GetPhysicalDeviceQueueFamilyProperties( ...@@ -1033,7 +1033,7 @@ void anv_GetPhysicalDeviceQueueFamilyProperties(
void anv_GetPhysicalDeviceQueueFamilyProperties2( void anv_GetPhysicalDeviceQueueFamilyProperties2(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t* pQueueFamilyPropertyCount, uint32_t* pQueueFamilyPropertyCount,
VkQueueFamilyProperties2KHR* pQueueFamilyProperties) VkQueueFamilyProperties2* pQueueFamilyProperties)
{ {
VK_OUTARRAY_MAKE(out, pQueueFamilyProperties, pQueueFamilyPropertyCount); VK_OUTARRAY_MAKE(out, pQueueFamilyProperties, pQueueFamilyPropertyCount);
...@@ -1072,7 +1072,7 @@ void anv_GetPhysicalDeviceMemoryProperties( ...@@ -1072,7 +1072,7 @@ void anv_GetPhysicalDeviceMemoryProperties(
void anv_GetPhysicalDeviceMemoryProperties2( void anv_GetPhysicalDeviceMemoryProperties2(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) VkPhysicalDeviceMemoryProperties2* pMemoryProperties)
{ {
anv_GetPhysicalDeviceMemoryProperties(physicalDevice, anv_GetPhysicalDeviceMemoryProperties(physicalDevice,
&pMemoryProperties->memoryProperties); &pMemoryProperties->memoryProperties);
...@@ -1835,7 +1835,7 @@ VkResult anv_AllocateMemory( ...@@ -1835,7 +1835,7 @@ VkResult anv_AllocateMemory(
if (fd_info && fd_info->handleType) { if (fd_info && fd_info->handleType) {
/* At the moment, we support only the below handle types. */ /* At the moment, we support only the below handle types. */
assert(fd_info->handleType == assert(fd_info->handleType ==
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR || VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT ||
fd_info->handleType == fd_info->handleType ==
VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT); VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT);
...@@ -1943,7 +1943,7 @@ VkResult anv_GetMemoryFdKHR( ...@@ -1943,7 +1943,7 @@ VkResult anv_GetMemoryFdKHR(
assert(pGetFdInfo->sType == VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR); assert(pGetFdInfo->sType == VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR);
assert(pGetFdInfo->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR || assert(pGetFdInfo->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT ||
pGetFdInfo->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT); pGetFdInfo->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT);
return anv_bo_cache_export(dev, &dev->bo_cache, mem->bo, pFd); return anv_bo_cache_export(dev, &dev->bo_cache, mem->bo, pFd);
...@@ -1973,7 +1973,7 @@ VkResult anv_GetMemoryFdPropertiesKHR( ...@@ -1973,7 +1973,7 @@ VkResult anv_GetMemoryFdPropertiesKHR(
* *
* So opaque handle types fall into the default "unsupported" case. * So opaque handle types fall into the default "unsupported" case.
*/ */
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR); return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE);
} }
} }
...@@ -2172,16 +2172,16 @@ void anv_GetBufferMemoryRequirements( ...@@ -2172,16 +2172,16 @@ void anv_GetBufferMemoryRequirements(
void anv_GetBufferMemoryRequirements2( void anv_GetBufferMemoryRequirements2(
VkDevice _device, VkDevice _device,
const VkBufferMemoryRequirementsInfo2KHR* pInfo, const VkBufferMemoryRequirementsInfo2* pInfo,
VkMemoryRequirements2KHR* pMemoryRequirements) VkMemoryRequirements2* pMemoryRequirements)
{ {
anv_GetBufferMemoryRequirements(_device, pInfo->buffer, anv_GetBufferMemoryRequirements(_device, pInfo->buffer,
&pMemoryRequirements->memoryRequirements); &pMemoryRequirements->memoryRequirements);
vk_foreach_struct(ext, pMemoryRequirements->pNext) { vk_foreach_struct(ext, pMemoryRequirements->pNext) {
switch (ext->sType) { switch (ext->sType) {
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: { case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
VkMemoryDedicatedRequirementsKHR *requirements = (void *)ext; VkMemoryDedicatedRequirements *requirements = (void *)ext;
requirements->prefersDedicatedAllocation = VK_FALSE; requirements->prefersDedicatedAllocation = VK_FALSE;
requirements->requiresDedicatedAllocation = VK_FALSE; requirements->requiresDedicatedAllocation = VK_FALSE;
break; break;
...@@ -2221,8 +2221,8 @@ void anv_GetImageMemoryRequirements( ...@@ -2221,8 +2221,8 @@ void anv_GetImageMemoryRequirements(
void anv_GetImageMemoryRequirements2( void anv_GetImageMemoryRequirements2(
VkDevice _device, VkDevice _device,
const VkImageMemoryRequirementsInfo2KHR* pInfo, const VkImageMemoryRequirementsInfo2* pInfo,
VkMemoryRequirements2KHR* pMemoryRequirements) VkMemoryRequirements2* pMemoryRequirements)
{ {
ANV_FROM_HANDLE(anv_device, device, _device); ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_image, image, pInfo->image); ANV_FROM_HANDLE(anv_image, image, pInfo->image);
...@@ -2232,7 +2232,7 @@ void anv_GetImageMemoryRequirements2( ...@@ -2232,7 +2232,7 @@ void anv_GetImageMemoryRequirements2(
vk_foreach_struct_const(ext, pInfo->pNext) { vk_foreach_struct_const(ext, pInfo->pNext) {
switch (ext->sType) { switch (ext->sType) {
case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO_KHR: { case VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO: {
struct anv_physical_device *pdevice = &device->instance->physicalDevice; struct anv_physical_device *pdevice = &device->instance->physicalDevice;
const VkImagePlaneMemoryRequirementsInfoKHR *plane_reqs = const VkImagePlaneMemoryRequirementsInfoKHR *plane_reqs =
(const VkImagePlaneMemoryRequirementsInfoKHR *) ext; (const VkImagePlaneMemoryRequirementsInfoKHR *) ext;
...@@ -2268,8 +2268,8 @@ void anv_GetImageMemoryRequirements2( ...@@ -2268,8 +2268,8 @@ void anv_GetImageMemoryRequirements2(
vk_foreach_struct(ext, pMemoryRequirements->pNext) { vk_foreach_struct(ext, pMemoryRequirements->pNext) {
switch (ext->sType) { switch (ext->sType) {
case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: { case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS: {
VkMemoryDedicatedRequirementsKHR *requirements = (void *)ext; VkMemoryDedicatedRequirements *requirements = (void *)ext;
if (image->needs_set_tiling) { if (image->needs_set_tiling) {
/* If we need to set the tiling for external consumers, we need a /* If we need to set the tiling for external consumers, we need a
* dedicated allocation. * dedicated allocation.
...@@ -2303,9 +2303,9 @@ void anv_GetImageSparseMemoryRequirements( ...@@ -2303,9 +2303,9 @@ void anv_GetImageSparseMemoryRequirements(
void anv_GetImageSparseMemoryRequirements2( void anv_GetImageSparseMemoryRequirements2(
VkDevice device, VkDevice device,
const VkImageSparseMemoryRequirementsInfo2KHR* pInfo, const VkImageSparseMemoryRequirementsInfo2* pInfo,
uint32_t* pSparseMemoryRequirementCount, uint32_t* pSparseMemoryRequirementCount,
VkSparseImageMemoryRequirements2KHR* pSparseMemoryRequirements) VkSparseImageMemoryRequirements2* pSparseMemoryRequirements)
{ {
*pSparseMemoryRequirementCount = 0; *pSparseMemoryRequirementCount = 0;
} }
...@@ -2319,12 +2319,12 @@ void anv_GetDeviceMemoryCommitment( ...@@ -2319,12 +2319,12 @@ void anv_GetDeviceMemoryCommitment(
} }
static void static void
anv_bind_buffer_memory(const VkBindBufferMemoryInfoKHR *pBindInfo) anv_bind_buffer_memory(const VkBindBufferMemoryInfo *pBindInfo)
{ {
ANV_FROM_HANDLE(anv_device_memory, mem, pBindInfo->memory); ANV_FROM_HANDLE(anv_device_memory, mem, pBindInfo->memory);
ANV_FROM_HANDLE(anv_buffer, buffer, pBindInfo->buffer); ANV_FROM_HANDLE(anv_buffer, buffer, pBindInfo->buffer);
assert(pBindInfo->sType == VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR); assert(pBindInfo->sType == VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO);
if (mem) { if (mem) {
assert((buffer->usage & mem->type->valid_buffer_usage) == buffer->usage); assert((buffer->usage & mem->type->valid_buffer_usage) == buffer->usage);
...@@ -2343,8 +2343,8 @@ VkResult anv_BindBufferMemory( ...@@ -2343,8 +2343,8 @@ VkResult anv_BindBufferMemory(
VkDeviceSize memoryOffset) VkDeviceSize memoryOffset)
{ {
anv_bind_buffer_memory( anv_bind_buffer_memory(
&(VkBindBufferMemoryInfoKHR) { &(VkBindBufferMemoryInfo) {
.sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO_KHR, .sType = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO,
.buffer = buffer, .buffer = buffer,
.memory = memory, .memory = memory,
.memoryOffset = memoryOffset, .memoryOffset = memoryOffset,
...@@ -2356,7 +2356,7 @@ VkResult anv_BindBufferMemory( ...@@ -2356,7 +2356,7 @@ VkResult anv_BindBufferMemory(
VkResult anv_BindBufferMemory2( VkResult anv_BindBufferMemory2(
VkDevice device, VkDevice device,
uint32_t bindInfoCount, uint32_t bindInfoCount,
const VkBindBufferMemoryInfoKHR* pBindInfos) const VkBindBufferMemoryInfo* pBindInfos)
{ {
for (uint32_t i = 0; i < bindInfoCount; i++) for (uint32_t i = 0; i < bindInfoCount; i++)
anv_bind_buffer_memory(&pBindInfos[i]); anv_bind_buffer_memory(&pBindInfos[i]);
......
...@@ -303,70 +303,70 @@ static const struct anv_format main_formats[] = { ...@@ -303,70 +303,70 @@ static const struct anv_format main_formats[] = {
}; };
static const struct anv_format ycbcr_formats[] = { static const struct anv_format ycbcr_formats[] = {
ycbcr_fmt(VK_FORMAT_G8B8G8R8_422_UNORM_KHR, 1, ycbcr_fmt(VK_FORMAT_G8B8G8R8_422_UNORM, 1,
y_plane(ISL_FORMAT_YCRCB_SWAPUV, RGBA, _ISL_SWIZZLE(BLUE, GREEN, RED, ZERO), 1, 1)), y_plane(ISL_FORMAT_YCRCB_SWAPUV, RGBA, _ISL_SWIZZLE(BLUE, GREEN, RED, ZERO), 1, 1)),
ycbcr_fmt(VK_FORMAT_B8G8R8G8_422_UNORM_KHR, 1, ycbcr_fmt(VK_FORMAT_B8G8R8G8_422_UNORM, 1,
y_plane(ISL_FORMAT_YCRCB_SWAPUVY, RGBA, _ISL_SWIZZLE(BLUE, GREEN, RED, ZERO), 1, 1)), y_plane(ISL_FORMAT_YCRCB_SWAPUVY, RGBA, _ISL_SWIZZLE(BLUE, GREEN, RED, ZERO), 1, 1)),
ycbcr_fmt(VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR, 3, ycbcr_fmt(VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, 3,
y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 2, 2), chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 2, 2),
chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 2, 2)), chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 2, 2)),
ycbcr_fmt(VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR, 2, ycbcr_fmt(VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, 2,
y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R8G8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, RED, ZERO, ZERO), 2, 2)), chroma_plane(ISL_FORMAT_R8G8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, RED, ZERO, ZERO), 2, 2)),
ycbcr_fmt(VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR, 3, ycbcr_fmt(VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM, 3,
y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 2, 1), chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 2, 1),
chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 2, 1)), chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 2, 1)),
ycbcr_fmt(VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR, 2, ycbcr_fmt(VK_FORMAT_G8_B8R8_2PLANE_422_UNORM, 2,
y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R8G8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, RED, ZERO, ZERO), 2, 1)), chroma_plane(ISL_FORMAT_R8G8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, RED, ZERO, ZERO), 2, 1)),
ycbcr_fmt(VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR, 3, ycbcr_fmt(VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM, 3,
y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 1, 1), chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 1, 1)), chroma_plane(ISL_FORMAT_R8_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 1, 1)),
fmt_unsupported(VK_FORMAT_R10X6_UNORM_PACK16_KHR), fmt_unsupported(VK_FORMAT_R10X6_UNORM_PACK16),
fmt_unsupported(VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR), fmt_unsupported(VK_FORMAT_R10X6G10X6_UNORM_2PACK16),
fmt_unsupported(VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR), fmt_unsupported(VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16),
fmt_unsupported(VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR), fmt_unsupported(VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16),
fmt_unsupported(VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR), fmt_unsupported(VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16),
fmt_unsupported(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16),
fmt_unsupported(VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16),
fmt_unsupported(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16),
fmt_unsupported(VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16),
fmt_unsupported(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16),
fmt_unsupported(VK_FORMAT_R12X4_UNORM_PACK16_KHR), fmt_unsupported(VK_FORMAT_R12X4_UNORM_PACK16),
fmt_unsupported(VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR), fmt_unsupported(VK_FORMAT_R12X4G12X4_UNORM_2PACK16),
fmt_unsupported(VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR), fmt_unsupported(VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16),
fmt_unsupported(VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR), fmt_unsupported(VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16),
fmt_unsupported(VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR), fmt_unsupported(VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16),
fmt_unsupported(VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16),
fmt_unsupported(VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16),
fmt_unsupported(VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16),
fmt_unsupported(VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16),
fmt_unsupported(VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR), fmt_unsupported(VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16),
/* TODO: it is possible to enable the following 2 formats, but that /* TODO: it is possible to enable the following 2 formats, but that
* requires further refactoring of how we handle multiplanar formats. * requires further refactoring of how we handle multiplanar formats.
*/ */
fmt_unsupported(VK_FORMAT_G16B16G16R16_422_UNORM_KHR), fmt_unsupported(VK_FORMAT_G16B16G16R16_422_UNORM),
fmt_unsupported(VK_FORMAT_B16G16R16G16_422_UNORM_KHR), fmt_unsupported(VK_FORMAT_B16G16R16G16_422_UNORM),
ycbcr_fmt(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR, 3, ycbcr_fmt(VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, 3,
y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 2, 2), chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 2, 2),
chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 2, 2)), chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 2, 2)),
ycbcr_fmt(VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR, 2, ycbcr_fmt(VK_FORMAT_G16_B16R16_2PLANE_420_UNORM, 2,
y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R16G16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, RED, ZERO, ZERO), 2, 2)), chroma_plane(ISL_FORMAT_R16G16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, RED, ZERO, ZERO), 2, 2)),
ycbcr_fmt(VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR, 3, ycbcr_fmt(VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, 3,
y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 2, 1), chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 2, 1),
chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 2, 1)), chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 2, 1)),
ycbcr_fmt(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR, 2, ycbcr_fmt(VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, 2,
y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R16G16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, RED, ZERO, ZERO), 2, 1)), chroma_plane(ISL_FORMAT_R16G16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, RED, ZERO, ZERO), 2, 1)),
ycbcr_fmt(VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR, 3, ycbcr_fmt(VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, 3,
y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1), y_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(GREEN, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 1, 1), chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(BLUE, ZERO, ZERO, ZERO), 1, 1),
chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 1, 1)), chroma_plane(ISL_FORMAT_R16_UNORM, RGBA, _ISL_SWIZZLE(RED, ZERO, ZERO, ZERO), 1, 1)),
...@@ -550,8 +550,8 @@ get_image_format_features(const struct gen_device_info *devinfo, ...@@ -550,8 +550,8 @@ get_image_format_features(const struct gen_device_info *devinfo,
flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT; flags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT;
if (flags) { if (flags) {
flags |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR | flags |= VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR; VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
} }
/* XXX: We handle 3-channel formats by switching them out for RGBX or /* XXX: We handle 3-channel formats by switching them out for RGBX or
...@@ -578,11 +578,11 @@ get_image_format_features(const struct gen_device_info *devinfo, ...@@ -578,11 +578,11 @@ get_image_format_features(const struct gen_device_info *devinfo,
* sampler. The failures show a slightly out of range values on the * sampler. The failures show a slightly out of range values on the
* bottom left of the sampled image. * bottom left of the sampled image.
*/ */
flags |= VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR; flags |= VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT;
} else { } else {
flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR | flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT |
VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT_KHR | VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT |
VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR; VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT;
} }
/* We can support cosited chroma locations when handle planes with our /* We can support cosited chroma locations when handle planes with our
...@@ -591,13 +591,13 @@ get_image_format_features(const struct gen_device_info *devinfo, ...@@ -591,13 +591,13 @@ get_image_format_features(const struct gen_device_info *devinfo,
for (unsigned p = 0; p < anv_format->n_planes; p++) { for (unsigned p = 0; p < anv_format->n_planes; p++) {
if (anv_format->planes[p].denominator_scales[0] > 1 || if (anv_format->planes[p].denominator_scales[0] > 1 ||
anv_format->planes[p].denominator_scales[1] > 1) { anv_format->planes[p].denominator_scales[1] > 1) {
flags |= VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR; flags |= VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT;
break; break;
} }
} }
if (anv_format->n_planes > 1) if (anv_format->n_planes > 1)
flags |= VK_FORMAT_FEATURE_DISJOINT_BIT_KHR; flags |= VK_FORMAT_FEATURE_DISJOINT_BIT;
const VkFormatFeatureFlags disallowed_ycbcr_image_features = const VkFormatFeatureFlags disallowed_ycbcr_image_features =
VK_FORMAT_FEATURE_BLIT_SRC_BIT | VK_FORMAT_FEATURE_BLIT_SRC_BIT |
...@@ -708,7 +708,7 @@ void anv_GetPhysicalDeviceFormatProperties( ...@@ -708,7 +708,7 @@ void anv_GetPhysicalDeviceFormatProperties(
void anv_GetPhysicalDeviceFormatProperties2( void anv_GetPhysicalDeviceFormatProperties2(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkFormat format, VkFormat format,
VkFormatProperties2KHR* pFormatProperties) VkFormatProperties2* pFormatProperties)
{ {
ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice); ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice);
anv_GetPhysicalDeviceFormatProperties(physicalDevice, format, anv_GetPhysicalDeviceFormatProperties(physicalDevice, format,
...@@ -730,7 +730,7 @@ void anv_GetPhysicalDeviceFormatProperties2( ...@@ -730,7 +730,7 @@ void anv_GetPhysicalDeviceFormatProperties2(
static VkResult static VkResult
anv_get_image_format_properties( anv_get_image_format_properties(
struct anv_physical_device *physical_device, struct anv_physical_device *physical_device,
const VkPhysicalDeviceImageFormatInfo2KHR *info, const VkPhysicalDeviceImageFormatInfo2 *info,
VkImageFormatProperties *pImageFormatProperties, VkImageFormatProperties *pImageFormatProperties,
VkSamplerYcbcrConversionImageFormatPropertiesKHR *pYcbcrImageFormatProperties) VkSamplerYcbcrConversionImageFormatPropertiesKHR *pYcbcrImageFormatProperties)
{ {
...@@ -897,8 +897,8 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties( ...@@ -897,8 +897,8 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
{ {
ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice); ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice);
const VkPhysicalDeviceImageFormatInfo2KHR info = { const VkPhysicalDeviceImageFormatInfo2 info = {