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,
} else {
int merge = anv_gem_sync_file_merge(device, in_fence, impl->fd);
if (merge == -1)
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE);
close(impl->fd);
close(in_fence);
......
......@@ -878,7 +878,7 @@ VkResult anv_ResetCommandPool(
void anv_TrimCommandPool(
VkDevice device,
VkCommandPool commandPool,
VkCommandPoolTrimFlagsKHR flags)
VkCommandPoolTrimFlags flags)
{
/* Nothing for us to do here. Our pools stay pretty tidy. */
}
......@@ -1026,7 +1026,7 @@ void anv_CmdPushDescriptorSetKHR(
void anv_CmdPushDescriptorSetWithTemplateKHR(
VkCommandBuffer commandBuffer,
VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
VkPipelineLayout _layout,
uint32_t _set,
const void* pData)
......
......@@ -460,7 +460,7 @@ anv_descriptor_set_create(struct anv_device *device,
if (pool->free_list != EMPTY) {
return vk_error(VK_ERROR_FRAGMENTED_POOL);
} 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,
VkResult anv_CreateDescriptorUpdateTemplate(
VkDevice _device,
const VkDescriptorUpdateTemplateCreateInfoKHR* pCreateInfo,
const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkDescriptorUpdateTemplateKHR* pDescriptorUpdateTemplate)
VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate)
{
ANV_FROM_HANDLE(anv_device, device, _device);
struct anv_descriptor_update_template *template;
......@@ -908,7 +908,7 @@ VkResult anv_CreateDescriptorUpdateTemplate(
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->entry_count = pCreateInfo->descriptorUpdateEntryCount;
......@@ -934,7 +934,7 @@ VkResult anv_CreateDescriptorUpdateTemplate(
void anv_DestroyDescriptorUpdateTemplate(
VkDevice _device,
VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const VkAllocationCallbacks* pAllocator)
{
ANV_FROM_HANDLE(anv_device, device, _device);
......@@ -947,7 +947,7 @@ void anv_DestroyDescriptorUpdateTemplate(
void anv_UpdateDescriptorSetWithTemplate(
VkDevice _device,
VkDescriptorSet descriptorSet,
VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
const void* pData)
{
ANV_FROM_HANDLE(anv_device, device, _device);
......
This diff is collapsed.
This diff is collapsed.
......@@ -67,9 +67,9 @@ choose_isl_surf_usage(VkImageCreateFlags vk_create_flags,
isl_usage |= ISL_SURF_USAGE_STENCIL_BIT;
break;
case VK_IMAGE_ASPECT_COLOR_BIT:
case VK_IMAGE_ASPECT_PLANE_0_BIT_KHR:
case VK_IMAGE_ASPECT_PLANE_1_BIT_KHR:
case VK_IMAGE_ASPECT_PLANE_2_BIT_KHR:
case VK_IMAGE_ASPECT_PLANE_0_BIT:
case VK_IMAGE_ASPECT_PLANE_1_BIT:
case VK_IMAGE_ASPECT_PLANE_2_BIT:
break;
default:
unreachable("bad VkImageAspect");
......@@ -327,7 +327,7 @@ make_surface(const struct anv_device *dev,
*/
bool needs_shadow = false;
if (dev->info.gen <= 8 &&
(vk_info->flags & VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR) &&
(vk_info->flags & VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT) &&
vk_info->tiling == VK_IMAGE_TILING_OPTIMAL) {
assert(isl_format_is_compressed(plane_format.isl_format));
tiling_flags = ISL_TILING_LINEAR_BIT;
......@@ -430,7 +430,7 @@ make_surface(const struct anv_device *dev,
*/
const bool allow_compression =
image->n_planes == 1 &&
(vk_info->flags & VK_IMAGE_CREATE_ALIAS_BIT_KHR) == 0 &&
(vk_info->flags & VK_IMAGE_CREATE_ALIAS_BIT) == 0 &&
likely((INTEL_DEBUG & DEBUG_NO_RBC) == 0);
if (allow_compression) {
......@@ -585,7 +585,7 @@ anv_image_create(VkDevice _device,
image->samples = pCreateInfo->samples;
image->usage = pCreateInfo->usage;
image->tiling = pCreateInfo->tiling;
image->disjoint = pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT_KHR;
image->disjoint = pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT;
image->needs_set_tiling = wsi_info && wsi_info->scanout;
image->drm_format_mod = isl_mod_info ? isl_mod_info->modifier :
DRM_FORMAT_MOD_INVALID;
......@@ -702,21 +702,21 @@ VkResult anv_BindImageMemory(
VkResult anv_BindImageMemory2(
VkDevice _device,
uint32_t bindInfoCount,
const VkBindImageMemoryInfoKHR* pBindInfos)
const VkBindImageMemoryInfo* pBindInfos)
{
ANV_FROM_HANDLE(anv_device, device, _device);
for (uint32_t i = 0; i < bindInfoCount; i++) {
const VkBindImageMemoryInfoKHR *bind_info = &pBindInfos[i];
const VkBindImageMemoryInfo *bind_info = &pBindInfos[i];
ANV_FROM_HANDLE(anv_device_memory, mem, bind_info->memory);
ANV_FROM_HANDLE(anv_image, image, bind_info->image);
VkImageAspectFlags aspects = image->aspects;
vk_foreach_struct_const(s, bind_info->pNext) {
switch (s->sType) {
case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR: {
const VkBindImagePlaneMemoryInfoKHR *plane_info =
(const VkBindImagePlaneMemoryInfoKHR *) s;
case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO: {
const VkBindImagePlaneMemoryInfo *plane_info =
(const VkBindImagePlaneMemoryInfo *) s;
aspects = plane_info->planeAspect;
break;
......@@ -848,7 +848,7 @@ anv_layout_to_aux_usage(const struct gen_device_info * const devinfo,
/* Sampling Layouts */
case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL:
case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR:
case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL:
assert((image->aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) == 0);
/* Fall-through */
case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
......@@ -895,7 +895,7 @@ anv_layout_to_aux_usage(const struct gen_device_info * const devinfo,
}
case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL:
case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR:
case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL:
assert(aspect == VK_IMAGE_ASPECT_DEPTH_BIT);
return ISL_AUX_USAGE_HIZ;
......@@ -1182,7 +1182,7 @@ remap_aspect_flags(VkImageAspectFlags view_aspects)
VkImageAspectFlags color_aspects = 0;
for (uint32_t i = 0; i < _mesa_bitcount(view_aspects); i++)
color_aspects |= VK_IMAGE_ASPECT_PLANE_0_BIT_KHR << i;
color_aspects |= VK_IMAGE_ASPECT_PLANE_0_BIT << i;
return color_aspects;
}
/* No special remapping needed for depth & stencil aspects. */
......@@ -1209,8 +1209,8 @@ anv_CreateImageView(VkDevice _device,
assert(range->layerCount > 0);
assert(range->baseMipLevel < image->levels);
const VkImageViewUsageCreateInfoKHR *usage_info =
vk_find_struct_const(pCreateInfo, IMAGE_VIEW_USAGE_CREATE_INFO_KHR);
const VkImageViewUsageCreateInfo *usage_info =
vk_find_struct_const(pCreateInfo, IMAGE_VIEW_USAGE_CREATE_INFO);
VkImageUsageFlags view_usage = usage_info ? usage_info->usage : image->usage;
/* View usage should be a subset of image usage */
assert((view_usage & ~image->usage) == 0);
......@@ -1235,8 +1235,8 @@ anv_CreateImageView(VkDevice _device,
/* First expand aspects to the image's ones (for example
* VK_IMAGE_ASPECT_COLOR_BIT will be converted to
* VK_IMAGE_ASPECT_PLANE_0_BIT_KHR | VK_IMAGE_ASPECT_PLANE_1_BIT_KHR |
* VK_IMAGE_ASPECT_PLANE_2_BIT_KHR for an image of format
* VK_IMAGE_ASPECT_PLANE_0_BIT | VK_IMAGE_ASPECT_PLANE_1_BIT |
* VK_IMAGE_ASPECT_PLANE_2_BIT for an image of format
* VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR.
*/
VkImageAspectFlags expanded_aspects =
......@@ -1245,7 +1245,7 @@ anv_CreateImageView(VkDevice _device,
iview->image = image;
/* Remap the expanded aspects for the image view. For example if only
* VK_IMAGE_ASPECT_PLANE_1_BIT_KHR was given in range->aspectMask, we will
* VK_IMAGE_ASPECT_PLANE_1_BIT was given in range->aspectMask, we will
* convert it to VK_IMAGE_ASPECT_COLOR_BIT since from the point of view of
* the image view, it only has a single plane.
*/
......@@ -1535,17 +1535,17 @@ anv_image_get_surface_for_aspect_mask(const struct anv_image *image,
sanitized_mask = VK_IMAGE_ASPECT_STENCIL_BIT;
}
break;
case VK_IMAGE_ASPECT_PLANE_0_BIT_KHR:
case VK_IMAGE_ASPECT_PLANE_0_BIT:
assert((image->aspects & ~VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) == 0);
sanitized_mask = VK_IMAGE_ASPECT_PLANE_0_BIT_KHR;
sanitized_mask = VK_IMAGE_ASPECT_PLANE_0_BIT;
break;
case VK_IMAGE_ASPECT_PLANE_1_BIT_KHR:
case VK_IMAGE_ASPECT_PLANE_1_BIT:
assert((image->aspects & ~VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) == 0);
sanitized_mask = VK_IMAGE_ASPECT_PLANE_1_BIT_KHR;
sanitized_mask = VK_IMAGE_ASPECT_PLANE_1_BIT;
break;
case VK_IMAGE_ASPECT_PLANE_2_BIT_KHR:
case VK_IMAGE_ASPECT_PLANE_2_BIT:
assert((image->aspects & ~VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) == 0);
sanitized_mask = VK_IMAGE_ASPECT_PLANE_2_BIT_KHR;
sanitized_mask = VK_IMAGE_ASPECT_PLANE_2_BIT;
break;
default:
unreachable("image does not have aspect");
......
......@@ -40,9 +40,9 @@ y_range(nir_builder *b,
VkSamplerYcbcrRangeKHR range)
{
switch (range) {
case VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR:
case VK_SAMPLER_YCBCR_RANGE_ITU_FULL:
return y_channel;
case VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR:
case VK_SAMPLER_YCBCR_RANGE_ITU_NARROW:
return nir_fmul(b,
nir_fadd(b,
nir_fmul(b, y_channel,
......@@ -62,10 +62,10 @@ chroma_range(nir_builder *b,
VkSamplerYcbcrRangeKHR range)
{
switch (range) {
case VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR:
case VK_SAMPLER_YCBCR_RANGE_ITU_FULL:
return nir_fadd(b, chroma_channel,
nir_imm_float(b, -pow(2, bpc - 1) / (pow(2, bpc) - 1.0f)));
case VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR:
case VK_SAMPLER_YCBCR_RANGE_ITU_NARROW:
return nir_fmul(b,
nir_fadd(b,
nir_fmul(b, chroma_channel,
......@@ -82,7 +82,7 @@ static const nir_const_value *
ycbcr_model_to_rgb_matrix(VkSamplerYcbcrModelConversionKHR model)
{
switch (model) {
case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR: {
case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601: {
static const nir_const_value bt601[3] = {
{ .f32 = { 1.402f, 1.0f, 0.0f, 0.0f } },
{ .f32 = { -0.714136286201022f, 1.0f, -0.344136286201022f, 0.0f } },
......@@ -91,7 +91,7 @@ ycbcr_model_to_rgb_matrix(VkSamplerYcbcrModelConversionKHR model)
return bt601;
}
case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR: {
case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709: {
static const nir_const_value bt709[3] = {
{ .f32 = { 1.5748031496063f, 1.0f, 0.0, 0.0f } },
{ .f32 = { -0.468125209181067f, 1.0f, -0.187327487470334f, 0.0f } },
......@@ -100,7 +100,7 @@ ycbcr_model_to_rgb_matrix(VkSamplerYcbcrModelConversionKHR model)
return bt709;
}
case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR: {
case VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020: {
static const nir_const_value bt2020[3] = {
{ .f32 = { 1.4746f, 1.0f, 0.0f, 0.0f } },
{ .f32 = { -0.571353126843658f, 1.0f, -0.164553126843658f, 0.0f } },
......@@ -133,7 +133,7 @@ convert_ycbcr(struct ycbcr_state *state,
bpcs[2], conversion->ycbcr_range),
nir_imm_float(b, 1.0f));
if (conversion->ycbcr_model == VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY_KHR)
if (conversion->ycbcr_model == VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY)
return expanded_channels;
const nir_const_value *conversion_matrix =
......@@ -206,7 +206,7 @@ implicit_downsampled_coords(struct ycbcr_state *state,
for (c = 0; c < ARRAY_SIZE(conversion->chroma_offsets); c++) {
if (plane_format->denominator_scales[c] > 1 &&
conversion->chroma_offsets[c] == VK_CHROMA_LOCATION_COSITED_EVEN_KHR) {
conversion->chroma_offsets[c] == VK_CHROMA_LOCATION_COSITED_EVEN) {
comp[c] = implicit_downsampled_coord(b,
nir_channel(b, old_coords, c),
nir_channel(b, image_size, c),
......@@ -430,7 +430,7 @@ try_lower_tex_ycbcr(struct anv_pipeline_layout *layout,
}
nir_ssa_def *result = nir_vec(builder, swizzled_comp, 4);
if (state.conversion->ycbcr_model != VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY_KHR)
if (state.conversion->ycbcr_model != VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY)
result = convert_ycbcr(&state, result, swizzled_bpcs);
nir_ssa_def_rewrite_uses(&tex->dest.ssa, nir_src_for_ssa(result));
......
......@@ -1587,13 +1587,13 @@ anv_pipe_invalidate_bits_for_access_flags(VkAccessFlags flags)
#define VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV ( \
VK_IMAGE_ASPECT_COLOR_BIT | \
VK_IMAGE_ASPECT_PLANE_0_BIT_KHR | \
VK_IMAGE_ASPECT_PLANE_1_BIT_KHR | \
VK_IMAGE_ASPECT_PLANE_2_BIT_KHR)
VK_IMAGE_ASPECT_PLANE_0_BIT | \
VK_IMAGE_ASPECT_PLANE_1_BIT | \
VK_IMAGE_ASPECT_PLANE_2_BIT)
#define VK_IMAGE_ASPECT_PLANES_BITS_ANV ( \
VK_IMAGE_ASPECT_PLANE_0_BIT_KHR | \
VK_IMAGE_ASPECT_PLANE_1_BIT_KHR | \
VK_IMAGE_ASPECT_PLANE_2_BIT_KHR)
VK_IMAGE_ASPECT_PLANE_0_BIT | \
VK_IMAGE_ASPECT_PLANE_1_BIT | \
VK_IMAGE_ASPECT_PLANE_2_BIT)
struct anv_vertex_binding {
struct anv_buffer * buffer;
......@@ -2287,15 +2287,15 @@ anv_image_aspect_to_plane(VkImageAspectFlags image_aspects,
switch (aspect_mask) {
case VK_IMAGE_ASPECT_COLOR_BIT:
case VK_IMAGE_ASPECT_DEPTH_BIT:
case VK_IMAGE_ASPECT_PLANE_0_BIT_KHR:
case VK_IMAGE_ASPECT_PLANE_0_BIT:
return 0;
case VK_IMAGE_ASPECT_STENCIL_BIT:
if ((image_aspects & VK_IMAGE_ASPECT_DEPTH_BIT) == 0)
return 0;
/* Fall-through */
case VK_IMAGE_ASPECT_PLANE_1_BIT_KHR:
case VK_IMAGE_ASPECT_PLANE_1_BIT:
return 1;
case VK_IMAGE_ASPECT_PLANE_2_BIT_KHR:
case VK_IMAGE_ASPECT_PLANE_2_BIT:
return 2;
default:
/* Purposefully assert with depth/stencil aspects. */
......@@ -2311,11 +2311,11 @@ anv_image_aspect_get_planes(VkImageAspectFlags aspect_mask)
if (aspect_mask & (VK_IMAGE_ASPECT_COLOR_BIT |
VK_IMAGE_ASPECT_DEPTH_BIT |
VK_IMAGE_ASPECT_STENCIL_BIT |
VK_IMAGE_ASPECT_PLANE_0_BIT_KHR))
VK_IMAGE_ASPECT_PLANE_0_BIT))
planes++;
if (aspect_mask & VK_IMAGE_ASPECT_PLANE_1_BIT_KHR)
if (aspect_mask & VK_IMAGE_ASPECT_PLANE_1_BIT)
planes++;
if (aspect_mask & VK_IMAGE_ASPECT_PLANE_2_BIT_KHR)
if (aspect_mask & VK_IMAGE_ASPECT_PLANE_2_BIT)
planes++;
return planes;
......@@ -2327,7 +2327,7 @@ anv_plane_to_aspect(VkImageAspectFlags image_aspects,
{
if (image_aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) {
if (_mesa_bitcount(image_aspects) > 1)
return VK_IMAGE_ASPECT_PLANE_0_BIT_KHR << plane;
return VK_IMAGE_ASPECT_PLANE_0_BIT << plane;
return VK_IMAGE_ASPECT_COLOR_BIT;
}
if (image_aspects & VK_IMAGE_ASPECT_DEPTH_BIT)
......@@ -2869,10 +2869,10 @@ void anv_fill_buffer_surface_state(struct anv_device *device,
struct anv_ycbcr_conversion {
const struct anv_format * format;
VkSamplerYcbcrModelConversionKHR ycbcr_model;
VkSamplerYcbcrRangeKHR ycbcr_range;
VkSamplerYcbcrModelConversion ycbcr_model;
VkSamplerYcbcrRange ycbcr_range;
VkComponentSwizzle mapping[4];
VkChromaLocationKHR chroma_offsets[2];
VkChromaLocation chroma_offsets[2];
VkFilter chroma_filter;
bool chroma_reconstruction;
};
......@@ -3067,7 +3067,7 @@ ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_sampler, VkSampler)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_semaphore, VkSemaphore)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_shader_module, VkShaderModule)
ANV_DEFINE_NONDISP_HANDLE_CASTS(vk_debug_report_callback, VkDebugReportCallbackEXT)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_ycbcr_conversion, VkSamplerYcbcrConversionKHR)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_ycbcr_conversion, VkSamplerYcbcrConversion)
/* Gen-specific function declarations */
#ifdef genX
......
......@@ -690,18 +690,18 @@ void anv_GetPhysicalDeviceExternalFenceProperties(
ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice);
switch (pExternalFenceInfo->handleType) {
case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR:
case VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR:
case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT:
case VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT:
if (device->has_syncobj_wait) {
pExternalFenceProperties->exportFromImportedHandleTypes =
VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR |
VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR;
VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT |
VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT;
pExternalFenceProperties->compatibleHandleTypes =
VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR |
VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR;
VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT |
VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT;
pExternalFenceProperties->externalFenceFeatures =
VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT_KHR |
VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT_KHR;
VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT |
VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT;
return;
}
break;
......@@ -731,16 +731,16 @@ VkResult anv_ImportFenceFdKHR(
};
switch (pImportFenceFdInfo->handleType) {
case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR:
case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT:
new_impl.type = ANV_FENCE_TYPE_SYNCOBJ;
new_impl.syncobj = anv_gem_syncobj_fd_to_handle(device, fd);
if (!new_impl.syncobj)
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE);
break;
case VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR:
case VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT:
/* Sync files are a bit tricky. Because we want to continue using the
* syncobj implementation of WaitForFences, we don't use the sync file
* directly but instead import it into a syncobj.
......@@ -754,13 +754,13 @@ VkResult anv_ImportFenceFdKHR(
if (anv_gem_syncobj_import_sync_file(device, new_impl.syncobj, fd)) {
anv_gem_syncobj_destroy(device, new_impl.syncobj);
return vk_errorf(device->instance, NULL,
VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR,
VK_ERROR_INVALID_EXTERNAL_HANDLE,
"syncobj sync file import failed: %m");
}
break;
default:
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE);
}
/* From the Vulkan 1.0.53 spec:
......@@ -774,7 +774,7 @@ VkResult anv_ImportFenceFdKHR(
*/
close(fd);
if (pImportFenceFdInfo->flags & VK_FENCE_IMPORT_TEMPORARY_BIT_KHR) {
if (pImportFenceFdInfo->flags & VK_FENCE_IMPORT_TEMPORARY_BIT) {
anv_fence_impl_cleanup(device, &fence->temporary);
fence->temporary = new_impl;
} else {
......@@ -801,7 +801,7 @@ VkResult anv_GetFenceFdKHR(
assert(impl->type == ANV_FENCE_TYPE_SYNCOBJ);
switch (pGetFdInfo->handleType) {
case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR: {
case VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT: {
int fd = anv_gem_syncobj_handle_to_fd(device, impl->syncobj);
if (fd < 0)
return vk_error(VK_ERROR_TOO_MANY_OBJECTS);
......@@ -810,7 +810,7 @@ VkResult anv_GetFenceFdKHR(
break;
}
case VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT_KHR: {
case VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT: {
int fd = anv_gem_syncobj_export_sync_file(device, impl->syncobj);
if (fd < 0)
return vk_error(VK_ERROR_TOO_MANY_OBJECTS);
......@@ -855,7 +855,7 @@ VkResult anv_CreateSemaphore(
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
const VkExportSemaphoreCreateInfoKHR *export =
vk_find_struct_const(pCreateInfo->pNext, EXPORT_SEMAPHORE_CREATE_INFO_KHR);
vk_find_struct_const(pCreateInfo->pNext, EXPORT_SEMAPHORE_CREATE_INFO);
VkExternalSemaphoreHandleTypeFlagsKHR handleTypes =
export ? export->handleTypes : 0;
......@@ -865,8 +865,8 @@ VkResult anv_CreateSemaphore(
* queue, a dummy no-op semaphore is a perfectly valid implementation.
*/
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_DUMMY;
} else if (handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR) {
assert(handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR);
} else if (handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT) {
assert(handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT);
if (device->instance->physicalDevice.has_syncobj) {
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_DRM_SYNCOBJ;
semaphore->permanent.syncobj = anv_gem_syncobj_create(device, 0);
......@@ -888,15 +888,15 @@ VkResult anv_CreateSemaphore(
*/
assert(!(semaphore->permanent.bo->flags & EXEC_OBJECT_ASYNC));
}
} else if (handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR) {
assert(handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR);
} else if (handleTypes & VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT) {
assert(handleTypes == VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT);
semaphore->permanent.type = ANV_SEMAPHORE_TYPE_SYNC_FILE;
semaphore->permanent.fd = -1;
} else {
assert(!"Unknown handle type");
vk_free2(&device->alloc, pAllocator, semaphore);
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE);
}
semaphore->temporary.type = ANV_SEMAPHORE_TYPE_NONE;
......@@ -968,24 +968,24 @@ void anv_GetPhysicalDeviceExternalSemaphoreProperties(
ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice);
switch (pExternalSemaphoreInfo->handleType) {
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR:
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT:
pExternalSemaphoreProperties->exportFromImportedHandleTypes =
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT;
pExternalSemaphoreProperties->compatibleHandleTypes =
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT;
pExternalSemaphoreProperties->externalSemaphoreFeatures =
VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR |
VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR;
VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT |
VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT;
return;
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR:
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT:
if (device->has_exec_fence) {
pExternalSemaphoreProperties->exportFromImportedHandleTypes = 0;
pExternalSemaphoreProperties->compatibleHandleTypes =
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR;
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT;
pExternalSemaphoreProperties->externalSemaphoreFeatures =
VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT_KHR |
VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT_KHR;
VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT |
VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT;
return;
}
break;
......@@ -1012,13 +1012,13 @@ VkResult anv_ImportSemaphoreFdKHR(
};
switch (pImportSemaphoreFdInfo->handleType) {
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR:
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT:
if (device->instance->physicalDevice.has_syncobj) {
new_impl.type = ANV_SEMAPHORE_TYPE_DRM_SYNCOBJ;
new_impl.syncobj = anv_gem_syncobj_fd_to_handle(device, fd);
if (!new_impl.syncobj)
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE);
} else {
new_impl.type = ANV_SEMAPHORE_TYPE_BO;
......@@ -1050,7 +1050,7 @@ VkResult anv_ImportSemaphoreFdKHR(
close(fd);
break;
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT_KHR:
case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT:
new_impl = (struct anv_semaphore_impl) {
.type = ANV_SEMAPHORE_TYPE_SYNC_FILE,
.fd = fd,
......@@ -1058,10 +1058,10 @@ VkResult anv_ImportSemaphoreFdKHR(
break;
default:
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE);
}
if (pImportSemaphoreFdInfo->flags & VK_SEMAPHORE_IMPORT_TEMPORARY_BIT_KHR) {
if (pImportSemaphoreFdInfo->flags & VK_SEMAPHORE_IMPORT_TEMPORARY_BIT) {
anv_semaphore_impl_cleanup(device, &semaphore->temporary);
semaphore->temporary = new_impl;
} else {
......@@ -1131,7 +1131,7 @@ VkResult anv_GetSemaphoreFdKHR(
break;
default:
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR);
return vk_error(VK_ERROR_INVALID_EXTERNAL_HANDLE);
}
/* From the Vulkan 1.0.53 spec:
......
......@@ -253,9 +253,9 @@ VkResult genX(CreateSampler)(
vk_foreach_struct(ext, pCreateInfo->pNext) {
switch (ext->sType) {
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR: {
VkSamplerYcbcrConversionInfoKHR *pSamplerConversion =
(VkSamplerYcbcrConversionInfoKHR *) ext;
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: {
VkSamplerYcbcrConversionInfo *pSamplerConversion =
(VkSamplerYcbcrConversionInfo *) ext;
ANV_FROM_HANDLE(anv_ycbcr_conversion, conversion,
pSamplerConversion->conversion);
......
......@@ -47,32 +47,32 @@ vk_format_aspects(VkFormat format)
case VK_FORMAT_D32_SFLOAT:
return VK_IMAGE_ASPECT_DEPTH_BIT;
case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:
case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:
case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:
case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:
case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:
case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:
case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:
case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:
case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:
case VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:
case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:
case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:
return (VK_IMAGE_ASPECT_PLANE_0_BIT_KHR |
VK_IMAGE_ASPECT_PLANE_1_BIT_KHR |
VK_IMAGE_ASPECT_PLANE_2_BIT_KHR);
case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:
case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:
case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:
case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:
case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:
case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:
case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:
case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:
case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:
case VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:
case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:
case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:
return (VK_IMAGE_ASPECT_PLANE_0_BIT |
VK_IMAGE_ASPECT_PLANE_1_BIT |
VK_IMAGE_ASPECT_PLANE_2_BIT);
case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:
case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:
case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:
case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:
case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:
case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:
case VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:
case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:
return (VK_IMAGE_ASPECT_PLANE_0_BIT_KHR |
VK_IMAGE_ASPECT_PLANE_1_BIT_KHR);
case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:
case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:
case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:
case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:
case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:
case VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:
case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:
return (VK_IMAGE_ASPECT_PLANE_0_BIT |
VK_IMAGE_ASPECT_PLANE_1_BIT);
default:
return VK_IMAGE_ASPECT_COLOR_BIT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment