Enables some test cases to run instead of skipping (e.g. all stencil tests).
Signed-off-by: Nanley Chery <[email protected]> --- src/tests/func/miptree/miptree.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/tests/func/miptree/miptree.c b/src/tests/func/miptree/miptree.c index 37002cb..ccb9c66 100644 --- a/src/tests/func/miptree/miptree.c +++ b/src/tests/func/miptree/miptree.c @@ -412,7 +412,7 @@ miptree_destroy(miptree_t *mt) static void can_create_image(VkImageType type, VkImageTiling tiling, - uint32_t usage, VkFormat format) + VkImageUsageFlags usage, VkFormat format) { VkImageFormatProperties fmt_properties; VkResult result = @@ -437,10 +437,19 @@ miptree_create(void) const uint32_t depth = params->depth; const uint32_t array_length = params->array_length; const size_t buffer_size = miptree_calc_buffer_size(); - const uint32_t usage_bits = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | - VK_IMAGE_USAGE_TRANSFER_DST_BIT | - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | - VK_IMAGE_USAGE_SAMPLED_BIT; + + // Determine the appropriate usage flags for the test + VkImageUsageFlags usage_bits = 0; + if (params->upload_method == MIPTREE_UPLOAD_METHOD_COPY_WITH_DRAW) + usage_bits |= VK_IMAGE_USAGE_SAMPLED_BIT; + else + usage_bits |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT; + + if (params->download_method == MIPTREE_DOWNLOAD_METHOD_COPY_WITH_DRAW) + usage_bits |= VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + else + usage_bits |= VK_IMAGE_USAGE_TRANSFER_DST_BIT; + VkImageType image_type = image_type_from_image_view_type(params->view_type); // Determine if an image can be created with this combination -- 2.9.3 _______________________________________________ Piglit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/piglit
