radv: fix FMASK expand if layerCount is VK_REMAINING_ARRAY_LAYERS
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 26 Jun 2019 14:24:10 +0000 (16:24 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 27 Jun 2019 06:56:34 +0000 (08:56 +0200)
This doesn't fix anything known, but it's likely going to
break if layerCount is ~0U.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_fmask_expand.c

index c4cec58235faf6b368acb55c20d6a0d8a8ba218a..7f3cbb2a6a6e246bbd718a390b7c542ea5d02583 100644 (file)
@@ -123,7 +123,7 @@ radv_expand_fmask_image_inplace(struct radv_cmd_buffer *cmd_buffer,
        radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
                             VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
 
-       for (unsigned l = 0; l < subresourceRange->layerCount; l++) {
+       for (unsigned l = 0; l < radv_get_layerCount(image, subresourceRange); l++) {
                struct radv_image_view iview;
 
                radv_image_view_init(&iview, device,