bug-14538: Remove driver validation checks
Marked validation checks done in the driver with
TODOVV. Once we verify the check is covered in a
validation layer we can remove the driver code.
diff --git a/demos/cube.c b/demos/cube.c
index 272ef0a..83755c1 100644
--- a/demos/cube.c
+++ b/demos/cube.c
@@ -2436,10 +2436,6 @@
switch (err) {
case VK_SUCCESS:
break;
- case VK_ERROR_INVALID_POINTER:
- ERR_EXIT("dbgCreateMsgCallback: Invalid pointer\n",
- "dbgCreateMsgCallback Failure");
- break;
case VK_ERROR_OUT_OF_HOST_MEMORY:
ERR_EXIT("dbgCreateMsgCallback: out of host memory\n",
"dbgCreateMsgCallback Failure");
diff --git a/demos/tri.c b/demos/tri.c
index 0f3bcc3..30f95c9 100644
--- a/demos/tri.c
+++ b/demos/tri.c
@@ -1932,10 +1932,6 @@
switch (err) {
case VK_SUCCESS:
break;
- case VK_ERROR_INVALID_POINTER:
- ERR_EXIT("dbgCreateMsgCallback: Invalid pointer\n",
- "dbgCreateMsgCallback Failure");
- break;
case VK_ERROR_OUT_OF_HOST_MEMORY:
ERR_EXIT("dbgCreateMsgCallback: out of host memory\n",
"dbgCreateMsgCallback Failure");
diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c
index fd6c08a..786a383 100644
--- a/demos/vulkaninfo.c
+++ b/demos/vulkaninfo.c
@@ -138,36 +138,15 @@
STR(VK_EVENT_SET);
STR(VK_EVENT_RESET);
STR(VK_ERROR_UNKNOWN);
- STR(VK_ERROR_UNAVAILABLE);
STR(VK_ERROR_INITIALIZATION_FAILED);
STR(VK_ERROR_OUT_OF_HOST_MEMORY);
STR(VK_ERROR_OUT_OF_DEVICE_MEMORY);
- STR(VK_ERROR_DEVICE_ALREADY_CREATED);
STR(VK_ERROR_DEVICE_LOST);
- STR(VK_ERROR_INVALID_POINTER);
- STR(VK_ERROR_INVALID_VALUE);
- STR(VK_ERROR_INVALID_HANDLE);
- STR(VK_ERROR_INVALID_ORDINAL);
- STR(VK_ERROR_INVALID_MEMORY_SIZE);
STR(VK_ERROR_INVALID_EXTENSION);
- STR(VK_ERROR_INVALID_FLAGS);
- STR(VK_ERROR_INVALID_ALIGNMENT);
- STR(VK_ERROR_INVALID_FORMAT);
- STR(VK_ERROR_INVALID_IMAGE);
- STR(VK_ERROR_INVALID_DESCRIPTOR_SET_DATA);
- STR(VK_ERROR_INVALID_QUEUE_TYPE);
- STR(VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION);
- STR(VK_ERROR_BAD_SHADER_CODE);
- STR(VK_ERROR_BAD_PIPELINE_DATA);
- STR(VK_ERROR_NOT_MAPPABLE);
STR(VK_ERROR_MEMORY_MAP_FAILED);
STR(VK_ERROR_MEMORY_UNMAP_FAILED);
STR(VK_ERROR_INCOMPATIBLE_DEVICE);
STR(VK_ERROR_INCOMPATIBLE_DRIVER);
- STR(VK_ERROR_INCOMPLETE_COMMAND_BUFFER);
- STR(VK_ERROR_BUILDING_COMMAND_BUFFER);
- STR(VK_ERROR_MEMORY_NOT_BOUND);
- STR(VK_ERROR_INCOMPATIBLE_QUEUE);
#undef STR
default: return "UNKNOWN_RESULT";
}
diff --git a/icd/common/icd-instance.c b/icd/common/icd-instance.c
index 449ff98..3568b76 100644
--- a/icd/common/icd-instance.c
+++ b/icd/common/icd-instance.c
@@ -123,9 +123,10 @@
{
struct icd_instance_logger *logger;
- if (msg_obj == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
+ /* TODOVV: Move this test to a validation layer */
+// if (msg_obj == NULL) {
+// return VK_ERROR_INVALID_POINTER;
+// }
logger = icd_instance_alloc(instance, sizeof(*logger), 0,
VK_SYSTEM_ALLOC_TYPE_DEBUG);
@@ -157,8 +158,9 @@
break;
}
- if (!logger)
- return VK_ERROR_INVALID_POINTER;
+ /* TODOVV: Move this to validation layer */
+// if (!logger)
+// return VK_ERROR_INVALID_POINTER;
if (prev)
prev->next = logger->next;
diff --git a/icd/intel/cmd.c b/icd/intel/cmd.c
index f964f9e..7b97e95 100644
--- a/icd/intel/cmd.c
+++ b/icd/intel/cmd.c
@@ -270,7 +270,8 @@
pipeline_select = GEN6_PIPELINE_SELECT_DW0_SELECT_3D;
break;
default:
- return VK_ERROR_INVALID_VALUE;
+ /* TODOVV: Add validation check for this */
+ return VK_ERROR_UNKNOWN;
break;
}
@@ -319,13 +320,8 @@
cmd_reset(cmd);
- if (cmd->primary) {
- if (info->renderPass.handle || info->framebuffer.handle)
- return VK_ERROR_INVALID_VALUE;
- } else {
- if (!info->renderPass.handle || !info->framebuffer.handle)
- return VK_ERROR_INVALID_VALUE;
-
+ /* TODOVV: Check that render pass is defined */
+ if (!cmd->primary) {
cmd_begin_render_pass(cmd,
intel_render_pass(info->renderPass),
intel_fb(info->framebuffer),
@@ -370,8 +366,10 @@
uint32_t i;
/* no matching intel_cmd_begin() */
- if (!cmd->writers[INTEL_CMD_WRITER_BATCH].ptr)
- return VK_ERROR_INCOMPLETE_COMMAND_BUFFER;
+ if (!cmd->writers[INTEL_CMD_WRITER_BATCH].ptr) {
+ /* TODOVV: Move this to validation layer */
+ return VK_ERROR_UNKNOWN;
+ }
cmd_batch_end(cmd);
diff --git a/icd/intel/cmd_meta.c b/icd/intel/cmd_meta.c
index 05cc993..f51476c 100644
--- a/icd/intel/cmd_meta.c
+++ b/icd/intel/cmd_meta.c
@@ -575,7 +575,7 @@
/*
* TODO: Implement actual blit function.
*/
- cmd_fail(cmd, VK_ERROR_UNAVAILABLE);
+ cmd_fail(cmd, VK_ERROR_UNKNOWN);
}
ICD_EXPORT void VKAPI vkCmdCopyBufferToImage(
diff --git a/icd/intel/cmd_mi.c b/icd/intel/cmd_mi.c
index 63dca79..4ebefbb 100644
--- a/icd/intel/cmd_mi.c
+++ b/icd/intel/cmd_mi.c
@@ -236,7 +236,8 @@
cmd_batch_timestamp(cmd, buf->obj.mem->bo, destOffset);
break;
default:
- cmd_fail(cmd, VK_ERROR_INVALID_VALUE);
+ /* TODOVV: This should be covered by validation error */
+ cmd_fail(cmd, VK_ERROR_UNKNOWN);
break;
}
}
diff --git a/icd/intel/cmd_pipeline.c b/icd/intel/cmd_pipeline.c
index 49f9e56..149d616 100644
--- a/icd/intel/cmd_pipeline.c
+++ b/icd/intel/cmd_pipeline.c
@@ -263,13 +263,15 @@
offset_align = 4;
break;
default:
- cmd_fail(cmd, VK_ERROR_INVALID_VALUE);
+ /* TODOVV: Make sure covered in validation test */
+// cmd_fail(cmd, VK_ERROR_INVALID_VALUE);
return;
break;
}
if (offset % offset_align) {
- cmd_fail(cmd, VK_ERROR_INVALID_VALUE);
+ /* TODOVV: Make sure covered in validation test */
+// cmd_fail(cmd, VK_ERROR_INVALID_VALUE);
return;
}
@@ -3470,7 +3472,8 @@
cmd_bind_graphics_pipeline(cmd, intel_pipeline(pipeline));
break;
default:
- cmd_fail(cmd, VK_ERROR_INVALID_VALUE);
+ /* TODOVV: Move test to validation layer */
+// cmd_fail(cmd, VK_ERROR_INVALID_VALUE);
break;
}
}
@@ -3561,7 +3564,8 @@
data = &cmd->bind.dset.graphics_data;
break;
default:
- cmd_fail(cmd, VK_ERROR_INVALID_VALUE);
+ /* TODOVV: Move test to validation layer */
+// cmd_fail(cmd, VK_ERROR_INVALID_VALUE);
return;
break;
}
@@ -3803,7 +3807,9 @@
const struct intel_cmd *secondary = intel_cmd(pCmdBuffers[i]);
if (secondary->primary) {
- cmd->result = VK_ERROR_INVALID_VALUE;
+ /* TODOVV: Move test to validation layer */
+// cmd->result = VK_ERROR_INVALID_VALUE;
+ cmd->result = VK_ERROR_UNKNOWN;
break;
}
diff --git a/icd/intel/compiler/pipeline/pipeline_compiler_interface.cpp b/icd/intel/compiler/pipeline/pipeline_compiler_interface.cpp
index b5a9302..88050af 100644
--- a/icd/intel/compiler/pipeline/pipeline_compiler_interface.cpp
+++ b/icd/intel/compiler/pipeline/pipeline_compiler_interface.cpp
@@ -560,7 +560,9 @@
"compile error: UBO mismatch, %s shader may read from global, non-block uniform", shader_stage_to_string(stage));
assert(0);
- return VK_ERROR_BAD_PIPELINE_DATA;
+ /* TODO: Move this test to validation layer, is this already covered in shader_checker? */
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
}
// Sampler mapping data
@@ -886,11 +888,11 @@
case GL_COMPUTE_SHADER:
default:
assert(0);
- status = VK_ERROR_BAD_PIPELINE_DATA;
+ status = VK_ERROR_UNKNOWN;
}
} else {
assert(0);
- status = VK_ERROR_BAD_PIPELINE_DATA;
+ status = VK_ERROR_UNKNOWN;
}
if (status == VK_SUCCESS) {
diff --git a/icd/intel/desc.c b/icd/intel/desc.c
index e7c31c3..e127a42 100644
--- a/icd/intel/desc.c
+++ b/icd/intel/desc.c
@@ -195,7 +195,6 @@
break;
default:
assert(!"unknown descriptor type");
- return VK_ERROR_INVALID_VALUE;
break;
}
@@ -891,8 +890,11 @@
if (!desc_iter_init_for_writing(&iter, set, write->destBinding,
write->destArrayElement) ||
- iter.type != write->descriptorType)
- return VK_ERROR_INVALID_VALUE;
+ iter.type != write->descriptorType) {
+ /* TODOVV: is this covered in validation? */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
switch (write->descriptorType) {
case VK_DESCRIPTOR_TYPE_SAMPLER:
@@ -903,8 +905,11 @@
desc_set_write_sampler(set, &iter, sampler);
- if (!intel_desc_iter_advance(&iter))
- return VK_ERROR_INVALID_VALUE;
+ if (!intel_desc_iter_advance(&iter)) {
+ /* TODOVV: is this covered in validation? */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
}
break;
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
@@ -936,8 +941,11 @@
desc_set_write_combined_image_sampler(set, &iter,
img_view, info->imageLayout, sampler);
- if (!intel_desc_iter_advance(&iter))
- return VK_ERROR_INVALID_VALUE;
+ if (!intel_desc_iter_advance(&iter)) {
+ /* TODOVV: Move test to validation */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
}
break;
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
@@ -949,8 +957,11 @@
desc_set_write_image(set, &iter, img_view, info->imageLayout);
- if (!intel_desc_iter_advance(&iter))
- return VK_ERROR_INVALID_VALUE;
+ if (!intel_desc_iter_advance(&iter)) {
+ /* TODOVV: Move test to validation */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
}
break;
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
@@ -966,12 +977,16 @@
desc_set_write_buffer(set, &iter, buf_view);
- if (!intel_desc_iter_advance(&iter))
- return VK_ERROR_INVALID_VALUE;
+ if (!intel_desc_iter_advance(&iter)) {
+ /* TODOVV: Move test to validation */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
}
break;
default:
- return VK_ERROR_INVALID_VALUE;
+ /* TODOVV: Make sure validation layer covers this case */
+ return VK_ERROR_UNKNOWN;
break;
}
}
@@ -987,8 +1002,11 @@
copy->srcBinding, copy->srcArrayElement) ||
!desc_iter_init_for_writing(&dst_iter, dst_set,
copy->destBinding, copy->destArrayElement) ||
- src_iter.type != dst_iter.type)
- return VK_ERROR_INVALID_VALUE;
+ src_iter.type != dst_iter.type) {
+ /* TODOVV: Move test to validation layer */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
/* disallow combined image samplers */
if (dst_iter.type == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)
@@ -1001,8 +1019,11 @@
/* advance to the end */
for (j = 0; j < copy->count; j++) {
if (!intel_desc_iter_advance(&src_iter) ||
- !intel_desc_iter_advance(&dst_iter))
- return VK_ERROR_INVALID_VALUE;
+ !intel_desc_iter_advance(&dst_iter)) {
+ /* TODOVV: Move test to validation layer */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
}
intel_desc_region_copy(dst_set->region, &dst_begin,
diff --git a/icd/intel/dev.c b/icd/intel/dev.c
index 19244d1..d292068 100644
--- a/icd/intel/dev.c
+++ b/icd/intel/dev.c
@@ -71,8 +71,9 @@
{
uint32_t i;
- if (!count)
- return VK_ERROR_INVALID_POINTER;
+ /* TODOVV: make sure test is covered by validation layer */
+// if (!count)
+// return VK_ERROR_INVALID_POINTER;
for (i = 0; i < count; i++) {
const VkDeviceQueueCreateInfo *q = &queues[i];
@@ -84,7 +85,9 @@
&dev->queues[q->queueFamilyIndex]);
}
else {
- ret = VK_ERROR_INVALID_POINTER;
+ /* TODOVV: make sure test is covered by validation layer */
+// ret = VK_ERROR_INVALID_POINTER;
+ return VK_ERROR_UNKNOWN;
}
if (ret != VK_SUCCESS) {
@@ -107,8 +110,9 @@
uint32_t i;
VkResult ret;
- if (gpu->winsys)
- return VK_ERROR_DEVICE_ALREADY_CREATED;
+ /* TODOVV: Make sure test is covered by validation layer */
+// if (gpu->winsys)
+// return VK_ERROR_DEVICE_ALREADY_CREATED;
dev = (struct intel_dev *) intel_base_create(&gpu->handle,
sizeof(*dev), false,
@@ -234,18 +238,20 @@
ICD_EXPORT VkResult VKAPI vkGetDeviceQueue(
VkDevice device,
- uint32_t queueNodeIndex,
- uint32_t queueIndex,
+ uint32_t queueNodeIndex,
+ uint32_t queueIndex,
VkQueue* pQueue)
{
struct intel_dev *dev = intel_dev(device);
- if (queueNodeIndex >= INTEL_GPU_ENGINE_COUNT) {
- return VK_ERROR_UNAVAILABLE;
- }
+ /* TODOVV: Move to validation layer */
+// if (queueNodeIndex >= INTEL_GPU_ENGINE_COUNT) {
+// return VK_ERROR_UNAVAILABLE;
+// }
- if (queueIndex > 0)
- return VK_ERROR_UNAVAILABLE;
+ /* TODOVV: Move to validation layer */
+// if (queueIndex > 0)
+// return VK_ERROR_UNAVAILABLE;
*pQueue = (VkQueue) dev->queues[queueNodeIndex];
return VK_SUCCESS;
diff --git a/icd/intel/fb.c b/icd/intel/fb.c
index b434ae4..20634e7 100644
--- a/icd/intel/fb.c
+++ b/icd/intel/fb.c
@@ -102,7 +102,7 @@
struct intel_render_pass *rp;
uint32_t i;
- /* TODO */
+ /* TODOVV: Move to validation layer */
if (info->dependencyCount)
return VK_ERROR_UNKNOWN;
diff --git a/icd/intel/fence.c b/icd/intel/fence.c
index 019fe10..9edaedf 100644
--- a/icd/intel/fence.c
+++ b/icd/intel/fence.c
@@ -113,7 +113,7 @@
return ret;
}
- return VK_ERROR_UNAVAILABLE;
+ return VK_ERROR_UNKNOWN;
}
ICD_EXPORT VkResult VKAPI vkCreateFence(
diff --git a/icd/intel/gpu.c b/icd/intel/gpu.c
index a6ed56c..495c16b 100644
--- a/icd/intel/gpu.c
+++ b/icd/intel/gpu.c
@@ -466,8 +466,11 @@
return VK_SUCCESS;
}
- if (*pCount > INTEL_GPU_ENGINE_COUNT)
- return VK_ERROR_INVALID_VALUE;
+ /* TODOVV: Move test to validation layer */
+ if (*pCount > INTEL_GPU_ENGINE_COUNT) {
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
for (engine = 0; engine < *pCount; engine++) {
intel_gpu_get_queue_props(gpu, engine, pProperties);
@@ -512,12 +515,6 @@
uint32_t copy_size;
uint32_t extension_count = ARRAY_SIZE(intel_phy_dev_gpu_exts);
- /* TODO: Do we want to check that pLayerName is null? */
-
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
if (pProperties == NULL) {
*pCount = INTEL_PHY_DEV_EXT_COUNT;
return VK_SUCCESS;
@@ -538,10 +535,6 @@
uint32_t* pCount,
VkLayerProperties* pProperties)
{
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
*pCount = 0;
return VK_SUCCESS;
}
diff --git a/icd/intel/img.c b/icd/intel/img.c
index 418b492..20b95ae 100644
--- a/icd/intel/img.c
+++ b/icd/intel/img.c
@@ -85,7 +85,9 @@
intel_dev_log(dev, VK_DBG_REPORT_ERROR_BIT,
VK_NULL_HANDLE, 0, 0, "image too big");
intel_img_destroy(img);
- return VK_ERROR_INVALID_MEMORY_SIZE;
+ /* TODOVV: Move test to validation layer */
+// return VK_ERROR_INVALID_MEMORY_SIZE;
+ return VK_ERROR_OUT_OF_DEVICE_MEMORY;
}
img->total_size = img->layout.bo_stride * img->layout.bo_height;
diff --git a/icd/intel/instance.c b/icd/intel/instance.c
index 5d6e6ba..3deca51 100644
--- a/icd/intel/instance.c
+++ b/icd/intel/instance.c
@@ -239,10 +239,6 @@
{
uint32_t copy_size;
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
if (pProperties == NULL) {
*pCount = INTEL_GLOBAL_EXT_COUNT;
return VK_SUCCESS;
@@ -262,10 +258,6 @@
uint32_t* pCount,
VkLayerProperties* pProperties)
{
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
*pCount = 0;
return VK_SUCCESS;
}
@@ -320,7 +312,7 @@
*pPhysicalDeviceCount = count;
- return (count > 0) ? VK_SUCCESS : VK_ERROR_UNAVAILABLE;
+ return (count > 0) ? VK_SUCCESS : VK_ERROR_UNKNOWN;
}
ICD_EXPORT VkResult VKAPI vkDbgCreateMsgCallback(
diff --git a/icd/intel/pipeline.c b/icd/intel/pipeline.c
index 06916c7..7c1e3c0 100644
--- a/icd/intel/pipeline.c
+++ b/icd/intel/pipeline.c
@@ -339,13 +339,18 @@
break;
case VK_PRIMITIVE_TOPOLOGY_PATCH:
if (!info->tess.patchControlPoints ||
- info->tess.patchControlPoints > 32)
- return VK_ERROR_BAD_PIPELINE_DATA;
+ info->tess.patchControlPoints > 32) {
+ /* TODOVV: Move test to validation layer */
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
+ }
pipeline->prim_type = GEN7_3DPRIM_PATCHLIST_1 +
info->tess.patchControlPoints - 1;
break;
default:
- return VK_ERROR_BAD_PIPELINE_DATA;
+ /* TODOVV: Move test to validation layer */
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
}
if (info->ia.primitiveRestartEnable) {
@@ -457,7 +462,9 @@
*/
if (!(pipeline->active_shaders & SHADER_VERTEX_FLAG)) {
// TODO: Log debug message: Vertex Shader required.
- return VK_ERROR_BAD_PIPELINE_DATA;
+ /* TODOVV: Add test to validation layer */
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
}
/*
@@ -467,7 +474,9 @@
if (((pipeline->active_shaders & SHADER_TESS_CONTROL_FLAG) == 0) !=
((pipeline->active_shaders & SHADER_TESS_EVAL_FLAG) == 0) ) {
// TODO: Log debug message: Both Tess control and Tess eval are required to use tessalation
- return VK_ERROR_BAD_PIPELINE_DATA;
+ /* TODOVV: Add test to validation layer */
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
}
if ((pipeline->active_shaders & SHADER_COMPUTE_FLAG) &&
@@ -475,7 +484,9 @@
SHADER_TESS_EVAL_FLAG | SHADER_GEOMETRY_FLAG |
SHADER_FRAGMENT_FLAG))) {
// TODO: Log debug message: Can only specify compute shader when doing compute
- return VK_ERROR_BAD_PIPELINE_DATA;
+ /* TODOVV: Add test to validation layer */
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
}
/*
@@ -485,13 +496,17 @@
if (pipeline->active_shaders & (SHADER_TESS_CONTROL_FLAG | SHADER_TESS_EVAL_FLAG) &&
(pipeline->topology != VK_PRIMITIVE_TOPOLOGY_PATCH)) {
// TODO: Log debug message: Invalid topology used with tessellation shader.
- return VK_ERROR_BAD_PIPELINE_DATA;
+ /* TODOVV: Add test to validation layer */
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
}
if ((pipeline->topology == VK_PRIMITIVE_TOPOLOGY_PATCH) &&
(~pipeline->active_shaders & (SHADER_TESS_CONTROL_FLAG | SHADER_TESS_EVAL_FLAG))) {
// TODO: Log debug message: Cannot use TOPOLOGY_PATCH on non-tessellation shader.
- return VK_ERROR_BAD_PIPELINE_DATA;
+ /* TODOVV: Add test to validation layer */
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
}
return VK_SUCCESS;
@@ -1131,9 +1146,12 @@
if (ret != VK_SUCCESS)
return ret;
+ /* TODOVV: Move test to validation layer */
if (info->vi.bindingCount > ARRAY_SIZE(pipeline->vb) ||
- info->vi.attributeCount > ARRAY_SIZE(pipeline->vb))
- return VK_ERROR_BAD_PIPELINE_DATA;
+ info->vi.attributeCount > ARRAY_SIZE(pipeline->vb)) {
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
+ }
pipeline->vb_count = info->vi.bindingCount;
memcpy(pipeline->vb, info->vi.pVertexBindingDescriptions,
@@ -1214,7 +1232,9 @@
dst = &info->compute;
break;
default:
- return VK_ERROR_BAD_PIPELINE_DATA;
+ /* TODOVV: Move test to validation layer */
+// return VK_ERROR_BAD_PIPELINE_DATA;
+ return VK_ERROR_UNKNOWN;
break;
}
memcpy(dst, thisStage, sizeof(VkPipelineShaderStageCreateInfo));
@@ -1316,7 +1336,7 @@
VkDevice device,
VkPipelineCache pipelineCache)
{
- return VK_ERROR_UNAVAILABLE;
+ return VK_ERROR_UNKNOWN;
}
ICD_EXPORT VkResult VKAPI vkGetPipelineCacheData(
@@ -1324,7 +1344,7 @@
VkPipelineCache pipelineCache,
void* pData)
{
- return VK_ERROR_UNAVAILABLE;
+ return VK_ERROR_UNKNOWN;
}
ICD_EXPORT VkResult VKAPI vkMergePipelineCaches(
@@ -1333,7 +1353,7 @@
uint32_t srcCacheCount,
const VkPipelineCache* pSrcCaches)
{
- return VK_ERROR_UNAVAILABLE;
+ return VK_ERROR_UNKNOWN;
}
ICD_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(
@@ -1371,7 +1391,7 @@
const VkComputePipelineCreateInfo* pCreateInfos,
VkPipeline* pPipelines)
{
- return VK_ERROR_UNAVAILABLE;
+ return VK_ERROR_UNKNOWN;
}
ICD_EXPORT VkResult VKAPI vkDestroyPipeline(
diff --git a/icd/intel/query.c b/icd/intel/query.c
index 978ffae..b920577 100644
--- a/icd/intel/query.c
+++ b/icd/intel/query.c
@@ -110,7 +110,9 @@
if (!query->slot_stride) {
intel_query_destroy(query);
- return VK_ERROR_INVALID_VALUE;
+ /* TODOVV: Move test to validation layer */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
}
VkMemoryAllocInfo mem_reqs;
@@ -240,7 +242,9 @@
*pDataSize = query->slot_stride * queryCount;
break;
default:
- return VK_ERROR_INVALID_HANDLE;
+ /* TODOVV: Move test to validation layer */
+// return VK_ERROR_INVALID_HANDLE;
+ return VK_ERROR_UNKNOWN;
break;
}
diff --git a/icd/intel/queue.c b/icd/intel/queue.c
index 4e184b6..d431cc9 100644
--- a/icd/intel/queue.c
+++ b/icd/intel/queue.c
@@ -110,7 +110,9 @@
bo = queue->select_compute_bo;
break;
default:
- return VK_ERROR_INVALID_VALUE;
+ /* TODOVV: Make sure coved in validation test */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
break;
}
@@ -267,7 +269,8 @@
ring = INTEL_RING_RENDER;
break;
default:
- return VK_ERROR_INVALID_VALUE;
+ /* TODOVV: Verify test in validation layer */
+ return VK_ERROR_UNKNOWN;
break;
}
diff --git a/icd/intel/shader.c b/icd/intel/shader.c
index 29dd2ee..fde1036 100644
--- a/icd/intel/shader.c
+++ b/icd/intel/shader.c
@@ -52,10 +52,16 @@
if (!sm)
return VK_ERROR_OUT_OF_HOST_MEMORY;
- if (info->codeSize < sizeof(*spv))
- return VK_ERROR_INVALID_MEMORY_SIZE;
- if (spv->magic != ICD_SPV_MAGIC)
- return VK_ERROR_BAD_SHADER_CODE;
+ /* TODOVV: Move test to validation layer */
+ if (info->codeSize < sizeof(*spv)) {
+// return VK_ERROR_INVALID_MEMORY_SIZE;
+ return VK_ERROR_UNKNOWN;
+ }
+ /* TODOVV: Move test to validation layer */
+ if (spv->magic != ICD_SPV_MAGIC) {
+// return VK_ERROR_BAD_SHADER_CODE;
+ return VK_ERROR_UNKNOWN;
+ }
sm->code_size = info->codeSize;
sm->code = malloc(info->codeSize);
@@ -119,7 +125,9 @@
sh->ir = shader_create_ir(dev->gpu, sm->code, sm->code_size, info->stage);
if (!sh->ir) {
shader_destroy(&sh->obj);
- return VK_ERROR_BAD_SHADER_CODE;
+ /* TODOVV: Can this move to validation layer? */
+// return VK_ERROR_BAD_SHADER_CODE;
+ return VK_ERROR_UNKNOWN;
}
sh->obj.destroy = shader_destroy;
diff --git a/icd/intel/view.c b/icd/intel/view.c
index bcefcc0..08e635e 100644
--- a/icd/intel/view.c
+++ b/icd/intel/view.c
@@ -1284,8 +1284,11 @@
if (info->subresourceRange.baseMipLevel >= img->mip_levels ||
info->subresourceRange.baseArraySlice >= img->array_size ||
!info->subresourceRange.mipLevels ||
- !info->subresourceRange.arraySize)
- return VK_ERROR_INVALID_VALUE;
+ !info->subresourceRange.arraySize) {
+ /* TODOVV: Move test to validation layer */
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
view = (struct intel_img_view *) intel_base_create(&dev->base.handle,
sizeof(*view), dev->base.dbg, VK_OBJECT_TYPE_IMAGE_VIEW, info, 0);
diff --git a/icd/intel/wsi_x11.c b/icd/intel/wsi_x11.c
index 470156d..880ece8 100644
--- a/icd/intel/wsi_x11.c
+++ b/icd/intel/wsi_x11.c
@@ -723,20 +723,27 @@
struct intel_x11_swap_chain *sc;
int fd;
+ /* TODOVV: Add test to validation layer */
if (!x11_is_format_presentable(dev, info->imageFormat)) {
intel_dev_log(dev, VK_DBG_REPORT_ERROR_BIT,
VK_NULL_HANDLE, 0, 0, "invalid presentable image format");
- return VK_ERROR_INVALID_VALUE;
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
}
- if (!x11_is_dri3_and_present_supported(c))
- return VK_ERROR_INVALID_VALUE;
+ /* TODOVV: Can we add test to validation layer? */
+ if (!x11_is_dri3_and_present_supported(c)) {
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
+ }
+ /* TODOVV: Can we add test to validation layer? */
fd = x11_dri3_open(c, window, provider);
if (fd < 0 || !x11_gpu_match_fd(dev->gpu, fd)) {
if (fd >= 0)
close(fd);
- return VK_ERROR_INVALID_VALUE;
+// return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
}
close(fd);
@@ -874,13 +881,13 @@
*pSupported = false;
- // TODO: Move this check to a validation layer (i.e. the driver should
+ // TODOVV: Move this check to a validation layer (i.e. the driver should
// assume the correct data type, and not check):
if (pSurfaceDescriptionWindow->sType != VK_STRUCTURE_TYPE_SURFACE_DESCRIPTION_WINDOW_KHR) {
- return VK_ERROR_INVALID_VALUE;
+ return VK_ERROR_UNKNOWN;
}
- // TODO: NEED TO ALSO CHECK:
+ // TODOVV: NEED TO ALSO CHECK:
// - queueNodeIndex
// - pSurfaceDescriptionWindow->pPlatformHandle (can try to use it)
// - pSurfaceDescriptionWindow->pPlatformWindow (can try to use it)
@@ -896,7 +903,7 @@
const VkSurfaceDescriptionKHR* pSurfaceDescription,
VkSurfacePropertiesKHR* pSurfaceProperties)
{
- // TODO: Move this check to a validation layer (i.e. the driver should
+ // TODOVV: Move this check to a validation layer (i.e. the driver should
// assume the correct data type, and not check):
assert(pSurfaceProperties);
@@ -911,10 +918,11 @@
{
VkResult ret = VK_SUCCESS;
- // TODO: Move this check to a validation layer (i.e. the driver should
+ // TODOVV: Move this check to a validation layer (i.e. the driver should
// assume the correct data type, and not check):
if (!pCount) {
- return VK_ERROR_INVALID_POINTER;
+// return VK_ERROR_INVALID_POINTER;
+ return VK_ERROR_UNKNOWN;
}
if (pSurfaceFormats) {
@@ -938,10 +946,11 @@
{
VkResult ret = VK_SUCCESS;
- // TODO: Move this check to a validation layer (i.e. the driver should
+ // TODOVV: Move this check to a validation layer (i.e. the driver should
// assume the correct data type, and not check):
if (!pCount) {
- return VK_ERROR_INVALID_POINTER;
+// return VK_ERROR_INVALID_POINTER;
+ return VK_ERROR_UNKNOWN;
}
if (pPresentModes) {
@@ -995,10 +1004,11 @@
struct intel_x11_swap_chain *sc = x11_swap_chain(swapchain);
VkResult ret = VK_SUCCESS;
- // TODO: Move this check to a validation layer (i.e. the driver should
+ // TODOVV: Move this check to a validation layer (i.e. the driver should
// assume the correct data type, and not check):
if (!pCount) {
- return VK_ERROR_INVALID_POINTER;
+// return VK_ERROR_INVALID_POINTER;
+ return VK_ERROR_UNKNOWN;
}
if (pSwapchainImages) {
diff --git a/include/vulkan.h b/include/vulkan.h
index d1e4727..23c6805 100644
--- a/include/vulkan.h
+++ b/include/vulkan.h
@@ -151,37 +151,16 @@
VK_EVENT_RESET = 5,
VK_INCOMPLETE = 6,
VK_ERROR_UNKNOWN = -1,
- VK_ERROR_UNAVAILABLE = -2,
- VK_ERROR_INITIALIZATION_FAILED = -3,
- VK_ERROR_OUT_OF_HOST_MEMORY = -4,
- VK_ERROR_OUT_OF_DEVICE_MEMORY = -5,
- VK_ERROR_DEVICE_ALREADY_CREATED = -6,
- VK_ERROR_DEVICE_LOST = -7,
- VK_ERROR_INVALID_POINTER = -8,
- VK_ERROR_INVALID_VALUE = -9,
- VK_ERROR_INVALID_HANDLE = -10,
- VK_ERROR_INVALID_ORDINAL = -11,
- VK_ERROR_INVALID_MEMORY_SIZE = -12,
- VK_ERROR_INVALID_EXTENSION = -13,
- VK_ERROR_INVALID_FLAGS = -14,
- VK_ERROR_INVALID_ALIGNMENT = -15,
- VK_ERROR_INVALID_FORMAT = -16,
- VK_ERROR_INVALID_IMAGE = -17,
- VK_ERROR_INVALID_DESCRIPTOR_SET_DATA = -18,
- VK_ERROR_INVALID_QUEUE_TYPE = -19,
- VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION = -20,
- VK_ERROR_BAD_SHADER_CODE = -21,
- VK_ERROR_BAD_PIPELINE_DATA = -22,
- VK_ERROR_NOT_MAPPABLE = -23,
- VK_ERROR_MEMORY_MAP_FAILED = -24,
- VK_ERROR_MEMORY_UNMAP_FAILED = -25,
- VK_ERROR_INCOMPATIBLE_DEVICE = -26,
- VK_ERROR_INCOMPATIBLE_DRIVER = -27,
- VK_ERROR_INCOMPLETE_COMMAND_BUFFER = -28,
- VK_ERROR_BUILDING_COMMAND_BUFFER = -29,
- VK_ERROR_MEMORY_NOT_BOUND = -30,
- VK_ERROR_INCOMPATIBLE_QUEUE = -31,
- VK_ERROR_INVALID_LAYER = -32,
+ VK_ERROR_OUT_OF_HOST_MEMORY = -2,
+ VK_ERROR_OUT_OF_DEVICE_MEMORY = -3,
+ VK_ERROR_INITIALIZATION_FAILED = -4,
+ VK_ERROR_DEVICE_LOST = -5,
+ VK_ERROR_MEMORY_MAP_FAILED = -6,
+ VK_ERROR_MEMORY_UNMAP_FAILED = -7,
+ VK_ERROR_INCOMPATIBLE_DEVICE = -8,
+ VK_ERROR_INCOMPATIBLE_DRIVER = -9,
+ VK_ERROR_INVALID_EXTENSION = -10,
+ VK_ERROR_INVALID_LAYER = -11,
VK_RESULT_BEGIN_RANGE = VK_ERROR_INVALID_LAYER,
VK_RESULT_END_RANGE = VK_INCOMPLETE,
VK_RESULT_NUM = (VK_INCOMPLETE - VK_ERROR_INVALID_LAYER + 1),
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 04bf397..0c459ea 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -1733,7 +1733,7 @@
VK_LAYER_EXPORT VkResult VKAPI vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines)
{
- VkResult result = VK_ERROR_BAD_PIPELINE_DATA;
+ VkResult result = VK_SUCCESS;
//TODO handle count > 1 and handle pipelineCache
// The order of operations here is a little convoluted but gets the job done
// 1. Pipeline create state is first shadowed into PIPELINE_NODE struct
@@ -1743,6 +1743,7 @@
PIPELINE_NODE* pPipeNode = initPipeline(pCreateInfos, NULL);
VkBool32 valid = verifyPipelineCreateState(device, pPipeNode);
loader_platform_thread_unlock_mutex(&globalLock);
+ /* TODO: preference is to make API call after reporting any validation errors */
if (VK_TRUE == valid) {
result = get_dispatch_table(draw_state_device_table_map, device)->CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pPipelines);
log_msg(mdd(device), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_PIPELINE, (*pPipelines).handle, 0, DRAWSTATE_NONE, "DS",
@@ -2061,8 +2062,9 @@
VK_LAYER_EXPORT VkResult VKAPI vkEndCommandBuffer(VkCmdBuffer cmdBuffer)
{
- VkResult result = VK_ERROR_BUILDING_COMMAND_BUFFER;
+ VkResult result = VK_SUCCESS;
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
+ /* TODO: preference is to always call API function after reporting any validation errors */
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
result = get_dispatch_table(draw_state_device_table_map, cmdBuffer)->EndCommandBuffer(cmdBuffer);
diff --git a/layers/mem_tracker.cpp b/layers/mem_tracker.cpp
index d7e8316..49c65f1 100644
--- a/layers/mem_tracker.cpp
+++ b/layers/mem_tracker.cpp
@@ -2056,7 +2056,7 @@
if (!(fence_item->second.createInfo.flags & VK_FENCE_CREATE_SIGNALED_BIT)) {
log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_FENCE, pFences[i].handle, 0, MEMTRACK_INVALID_FENCE_STATE, "MEM",
"Fence %#" PRIxLEAST64 " submitted to VkResetFences in UNSIGNALED STATE", pFences[i].handle);
- result = VK_ERROR_INVALID_VALUE;
+ result = VK_ERROR_UNKNOWN;
}
else {
fence_item->second.createInfo.flags =
diff --git a/layers/param_checker.cpp b/layers/param_checker.cpp
index 3194f89..50d4e18 100644
--- a/layers/param_checker.cpp
+++ b/layers/param_checker.cpp
@@ -199,16 +199,6 @@
return "VK_ERROR_INVALID_LAYER";
break;
}
- case VK_ERROR_MEMORY_NOT_BOUND:
- {
- return "VK_ERROR_MEMORY_NOT_BOUND";
- break;
- }
- case VK_ERROR_BUILDING_COMMAND_BUFFER:
- {
- return "VK_ERROR_BUILDING_COMMAND_BUFFER";
- break;
- }
case VK_ERROR_INCOMPATIBLE_DRIVER:
{
return "VK_ERROR_INCOMPATIBLE_DRIVER";
@@ -224,36 +214,6 @@
return "VK_ERROR_MEMORY_MAP_FAILED";
break;
}
- case VK_ERROR_BAD_PIPELINE_DATA:
- {
- return "VK_ERROR_BAD_PIPELINE_DATA";
- break;
- }
- case VK_ERROR_INVALID_QUEUE_TYPE:
- {
- return "VK_ERROR_INVALID_QUEUE_TYPE";
- break;
- }
- case VK_ERROR_BAD_SHADER_CODE:
- {
- return "VK_ERROR_BAD_SHADER_CODE";
- break;
- }
- case VK_ERROR_INVALID_IMAGE:
- {
- return "VK_ERROR_INVALID_IMAGE";
- break;
- }
- case VK_ERROR_INVALID_FORMAT:
- {
- return "VK_ERROR_INVALID_FORMAT";
- break;
- }
- case VK_ERROR_UNAVAILABLE:
- {
- return "VK_ERROR_UNAVAILABLE";
- break;
- }
case VK_INCOMPLETE:
{
return "VK_INCOMPLETE";
@@ -269,11 +229,6 @@
return "VK_ERROR_UNKNOWN";
break;
}
- case VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION:
- {
- return "VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION";
- break;
- }
case VK_ERROR_INITIALIZATION_FAILED:
{
return "VK_ERROR_INITIALIZATION_FAILED";
@@ -284,21 +239,6 @@
return "VK_NOT_READY";
break;
}
- case VK_ERROR_INVALID_POINTER:
- {
- return "VK_ERROR_INVALID_POINTER";
- break;
- }
- case VK_ERROR_INVALID_VALUE:
- {
- return "VK_ERROR_INVALID_VALUE";
- break;
- }
- case VK_ERROR_NOT_MAPPABLE:
- {
- return "VK_ERROR_NOT_MAPPABLE";
- break;
- }
case VK_ERROR_OUT_OF_DEVICE_MEMORY:
{
return "VK_ERROR_OUT_OF_DEVICE_MEMORY";
@@ -314,31 +254,16 @@
return "VK_TIMEOUT";
break;
}
- case VK_ERROR_INVALID_FLAGS:
- {
- return "VK_ERROR_INVALID_FLAGS";
- break;
- }
case VK_EVENT_RESET:
{
return "VK_EVENT_RESET";
break;
}
- case VK_ERROR_INVALID_DESCRIPTOR_SET_DATA:
- {
- return "VK_ERROR_INVALID_DESCRIPTOR_SET_DATA";
- break;
- }
case VK_UNSUPPORTED:
{
return "VK_UNSUPPORTED";
break;
}
- case VK_ERROR_INVALID_HANDLE:
- {
- return "VK_ERROR_INVALID_HANDLE";
- break;
- }
case VK_ERROR_INCOMPATIBLE_DEVICE:
{
return "VK_ERROR_INCOMPATIBLE_DEVICE";
@@ -349,46 +274,16 @@
return "VK_SUCCESS";
break;
}
- case VK_ERROR_INCOMPATIBLE_QUEUE:
- {
- return "VK_ERROR_INCOMPATIBLE_QUEUE";
- break;
- }
case VK_ERROR_INVALID_EXTENSION:
{
return "VK_ERROR_INVALID_EXTENSION";
break;
}
- case VK_ERROR_DEVICE_ALREADY_CREATED:
- {
- return "VK_ERROR_DEVICE_ALREADY_CREATED";
- break;
- }
case VK_ERROR_DEVICE_LOST:
{
return "VK_ERROR_DEVICE_LOST";
break;
}
- case VK_ERROR_INVALID_ORDINAL:
- {
- return "VK_ERROR_INVALID_ORDINAL";
- break;
- }
- case VK_ERROR_INVALID_MEMORY_SIZE:
- {
- return "VK_ERROR_INVALID_MEMORY_SIZE";
- break;
- }
- case VK_ERROR_INCOMPLETE_COMMAND_BUFFER:
- {
- return "VK_ERROR_INCOMPLETE_COMMAND_BUFFER";
- break;
- }
- case VK_ERROR_INVALID_ALIGNMENT:
- {
- return "VK_ERROR_INVALID_ALIGNMENT";
- break;
- }
default:
{
return "unrecognized enumerator";
diff --git a/layers/vk_layer_extension_utils.cpp b/layers/vk_layer_extension_utils.cpp
index 9e85a5b..2a5d9a3 100644
--- a/layers/vk_layer_extension_utils.cpp
+++ b/layers/vk_layer_extension_utils.cpp
@@ -42,10 +42,6 @@
{
uint32_t copy_size;
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
if (pProperties == NULL || layer_extensions == NULL) {
*pCount = count;
return VK_SUCCESS;
@@ -69,10 +65,6 @@
{
uint32_t copy_size;
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
if (pProperties == NULL || layer_properties == NULL) {
*pCount = count;
return VK_SUCCESS;
diff --git a/loader/debug_report.c b/loader/debug_report.c
index c7c1d9a..8a6bf5d 100644
--- a/loader/debug_report.c
+++ b/loader/debug_report.c
@@ -141,16 +141,18 @@
VkResult res;
uint32_t storage_idx;
- if (instance == VK_NULL_HANDLE)
- return VK_ERROR_INVALID_HANDLE;
+ /* TODOVV: move to validation layer */
+// if (instance == VK_NULL_HANDLE)
+// return VK_ERROR_INVALID_HANDLE;
for (inst = loader.instances; inst; inst = inst->next) {
if ((VkInstance) inst == instance)
break;
}
- if (inst == VK_NULL_HANDLE)
- return VK_ERROR_INVALID_HANDLE;
+ /* TODOVV: move to validation layer */
+// if (inst == VK_NULL_HANDLE)
+// return VK_ERROR_INVALID_HANDLE;
icd_info = calloc(sizeof(VkDbgMsgCallback), inst->total_icd_count);
if (!icd_info) {
@@ -210,16 +212,18 @@
VkResult res = VK_SUCCESS;
struct loader_instance *inst;
- if (instance == VK_NULL_HANDLE)
- return VK_ERROR_INVALID_HANDLE;
+ /* TODOVV: Move to validation layer */
+// if (instance == VK_NULL_HANDLE)
+// return VK_ERROR_INVALID_HANDLE;
for (inst = loader.instances; inst; inst = inst->next) {
if ((VkInstance) inst == instance)
break;
}
- if (inst == VK_NULL_HANDLE)
- return VK_ERROR_INVALID_HANDLE;
+ /* TODOVV: Move to validation layer */
+// if (inst == VK_NULL_HANDLE)
+// return VK_ERROR_INVALID_HANDLE;
icd_info = *(VkDbgMsgCallback **) &msgCallback;
storage_idx = 0;
diff --git a/loader/loader.c b/loader/loader.c
index 0b7d1ba..b12a065 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2664,10 +2664,11 @@
prev = next;
next = next->next;
}
- if (next == NULL) {
- // This must be an invalid instance handle or empty list
- return VK_ERROR_INVALID_HANDLE;
- }
+ /* TODOVV: Move this test to validation layer */
+// if (next == NULL) {
+// // This must be an invalid instance handle or empty list
+// return VK_ERROR_INVALID_HANDLE;
+// }
while (icds) {
if (icds->instance) {
@@ -3088,10 +3089,6 @@
uint32_t copy_size;
tls_instance = NULL;
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
memset(&icd_extensions, 0, sizeof(icd_extensions));
loader_platform_thread_once(&once_init, loader_initialize);
@@ -3160,10 +3157,6 @@
uint32_t copy_size;
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
/* TODO: do we still need to lock */
loader_platform_thread_lock_mutex(&loader_lock);
@@ -3203,10 +3196,6 @@
struct loader_icd *icd = loader_get_icd(gpu, &gpu_index);
uint32_t copy_size;
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
uint32_t count;
struct loader_extension_list *dev_ext_list;
@@ -3253,10 +3242,6 @@
uint32_t gpu_index;
struct loader_icd *icd = loader_get_icd(gpu, &gpu_index);
- if (pCount == NULL) {
- return VK_ERROR_INVALID_POINTER;
- }
-
uint32_t count = icd->this_instance->device_layer_list.count;
if (pProperties == NULL) {
diff --git a/loader/trampoline.c b/loader/trampoline.c
index 33971c3..4ca018c 100644
--- a/loader/trampoline.c
+++ b/loader/trampoline.c
@@ -44,8 +44,6 @@
struct loader_instance *ptr_instance = NULL;
VkResult res = VK_ERROR_INITIALIZATION_FAILED;
- if (pCreateInfo == NULL)
- return VK_ERROR_INVALID_POINTER;
loader_platform_thread_once(&once_init, loader_initialize);
if (pCreateInfo->pAllocCb
diff --git a/loader/wsi_swapchain.c b/loader/wsi_swapchain.c
index ec0ee0d..a59f389 100644
--- a/loader/wsi_swapchain.c
+++ b/loader/wsi_swapchain.c
@@ -95,7 +95,7 @@
{
uint32_t gpu_index;
struct loader_icd *icd = loader_get_icd(physicalDevice, &gpu_index);
- VkResult res = VK_ERROR_UNAVAILABLE;
+ VkResult res = VK_ERROR_UNKNOWN;
*pSupported = false;
if (icd->GetPhysicalDeviceSurfaceSupportKHR) {
diff --git a/tests/test_common.h b/tests/test_common.h
index 2fccbd5..d17238c 100644
--- a/tests/test_common.h
+++ b/tests/test_common.h
@@ -27,36 +27,15 @@
STR(VK_EVENT_SET);
STR(VK_EVENT_RESET);
STR(VK_ERROR_UNKNOWN);
- STR(VK_ERROR_UNAVAILABLE);
STR(VK_ERROR_INITIALIZATION_FAILED);
STR(VK_ERROR_OUT_OF_HOST_MEMORY);
STR(VK_ERROR_OUT_OF_DEVICE_MEMORY);
- STR(VK_ERROR_DEVICE_ALREADY_CREATED);
STR(VK_ERROR_DEVICE_LOST);
- STR(VK_ERROR_INVALID_POINTER);
- STR(VK_ERROR_INVALID_VALUE);
- STR(VK_ERROR_INVALID_HANDLE);
- STR(VK_ERROR_INVALID_ORDINAL);
- STR(VK_ERROR_INVALID_MEMORY_SIZE);
STR(VK_ERROR_INVALID_EXTENSION);
- STR(VK_ERROR_INVALID_FLAGS);
- STR(VK_ERROR_INVALID_ALIGNMENT);
- STR(VK_ERROR_INVALID_FORMAT);
- STR(VK_ERROR_INVALID_IMAGE);
- STR(VK_ERROR_INVALID_DESCRIPTOR_SET_DATA);
- STR(VK_ERROR_INVALID_QUEUE_TYPE);
- STR(VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION);
- STR(VK_ERROR_BAD_SHADER_CODE);
- STR(VK_ERROR_BAD_PIPELINE_DATA);
- STR(VK_ERROR_NOT_MAPPABLE);
STR(VK_ERROR_MEMORY_MAP_FAILED);
STR(VK_ERROR_MEMORY_UNMAP_FAILED);
STR(VK_ERROR_INCOMPATIBLE_DEVICE);
STR(VK_ERROR_INCOMPATIBLE_DRIVER);
- STR(VK_ERROR_INCOMPLETE_COMMAND_BUFFER);
- STR(VK_ERROR_BUILDING_COMMAND_BUFFER);
- STR(VK_ERROR_MEMORY_NOT_BOUND);
- STR(VK_ERROR_INCOMPATIBLE_QUEUE);
#undef STR
default: return "UNKNOWN_RESULT";
}