Mesa (master): anv: pipeline cache: fix return value of vkGetPipelineCacheData
Lionel Landwerlin
llandwerlin at kemper.freedesktop.org
Fri Oct 7 17:46:24 UTC 2016
Module: Mesa
Branch: master
Commit: eb23de61162d83238e0a93ff10e3f6bdafb364fb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb23de61162d83238e0a93ff10e3f6bdafb364fb
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Fri Oct 7 17:16:55 2016 +0100
anv: pipeline cache: fix return value of vkGetPipelineCacheData
According to the spec - 9.6. Pipeline Cache :
If pDataSize is less than the maximum size that can be retrieved by the
pipeline cache, at most pDataSize bytes will be written to pData, and
vkGetPipelineCacheData will return VK_INCOMPLETE.
Fixes the following test from Vulkan CTS :
dEQP-VK.pipeline.cache.pipeline_from_incomplete_get_data.vertex_stage_fragment_stage
dEQP-VK.pipeline.cache.pipeline_from_incomplete_get_data.vertex_stage_geometry_stage_fragment_stage
dEQP-VK.pipeline.cache.misc_tests.invalid_size_test
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
src/intel/vulkan/anv_pipeline_cache.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/intel/vulkan/anv_pipeline_cache.c b/src/intel/vulkan/anv_pipeline_cache.c
index 2753c46..6e3f0f2 100644
--- a/src/intel/vulkan/anv_pipeline_cache.c
+++ b/src/intel/vulkan/anv_pipeline_cache.c
@@ -490,13 +490,16 @@ VkResult anv_GetPipelineCacheData(
p += align_u32(sizeof(*count), 8);
*count = 0;
+ VkResult result = VK_SUCCESS;
if (cache->cache) {
struct hash_entry *entry;
hash_table_foreach(cache->cache, entry) {
struct anv_shader_bin *shader = entry->data;
size_t data_size = anv_shader_bin_data_size(entry->data);
- if (p + data_size > end)
+ if (p + data_size > end) {
+ result = VK_INCOMPLETE;
break;
+ }
anv_shader_bin_write_data(shader, p);
p += data_size;
@@ -507,7 +510,7 @@ VkResult anv_GetPipelineCacheData(
*pDataSize = p - pData;
- return VK_SUCCESS;
+ return result;
}
VkResult anv_MergePipelineCaches(
More information about the mesa-commit
mailing list