Simplify the memory API to use one pool for both image and buffer resources.
.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_BIT,
.flags = 0,
};
- VkMemoryAllocImageInfo img_alloc = {
- .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO,
- .pNext = NULL,
- };
VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
- .pNext = &img_alloc,
+ .pNext = NULL,
.allocationSize = 0,
.memProps = VK_MEMORY_PROPERTY_GPU_ONLY,
- .memType = VK_MEMORY_TYPE_IMAGE,
.memPriority = VK_MEMORY_PRIORITY_NORMAL,
};
VkDepthStencilViewCreateInfo view = {
};
VkMemoryRequirements *mem_reqs;
size_t mem_reqs_size = sizeof(VkMemoryRequirements);
- VkImageMemoryRequirements img_reqs;
- size_t img_reqs_size = sizeof(VkImageMemoryRequirements);
VkResult err;
uint32_t num_allocations = 0;
size_t num_alloc_size = sizeof(num_allocations);
VK_INFO_TYPE_MEMORY_REQUIREMENTS,
&mem_reqs_size, mem_reqs);
assert(!err && mem_reqs_size == num_allocations * sizeof(VkMemoryRequirements));
- err = vkGetObjectInfo(demo->depth.image,
- VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS,
- &img_reqs_size, &img_reqs);
- assert(!err && img_reqs_size == sizeof(VkImageMemoryRequirements));
- img_alloc.usage = img_reqs.usage;
- img_alloc.formatClass = img_reqs.formatClass;
- img_alloc.samples = img_reqs.samples;
for (uint32_t i = 0; i < num_allocations; i ++) {
mem_alloc.allocationSize = mem_reqs[i].size;
.usage = VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT,
.flags = 0,
};
- VkMemoryAllocBufferInfo buf_alloc = {
- .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_BUFFER_INFO,
- .pNext = NULL,
- };
- VkMemoryAllocImageInfo img_alloc = {
- .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO,
- .pNext = &buf_alloc,
- };
VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
- .pNext = &img_alloc,
+ .pNext = NULL,
.allocationSize = 0,
.memProps = mem_props,
- .memType = VK_MEMORY_TYPE_IMAGE,
.memPriority = VK_MEMORY_PRIORITY_NORMAL,
};
VkMemoryRequirements *mem_reqs;
size_t mem_reqs_size = sizeof(VkMemoryRequirements);
- VkBufferMemoryRequirements buf_reqs;
- size_t buf_reqs_size = sizeof(VkBufferMemoryRequirements);
- VkImageMemoryRequirements img_reqs;
- size_t img_reqs_size = sizeof(VkImageMemoryRequirements);
uint32_t num_allocations = 0;
size_t num_alloc_size = sizeof(num_allocations);
VK_INFO_TYPE_MEMORY_REQUIREMENTS,
&mem_reqs_size, mem_reqs);
assert(!err && mem_reqs_size == num_allocations * sizeof(VkMemoryRequirements));
- err = vkGetObjectInfo(tex_obj->image,
- VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS,
- &img_reqs_size, &img_reqs);
- assert(!err && img_reqs_size == sizeof(VkImageMemoryRequirements));
- img_alloc.usage = img_reqs.usage;
- img_alloc.formatClass = img_reqs.formatClass;
- img_alloc.samples = img_reqs.samples;
mem_alloc.memProps = VK_MEMORY_PROPERTY_CPU_VISIBLE_BIT;
for (uint32_t j = 0; j < num_allocations; j ++) {
- mem_alloc.memType = mem_reqs[j].memType;
mem_alloc.allocationSize = mem_reqs[j].size;
- if (mem_alloc.memType == VK_MEMORY_TYPE_BUFFER) {
- err = vkGetObjectInfo(tex_obj->image,
- VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS,
- &buf_reqs_size, &buf_reqs);
- assert(!err && buf_reqs_size == sizeof(VkBufferMemoryRequirements));
- buf_alloc.usage = buf_reqs.usage;
- img_alloc.pNext = &buf_alloc;
- } else {
- img_alloc.pNext = 0;
- }
-
/* allocate memory */
err = vkAllocMemory(demo->device, &mem_alloc,
&(tex_obj->mem[j]));
{
VkBufferCreateInfo buf_info;
VkBufferViewCreateInfo view_info;
- VkMemoryAllocBufferInfo buf_alloc = {
- .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_BUFFER_INFO,
- .pNext = NULL,
- };
VkMemoryAllocInfo alloc_info = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
- .pNext = &buf_alloc,
+ .pNext = NULL,
.allocationSize = 0,
.memProps = VK_MEMORY_PROPERTY_CPU_VISIBLE_BIT,
- .memType = VK_MEMORY_TYPE_BUFFER,
.memPriority = VK_MEMORY_PRIORITY_NORMAL,
};
VkMemoryRequirements *mem_reqs;
size_t mem_reqs_size = sizeof(VkMemoryRequirements);
- VkBufferMemoryRequirements buf_reqs;
- size_t buf_reqs_size = sizeof(VkBufferMemoryRequirements);
uint32_t num_allocations = 0;
size_t num_alloc_size = sizeof(num_allocations);
uint8_t *pData;
VK_INFO_TYPE_MEMORY_REQUIREMENTS,
&mem_reqs_size, mem_reqs);
assert(!err && mem_reqs_size == num_allocations * sizeof(*mem_reqs));
- err = vkGetObjectInfo(demo->uniform_data.buf,
- VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS,
- &buf_reqs_size, &buf_reqs);
- assert(!err && buf_reqs_size == sizeof(VkBufferMemoryRequirements));
- buf_alloc.usage = buf_reqs.usage;
for (uint32_t i = 0; i < num_allocations; i ++) {
alloc_info.allocationSize = mem_reqs[i].size;
struct {
VkImage image;
+ uint32_t num_mem;
VkGpuMemory mem;
VkColorAttachmentView view;
err = vkWsiX11CreatePresentableImage(demo->device, &presentable_image,
&demo->buffers[i].image, &demo->buffers[i].mem);
assert(!err);
- demo_add_mem_refs(demo, 1, &demo->buffers[i].mem);
+
+ demo->buffers[i].num_mem = 1;
+ demo_add_mem_refs(demo, demo->buffers[i].num_mem, demo->buffers[i].mem);
demo_set_image_layout(demo, demo->buffers[i].image,
VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);
.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_BIT,
.flags = 0,
};
- VkMemoryAllocImageInfo img_alloc = {
- .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO,
- .pNext = NULL,
- };
VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
- .pNext = &img_alloc,
+ .pNext = NULL,
.allocationSize = 0,
.memProps = VK_MEMORY_PROPERTY_GPU_ONLY,
- .memType = VK_MEMORY_TYPE_IMAGE,
.memPriority = VK_MEMORY_PRIORITY_NORMAL,
};
VkDepthStencilViewCreateInfo view = {
VkMemoryRequirements *mem_reqs;
size_t mem_reqs_size = sizeof(VkMemoryRequirements);
- VkImageMemoryRequirements img_reqs;
- size_t img_reqs_size = sizeof(VkImageMemoryRequirements);
VkResult err;
uint32_t num_allocations = 0;
size_t num_alloc_size = sizeof(num_allocations);
VK_INFO_TYPE_MEMORY_REQUIREMENTS,
&mem_reqs_size, mem_reqs);
assert(!err && mem_reqs_size == num_allocations * sizeof(VkMemoryRequirements));
- err = vkGetObjectInfo(demo->depth.image,
- VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS,
- &img_reqs_size, &img_reqs);
- assert(!err && img_reqs_size == sizeof(VkImageMemoryRequirements));
- img_alloc.usage = img_reqs.usage;
- img_alloc.formatClass = img_reqs.formatClass;
- img_alloc.samples = img_reqs.samples;
for (uint32_t i = 0; i < num_allocations; i ++) {
mem_alloc.allocationSize = mem_reqs[i].size;
.usage = VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT,
.flags = 0,
};
- VkMemoryAllocImageInfo img_alloc = {
- .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO,
- .pNext = NULL,
- };
VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
- .pNext = &img_alloc,
+ .pNext = NULL,
.allocationSize = 0,
.memProps = mem_props,
- .memType = VK_MEMORY_TYPE_IMAGE,
.memPriority = VK_MEMORY_PRIORITY_NORMAL,
};
VkMemoryRequirements *mem_reqs;
size_t mem_reqs_size = sizeof(VkMemoryRequirements);
- VkImageMemoryRequirements img_reqs;
- size_t img_reqs_size = sizeof(VkImageMemoryRequirements);
uint32_t num_allocations = 0;
size_t num_alloc_size = sizeof(num_allocations);
VK_INFO_TYPE_MEMORY_REQUIREMENTS,
&mem_reqs_size, mem_reqs);
assert(!err && mem_reqs_size == num_allocations * sizeof(VkMemoryRequirements));
- err = vkGetObjectInfo(tex_obj->image,
- VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS,
- &img_reqs_size, &img_reqs);
- assert(!err && img_reqs_size == sizeof(VkImageMemoryRequirements));
- img_alloc.usage = img_reqs.usage;
- img_alloc.formatClass = img_reqs.formatClass;
- img_alloc.samples = img_reqs.samples;
mem_alloc.memProps = VK_MEMORY_PROPERTY_CPU_VISIBLE_BIT;
for (uint32_t j = 0; j < num_allocations; j ++) {
mem_alloc.allocationSize = mem_reqs[j].size;
- mem_alloc.memType = mem_reqs[j].memType;
/* allocate memory */
err = vkAllocMemory(demo->device, &mem_alloc,
.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
.flags = 0,
};
- VkMemoryAllocBufferInfo buf_alloc = {
- .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_BUFFER_INFO,
- .pNext = NULL,
- };
VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
- .pNext = &buf_alloc,
+ .pNext = NULL,
.allocationSize = 0,
.memProps = VK_MEMORY_PROPERTY_CPU_VISIBLE_BIT,
- .memType = VK_MEMORY_TYPE_BUFFER,
.memPriority = VK_MEMORY_PRIORITY_NORMAL,
};
VkMemoryRequirements *mem_reqs;
size_t mem_reqs_size = sizeof(VkMemoryRequirements);
- VkBufferMemoryRequirements buf_reqs;
- size_t buf_reqs_size = sizeof(VkBufferMemoryRequirements);
uint32_t num_allocations = 0;
size_t num_alloc_size = sizeof(num_allocations);
VkResult err;
VK_INFO_TYPE_MEMORY_REQUIREMENTS,
&mem_reqs_size, mem_reqs);
assert(!err && mem_reqs_size == sizeof(*mem_reqs));
- err = vkGetObjectInfo(demo->vertices.buf,
- VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS,
- &buf_reqs_size, &buf_reqs);
- assert(!err && buf_reqs_size == sizeof(VkBufferMemoryRequirements));
- buf_alloc.usage = buf_reqs.usage;
for (uint32_t i = 0; i < num_allocations; i ++) {
mem_alloc.allocationSize = mem_reqs[i].size;
return icd_format_table[format].size;
}
-VkImageFormatClass icd_format_get_class(VkFormat format)
-{
- if (icd_format_is_undef(format))
- assert(!"undefined format");
- if (icd_format_is_compressed(format)) {
- switch (icd_format_get_size(format)) {
- case 8:
- return VK_IMAGE_FORMAT_CLASS_64_BIT_BLOCK;
- case 16:
- return VK_IMAGE_FORMAT_CLASS_128_BIT_BLOCK;
- default:
- assert(!"illegal compressed format");
- }
- } else if (icd_format_is_ds(format)) {
- switch (icd_format_get_size(format)) {
- case 1:
- return VK_IMAGE_FORMAT_CLASS_S8;
- case 2:
- return VK_IMAGE_FORMAT_CLASS_D16;
- case 3:
- switch (icd_format_get_channel_count(format)) {
- case 1:
- return VK_IMAGE_FORMAT_CLASS_D24;
- case 2:
- return VK_IMAGE_FORMAT_CLASS_D16S8;
- default:
- assert(!"illegal depth stencil format channels");
- }
- case 4:
- switch (icd_format_get_channel_count(format)) {
- case 1:
- return VK_IMAGE_FORMAT_CLASS_D32;
- case 2:
- return VK_IMAGE_FORMAT_CLASS_D24S8;
- default:
- assert(!"illegal depth stencil format channels");
- }
- case 5:
- return VK_IMAGE_FORMAT_CLASS_D32S8;
- default:
- assert(!"illegal depth stencil format");
- }
- } else { /* uncompressed color format */
- switch (icd_format_get_size(format)) {
- case 1:
- return VK_IMAGE_FORMAT_CLASS_8_BITS;
- case 2:
- return VK_IMAGE_FORMAT_CLASS_16_BITS;
- case 3:
- return VK_IMAGE_FORMAT_CLASS_24_BITS;
- case 4:
- return VK_IMAGE_FORMAT_CLASS_32_BITS;
- case 6:
- return VK_IMAGE_FORMAT_CLASS_48_BITS;
- case 8:
- return VK_IMAGE_FORMAT_CLASS_64_BITS;
- case 12:
- return VK_IMAGE_FORMAT_CLASS_96_BITS;
- case 16:
- return VK_IMAGE_FORMAT_CLASS_128_BITS;
- default:
- assert(!"illegal uncompressed color format");
- }
- }
-}
-
unsigned int icd_format_get_channel_count(VkFormat format)
{
return icd_format_table[format].channel_count;
size_t icd_format_get_size(VkFormat format);
-VkImageFormatClass icd_format_get_class(VkFormat format);
-
unsigned int icd_format_get_channel_count(VkFormat format);
void icd_format_get_raw_value(VkFormat format,
switch (type) {
case VK_INFO_TYPE_MEMORY_REQUIREMENTS:
{
- VkMemoryRequirements *mem_req = data;
s = sizeof(VkMemoryRequirements);
*size = s;
if (data == NULL)
return ret;
memset(data, 0, s);
- mem_req->memType = VK_MEMORY_TYPE_OTHER;
break;
}
case VK_INFO_TYPE_MEMORY_ALLOCATION_COUNT:
count = (uint32_t *) data;
*count = 1;
break;
- case VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS:
- s = sizeof(VkImageMemoryRequirements);
- *size = s;
- if (data == NULL)
- return ret;
- memset(data, 0, s);
- break;
- case VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS:
- s = sizeof(VkBufferMemoryRequirements);
- *size = s;
- if (data == NULL)
- return ret;
- memset(data, 0, s);
- break;
default:
ret = VK_ERROR_INVALID_VALUE;
break;
if (!gpu)
return VK_ERROR_OUT_OF_MEMORY;
memset(gpu, 0, sizeof(*gpu));
-
+
// Initialize pointer to loader's dispatch table with ICD_LOADER_MAGIC
set_loader_magic_value(gpu);
return ret;
mem_req->size = img->total_size;
mem_req->alignment = 4096;
- mem_req->memType = VK_MEMORY_TYPE_IMAGE;
- }
- break;
- case VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS:
- {
- VkImageMemoryRequirements *img_req = data;
-
- *size = sizeof(VkImageMemoryRequirements);
- if (data == NULL)
- return ret;
- img_req->usage = img->usage;
- img_req->formatClass = img->format_class;
- img_req->samples = img->samples;
- }
- break;
- case VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS:
- {
- VkBufferMemoryRequirements *buf_req = data;
-
- *size = sizeof(VkBufferMemoryRequirements);
- if (data == NULL)
- return ret;
- buf_req->usage = img->usage;
}
break;
default:
img->mip_levels = info->mipLevels;
img->array_size = info->arraySize;
img->usage = info->usage;
- if (info->tiling == VK_LINEAR_TILING)
- img->format_class = VK_IMAGE_FORMAT_CLASS_LINEAR;
- else
- img->format_class = icd_format_get_class(info->format);
img->samples = info->samples;
img->obj.base.get_info = img_get_info;
mem_req->size = buf->size;
mem_req->alignment = 4096;
- mem_req->memType = VK_MEMORY_TYPE_BUFFER;
}
break;
- case VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS:
- {
- VkBufferMemoryRequirements *buf_req = data;
-
- *size = sizeof(VkBufferMemoryRequirements);
- if (data == NULL)
- return ret;
- buf_req->usage = buf->usage;
- }
- break;
default:
ret = nulldrv_base_get_info(base, type, size, data);
break;
uint32_t mip_levels;
uint32_t array_size;
VkFlags usage;
- VkImageFormatClass format_class;
uint32_t samples;
size_t total_size;
};
// Info type for vkGetObjectInfo()
VK_INFO_TYPE_MEMORY_ALLOCATION_COUNT = 0x00000000,
VK_INFO_TYPE_MEMORY_REQUIREMENTS = 0x00000001,
- VK_INFO_TYPE_BUFFER_MEMORY_REQUIREMENTS = 0x00000002,
- VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS = 0x00000003,
VK_INFO_TYPE_BEGIN_RANGE = VK_INFO_TYPE_MEMORY_ALLOCATION_COUNT,
- VK_INFO_TYPE_END_RANGE = VK_INFO_TYPE_IMAGE_MEMORY_REQUIREMENTS,
+ VK_INFO_TYPE_END_RANGE = VK_INFO_TYPE_MEMORY_REQUIREMENTS,
VK_NUM_INFO_TYPE = (VK_INFO_TYPE_END_RANGE - VK_INFO_TYPE_BEGIN_RANGE + 1),
VK_MAX_ENUM(VkObjectInfoType)
} VkObjectInfoType;
VK_STRUCTURE_TYPE_UPDATE_IMAGES = 51,
VK_STRUCTURE_TYPE_UPDATE_BUFFERS = 52,
VK_STRUCTURE_TYPE_UPDATE_AS_COPY = 53,
- VK_STRUCTURE_TYPE_MEMORY_ALLOC_BUFFER_INFO = 54,
- VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO = 55,
- VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 56,
+ VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 54,
VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO,
VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
VK_MAX_ENUM(VkMemoryPropertyFlags)
} VkMemoryPropertyFlags;
-typedef enum VkMemoryType_
-{
- VK_MEMORY_TYPE_OTHER = 0x00000000, // device memory that is not any of the others
- VK_MEMORY_TYPE_BUFFER = 0x00000001, // memory for buffers and associated information
- VK_MEMORY_TYPE_IMAGE = 0x00000002, // memory for images and associated information
-
- VK_MEMORY_TYPE_BEGIN_RANGE = VK_MEMORY_TYPE_OTHER,
- VK_MEMORY_TYPE_END_RANGE = VK_MEMORY_TYPE_IMAGE,
- VK_NUM_MEMORY_TYPE = (VK_MEMORY_TYPE_END_RANGE - VK_MEMORY_TYPE_BEGIN_RANGE + 1),
- VK_MAX_ENUM(VkMemoryType)
-} VkMemoryType;
-
// Buffer and buffer allocation usage flags
typedef enum VkBufferUsageFlags_
{
VK_MAX_ENUM(VkBufferViewType)
} VkBufferViewType;
-
-// Images memory allocations can be used for resources of a given format class.
-typedef enum VkImageFormatClass_
-{
- VK_IMAGE_FORMAT_CLASS_128_BITS = 1, // color formats
- VK_IMAGE_FORMAT_CLASS_96_BITS = 2,
- VK_IMAGE_FORMAT_CLASS_64_BITS = 3,
- VK_IMAGE_FORMAT_CLASS_48_BITS = 4,
- VK_IMAGE_FORMAT_CLASS_32_BITS = 5,
- VK_IMAGE_FORMAT_CLASS_24_BITS = 6,
- VK_IMAGE_FORMAT_CLASS_16_BITS = 7,
- VK_IMAGE_FORMAT_CLASS_8_BITS = 8,
- VK_IMAGE_FORMAT_CLASS_128_BIT_BLOCK = 9, // 128-bit block compressed formats
- VK_IMAGE_FORMAT_CLASS_64_BIT_BLOCK = 10, // 64-bit block compressed formats
- VK_IMAGE_FORMAT_CLASS_D32 = 11, // D32_SFLOAT
- VK_IMAGE_FORMAT_CLASS_D24 = 12, // D24_UNORM
- VK_IMAGE_FORMAT_CLASS_D16 = 13, // D16_UNORM
- VK_IMAGE_FORMAT_CLASS_S8 = 14, // S8_UINT
- VK_IMAGE_FORMAT_CLASS_D32S8 = 15, // D32_SFLOAT_S8_UINT
- VK_IMAGE_FORMAT_CLASS_D24S8 = 16, // D24_UNORM_S8_UINT
- VK_IMAGE_FORMAT_CLASS_D16S8 = 17, // D16_UNORM_S8_UINT
- VK_IMAGE_FORMAT_CLASS_LINEAR = 18, // used for pitch-linear (transparent) textures
-
- VK_IMAGE_FORMAT_CLASS_BEGIN_RANGE = VK_IMAGE_FORMAT_CLASS_128_BITS,
- VK_IMAGE_FORMAT_CLASS_END_RANGE = VK_IMAGE_FORMAT_CLASS_LINEAR,
- VK_NUM_IMAGE_FORMAT_CLASS = (VK_IMAGE_FORMAT_CLASS_END_RANGE - VK_IMAGE_FORMAT_CLASS_BEGIN_RANGE + 1),
- VK_MAX_ENUM(VkImageFormatClass)
-} VkImageFormatClass;
-
// Image and image allocation usage flags
typedef enum VkImageUsageFlags_
{
const void* pNext; // Pointer to next structure
VkGpuSize allocationSize; // Size of memory allocation
VkFlags memProps; // VkMemoryPropertyFlags
- VkMemoryType memType;
VkMemoryPriority memPriority;
} VkMemoryAllocInfo;
-// This structure is included in the VkMemoryAllocInfo chain
-// for memory regions allocated for buffer usage.
-typedef struct VkMemoryAllocBufferInfo_
-{
- VkStructureType sType; // Must be VK_STRUCTURE_TYPE_MEMORY_ALLOC_BUFFER_INFO
- const void* pNext; // Pointer to next structure
- VkFlags usage; // VkBufferUsageFlags
-} VkMemoryAllocBufferInfo;
-
-// This structure is included in the VkMemoryAllocInfo chain
-// for memory regions allocated for image usage.
-typedef struct VkMemoryAllocImageInfo_
-{
- VkStructureType sType; // Must be VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO
- const void* pNext; // Pointer to next structure
- VkFlags usage; // VkImageUsageFlags
- VkImageFormatClass formatClass;
- uint32_t samples;
-} VkMemoryAllocImageInfo;
-
typedef struct VkMemoryOpenInfo_
{
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_MEMORY_OPEN_INFO
VkGpuSize alignment; // Specified in bytes
VkGpuSize granularity; // Granularity on which vkBindObjectMemoryRange can bind sub-ranges of memory specified in bytes (usually the page size)
VkFlags memProps; // VkMemoryPropertyFlags
- VkMemoryType memType;
} VkMemoryRequirements;
-typedef struct VkBufferMemoryRequirements_
-{
- VkFlags usage; // VkBufferUsageFlags
-} VkBufferMemoryRequirements;
-
-typedef struct VkImageMemoryRequirements_
-{
- VkFlags usage; // VkImageUsageFlags
- VkImageFormatClass formatClass;
- uint32_t samples;
-} VkImageMemoryRequirements;
-
typedef struct VkFormatProperties_
{
VkFlags linearTilingFeatures; // VkFormatFeatureFlags