Bug 14621: Change vkGet* functions to not return VkResult
diff --git a/demos/cube.c b/demos/cube.c
index 394a2d6..aed2b93 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -873,7 +873,7 @@
&demo->depth.image);
assert(!err);
- err = vkGetImageMemoryRequirements(demo->device,
+ vkGetImageMemoryRequirements(demo->device,
demo->depth.image, &mem_reqs);
assert(!err);
@@ -993,8 +993,7 @@
&tex_obj->image);
assert(!err);
- err = vkGetImageMemoryRequirements(demo->device, tex_obj->image, &mem_reqs);
- assert(!err);
+ vkGetImageMemoryRequirements(demo->device, tex_obj->image, &mem_reqs);
tex_obj->mem_alloc.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
tex_obj->mem_alloc.pNext = NULL;
@@ -1023,8 +1022,7 @@
VkSubresourceLayout layout;
void *data;
- err = vkGetImageSubresourceLayout(demo->device, tex_obj->image, &subres, &layout);
- assert(!err);
+ vkGetImageSubresourceLayout(demo->device, tex_obj->image, &subres, &layout);
err = vkMapMemory(demo->device, tex_obj->mem, 0, tex_obj->mem_alloc.allocationSize, 0, &data);
assert(!err);
@@ -1055,13 +1053,12 @@
{
const VkFormat tex_format = VK_FORMAT_R8G8B8A8_UNORM;
VkFormatProperties props;
- VkResult U_ASSERT_ONLY err;
uint32_t i;
- err = vkGetPhysicalDeviceFormatProperties(demo->gpu, tex_format, &props);
- assert(!err);
+ vkGetPhysicalDeviceFormatProperties(demo->gpu, tex_format, &props);
for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
+ VkResult U_ASSERT_ONLY err;
if ((props.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) && !demo->use_staging_buffer) {
/* Device can texture using linear textures */
@@ -1193,8 +1190,7 @@
err = vkCreateBuffer(demo->device, &buf_info, &demo->uniform_data.buf);
assert(!err);
- err = vkGetBufferMemoryRequirements(demo->device, demo->uniform_data.buf, &mem_reqs);
- assert(!err);
+ vkGetBufferMemoryRequirements(demo->device, demo->uniform_data.buf, &mem_reqs);
demo->uniform_data.mem_alloc.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO;
demo->uniform_data.mem_alloc.pNext = NULL;
@@ -2272,17 +2268,14 @@
break;
}
}
- err = vkGetPhysicalDeviceProperties(demo->gpu, &demo->gpu_props);
- assert(!err);
+ vkGetPhysicalDeviceProperties(demo->gpu, &demo->gpu_props);
/* Call with NULL data to get count */
- err = vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, NULL);
- assert(!err);
+ vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, NULL);
assert(demo->queue_count >= 1);
demo->queue_props = (VkQueueFamilyProperties *) malloc(demo->queue_count * sizeof(VkQueueFamilyProperties));
- err = vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, demo->queue_props);
- assert(!err);
+ vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, demo->queue_props);
// Find a queue that supports gfx
uint32_t gfx_queue_idx = 0;
for (gfx_queue_idx = 0; gfx_queue_idx<demo->queue_count; gfx_queue_idx++) {
@@ -2293,8 +2286,7 @@
// Query fine-grained feature support for this device.
// If app has specific feature requirements it should check supported features based on this query
VkPhysicalDeviceFeatures physDevFeatures;
- err = vkGetPhysicalDeviceFeatures(demo->gpu, &physDevFeatures);
- assert(!err);
+ vkGetPhysicalDeviceFeatures(demo->gpu, &physDevFeatures);
const VkDeviceQueueCreateInfo queue = {
.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
@@ -2405,9 +2397,8 @@
demo->graphics_queue_node_index = graphicsQueueNodeIndex;
- err = vkGetDeviceQueue(demo->device, demo->graphics_queue_node_index,
+ vkGetDeviceQueue(demo->device, demo->graphics_queue_node_index,
0, &demo->queue);
- assert(!err);
// Get the list of VkFormat's that are supported:
uint32_t formatCount;
@@ -2439,8 +2430,7 @@
demo->curFrame = 0;
// Get Memory information and properties
- err = vkGetPhysicalDeviceMemoryProperties(demo->gpu, &demo->memory_properties);
- assert(!err);
+ vkGetPhysicalDeviceMemoryProperties(demo->gpu, &demo->memory_properties);
}
static void demo_init_connection(struct demo *demo)
diff --git a/demos/tri.c b/demos/tri.c
index dc450f8..9b276e9 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -687,7 +687,7 @@
assert(!err);
/* get memory requirements for this object */
- err = vkGetImageMemoryRequirements(demo->device, demo->depth.image,
+ vkGetImageMemoryRequirements(demo->device, demo->depth.image,
&mem_reqs);
/* select memory size and type */
@@ -759,8 +759,7 @@
&tex_obj->image);
assert(!err);
- err = vkGetImageMemoryRequirements(demo->device, tex_obj->image, &mem_reqs);
- assert(!err);
+ vkGetImageMemoryRequirements(demo->device, tex_obj->image, &mem_reqs);
mem_alloc.allocationSize = mem_reqs.size;
err = memory_type_from_properties(demo, mem_reqs.memoryTypeBits, required_props, &mem_alloc.memoryTypeIndex);
@@ -785,8 +784,7 @@
void *data;
int32_t x, y;
- err = vkGetImageSubresourceLayout(demo->device, tex_obj->image, &subres, &layout);
- assert(!err);
+ vkGetImageSubresourceLayout(demo->device, tex_obj->image, &subres, &layout);
err = vkMapMemory(demo->device, tex_obj->mem, 0, mem_alloc.allocationSize, 0, &data);
assert(!err);
@@ -822,11 +820,10 @@
const uint32_t tex_colors[DEMO_TEXTURE_COUNT][2] = {
{ 0xffff0000, 0xff00ff00 },
};
- VkResult U_ASSERT_ONLY err;
uint32_t i;
+ VkResult err;
- err = vkGetPhysicalDeviceFormatProperties(demo->gpu, tex_format, &props);
- assert(!err);
+ vkGetPhysicalDeviceFormatProperties(demo->gpu, tex_format, &props);
for (i = 0; i < DEMO_TEXTURE_COUNT; i++) {
if ((props.linearTilingFeatures & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) && !demo->use_staging_buffer) {
@@ -955,7 +952,7 @@
err = vkCreateBuffer(demo->device, &buf_info, &demo->vertices.buf);
assert(!err);
- err = vkGetBufferMemoryRequirements(demo->device,
+ vkGetBufferMemoryRequirements(demo->device,
demo->vertices.buf, &mem_reqs);
assert(!err);
@@ -1944,16 +1941,13 @@
GET_DEVICE_PROC_ADDR(demo->device, AcquireNextImageKHR);
GET_DEVICE_PROC_ADDR(demo->device, QueuePresentKHR);
- err = vkGetPhysicalDeviceProperties(demo->gpu, &demo->gpu_props);
- assert(!err);
+ vkGetPhysicalDeviceProperties(demo->gpu, &demo->gpu_props);
// Query with NULL data to get count
- err = vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, NULL);
- assert(!err);
+ vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, NULL);
demo->queue_props = (VkQueueFamilyProperties *) malloc(demo->queue_count * sizeof(VkQueueFamilyProperties));
- err = vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, demo->queue_props);
- assert(!err);
+ vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, demo->queue_props);
assert(demo->queue_count >= 1);
// Graphics queue and MemMgr queue can be separate.
@@ -2035,9 +2029,8 @@
demo->graphics_queue_node_index = graphicsQueueNodeIndex;
- err = vkGetDeviceQueue(demo->device, demo->graphics_queue_node_index,
+ vkGetDeviceQueue(demo->device, demo->graphics_queue_node_index,
0, &demo->queue);
- assert(!err);
// Get the list of VkFormat's that are supported:
uint32_t formatCount;
@@ -2066,8 +2059,7 @@
demo->color_space = surfFormats[0].colorSpace;
// Get Memory information and properties
- err = vkGetPhysicalDeviceMemoryProperties(demo->gpu, &demo->memory_properties);
- assert(!err);
+ vkGetPhysicalDeviceMemoryProperties(demo->gpu, &demo->memory_properties);
}
static void demo_init_connection(struct demo *demo)
diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c
index c8d091d..5453c48 100644
--- a/demos/vulkaninfo.c
+++ b/demos/vulkaninfo.c
@@ -345,13 +345,8 @@
for (f = 0; f < VK_FORMAT_NUM; f++) {
const VkFormat fmt = f;
- VkResult err;
- err = vkGetPhysicalDeviceFormatProperties(dev->gpu->obj, fmt, &dev->format_props[f]);
- if (err) {
- memset(&dev->format_props[f], 0,
- sizeof(dev->format_props[f]));
- }
+ vkGetPhysicalDeviceFormatProperties(dev->gpu->obj, fmt, &dev->format_props[f]);
}
}
@@ -637,7 +632,6 @@
static void app_gpu_init(struct app_gpu *gpu, uint32_t id, VkPhysicalDevice obj)
{
- VkResult err;
uint32_t i;
memset(gpu, 0, sizeof(*gpu));
@@ -645,23 +639,17 @@
gpu->id = id;
gpu->obj = obj;
- err = vkGetPhysicalDeviceProperties(gpu->obj, &gpu->props);
- if (err)
- ERR_EXIT(err);
+ vkGetPhysicalDeviceProperties(gpu->obj, &gpu->props);
/* get queue count */
- err = vkGetPhysicalDeviceQueueFamilyProperties(gpu->obj, &gpu->queue_count, NULL);
- if (err)
- ERR_EXIT(err);
+ vkGetPhysicalDeviceQueueFamilyProperties(gpu->obj, &gpu->queue_count, NULL);
gpu->queue_props =
malloc(sizeof(gpu->queue_props[0]) * gpu->queue_count);
if (!gpu->queue_props)
ERR_EXIT(VK_ERROR_OUT_OF_HOST_MEMORY);
- err = vkGetPhysicalDeviceQueueFamilyProperties(gpu->obj, &gpu->queue_count, gpu->queue_props);
- if (err)
- ERR_EXIT(err);
+ vkGetPhysicalDeviceQueueFamilyProperties(gpu->obj, &gpu->queue_count, gpu->queue_props);
/* set up queue requests */
gpu->queue_reqs = malloc(sizeof(*gpu->queue_reqs) * gpu->queue_count);
@@ -674,13 +662,9 @@
gpu->queue_reqs[i].queueCount = gpu->queue_props[i].queueCount;
}
- err = vkGetPhysicalDeviceMemoryProperties(gpu->obj, &gpu->memory_props);
- if (err)
- ERR_EXIT(err);
+ vkGetPhysicalDeviceMemoryProperties(gpu->obj, &gpu->memory_props);
- err = vkGetPhysicalDeviceFeatures(gpu->obj, &gpu->features);
- if (err)
- ERR_EXIT(err);
+ vkGetPhysicalDeviceFeatures(gpu->obj, &gpu->features);
app_dev_init(&gpu->dev, gpu);
app_dev_init_formats(&gpu->dev);