compiles, but it returns a null smart pointer. I'm linking against vulkan.1 and the lunarg examples work fine for me on the macbook pro 16" from 2019
--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/85f3f74e-e6ec-4d3e-a7c5-6a6b5577d816n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/544a15c5-423d-41c9-b97a-c8eacae99736n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/6c3ea529-f095-440c-aef5-a4ba887577b6n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/6c3ea529-f095-440c-aef5-a4ba887577b6n%40googlegroups.com.
VUID-VkImageSubresourceRange-levelCount-01720(ERROR / SPEC): msgNum: 357932245 - Validation Error: [ VUID-VkImageSubresourceRange-levelCount-01720 ] Object 0: handle = 0xf443490000000006, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x15559cd5 | vkCmdPipelineBarrier: subresourceRange.levelCount is 0. The Vulkan spec states: If levelCount is not VK_REMAINING_MIP_LEVELS, it must be greater than 0 (https://vulkan.lunarg.com/doc/view/1.2.189.0/mac/1.2-extensions/vkspec.html#VUID-VkImageSubresourceRange-levelCount-01720)
Objects: 1
[0] 0xf443490000000006, type: 10, name: NULL
My SkImage has a mipLevels = 1. This 'levelCount' member I'm not sure what struct this is associated to, but it seems incorrect about my image. GrDirectContext *ctx = Skia::Context()->sk_context.get();
auto imi = GrVkImageInfo { };
imi.fFormat = VK_FORMAT_R8G8B8A8_UNORM;
VkImage image = VK_NULL_HANDLE;
VkImageCreateInfo im = {};
VkDeviceMemory imem;
VkMemoryRequirements mreq;
VkMemoryAllocateInfo ai {};
// setup image creation info
im.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
im.imageType = VK_IMAGE_TYPE_2D;
im.extent.width = sz.x;
im.extent.height = sz.y;
im.extent.depth = 1; // ? 4 should be right since this is an allocation parameter
im.mipLevels = 1;
im.arrayLayers = 1;
im.format = VK_FORMAT_R8G8B8A8_UNORM;
im.tiling = VK_IMAGE_TILING_OPTIMAL;
im.initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL; // was VK_IMAGE_LAYOUT_PREINITIALIZED;
im.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; // was 0
im.samples = VK_SAMPLE_COUNT_1_BIT;
im.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
// create image for device with the above params
vkCreateImage(device, &im, nullptr, &image);
assert(image != VK_NULL_HANDLE);
// fetch image memory requirements
vkGetImageMemoryRequirements(device, image, &mreq);
// setup memory alloc info
ai.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
ai.allocationSize = mreq.size;
ai.memoryTypeIndex = find_memory_type(mreq.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
if (vkAllocateMemory(device, &ai, nullptr, &imem) != VK_SUCCESS)
throw std::runtime_error("failed to allocate image memory!");
vkBindImageMemory(device, image, imem, 0);
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/d7218499-347e-4d48-8e6f-2d420c446786n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/c3e9b55c-8562-48ff-bac9-111915ea7c5cn%40googlegroups.com.