[Mesa-dev] [PATCH] Vulkan: Solve the vkCmdClearColorImage crash issue
Xu, Randy
randy.xu at intel.com
Sun Mar 19 11:44:33 UTC 2017
> -----Original Message-----
> From: Landwerlin, Lionel G
> Sent: Saturday, March 18, 2017 8:21 PM
> To: Xu, Randy <randy.xu at intel.com>; mesa-dev at lists.freedesktop.org
> Cc: Xu at freedesktop.org
> Subject: Re: [Mesa-dev] [PATCH] Vulkan: Solve the vkCmdClearColorImage
> crash issue
>
> Thanks Randy!
Welcome, it's my pleasure :)
> I believe we might have a few of those left in anv_blorp.c.
>
Yes, there are many direct access of layerCount(VkImageSubresourceRange) in anv_blorp.c.
We need change them using anv_get_layerCount.
./src/intel/vulkan/anv_blorp.c:235: layer_count = pRegions[r].dstSubresource.layerCount;
./src/intel/vulkan/anv_blorp.c:243: assert(pRegions[r].srcSubresource.layerCount == layer_count);
./src/intel/vulkan/anv_blorp.c:315: extent.depth = pRegions[r].imageSubresource.layerCount;
./src/intel/vulkan/anv_blorp.c:469: dst_end = dst_start + dst_res->layerCount;
./src/intel/vulkan/anv_blorp.c:479: src_end = src_start + src_res->layerCount;
./src/intel/vulkan/anv_blorp.c:833: unsigned layer_count = pRanges[r].layerCount;
./src/intel/vulkan/anv_blorp.c:893: unsigned layer_count = pRanges[r].layerCount;
./src/intel/vulkan/anv_blorp.c:997: pRects[r].layerCount,
./src/intel/vulkan/anv_blorp.c:1046: pRects[r].layerCount,
./src/intel/vulkan/anv_blorp.c:1207: .layerCount = cmd_buffer->state.framebuffer->layers,
./src/intel/vulkan/anv_blorp.c:1409: assert(pRegions[r].srcSubresource.layerCount ==
./src/intel/vulkan/anv_blorp.c:1410: pRegions[r].dstSubresource.layerCount);
./src/intel/vulkan/anv_blorp.c:1412: const uint32_t layer_count = pRegions[r].dstSubresource.layerCount;
> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
>
> On 18/03/17 11:07, Xu,Randy wrote:
> > In anv_CmdClearColorImage, the layer count should be got through
> > anv_get_layerCount, which handles the VK_REMAINING_ARRAY_LAYERS
> (~0)
> > case.
> >
> > Test: Sample multithreadcmdbuf from LunarG can run without crash
> >
> > Signed-off-by: Xu,Randy <randy.xu at intel.com>
> > ---
> > src/intel/vulkan/anv_blorp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/intel/vulkan/anv_blorp.c
> > b/src/intel/vulkan/anv_blorp.c index 1f4fec5..955bb6d 100644
> > --- a/src/intel/vulkan/anv_blorp.c
> > +++ b/src/intel/vulkan/anv_blorp.c
> > @@ -830,7 +830,7 @@ void anv_CmdClearColorImage(
> > VK_IMAGE_ASPECT_COLOR_BIT, image->tiling);
> >
> > unsigned base_layer = pRanges[r].baseArrayLayer;
> > - unsigned layer_count = pRanges[r].layerCount;
> > + unsigned layer_count = anv_get_layerCount(image, &pRanges[r]);
> >
> > for (unsigned i = 0; i < anv_get_levelCount(image, &pRanges[r]); i++) {
> > const unsigned level = pRanges[r].baseMipLevel + i;
>
More information about the mesa-dev
mailing list