April 2017
Intermediate to advanced
700 pages
21h 36m
English
The process of creating a CUBEMAP is very similar to creating any other type of images. First, we create the image itself. We just need to remember that the image should have at least six layers that will be interpreted as six CUBEMAP faces. For CUBEMAPs, we also cannot use more than one sample per texel:
if( !CreateImage( logical_device, VK_IMAGE_TYPE_2D, VK_FORMAT_R8G8B8A8_UNORM, { size, size, 1 }, num_mipmaps, 6, VK_SAMPLE_COUNT_1_BIT, usage, true, image ) ) {
return false;
}
Next, we allocate and bind a memory object in the same way as for other resources:
if( !AllocateAndBindMemoryObjectToImage( physical_device, logical_device, image, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, memory_object ) ) {
return false;
}
Finally, ...
Read now
Unlock full access