<p dir="ltr">Thanks! Rb</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Oct 7, 2016 9:22 AM, "Lionel Landwerlin" <<a href="mailto:llandwerlin@gmail.com">llandwerlin@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">According to the spec - 9.6. Pipeline Cache :<br>
<br>
If pDataSize is less than the maximum size that can be retrieved by the<br>
pipeline cache, at most pDataSize bytes will be written to pData, and<br>
vkGetPipelineCacheData will return VK_INCOMPLETE.<br>
<br>
Fixes the following test from Vulkan CTS :<br>
<br>
dEQP-VK.pipeline.cache.<wbr>pipeline_from_incomplete_get_<wbr>data.vertex_stage_fragment_<wbr>stage<br>
dEQP-VK.pipeline.cache.<wbr>pipeline_from_incomplete_get_<wbr>data.vertex_stage_geometry_<wbr>stage_fragment_stage<br>
dEQP-VK.pipeline.cache.misc_<wbr>tests.invalid_size_test<br>
<br>
Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
---<br>
src/intel/vulkan/anv_pipeline_<wbr>cache.c | 7 +++++--<br>
1 file changed, 5 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_<wbr>pipeline_cache.c b/src/intel/vulkan/anv_<wbr>pipeline_cache.c<br>
index 2753c46..6e3f0f2 100644<br>
--- a/src/intel/vulkan/anv_<wbr>pipeline_cache.c<br>
+++ b/src/intel/vulkan/anv_<wbr>pipeline_cache.c<br>
@@ -490,13 +490,16 @@ VkResult anv_GetPipelineCacheData(<br>
p += align_u32(sizeof(*count), 8);<br>
*count = 0;<br>
<br>
+ VkResult result = VK_SUCCESS;<br>
if (cache->cache) {<br>
struct hash_entry *entry;<br>
hash_table_foreach(cache-><wbr>cache, entry) {<br>
struct anv_shader_bin *shader = entry->data;<br>
size_t data_size = anv_shader_bin_data_size(<wbr>entry->data);<br>
- if (p + data_size > end)<br>
+ if (p + data_size > end) {<br>
+ result = VK_INCOMPLETE;<br>
break;<br>
+ }<br>
<br>
anv_shader_bin_write_data(<wbr>shader, p);<br>
p += data_size;<br>
@@ -507,7 +510,7 @@ VkResult anv_GetPipelineCacheData(<br>
<br>
*pDataSize = p - pData;<br>
<br>
- return VK_SUCCESS;<br>
+ return result;<br>
}<br>
<br>
VkResult anv_MergePipelineCaches(<br>
--<br>
2.9.3<br>
<br>
</blockquote></div></div>