summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-11-30 12:21:19 -0800
committerJason Ekstrand <[email protected]>2015-11-30 12:46:30 -0800
commitf1a7c7841f4484d81d4f6c0242e04fdaea5f0933 (patch)
tree5c63e34c134a2bf9ae6bd2369d4e8051556d55ee /src
parenta89a485e79ad40793a85979d86d45760362be21a (diff)
vk/0.210.0: Switch to the new VKAPI function decorations
While we're at it, we do a bunch of the VkResult -> void updates
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/anv_device.c37
-rw-r--r--src/vulkan/anv_dump.c5
-rw-r--r--src/vulkan/anv_entrypoints_gen.py2
-rw-r--r--src/vulkan/anv_formats.c32
-rw-r--r--src/vulkan/anv_image.c6
-rw-r--r--src/vulkan/anv_pass.c4
6 files changed, 27 insertions, 59 deletions
diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c
index 15ad2107627..49d74bbfc78 100644
--- a/src/vulkan/anv_device.c
+++ b/src/vulkan/anv_device.c
@@ -330,7 +330,7 @@ VkResult anv_EnumeratePhysicalDevices(
return VK_SUCCESS;
}
-VkResult anv_GetPhysicalDeviceFeatures(
+void anv_GetPhysicalDeviceFeatures(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures* pFeatures)
{
@@ -378,11 +378,9 @@ VkResult anv_GetPhysicalDeviceFeatures(
.shaderInt16 = false,
.alphaToOne = true,
};
-
- return VK_SUCCESS;
}
-VkResult anv_GetPhysicalDeviceProperties(
+void anv_GetPhysicalDeviceProperties(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceProperties* pProperties)
{
@@ -514,18 +512,16 @@ VkResult anv_GetPhysicalDeviceProperties(
strcpy(pProperties->deviceName, pdevice->name);
snprintf((char *)pProperties->pipelineCacheUUID, VK_UUID_LENGTH,
"anv-%s", MESA_GIT_SHA1 + 4);
-
- return VK_SUCCESS;
}
-VkResult anv_GetPhysicalDeviceQueueFamilyProperties(
+void anv_GetPhysicalDeviceQueueFamilyProperties(
VkPhysicalDevice physicalDevice,
uint32_t* pCount,
VkQueueFamilyProperties* pQueueFamilyProperties)
{
if (pQueueFamilyProperties == NULL) {
*pCount = 1;
- return VK_SUCCESS;
+ return;
}
assert(*pCount >= 1);
@@ -537,11 +533,9 @@ VkResult anv_GetPhysicalDeviceQueueFamilyProperties(
.queueCount = 1,
.supportsTimestamps = true,
};
-
- return VK_SUCCESS;
}
-VkResult anv_GetPhysicalDeviceMemoryProperties(
+void anv_GetPhysicalDeviceMemoryProperties(
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceMemoryProperties* pMemoryProperties)
{
@@ -565,8 +559,6 @@ VkResult anv_GetPhysicalDeviceMemoryProperties(
.size = heap_size,
.flags = VK_MEMORY_HEAP_HOST_LOCAL_BIT,
};
-
- return VK_SUCCESS;
}
PFN_vkVoidFunction anv_GetInstanceProcAddr(
@@ -795,7 +787,7 @@ VkResult anv_EnumerateDeviceLayerProperties(
return vk_error(VK_ERROR_LAYER_NOT_PRESENT);
}
-VkResult anv_GetDeviceQueue(
+void anv_GetDeviceQueue(
VkDevice _device,
uint32_t queueNodeIndex,
uint32_t queueIndex,
@@ -806,8 +798,6 @@ VkResult anv_GetDeviceQueue(
assert(queueIndex == 0);
*pQueue = anv_queue_to_handle(&device->queue);
-
- return VK_SUCCESS;
}
VkResult anv_QueueSubmit(
@@ -1059,7 +1049,7 @@ VkResult anv_InvalidateMappedMemoryRanges(
return anv_FlushMappedMemoryRanges(device, memRangeCount, pMemRanges);
}
-VkResult anv_GetBufferMemoryRequirements(
+void anv_GetBufferMemoryRequirements(
VkDevice device,
VkBuffer _buffer,
VkMemoryRequirements* pMemoryRequirements)
@@ -1079,11 +1069,9 @@ VkResult anv_GetBufferMemoryRequirements(
pMemoryRequirements->size = buffer->size;
pMemoryRequirements->alignment = 16;
-
- return VK_SUCCESS;
}
-VkResult anv_GetImageMemoryRequirements(
+void anv_GetImageMemoryRequirements(
VkDevice device,
VkImage _image,
VkMemoryRequirements* pMemoryRequirements)
@@ -1103,26 +1091,23 @@ VkResult anv_GetImageMemoryRequirements(
pMemoryRequirements->size = image->size;
pMemoryRequirements->alignment = image->alignment;
-
- return VK_SUCCESS;
}
-VkResult anv_GetImageSparseMemoryRequirements(
+void anv_GetImageSparseMemoryRequirements(
VkDevice device,
VkImage image,
uint32_t* pNumRequirements,
VkSparseImageMemoryRequirements* pSparseMemoryRequirements)
{
- return vk_error(VK_UNSUPPORTED);
+ stub();
}
-VkResult anv_GetDeviceMemoryCommitment(
+void anv_GetDeviceMemoryCommitment(
VkDevice device,
VkDeviceMemory memory,
VkDeviceSize* pCommittedMemoryInBytes)
{
*pCommittedMemoryInBytes = 0;
- stub_return(VK_SUCCESS);
}
VkResult anv_BindBufferMemory(
diff --git a/src/vulkan/anv_dump.c b/src/vulkan/anv_dump.c
index 1c5cd4b56f9..9d0c4d700e5 100644
--- a/src/vulkan/anv_dump.c
+++ b/src/vulkan/anv_dump.c
@@ -58,7 +58,7 @@ anv_dump_image_to_ppm(struct anv_device *device,
assert(result == VK_SUCCESS);
VkMemoryRequirements reqs;
- result = anv_GetImageMemoryRequirements(vk_device, copy_image, &reqs);
+ anv_GetImageMemoryRequirements(vk_device, copy_image, &reqs);
VkDeviceMemory memory;
result = anv_AllocMemory(vk_device,
@@ -176,13 +176,12 @@ anv_dump_image_to_ppm(struct anv_device *device,
assert(result == VK_SUCCESS);
VkSubresourceLayout layout;
- result = anv_GetImageSubresourceLayout(vk_device, copy_image,
+ anv_GetImageSubresourceLayout(vk_device, copy_image,
&(VkImageSubresource) {
.aspect = VK_IMAGE_ASPECT_COLOR,
.mipLevel = 0,
.arrayLayer = 0,
}, &layout);
- assert(result == VK_SUCCESS);
map += layout.offset;
diff --git a/src/vulkan/anv_entrypoints_gen.py b/src/vulkan/anv_entrypoints_gen.py
index 2e56274eb50..406f1421054 100644
--- a/src/vulkan/anv_entrypoints_gen.py
+++ b/src/vulkan/anv_entrypoints_gen.py
@@ -27,7 +27,7 @@ import fileinput, re, sys
# Each function typedef in the vulkan.h header is all on one line and matches
# this regepx. We hope that won't change.
-p = re.compile('typedef ([^ ]*) *\(VKAPI \*PFN_vk([^(]*)\)(.*);')
+p = re.compile('typedef ([^ ]*) *\(VKAPI_PTR \*PFN_vk([^(]*)\)(.*);')
entrypoints = []
diff --git a/src/vulkan/anv_formats.c b/src/vulkan/anv_formats.c
index 8d5eae4c12e..8afef443696 100644
--- a/src/vulkan/anv_formats.c
+++ b/src/vulkan/anv_formats.c
@@ -227,17 +227,17 @@ anv_format_for_vk_format(VkFormat format)
// Format capabilities
-VkResult anv_validate_GetPhysicalDeviceFormatProperties(
+void anv_validate_GetPhysicalDeviceFormatProperties(
VkPhysicalDevice physicalDevice,
VkFormat _format,
VkFormatProperties* pFormatProperties)
{
const struct anv_format *format = anv_format_for_vk_format(_format);
fprintf(stderr, "vkGetFormatProperties(%s)\n", format->name);
- return anv_GetPhysicalDeviceFormatProperties(physicalDevice, _format, pFormatProperties);
+ anv_GetPhysicalDeviceFormatProperties(physicalDevice, _format, pFormatProperties);
}
-static VkResult
+static void
anv_physical_device_get_format_properties(struct anv_physical_device *physical_device,
const struct anv_format *format,
VkFormatProperties *out_properties)
@@ -296,32 +296,25 @@ anv_physical_device_get_format_properties(struct anv_physical_device *physical_d
out_properties->optimalTilingFeatures = tiled;
out_properties->bufferFeatures = 0; /* FINISHME */
- return VK_SUCCESS;
+ return;
unsupported:
out_properties->linearTilingFeatures = 0;
out_properties->optimalTilingFeatures = 0;
-
- return VK_SUCCESS;
}
-VkResult anv_GetPhysicalDeviceFormatProperties(
+void anv_GetPhysicalDeviceFormatProperties(
VkPhysicalDevice physicalDevice,
VkFormat format,
VkFormatProperties* pFormatProperties)
{
ANV_FROM_HANDLE(anv_physical_device, physical_device, physicalDevice);
- VkResult result;
- result = anv_physical_device_get_format_properties(
+ anv_physical_device_get_format_properties(
physical_device,
anv_format_for_vk_format(format),
pFormatProperties);
- if (result != VK_SUCCESS)
- return vk_error(result);
-
- return VK_SUCCESS;
}
VkResult anv_GetPhysicalDeviceImageFormatProperties(
@@ -340,12 +333,9 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
VkExtent3D maxExtent;
uint32_t maxMipLevels;
uint32_t maxArraySize;
- VkResult result;
- result = anv_physical_device_get_format_properties(physical_device, format,
- &format_props);
- if (result != VK_SUCCESS)
- return vk_error(result);
+ anv_physical_device_get_format_properties(physical_device, format,
+ &format_props);
/* Extract the VkFormatFeatureFlags that are relevant for the queried
* tiling.
@@ -453,7 +443,7 @@ VkResult anv_GetPhysicalDeviceImageFormatProperties(
.maxResourceSize = UINT32_MAX,
};
- return VK_SUCCESS;
+ return VK_SUCCESS;
unsupported:
*pImageFormatProperties = (VkImageFormatProperties) {
@@ -467,7 +457,7 @@ unsupported:
return VK_SUCCESS;
}
-VkResult anv_GetPhysicalDeviceSparseImageFormatProperties(
+void anv_GetPhysicalDeviceSparseImageFormatProperties(
VkPhysicalDevice physicalDevice,
VkFormat format,
VkImageType type,
@@ -479,6 +469,4 @@ VkResult anv_GetPhysicalDeviceSparseImageFormatProperties(
{
/* Sparse images are not yet supported. */
*pNumProperties = 0;
-
- return VK_SUCCESS;
}
diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c
index 973e8bd609a..1a500d2b4e4 100644
--- a/src/vulkan/anv_image.c
+++ b/src/vulkan/anv_image.c
@@ -422,7 +422,7 @@ anv_surface_get_subresource_layout(struct anv_image *image,
layout->size = surface->stride * image->extent.height;
}
-VkResult anv_GetImageSubresourceLayout(
+void anv_GetImageSubresourceLayout(
VkDevice device,
VkImage _image,
const VkImageSubresource* pSubresource,
@@ -444,10 +444,8 @@ VkResult anv_GetImageSubresourceLayout(
pSubresource, pLayout);
break;
default:
- return vk_error(VK_UNSUPPORTED);
+ assert(!"Invalid image aspect");
}
-
- return VK_SUCCESS;
}
VkResult
diff --git a/src/vulkan/anv_pass.c b/src/vulkan/anv_pass.c
index bf0f830f3c1..a89c494f7e0 100644
--- a/src/vulkan/anv_pass.c
+++ b/src/vulkan/anv_pass.c
@@ -133,12 +133,10 @@ void anv_DestroyRenderPass(
anv_device_free(device, pass);
}
-VkResult anv_GetRenderAreaGranularity(
+void anv_GetRenderAreaGranularity(
VkDevice device,
VkRenderPass renderPass,
VkExtent2D* pGranularity)
{
*pGranularity = (VkExtent2D) { 1, 1 };
-
- return VK_SUCCESS;
}