.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_BIT,
.flags = 0,
};
- VK_MEMORY_ALLOC_IMAGE_INFO img_alloc = {
+ VkMemoryAllocImageInfo img_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO,
.pNext = NULL,
};
- VK_MEMORY_ALLOC_INFO mem_alloc = {
+ VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
.pNext = &img_alloc,
.allocationSize = 0,
.usage = VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT,
.flags = 0,
};
- VK_MEMORY_ALLOC_BUFFER_INFO buf_alloc = {
+ VkMemoryAllocBufferInfo buf_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_BUFFER_INFO,
.pNext = NULL,
};
- VK_MEMORY_ALLOC_IMAGE_INFO img_alloc = {
+ VkMemoryAllocImageInfo img_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO,
.pNext = &buf_alloc,
};
- VK_MEMORY_ALLOC_INFO mem_alloc = {
+ VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
.pNext = &img_alloc,
.allocationSize = 0,
void demo_prepare_cube_data_buffer(struct demo *demo)
{
- VK_BUFFER_CREATE_INFO buf_info;
- VK_BUFFER_VIEW_CREATE_INFO view_info;
- VK_MEMORY_ALLOC_BUFFER_INFO buf_alloc = {
+ VkBufferCreateInfo buf_info;
+ VkBufferViewCreateInfo view_info;
+ VkMemoryAllocBufferInfo buf_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_BUFFER_INFO,
.pNext = NULL,
};
- VK_MEMORY_ALLOC_INFO alloc_info = {
+ VkMemoryAllocInfo alloc_info = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
.pNext = &buf_alloc,
.allocationSize = 0,
.engineVersion = 0,
.apiVersion = VK_API_VERSION,
};
- const VK_INSTANCE_CREATE_INFO inst_info = {
+ const VkInstanceCreateInfo inst_info = {
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
.pNext = NULL,
.pAppInfo = &app,
.root = demo->screen->root,
.provider = 0,
};
- const VK_DEVICE_QUEUE_CREATE_INFO queue = {
+ const VkDeviceQueueCreateInfo queue = {
.queueNodeIndex = 0,
.queueCount = 1,
};
const char *ext_names[] = {
"VK_WSI_X11",
};
- const VK_DEVICE_CREATE_INFO device = {
+ const VkDeviceCreateInfo device = {
.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
.pNext = NULL,
.queueRecordCount = 1,
.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_BIT,
.flags = 0,
};
- VK_MEMORY_ALLOC_IMAGE_INFO img_alloc = {
+ VkMemoryAllocImageInfo img_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO,
.pNext = NULL,
};
- VK_MEMORY_ALLOC_INFO mem_alloc = {
+ VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
.pNext = &img_alloc,
.allocationSize = 0,
.usage = VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT,
.flags = 0,
};
- VK_MEMORY_ALLOC_IMAGE_INFO img_alloc = {
+ VkMemoryAllocImageInfo img_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO,
.pNext = NULL,
};
- VK_MEMORY_ALLOC_INFO mem_alloc = {
+ VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
.pNext = &img_alloc,
.allocationSize = 0,
{ 1.0f, -1.0f, -0.5f, 1.0f, 0.0f },
{ 0.0f, 1.0f, 1.0f, 0.5f, 1.0f },
};
- const VK_BUFFER_CREATE_INFO buf_info = {
+ const VkBufferCreateInfo buf_info = {
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
.pNext = NULL,
.size = sizeof(vb),
.usage = VK_BUFFER_USAGE_VERTEX_FETCH_BIT,
.flags = 0,
};
- VK_MEMORY_ALLOC_BUFFER_INFO buf_alloc = {
+ VkMemoryAllocBufferInfo buf_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_BUFFER_INFO,
.pNext = NULL,
};
- VK_MEMORY_ALLOC_INFO mem_alloc = {
+ VkMemoryAllocInfo mem_alloc = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO,
.pNext = &buf_alloc,
.allocationSize = 0,
.engineVersion = 0,
.apiVersion = VK_API_VERSION,
};
- const VK_INSTANCE_CREATE_INFO inst_info = {
+ const VkInstanceCreateInfo inst_info = {
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
.pNext = NULL,
.pAppInfo = &app,
.root = demo->screen->root,
.provider = 0,
};
- const VK_DEVICE_QUEUE_CREATE_INFO queue = {
+ const VkDeviceQueueCreateInfo queue = {
.queueNodeIndex = 0,
.queueCount = 1,
};
const char *ext_names[] = {
"VK_WSI_X11",
};
- const VK_DEVICE_CREATE_INFO device = {
+ const VkDeviceCreateInfo device = {
.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
.pNext = NULL,
.queueRecordCount = 1,
uint32_t queue_count;
VK_PHYSICAL_GPU_QUEUE_PROPERTIES *queue_props;
- VK_DEVICE_QUEUE_CREATE_INFO *queue_reqs;
+ VkDeviceQueueCreateInfo *queue_reqs;
VK_PHYSICAL_GPU_MEMORY_PROPERTIES memory_props;
static void app_dev_init(struct app_dev *dev, struct app_gpu *gpu)
{
- VK_DEVICE_CREATE_INFO info = {
+ VkDeviceCreateInfo info = {
.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
.pNext = NULL,
.queueRecordCount = 0,
.engineVersion = 1,
.apiVersion = VK_API_VERSION,
};
- static const VK_INSTANCE_CREATE_INFO inst_info = {
+ static const VkInstanceCreateInfo inst_info = {
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
.pNext = NULL,
.pAppInfo = &app_info,
}
static VK_RESULT dev_create_queues(struct nulldrv_dev *dev,
- const VK_DEVICE_QUEUE_CREATE_INFO *queues,
+ const VkDeviceQueueCreateInfo *queues,
uint32_t count)
{
uint32_t i;
return VK_ERROR_INVALID_POINTER;
for (i = 0; i < count; i++) {
- const VK_DEVICE_QUEUE_CREATE_INFO *q = &queues[i];
+ const VkDeviceQueueCreateInfo *q = &queues[i];
VK_RESULT ret = VK_SUCCESS;
if (q->queueCount == 1 && !dev->queues[q->queueNodeIndex]) {
}
static VK_RESULT nulldrv_dev_create(struct nulldrv_gpu *gpu,
- const VK_DEVICE_CREATE_INFO *info,
+ const VkDeviceCreateInfo *info,
struct nulldrv_dev **dev_ret)
{
struct nulldrv_dev *dev;
}
static VK_RESULT nulldrv_mem_alloc(struct nulldrv_dev *dev,
- const VK_MEMORY_ALLOC_INFO *info,
+ const VkMemoryAllocInfo *info,
struct nulldrv_mem **mem_ret)
{
struct nulldrv_mem *mem;
}
static VK_RESULT nulldrv_buf_create(struct nulldrv_dev *dev,
- const VK_BUFFER_CREATE_INFO *info,
+ const VkBufferCreateInfo *info,
struct nulldrv_buf **buf_ret)
{
struct nulldrv_buf *buf;
}
static VK_RESULT nulldrv_buf_view_create(struct nulldrv_dev *dev,
- const VK_BUFFER_VIEW_CREATE_INFO *info,
+ const VkBufferViewCreateInfo *info,
struct nulldrv_buf_view **view_ret)
{
struct nulldrv_buf *buf = nulldrv_buf(info->buffer);
ICD_EXPORT VK_RESULT VKAPI vkCreateBuffer(
VK_DEVICE device,
- const VK_BUFFER_CREATE_INFO* pCreateInfo,
+ const VkBufferCreateInfo* pCreateInfo,
VK_BUFFER* pBuffer)
{
NULLDRV_LOG_FUNC;
ICD_EXPORT VK_RESULT VKAPI vkCreateDevice(
VK_PHYSICAL_GPU gpu_,
- const VK_DEVICE_CREATE_INFO* pCreateInfo,
+ const VkDeviceCreateInfo* pCreateInfo,
VK_DEVICE* pDevice)
{
NULLDRV_LOG_FUNC;
ICD_EXPORT VK_RESULT VKAPI vkAllocMemory(
VK_DEVICE device,
- const VK_MEMORY_ALLOC_INFO* pAllocInfo,
+ const VkMemoryAllocInfo* pAllocInfo,
VK_GPU_MEMORY* pMem)
{
NULLDRV_LOG_FUNC;
}
ICD_EXPORT VK_RESULT VKAPI vkCreateInstance(
- const VK_INSTANCE_CREATE_INFO* pCreateInfo,
+ const VkInstanceCreateInfo* pCreateInfo,
VK_INSTANCE* pInstance)
{
NULLDRV_LOG_FUNC;
ICD_EXPORT VK_RESULT VKAPI vkCreateBufferView(
VK_DEVICE device,
- const VK_BUFFER_VIEW_CREATE_INFO* pCreateInfo,
+ const VkBufferViewCreateInfo* pCreateInfo,
VK_BUFFER_VIEW* pView)
{
NULLDRV_LOG_FUNC;
VK_FREE_FUNCTION pfnFree;
} VK_ALLOC_CALLBACKS;
-typedef struct _VK_DEVICE_QUEUE_CREATE_INFO
+typedef struct _VkDeviceQueueCreateInfo
{
uint32_t queueNodeIndex;
uint32_t queueCount;
-} VK_DEVICE_QUEUE_CREATE_INFO;
+} VkDeviceQueueCreateInfo;
-typedef struct _VK_DEVICE_CREATE_INFO
+typedef struct _VkDeviceCreateInfo
{
VK_STRUCTURE_TYPE sType; // Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t queueRecordCount;
- const VK_DEVICE_QUEUE_CREATE_INFO* pRequestedQueues;
+ const VkDeviceQueueCreateInfo* pRequestedQueues;
uint32_t extensionCount;
const char*const* ppEnabledExtensionNames;
VK_VALIDATION_LEVEL maxValidationLevel;
VK_FLAGS flags; // VK_DEVICE_CREATE_FLAGS
-} VK_DEVICE_CREATE_INFO;
+} VkDeviceCreateInfo;
-typedef struct _VK_INSTANCE_CREATE_INFO
+typedef struct _VkInstanceCreateInfo
{
VK_STRUCTURE_TYPE sType; // Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
const void* pNext; // Pointer to next structure
const VK_ALLOC_CALLBACKS* pAllocCb;
uint32_t extensionCount;
const char*const* ppEnabledExtensionNames; // layer or extension name to be enabled
-} VK_INSTANCE_CREATE_INFO;
+} VkInstanceCreateInfo;
-// can be added to VK_DEVICE_CREATE_INFO or VK_INSTANCE_CREATE_INFO via pNext
-typedef struct _VK_LAYER_CREATE_INFO
+// can be added to VkDeviceCreateInfo or VkInstanceCreateInfo via pNext
+typedef struct _VkLayerCreateInfo
{
VK_STRUCTURE_TYPE sType; // Should be VK_STRUCTURE_TYPE_LAYER_CREATE_INFO
const void* pNext; // Pointer to next structure
uint32_t layerCount;
const char *const* ppActiveLayerNames; // layer name from the layer's vkEnumerateLayers())
-} VK_LAYER_CREATE_INFO;
+} VkLayerCreateInfo;
typedef struct _VK_PHYSICAL_GPU_QUEUE_PROPERTIES
{
bool32_t supportsPinning;
} VK_PHYSICAL_GPU_MEMORY_PROPERTIES;
-typedef struct _VK_MEMORY_ALLOC_INFO
+typedef struct _VkMemoryAllocInfo
{
VK_STRUCTURE_TYPE sType; // Must be VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO
const void* pNext; // Pointer to next structure
VK_FLAGS memProps; // VK_MEMORY_PROPERTY_FLAGS
VK_MEMORY_TYPE memType;
VK_MEMORY_PRIORITY memPriority;
-} VK_MEMORY_ALLOC_INFO;
+} VkMemoryAllocInfo;
-// This structure is included in the VK_MEMORY_ALLOC_INFO chain
+// This structure is included in the VkMemoryAllocInfo chain
// for memory regions allocated for buffer usage.
-typedef struct _VK_MEMORY_ALLOC_BUFFER_INFO
+typedef struct _VkMemoryAllocBufferInfo
{
VK_STRUCTURE_TYPE sType; // Must be VK_STRUCTURE_TYPE_MEMORY_ALLOC_BUFFER_INFO
const void* pNext; // Pointer to next structure
VK_FLAGS usage; // VK_BUFFER_USAGE_FLAGS
-} VK_MEMORY_ALLOC_BUFFER_INFO;
+} VkMemoryAllocBufferInfo;
-// This structure is included in the VK_MEMORY_ALLOC_INFO chain
+// This structure is included in the VkMemoryAllocInfo chain
// for memory regions allocated for image usage.
-typedef struct _VK_MEMORY_ALLOC_IMAGE_INFO
+typedef struct _VkMemoryAllocImageInfo
{
VK_STRUCTURE_TYPE sType; // Must be VK_STRUCTURE_TYPE_MEMORY_ALLOC_IMAGE_INFO
const void* pNext; // Pointer to next structure
VK_FLAGS usage; // VK_IMAGE_USAGE_FLAGS
VK_IMAGE_FORMAT_CLASS formatClass;
uint32_t samples;
-} VK_MEMORY_ALLOC_IMAGE_INFO;
+} VkMemoryAllocImageInfo;
typedef struct _VK_MEMORY_OPEN_INFO
{
uint32_t count;
} VK_UPDATE_AS_COPY;
-typedef struct _VK_BUFFER_CREATE_INFO
+typedef struct _VkBufferCreateInfo
{
VK_STRUCTURE_TYPE sType; // Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
const void* pNext; // Pointer to next structure.
VK_GPU_SIZE size; // Specified in bytes
VK_FLAGS usage; // VK_BUFFER_USAGE_FLAGS
VK_FLAGS flags; // VK_BUFFER_CREATE_FLAGS
-} VK_BUFFER_CREATE_INFO;
+} VkBufferCreateInfo;
-typedef struct _VK_BUFFER_VIEW_CREATE_INFO
+typedef struct _VkBufferViewCreateInfo
{
VK_STRUCTURE_TYPE sType; // Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
const void* pNext; // Pointer to next structure.
VK_FORMAT format; // Optionally specifies format of elements
VK_GPU_SIZE offset; // Specified in bytes
VK_GPU_SIZE range; // View size specified in bytes
-} VK_BUFFER_VIEW_CREATE_INFO;
+} VkBufferViewCreateInfo;
typedef struct _VK_IMAGE_SUBRESOURCE
{
// ------------------------------------------------------------------------------------------------
// API functions
-typedef VK_RESULT (VKAPI *vkCreateInstanceType)(const VK_INSTANCE_CREATE_INFO* pCreateInfo, VK_INSTANCE* pInstance);
+typedef VK_RESULT (VKAPI *vkCreateInstanceType)(const VkInstanceCreateInfo* pCreateInfo, VK_INSTANCE* pInstance);
typedef VK_RESULT (VKAPI *vkDestroyInstanceType)(VK_INSTANCE instance);
typedef VK_RESULT (VKAPI *vkEnumerateGpusType)(VK_INSTANCE instance, uint32_t maxGpus, uint32_t* pGpuCount, VK_PHYSICAL_GPU* pGpus);
typedef VK_RESULT (VKAPI *vkGetGpuInfoType)(VK_PHYSICAL_GPU gpu, VK_PHYSICAL_GPU_INFO_TYPE infoType, size_t* pDataSize, void* pData);
typedef void * (VKAPI *vkGetProcAddrType)(VK_PHYSICAL_GPU gpu, const char * pName);
-typedef VK_RESULT (VKAPI *vkCreateDeviceType)(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo, VK_DEVICE* pDevice);
+typedef VK_RESULT (VKAPI *vkCreateDeviceType)(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo, VK_DEVICE* pDevice);
typedef VK_RESULT (VKAPI *vkDestroyDeviceType)(VK_DEVICE device);
typedef VK_RESULT (VKAPI *vkGetExtensionSupportType)(VK_PHYSICAL_GPU gpu, const char* pExtName);
typedef VK_RESULT (VKAPI *vkEnumerateLayersType)(VK_PHYSICAL_GPU gpu, size_t maxLayerCount, size_t maxStringSize, size_t* pOutLayerCount, char* const* pOutLayers, void* pReserved);
typedef VK_RESULT (VKAPI *vkQueueRemoveMemReferenceType)(VK_QUEUE queue, VK_GPU_MEMORY mem);
typedef VK_RESULT (VKAPI *vkQueueWaitIdleType)(VK_QUEUE queue);
typedef VK_RESULT (VKAPI *vkDeviceWaitIdleType)(VK_DEVICE device);
-typedef VK_RESULT (VKAPI *vkAllocMemoryType)(VK_DEVICE device, const VK_MEMORY_ALLOC_INFO* pAllocInfo, VK_GPU_MEMORY* pMem);
+typedef VK_RESULT (VKAPI *vkAllocMemoryType)(VK_DEVICE device, const VkMemoryAllocInfo* pAllocInfo, VK_GPU_MEMORY* pMem);
typedef VK_RESULT (VKAPI *vkFreeMemoryType)(VK_GPU_MEMORY mem);
typedef VK_RESULT (VKAPI *vkSetMemoryPriorityType)(VK_GPU_MEMORY mem, VK_MEMORY_PRIORITY priority);
typedef VK_RESULT (VKAPI *vkMapMemoryType)(VK_GPU_MEMORY mem, VK_FLAGS flags, void** ppData);
typedef VK_RESULT (VKAPI *vkCreateQueryPoolType)(VK_DEVICE device, const VK_QUERY_POOL_CREATE_INFO* pCreateInfo, VK_QUERY_POOL* pQueryPool);
typedef VK_RESULT (VKAPI *vkGetQueryPoolResultsType)(VK_QUERY_POOL queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData);
typedef VK_RESULT (VKAPI *vkGetFormatInfoType)(VK_DEVICE device, VK_FORMAT format, VK_FORMAT_INFO_TYPE infoType, size_t* pDataSize, void* pData);
-typedef VK_RESULT (VKAPI *vkCreateBufferType)(VK_DEVICE device, const VK_BUFFER_CREATE_INFO* pCreateInfo, VK_BUFFER* pBuffer);
-typedef VK_RESULT (VKAPI *vkCreateBufferViewType)(VK_DEVICE device, const VK_BUFFER_VIEW_CREATE_INFO* pCreateInfo, VK_BUFFER_VIEW* pView);
+typedef VK_RESULT (VKAPI *vkCreateBufferType)(VK_DEVICE device, const VkBufferCreateInfo* pCreateInfo, VK_BUFFER* pBuffer);
+typedef VK_RESULT (VKAPI *vkCreateBufferViewType)(VK_DEVICE device, const VkBufferViewCreateInfo* pCreateInfo, VK_BUFFER_VIEW* pView);
typedef VK_RESULT (VKAPI *vkCreateImageType)(VK_DEVICE device, const VK_IMAGE_CREATE_INFO* pCreateInfo, VK_IMAGE* pImage);
typedef VK_RESULT (VKAPI *vkGetImageSubresourceInfoType)(VK_IMAGE image, const VK_IMAGE_SUBRESOURCE* pSubresource, VK_SUBRESOURCE_INFO_TYPE infoType, size_t* pDataSize, void* pData);
typedef VK_RESULT (VKAPI *vkCreateImageViewType)(VK_DEVICE device, const VK_IMAGE_VIEW_CREATE_INFO* pCreateInfo, VK_IMAGE_VIEW* pView);
// GPU initialization
VK_RESULT VKAPI vkCreateInstance(
- const VK_INSTANCE_CREATE_INFO* pCreateInfo,
+ const VkInstanceCreateInfo* pCreateInfo,
VK_INSTANCE* pInstance);
VK_RESULT VKAPI vkDestroyInstance(
VK_RESULT VKAPI vkCreateDevice(
VK_PHYSICAL_GPU gpu,
- const VK_DEVICE_CREATE_INFO* pCreateInfo,
+ const VkDeviceCreateInfo* pCreateInfo,
VK_DEVICE* pDevice);
VK_RESULT VKAPI vkDestroyDevice(
VK_RESULT VKAPI vkAllocMemory(
VK_DEVICE device,
- const VK_MEMORY_ALLOC_INFO* pAllocInfo,
+ const VkMemoryAllocInfo* pAllocInfo,
VK_GPU_MEMORY* pMem);
VK_RESULT VKAPI vkFreeMemory(
VK_RESULT VKAPI vkCreateBuffer(
VK_DEVICE device,
- const VK_BUFFER_CREATE_INFO* pCreateInfo,
+ const VkBufferCreateInfo* pCreateInfo,
VK_BUFFER* pBuffer);
// Buffer view functions
VK_RESULT VKAPI vkCreateBufferView(
VK_DEVICE device,
- const VK_BUFFER_VIEW_CREATE_INFO* pCreateInfo,
+ const VkBufferViewCreateInfo* pCreateInfo,
VK_BUFFER_VIEW* pView);
// Image functions
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo, VK_DEVICE* pDevice)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo, VK_DEVICE* pDevice)
{
VK_BASE_LAYER_OBJECT* gpuw = (VK_BASE_LAYER_OBJECT *) gpu;
VK_LAYER_DISPATCH_TABLE* pTable = tableMap[gpuw];
delete (*ii).second;
}
}
-static VK_BUFFER_VIEW_CREATE_INFO* getBufferViewCreateInfo(VK_BUFFER_VIEW view)
+static VkBufferViewCreateInfo* getBufferViewCreateInfo(VK_BUFFER_VIEW view)
{
loader_platform_thread_lock_mutex(&globalLock);
if (bufferMap.find(view) == bufferMap.end()) {
VK_UPDATE_AS_COPY* pUAC = NULL;
VK_SAMPLER_CREATE_INFO* pSCI = NULL;
VK_IMAGE_VIEW_CREATE_INFO* pIVCI = NULL;
- VK_BUFFER_VIEW_CREATE_INFO* pBVCI = NULL;
+ VkBufferViewCreateInfo* pBVCI = NULL;
void** ppNextPtr = NULL;
void* pSaveNext = NULL;
for (i=0; i < pSet->descriptorCount; i++) {
pBVCI = getBufferViewCreateInfo(pUB->pBufferViews[i-pUB->arrayIndex].view);
if (pBVCI) {
sprintf(tmp_str, "BUFFER_VIEW%u", i);
- fprintf(pOutFile, "%s", vk_gv_print_vk_buffer_view_create_info(pBVCI, tmp_str));
+ fprintf(pOutFile, "%s", vk_gv_print_vkbufferviewcreateinfo(pBVCI, tmp_str));
fprintf(pOutFile, "\"DESCRIPTORS\":slot%u -> \"%s\" [color=\"#%s\"];\n", i, tmp_str, edgeColors[colorIdx].c_str());
}
break;
}
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo, VK_DEVICE* pDevice)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo, VK_DEVICE* pDevice)
{
VK_BASE_LAYER_OBJECT* gpuw = (VK_BASE_LAYER_OBJECT *) gpu;
pCurObj = gpuw;
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBufferView(VK_DEVICE device, const VK_BUFFER_VIEW_CREATE_INFO* pCreateInfo, VK_BUFFER_VIEW* pView)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBufferView(VK_DEVICE device, const VkBufferViewCreateInfo* pCreateInfo, VK_BUFFER_VIEW* pView)
{
VK_RESULT result = nextTable.CreateBufferView(device, pCreateInfo, pView);
if (VK_SUCCESS == result) {
typedef struct _BUFFER_NODE {
VK_BUFFER_VIEW buffer;
- VK_BUFFER_VIEW_CREATE_INFO createInfo;
+ VkBufferViewCreateInfo createInfo;
VK_BUFFER_VIEW_ATTACH_INFO attachInfo;
} BUFFER_NODE;
memcpy(*ppDest, pSrc, size);
}
-VK_DEVICE_CREATE_INFO* glv_deepcopy_VK_DEVICE_CREATE_INFO(const VK_DEVICE_CREATE_INFO* pSrcCreateInfo)
+VkDeviceCreateInfo* glv_deepcopy_VkDeviceCreateInfo(const VkDeviceCreateInfo* pSrcCreateInfo)
{
- VK_DEVICE_CREATE_INFO* pDestCreateInfo;
+ VkDeviceCreateInfo* pDestCreateInfo;
- // NOTE: partially duplicated code from add_VK_DEVICE_CREATE_INFO_to_packet(...)
+ // NOTE: partially duplicated code from add_VkDeviceCreateInfo_to_packet(...)
{
uint32_t i;
- glv_vk_malloc_and_copy((void**)&pDestCreateInfo, sizeof(VK_DEVICE_CREATE_INFO), pSrcCreateInfo);
- glv_vk_malloc_and_copy((void**)&pDestCreateInfo->pRequestedQueues, pSrcCreateInfo->queueRecordCount*sizeof(VK_DEVICE_QUEUE_CREATE_INFO), pSrcCreateInfo->pRequestedQueues);
+ glv_vk_malloc_and_copy((void**)&pDestCreateInfo, sizeof(VkDeviceCreateInfo), pSrcCreateInfo);
+ glv_vk_malloc_and_copy((void**)&pDestCreateInfo->pRequestedQueues, pSrcCreateInfo->queueRecordCount*sizeof(VkDeviceQueueCreateInfo), pSrcCreateInfo->pRequestedQueues);
if (pSrcCreateInfo->extensionCount > 0)
{
glv_vk_malloc_and_copy((void**)&pDestCreateInfo->ppEnabledExtensionNames[i], strlen(pSrcCreateInfo->ppEnabledExtensionNames[i]) + 1, pSrcCreateInfo->ppEnabledExtensionNames[i]);
}
}
- VK_LAYER_CREATE_INFO *pSrcNext = ( VK_LAYER_CREATE_INFO *) pSrcCreateInfo->pNext;
- VK_LAYER_CREATE_INFO **ppDstNext = ( VK_LAYER_CREATE_INFO **) &pDestCreateInfo->pNext;
+ VkLayerCreateInfo *pSrcNext = ( VkLayerCreateInfo *) pSrcCreateInfo->pNext;
+ VkLayerCreateInfo **ppDstNext = ( VkLayerCreateInfo **) &pDestCreateInfo->pNext;
while (pSrcNext != NULL)
{
if ((pSrcNext->sType == VK_STRUCTURE_TYPE_LAYER_CREATE_INFO) && pSrcNext->layerCount > 0)
{
- glv_vk_malloc_and_copy((void**)ppDstNext, sizeof(VK_LAYER_CREATE_INFO), pSrcNext);
+ glv_vk_malloc_and_copy((void**)ppDstNext, sizeof(VkLayerCreateInfo), pSrcNext);
glv_vk_malloc_and_copy((void**)&(*ppDstNext)->ppActiveLayerNames, pSrcNext->layerCount * sizeof(char*), pSrcNext->ppActiveLayerNames);
for (i = 0; i < pSrcNext->layerCount; i++)
{
glv_vk_malloc_and_copy((void**)&(*ppDstNext)->ppActiveLayerNames[i], strlen(pSrcNext->ppActiveLayerNames[i]) + 1, pSrcNext->ppActiveLayerNames[i]);
}
- ppDstNext = (VK_LAYER_CREATE_INFO**) &(*ppDstNext)->pNext;
+ ppDstNext = (VkLayerCreateInfo**) &(*ppDstNext)->pNext;
}
- pSrcNext = (VK_LAYER_CREATE_INFO*) pSrcNext->pNext;
+ pSrcNext = (VkLayerCreateInfo*) pSrcNext->pNext;
}
}
return pDestCreateInfo;
}
-void glv_deepfree_VK_DEVICE_CREATE_INFO(VK_DEVICE_CREATE_INFO* pCreateInfo)
+void glv_deepfree_VkDeviceCreateInfo(VkDeviceCreateInfo* pCreateInfo)
{
uint32_t i;
if (pCreateInfo->pRequestedQueues != NULL)
free((void*)pCreateInfo->ppEnabledExtensionNames);
}
- VK_LAYER_CREATE_INFO *pSrcNext = (VK_LAYER_CREATE_INFO*)pCreateInfo->pNext;
+ VkLayerCreateInfo *pSrcNext = (VkLayerCreateInfo*)pCreateInfo->pNext;
while (pSrcNext != NULL)
{
- VK_LAYER_CREATE_INFO* pTmp = (VK_LAYER_CREATE_INFO*)pSrcNext->pNext;
+ VkLayerCreateInfo* pTmp = (VkLayerCreateInfo*)pSrcNext->pNext;
if ((pSrcNext->sType == VK_STRUCTURE_TYPE_LAYER_CREATE_INFO) && pSrcNext->layerCount > 0)
{
for (i = 0; i < pSrcNext->layerCount; i++)
free(pCreateInfo);
}
-void glv_vk_snapshot_copy_createdevice_params(GLV_VK_SNAPSHOT_CREATEDEVICE_PARAMS* pDest, VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo, VK_DEVICE* pDevice)
+void glv_vk_snapshot_copy_createdevice_params(GLV_VK_SNAPSHOT_CREATEDEVICE_PARAMS* pDest, VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo, VK_DEVICE* pDevice)
{
pDest->gpu = gpu;
- pDest->pCreateInfo = glv_deepcopy_VK_DEVICE_CREATE_INFO(pCreateInfo);
+ pDest->pCreateInfo = glv_deepcopy_VkDeviceCreateInfo(pCreateInfo);
pDest->pDevice = (VK_DEVICE*)malloc(sizeof(VK_DEVICE));
*pDest->pDevice = *pDevice;
{
memset(&pSrc->gpu, 0, sizeof(VK_PHYSICAL_GPU));
- glv_deepfree_VK_DEVICE_CREATE_INFO(pSrc->pCreateInfo);
+ glv_deepfree_VkDeviceCreateInfo(pSrc->pCreateInfo);
pSrc->pCreateInfo = NULL;
free(pSrc->pDevice);
}
// Note: the parameters after pSnapshot match the order of vkCreateDevice(..)
-static void snapshot_insert_device(GLV_VK_SNAPSHOT* pSnapshot, VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo, VK_DEVICE* pDevice)
+static void snapshot_insert_device(GLV_VK_SNAPSHOT* pSnapshot, VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo, VK_DEVICE* pDevice)
{
GLV_VK_SNAPSHOT_LL_NODE* pNode = snapshot_insert_object(pSnapshot, *pDevice, VK_OBJECT_TYPE_DEVICE);
pNode->obj.pStruct = malloc(sizeof(GLV_VK_SNAPSHOT_DEVICE_NODE));
//=============================================================================
// vulkan entrypoints
//=============================================================================
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateInstance(const VK_INSTANCE_CREATE_INFO* pCreateInfo, VK_INSTANCE* pInstance)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, VK_INSTANCE* pInstance)
{
VK_RESULT result = nextTable.CreateInstance(pCreateInfo, pInstance);
loader_platform_thread_lock_mutex(&objLock);
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo, VK_DEVICE* pDevice)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo, VK_DEVICE* pDevice)
{
VK_BASE_LAYER_OBJECT* gpuw = (VK_BASE_LAYER_OBJECT *) gpu;
pCurObj = gpuw;
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkAllocMemory(VK_DEVICE device, const VK_MEMORY_ALLOC_INFO* pAllocInfo, VK_GPU_MEMORY* pMem)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkAllocMemory(VK_DEVICE device, const VkMemoryAllocInfo * pAllocInfo, VK_GPU_MEMORY* pMem)
{
loader_platform_thread_lock_mutex(&objLock);
ll_increment_use_count((void*)device, VK_OBJECT_TYPE_DEVICE);
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBuffer(VK_DEVICE device, const VK_BUFFER_CREATE_INFO* pCreateInfo, VK_BUFFER* pBuffer)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBuffer(VK_DEVICE device, const VkBufferCreateInfo* pCreateInfo, VK_BUFFER* pBuffer)
{
loader_platform_thread_lock_mutex(&objLock);
ll_increment_use_count((void*)device, VK_OBJECT_TYPE_DEVICE);
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBufferView(VK_DEVICE device, const VK_BUFFER_VIEW_CREATE_INFO* pCreateInfo, VK_BUFFER_VIEW* pView)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBufferView(VK_DEVICE device, const VkBufferViewCreateInfo* pCreateInfo, VK_BUFFER_VIEW* pView)
{
loader_platform_thread_lock_mutex(&objLock);
ll_increment_use_count((void*)device, VK_OBJECT_TYPE_DEVICE);
while (pDeviceNode != NULL)
{
GLV_VK_SNAPSHOT_DEVICE_NODE* pDev = (GLV_VK_SNAPSHOT_DEVICE_NODE*)pDeviceNode->obj.pStruct;
- char * createInfoStr = vk_print_vk_device_create_info(pDev->params.pCreateInfo, "\t\t");
+ char * createInfoStr = vk_print_vkdevicecreateinfo(pDev->params.pCreateInfo, "\t\t");
sprintf(str, "\t%s obj %p:\n%s", string_VK_OBJECT_TYPE(VK_OBJECT_TYPE_DEVICE), pDeviceNode->obj.pVkObject, createInfoStr);
layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, pDeviceNode->obj.pVkObject, 0, GLVSNAPSHOT_SNAPSHOT_DATA, LAYER_ABBREV_STR, str);
pDeviceNode = pDeviceNode->pNextObj;
typedef struct _GLV_VK_SNAPSHOT_CREATEDEVICE_PARAMS
{
VK_PHYSICAL_GPU gpu;
- VK_DEVICE_CREATE_INFO* pCreateInfo;
+ VkDeviceCreateInfo* pCreateInfo;
VK_DEVICE* pDevice;
} GLV_VK_SNAPSHOT_CREATEDEVICE_PARAMS;
-VK_DEVICE_CREATE_INFO* glv_deepcopy_xgl_device_create_info(const VK_DEVICE_CREATE_INFO* pSrcCreateInfo);void glv_deepfree_xgl_device_create_info(VK_DEVICE_CREATE_INFO* pCreateInfo);
-void glv_vk_snapshot_copy_createdevice_params(GLV_VK_SNAPSHOT_CREATEDEVICE_PARAMS* pDest, VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo, VK_DEVICE* pDevice);
+VkDeviceCreateInfo* glv_deepcopy_xgl_device_create_info(const VkDeviceCreateInfo* pSrcCreateInfo);void glv_deepfree_xgl_device_create_info(VkDeviceCreateInfo* pCreateInfo);
+void glv_vk_snapshot_copy_createdevice_params(GLV_VK_SNAPSHOT_CREATEDEVICE_PARAMS* pDest, VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo, VK_DEVICE* pDevice);
void glv_vk_snapshot_destroy_createdevice_params(GLV_VK_SNAPSHOT_CREATEDEVICE_PARAMS* pSrc);
//=============================================================================
return pMemObjInfo;
}
-static void addMemObjInfo(const VK_GPU_MEMORY mem, const VK_MEMORY_ALLOC_INFO* pAllocInfo)
+static void addMemObjInfo(const VK_GPU_MEMORY mem, const VkMemoryAllocInfo* pAllocInfo)
{
MT_MEM_OBJ_INFO* pInfo = new MT_MEM_OBJ_INFO;
pInfo->refCount = 0;
- memset(&pInfo->allocInfo, 0, sizeof(VK_MEMORY_ALLOC_INFO));
+ memset(&pInfo->allocInfo, 0, sizeof(VkMemoryAllocInfo));
if (pAllocInfo) { // MEM alloc created by vkWsiX11CreatePresentableImage() doesn't have alloc info struct
- memcpy(&pInfo->allocInfo, pAllocInfo, sizeof(VK_MEMORY_ALLOC_INFO));
+ memcpy(&pInfo->allocInfo, pAllocInfo, sizeof(VkMemoryAllocInfo));
// TODO: Update for real hardware, actually process allocation info structures
pInfo->allocInfo.pNext = NULL;
}
sprintf(str, " Ref Count: %u", pInfo->refCount);
layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, MEMTRACK_NONE, "MEM", str);
if (0 != pInfo->allocInfo.allocationSize) {
- string pAllocInfoMsg = vk_print_vk_memory_alloc_info(&pInfo->allocInfo, "{MEM}INFO : ");
+ string pAllocInfoMsg = vk_print_vkmemoryallocinfo(&pInfo->allocInfo, "{MEM}INFO : ");
sprintf(str, " Mem Alloc info:\n%s", pAllocInfoMsg.c_str());
layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, MEMTRACK_NONE, "MEM", str);
} else {
}
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo, VK_DEVICE* pDevice)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo, VK_DEVICE* pDevice)
{
VK_BASE_LAYER_OBJECT* gpuw = (VK_BASE_LAYER_OBJECT *) gpu;
pCurObj = gpuw;
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkAllocMemory(VK_DEVICE device, const VK_MEMORY_ALLOC_INFO* pAllocInfo, VK_GPU_MEMORY* pMem)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkAllocMemory(VK_DEVICE device, const VkMemoryAllocInfo* pAllocInfo, VK_GPU_MEMORY* pMem)
{
VK_RESULT result = nextTable.AllocMemory(device, pAllocInfo, pMem);
// TODO : Track allocations and overall size here
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBuffer(VK_DEVICE device, const VK_BUFFER_CREATE_INFO* pCreateInfo, VK_BUFFER* pBuffer)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBuffer(VK_DEVICE device, const VkBufferCreateInfo* pCreateInfo, VK_BUFFER* pBuffer)
{
VK_RESULT result = nextTable.CreateBuffer(device, pCreateInfo, pBuffer);
if (VK_SUCCESS == result) {
loader_platform_thread_lock_mutex(&globalLock);
- addObjectInfo(*pBuffer, pCreateInfo->sType, pCreateInfo, sizeof(VK_BUFFER_CREATE_INFO), "buffer");
+ addObjectInfo(*pBuffer, pCreateInfo->sType, pCreateInfo, sizeof(VkBufferCreateInfo), "buffer");
loader_platform_thread_unlock_mutex(&globalLock);
}
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBufferView(VK_DEVICE device, const VK_BUFFER_VIEW_CREATE_INFO* pCreateInfo, VK_BUFFER_VIEW* pView)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBufferView(VK_DEVICE device, const VkBufferViewCreateInfo* pCreateInfo, VK_BUFFER_VIEW* pView)
{
VK_RESULT result = nextTable.CreateBufferView(device, pCreateInfo, pView);
if (result == VK_SUCCESS) {
loader_platform_thread_lock_mutex(&globalLock);
- addObjectInfo(*pView, pCreateInfo->sType, pCreateInfo, sizeof(VK_BUFFER_VIEW_CREATE_INFO), "buffer_view");
+ addObjectInfo(*pView, pCreateInfo->sType, pCreateInfo, sizeof(VkBufferViewCreateInfo), "buffer_view");
loader_platform_thread_unlock_mutex(&globalLock);
}
return result;
struct MT_MEM_OBJ_INFO {
uint32_t refCount; // Count of references (obj bindings or CB use)
VK_GPU_MEMORY mem;
- VK_MEMORY_ALLOC_INFO allocInfo;
+ VkMemoryAllocInfo allocInfo;
list<VK_OBJECT> pObjBindings; // list container of objects bound to this memory
list<VK_CMD_BUFFER> pCmdBufferBindings; // list container of cmd buffers that reference this mem object
};
#endif
-VK_LAYER_EXPORT VK_RESULT VKAPI multi1CreateDevice(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo,
+VK_LAYER_EXPORT VK_RESULT VKAPI multi1CreateDevice(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo,
VK_DEVICE* pDevice)
{
VK_BASE_LAYER_OBJECT* gpuw = (VK_BASE_LAYER_OBJECT *) gpu;
}
}
-VK_LAYER_EXPORT VK_RESULT VKAPI multi2CreateDevice(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo,
+VK_LAYER_EXPORT VK_RESULT VKAPI multi2CreateDevice(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo,
VK_DEVICE* pDevice)
{
VK_BASE_LAYER_OBJECT* gpuw = (VK_BASE_LAYER_OBJECT *) gpu;
}
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateInstance(const VK_INSTANCE_CREATE_INFO* pCreateInfo, VK_INSTANCE* pInstance)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateInstance(const VkInstanceCreateInfo* pCreateInfo, VK_INSTANCE* pInstance)
{
PreCreateInstance(pCreateInfo->pAppInfo, pCreateInfo->pAllocCb);
VK_RESULT result = nextTable.CreateInstance(pCreateInfo, pInstance);
return result;
}
-void PreCreateDevice(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo)
+void PreCreateDevice(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo)
{
if(gpu == nullptr)
{
if(pCreateInfo == nullptr)
{
- char const str[] = "vkCreateDevice parameter, VK_DEVICE_CREATE_INFO* pCreateInfo, is "\
+ char const str[] = "vkCreateDevice parameter, VkDeviceCreateInfo* pCreateInfo, is "\
"nullptr (precondition).";
layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
return;
if(pCreateInfo->pRequestedQueues == nullptr)
{
- char const str[] = "vkCreateDevice parameter, VK_DEVICE_QUEUE_CREATE_INFO* pCreateInfo->pRequestedQueues, is "\
+ char const str[] = "vkCreateDevice parameter, VkDeviceQueueCreateInfo* pCreateInfo->pRequestedQueues, is "\
"nullptr (precondition).";
layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
return;
for(uint32_t i = 0; i < pCreateInfo->queueRecordCount; ++i)
{
- if(!vk_validate_vk_device_queue_create_info(&(pCreateInfo->pRequestedQueues[i])))
+ if(!vk_validate_vkdevicequeuecreateinfo(&(pCreateInfo->pRequestedQueues[i])))
{
std::stringstream ss;
- ss << "vkCreateDevice parameter, VK_DEVICE_QUEUE_CREATE_INFO pCreateInfo->pRequestedQueues[" << i <<
+ ss << "vkCreateDevice parameter, VkDeviceQueueCreateInfo pCreateInfo->pRequestedQueues[" << i <<
"], is invalid (precondition).";
layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", ss.str().c_str());
continue;
}
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo, VK_DEVICE* pDevice)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateDevice(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo, VK_DEVICE* pDevice)
{
VK_BASE_LAYER_OBJECT* gpuw = (VK_BASE_LAYER_OBJECT *) gpu;
pCurObj = gpuw;
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkAllocMemory(VK_DEVICE device, const VK_MEMORY_ALLOC_INFO* pAllocInfo, VK_GPU_MEMORY* pMem)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkAllocMemory(VK_DEVICE device, const VkMemoryAllocInfo* pAllocInfo, VK_GPU_MEMORY* pMem)
{
char str[1024];
if (!pAllocInfo) {
sprintf(str, "Struct ptr parameter pAllocInfo to function AllocMemory is NULL.");
layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
- }
- else if (!vk_validate_vk_memory_alloc_info(pAllocInfo)) {
+ } else if (!vk_validate_vkmemoryallocinfo(pAllocInfo)) {
sprintf(str, "Parameter pAllocInfo to function AllocMemory contains an invalid value.");
layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
}
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBuffer(VK_DEVICE device, const VK_BUFFER_CREATE_INFO* pCreateInfo, VK_BUFFER* pBuffer)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBuffer(VK_DEVICE device, const VkBufferCreateInfo* pCreateInfo, VK_BUFFER* pBuffer)
{
char str[1024];
if (!pCreateInfo) {
sprintf(str, "Struct ptr parameter pCreateInfo to function CreateBuffer is NULL.");
layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
}
- else if (!vk_validate_vk_buffer_create_info(pCreateInfo)) {
+ else if (!vk_validate_vkbuffercreateinfo(pCreateInfo)) {
sprintf(str, "Parameter pCreateInfo to function CreateBuffer contains an invalid value.");
layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
}
return result;
}
-VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBufferView(VK_DEVICE device, const VK_BUFFER_VIEW_CREATE_INFO* pCreateInfo, VK_BUFFER_VIEW* pView)
+VK_LAYER_EXPORT VK_RESULT VKAPI vkCreateBufferView(VK_DEVICE device, const VkBufferViewCreateInfo* pCreateInfo, VK_BUFFER_VIEW* pView)
{
char str[1024];
if (!pCreateInfo) {
sprintf(str, "Struct ptr parameter pCreateInfo to function CreateBufferView is NULL.");
layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
}
- else if (!vk_validate_vk_buffer_view_create_info(pCreateInfo)) {
+ else if (!vk_validate_vkbufferviewcreateinfo(pCreateInfo)) {
sprintf(str, "Parameter pCreateInfo to function CreateBufferView contains an invalid value.");
layerCbMsg(VK_DBG_MSG_ERROR, VK_VALIDATION_LEVEL_0, NULL, 0, 1, "PARAMCHECK", str);
}
return count;
}
-static uint32_t loader_get_layer_libs(struct loader_icd *icd, uint32_t gpu_index, const VK_DEVICE_CREATE_INFO* pCreateInfo, struct layer_name_pair **ppLayerNames)
+static uint32_t loader_get_layer_libs(struct loader_icd *icd, uint32_t gpu_index, const VkDeviceCreateInfo* pCreateInfo, struct layer_name_pair **ppLayerNames)
{
static struct layer_name_pair layerNames[MAX_LAYER_LIBRARIES];
const char *lib_name = NULL;
}
}
-extern uint32_t loader_activate_layers(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo)
+extern uint32_t loader_activate_layers(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo)
{
uint32_t gpu_index;
uint32_t count;
}
LOADER_EXPORT VK_RESULT VKAPI vkCreateInstance(
- const VK_INSTANCE_CREATE_INFO* pCreateInfo,
+ const VkInstanceCreateInfo* pCreateInfo,
VK_INSTANCE* pInstance)
{
static LOADER_PLATFORM_THREAD_ONCE_DECLARATION(once_icd);
return loader_get_data(wrap->baseObject);
}
-extern uint32_t loader_activate_layers(VK_PHYSICAL_GPU gpu, const VK_DEVICE_CREATE_INFO* pCreateInfo);
+extern uint32_t loader_activate_layers(VK_PHYSICAL_GPU gpu, const VkDeviceCreateInfo* pCreateInfo);
#define MAX_LAYER_LIBRARIES 64
#endif /* LOADER_H */
def _get_printf_params(self, vk_type, name, output_param, cpp=False):
# TODO : Need ENUM and STRUCT checks here
if vk_helper.is_type(vk_type, 'enum'):#"_TYPE" in vk_type: # TODO : This should be generic ENUM check
- return ("%s", "string_%s(%s)" % (vk_type.strip('const ').strip('*'), name))
+ return ("%s", "string_%s(%s)" % (vk_type.replace('const ', '').strip('*'), name))
if "char*" == vk_type:
return ("%s", name)
if "uint64" in vk_type:
log_func_no_addr += '%s = address, ' % (p.name)
else:
log_func_no_addr += '%s = " << %s << ", ' % (p.name, pfi)
- if prev_count_name != '' and (prev_count_name.strip('Count')[1:] in p.name or 'slotCount' == prev_count_name):
+ if prev_count_name != '' and (prev_count_name.replace('Count', '')[1:] in p.name or 'slotCount' == prev_count_name):
sp_param_dict[pindex] = prev_count_name
elif 'pDescriptorSets' == p.name and proto.params[-1].name == 'pCount':
sp_param_dict[pindex] = '*pCount'
- elif 'Wsi' not in proto.name and vk_helper.is_type(p.ty.strip('*').strip('const '), 'struct'):
+ elif 'Wsi' not in proto.name and vk_helper.is_type(p.ty.strip('*').replace('const ', ''), 'struct'):
sp_param_dict[pindex] = 'index'
pindex += 1
if p.name.endswith('Count'):
log_func += '\n string tmp_str;'
for sp_index in sp_param_dict:
if 'index' == sp_param_dict[sp_index]:
- cis_print_func = 'vk_print_%s' % (proto.params[sp_index].ty.strip('const ').strip('*').lower())
+ cis_print_func = 'vk_print_%s' % (proto.params[sp_index].ty.replace('const ', '').strip('*').lower())
local_name = proto.params[sp_index].name
if '*' not in proto.params[sp_index].ty:
local_name = '&%s' % proto.params[sp_index].name
else: # We have a count value stored to iterate over an array
print_cast = ''
print_func = ''
- if vk_helper.is_type(proto.params[sp_index].ty.strip('*').strip('const '), 'struct'):
+ if vk_helper.is_type(proto.params[sp_index].ty.strip('*').replace('const ', ''), 'struct'):
print_cast = '&'
- print_func = 'vk_print_%s' % proto.params[sp_index].ty.strip('const ').strip('*').lower()
- #cis_print_func = 'tmp_str = vk_print_%s(&%s[i], " ");' % (proto.params[sp_index].ty.strip('const ').strip('*').lower(), proto.params[sp_index].name)
-# TODO : Need to display this address as a string
+ print_func = 'vk_print_%s' % proto.params[sp_index].ty.replace('const ', '').strip('*').lower()
else:
print_cast = ''
print_func = 'string_convert_helper'
decl = proto.c_func(prefix="vk", attr="VKAPI")
param0_name = proto.params[0].name
- p0_type = proto.params[0].ty.strip('*').strip('const ')
+ p0_type = proto.params[0].ty.strip('*').replace('const ', '')
create_line = ''
destroy_line = ''
funcs = []
create_line += ' }\n'
elif 'CreatePresentableImage' in proto.name:
create_line = ' loader_platform_thread_lock_mutex(&objLock);\n'
- create_line += ' ll_insert_obj((void*)*%s, %s);\n' % (proto.params[-2].name, obj_type_mapping[proto.params[-2].ty.strip('*').strip('const ')])
+ create_line += ' ll_insert_obj((void*)*%s, %s);\n' % (proto.params[-2].name, obj_type_mapping[proto.params[-2].ty.strip('*').replace('const ', '')])
create_line += ' ll_insert_obj((void*)*pMem, VK_OBJECT_TYPE_PRESENTABLE_IMAGE_MEMORY);\n'
- # create_line += ' ll_insert_obj((void*)*%s, VK_OBJECT_TYPE_PRESENTABLE_IMAGE_MEMORY);\n' % (obj_type_mapping[proto.params[-1].ty.strip('*').strip('const ')])
+ # create_line += ' ll_insert_obj((void*)*%s, VK_OBJECT_TYPE_PRESENTABLE_IMAGE_MEMORY);\n' % (obj_type_mapping[proto.params[-1].ty.strip('*').replace('const ', '')])
create_line += ' loader_platform_thread_unlock_mutex(&objLock);\n'
elif 'Create' in proto.name or 'Alloc' in proto.name:
create_line = ' loader_platform_thread_lock_mutex(&objLock);\n'
- create_line += ' ll_insert_obj((void*)*%s, %s);\n' % (proto.params[-1].name, obj_type_mapping[proto.params[-1].ty.strip('*').strip('const ')])
+ create_line += ' ll_insert_obj((void*)*%s, %s);\n' % (proto.params[-1].name, obj_type_mapping[proto.params[-1].ty.strip('*').replace('const ', '')])
create_line += ' loader_platform_thread_unlock_mutex(&objLock);\n'
if 'DestroyObject' in proto.name:
destroy_line = ' loader_platform_thread_lock_mutex(&objLock);\n'
(cur_char, targ_type) = line.strip().split(None, 1)
self.typedef_fwd_dict[base_type] = targ_type.strip(';')
self.typedef_rev_dict[targ_type.strip(';')] = base_type
+ #print("fwd_dict: %s = %s" % (base_type, targ_type))
elif parse_enum:
#if 'VK_MAX_ENUM' not in line and '{' not in line:
if True not in [ens in line for ens in ['{', 'VK_MAX_ENUM', '_RANGE']]:
self.struct_dict[struct_type][num]['ptr'] = False
if 'const' in member_type:
self.struct_dict[struct_type][num]['const'] = True
- member_type = member_type.strip('const').strip()
+ member_type = member_type.replace('const', '').strip()
else:
self.struct_dict[struct_type][num]['const'] = False
# TODO : There is a bug here where it seems that at the time we do this check,
sys.stdout.write(typedef_fwd_dict[struct_name])
sys.stdout.write(";\n\n")
+#
+def get_struct_name_from_struct_type(struct_type):
+ caps_struct_name = struct_type.replace("_STRUCTURE_TYPE", "")
+ # NOTE: These must stay in caps as they are looking at the VK_STRUCTURE_TYPE_*_CREATE_INFO
+ # and that has not changed to camel case
+ exceptions_list = ['VK_DEVICE_CREATE_INFO', 'VK_INSTANCE_CREATE_INFO', 'VK_LAYER_CREATE_INFO',
+ 'VK_MEMORY_ALLOC_INFO', 'VK_MEMORY_ALLOC_BUFFER_INFO', 'VK_MEMORY_ALLOC_IMAGE_INFO',
+ 'VK_BUFFER_CREATE_INFO', 'VK_BUFFER_VIEW_CREATE_INFO']
+ if caps_struct_name in exceptions_list:
+ char_idx = 0
+ struct_name = ''
+ for char in caps_struct_name:
+ if (0 == char_idx) or (caps_struct_name[char_idx-1] == '_'):
+ struct_name += caps_struct_name[char_idx]
+ elif (caps_struct_name[char_idx] == '_'):
+ pass
+ else:
+ struct_name += caps_struct_name[char_idx].lower()
+ char_idx += 1
+ else:
+ struct_name = caps_struct_name
+ return struct_name
+
# class for writing common file elements
# Here's how this class lays out a file:
# COPYRIGHT
class_num = 0
if "_STRUCTURE_TYPE" in e:
for v in sorted(enum_type_dict[e]):
- struct_name = v.replace("_STRUCTURE_TYPE", "")
+ struct_name = get_struct_name_from_struct_type(v)
class_name = self.get_class_name(struct_name)
instance_name = "swc%i" % class_num
dp_funcs.append(" case %s:\n {" % (v))
for e in enum_type_dict:
if "_STRUCTURE_TYPE" in e:
for v in sorted(enum_type_dict[e]):
- struct_name = v.replace("_STRUCTURE_TYPE", "")
+ struct_name = get_struct_name_from_struct_type(v)
print_func_name = self._get_sh_func_name(struct_name)
sh_funcs.append(' case %s:\n {' % (v))
sh_funcs.append(' return %s((%s*)pStruct, indent);' % (print_func_name, struct_name))
if 1 < stp_list[index]['full_type'].count('*'):
addr_char = ''
if (stp_list[index]['array']):
+ sh_funcs.append('/* A */');
if stp_list[index]['dyn_array']:
+ sh_funcs.append('/* AA */');
array_count = 'pStruct->%s' % (stp_list[index]['array_size'])
else:
+ sh_funcs.append('/* AB */');
array_count = '%s' % (stp_list[index]['array_size'])
sh_funcs.append('%sstp_strs[%u] = "";' % (indent, index))
if not idx_ss_decl:
+ sh_funcs.append('/* AC */');
sh_funcs.append('%sstringstream index_ss;' % (indent))
idx_ss_decl = True
sh_funcs.append('%sif (pStruct->%s) {' % (indent, stp_list[index]['name']))
sh_funcs.append('%sindex_ss.str("");' % (indent))
sh_funcs.append('%sindex_ss << i;' % (indent))
if not is_type(stp_list[index]['type'], 'struct'):
+ sh_funcs.append('/* AD */');
addr_char = ''
sh_funcs.append('%sss[%u] << %spStruct->%s[i];' % (indent, index, addr_char, stp_list[index]['name']))
sh_funcs.append('%sstp_strs[%u] += " " + prefix + "%s[" + index_ss.str() + "] = " + ss[%u].str() + "\\n";' % (indent, index, stp_list[index]['name'], index))
else:
+ sh_funcs.append('/* AD */');
sh_funcs.append('%sss[%u] << %spStruct->%s[i];' % (indent, index, addr_char, stp_list[index]['name']))
sh_funcs.append('%stmp_str = %s(%spStruct->%s[i], extra_indent);' % (indent, self._get_sh_func_name(stp_list[index]['type']), addr_char, stp_list[index]['name']))
if self.no_addr:
+ sh_funcs.append('/* ADA */');
sh_funcs.append('%sstp_strs[%u] += " " + prefix + "%s[" + index_ss.str() + "] (addr)\\n" + tmp_str;' % (indent, index, stp_list[index]['name']))
else:
+ sh_funcs.append('/* ADB */');
sh_funcs.append('%sstp_strs[%u] += " " + prefix + "%s[" + index_ss.str() + "] (" + ss[%u].str() + ")\\n" + tmp_str;' % (indent, index, stp_list[index]['name'], index))
indent = indent[4:]
sh_funcs.append('%s}' % (indent))
indent = indent[4:]
sh_funcs.append('%s}' % (indent))
elif (stp_list[index]['ptr']):
+ sh_funcs.append('/* B */');
sh_funcs.append(' if (pStruct->%s) {' % stp_list[index]['name'])
if 'pNext' == stp_list[index]['name']:
sh_funcs.append(' tmp_str = dynamic_display((void*)pStruct->pNext, prefix);')
sh_funcs.append(' else')
sh_funcs.append(' stp_strs[%u] = "";' % index)
else:
+ sh_funcs.append('/* C */');
sh_funcs.append(' tmp_str = %s(&pStruct->%s, extra_indent);' % (self._get_sh_func_name(stp_list[index]['type']), stp_list[index]['name']))
sh_funcs.append(' ss[%u] << %spStruct->%s;' % (index, addr_char, stp_list[index]['name']))
if self.no_addr:
for e in enum_type_dict:
if "_STRUCTURE_TYPE" in e:
for v in sorted(enum_type_dict[e]):
- struct_name = v.replace("_STRUCTURE_TYPE", "")
+ struct_name = get_struct_name_from_struct_type(v)
print_func_name = self._get_sh_func_name(struct_name)
sh_funcs.append(' case %s:\n {' % (v))
sh_funcs.append(' return %s((%s*)pStruct, indent);' % (print_func_name, struct_name))
for e in enum_type_dict:
if '_STRUCTURE_TYPE' in e:
for v in sorted(enum_type_dict[e]):
- struct_name = v.replace("_STRUCTURE_TYPE", "")
+ struct_name = get_struct_name_from_struct_type(v)
sh_funcs.append('%scase %s:' % (indent, v))
sh_funcs.append('%s{' % (indent))
indent += ' '
for e in enum_type_dict:
if "_STRUCTURE_TYPE" in e:
for v in sorted(enum_type_dict[e]):
- struct_name = v.replace("_STRUCTURE_TYPE", "")
+ struct_name = get_struct_name_from_struct_type(v)
print_func_name = self._get_gv_func_name(struct_name)
# TODO : Hand-coded fixes for some exceptions
#if 'VK_PIPELINE_CB_STATE_CREATE_INFO' in struct_name:
],
protos=[
Proto("VK_RESULT", "CreateInstance",
- [Param("const VK_INSTANCE_CREATE_INFO*", "pCreateInfo"),
+ [Param("const VkInstanceCreateInfo*", "pCreateInfo"),
Param("VK_INSTANCE*", "pInstance")]),
Proto("VK_RESULT", "DestroyInstance",
Proto("VK_RESULT", "CreateDevice",
[Param("VK_PHYSICAL_GPU", "gpu"),
- Param("const VK_DEVICE_CREATE_INFO*", "pCreateInfo"),
+ Param("const VkDeviceCreateInfo*", "pCreateInfo"),
Param("VK_DEVICE*", "pDevice")]),
Proto("VK_RESULT", "DestroyDevice",
Proto("VK_RESULT", "AllocMemory",
[Param("VK_DEVICE", "device"),
- Param("const VK_MEMORY_ALLOC_INFO*", "pAllocInfo"),
+ Param("const VkMemoryAllocInfo*", "pAllocInfo"),
Param("VK_GPU_MEMORY*", "pMem")]),
Proto("VK_RESULT", "FreeMemory",
Proto("VK_RESULT", "CreateBuffer",
[Param("VK_DEVICE", "device"),
- Param("const VK_BUFFER_CREATE_INFO*", "pCreateInfo"),
+ Param("const VkBufferCreateInfo*", "pCreateInfo"),
Param("VK_BUFFER*", "pBuffer")]),
Proto("VK_RESULT", "CreateBufferView",
[Param("VK_DEVICE", "device"),
- Param("const VK_BUFFER_VIEW_CREATE_INFO*", "pCreateInfo"),
+ Param("const VkBufferViewCreateInfo*", "pCreateInfo"),
Param("VK_BUFFER_VIEW*", "pView")]),
Proto("VK_RESULT", "CreateImage",