Skip to content

Commit

Permalink
Update Vulkan-Loader to 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-lunarg committed Dec 3, 2024
1 parent 3b83150 commit ce2d68b
Show file tree
Hide file tree
Showing 9 changed files with 432 additions and 32 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# ~~~
cmake_minimum_required(VERSION 3.17.2)

project(VULKAN_LOADER VERSION 1.3.302 LANGUAGES C)
project(VULKAN_LOADER VERSION 1.4.303 LANGUAGES C)

option(CODE_COVERAGE "Enable Code Coverage" OFF)
if (CODE_COVERAGE)
Expand Down
21 changes: 21 additions & 0 deletions loader/generated/vk_layer_dispatch_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,27 @@ typedef struct VkLayerDispatchTable_ {
PFN_vkGetDeviceImageMemoryRequirements GetDeviceImageMemoryRequirements;
PFN_vkGetDeviceImageSparseMemoryRequirements GetDeviceImageSparseMemoryRequirements;

// ---- Core Vulkan 1.4 commands
PFN_vkCmdSetLineStipple CmdSetLineStipple;
PFN_vkMapMemory2 MapMemory2;
PFN_vkUnmapMemory2 UnmapMemory2;
PFN_vkCmdBindIndexBuffer2 CmdBindIndexBuffer2;
PFN_vkGetRenderingAreaGranularity GetRenderingAreaGranularity;
PFN_vkGetDeviceImageSubresourceLayout GetDeviceImageSubresourceLayout;
PFN_vkGetImageSubresourceLayout2 GetImageSubresourceLayout2;
PFN_vkCmdPushDescriptorSet CmdPushDescriptorSet;
PFN_vkCmdPushDescriptorSetWithTemplate CmdPushDescriptorSetWithTemplate;
PFN_vkCmdSetRenderingAttachmentLocations CmdSetRenderingAttachmentLocations;
PFN_vkCmdSetRenderingInputAttachmentIndices CmdSetRenderingInputAttachmentIndices;
PFN_vkCmdBindDescriptorSets2 CmdBindDescriptorSets2;
PFN_vkCmdPushConstants2 CmdPushConstants2;
PFN_vkCmdPushDescriptorSet2 CmdPushDescriptorSet2;
PFN_vkCmdPushDescriptorSetWithTemplate2 CmdPushDescriptorSetWithTemplate2;
PFN_vkCopyMemoryToImage CopyMemoryToImage;
PFN_vkCopyImageToMemory CopyImageToMemory;
PFN_vkCopyImageToImage CopyImageToImage;
PFN_vkTransitionImageLayout TransitionImageLayout;

// ---- VK_KHR_swapchain extension commands
PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
Expand Down
137 changes: 118 additions & 19 deletions loader/generated/vk_loader_extensions.c

Large diffs are not rendered by default.

27 changes: 24 additions & 3 deletions loader/gpa_helper.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
*
* Copyright (c) 2015-2021 The Khronos Group Inc.
* Copyright (c) 2015-2021 Valve Corporation
* Copyright (c) 2015-2021 LunarG, Inc.
* Copyright (c) 2015-2024 The Khronos Group Inc.
* Copyright (c) 2015-2024 Valve Corporation
* Copyright (c) 2015-2024 LunarG, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -249,6 +249,27 @@ void *trampoline_get_proc_addr(struct loader_instance *inst, const char *funcNam
if (!strcmp(funcName, "vkGetDeviceImageMemoryRequirements")) return vkGetDeviceImageMemoryRequirements;
if (!strcmp(funcName, "vkGetDeviceImageSparseMemoryRequirements")) return vkGetDeviceImageSparseMemoryRequirements;

// Core 1.4 functions
if (!strcmp(funcName, "vkCmdSetLineStipple")) return vkCmdSetLineStipple;
if (!strcmp(funcName, "vkMapMemory2")) return vkMapMemory2;
if (!strcmp(funcName, "vkUnmapMemory2")) return vkUnmapMemory2;
if (!strcmp(funcName, "vkCmdBindIndexBuffer2")) return vkCmdBindIndexBuffer2;
if (!strcmp(funcName, "vkGetRenderingAreaGranularity")) return vkGetRenderingAreaGranularity;
if (!strcmp(funcName, "vkGetDeviceImageSubresourceLayout")) return vkGetDeviceImageSubresourceLayout;
if (!strcmp(funcName, "vkGetImageSubresourceLayout2")) return vkGetImageSubresourceLayout2;
if (!strcmp(funcName, "vkCmdPushDescriptorSet")) return vkCmdPushDescriptorSet;
if (!strcmp(funcName, "vkCmdPushDescriptorSetWithTemplate")) return vkCmdPushDescriptorSetWithTemplate;
if (!strcmp(funcName, "vkCmdSetRenderingAttachmentLocations")) return vkCmdSetRenderingAttachmentLocations;
if (!strcmp(funcName, "vkCmdSetRenderingInputAttachmentIndices")) return vkCmdSetRenderingInputAttachmentIndices;
if (!strcmp(funcName, "vkCmdBindDescriptorSets2")) return vkCmdBindDescriptorSets2;
if (!strcmp(funcName, "vkCmdPushConstants2")) return vkCmdPushConstants2;
if (!strcmp(funcName, "vkCmdPushDescriptorSet2")) return vkCmdPushDescriptorSet2;
if (!strcmp(funcName, "vkCmdPushDescriptorSetWithTemplate2")) return vkCmdPushDescriptorSetWithTemplate2;
if (!strcmp(funcName, "vkCopyMemoryToImage")) return vkCopyMemoryToImage;
if (!strcmp(funcName, "vkCopyImageToMemory")) return vkCopyImageToMemory;
if (!strcmp(funcName, "vkCopyImageToImage")) return vkCopyImageToImage;
if (!strcmp(funcName, "vkTransitionImageLayout")) return vkTransitionImageLayout;

// Instance extensions
void *addr;
if (debug_extensions_InstanceGpa(inst, funcName, &addr)) return addr;
Expand Down
4 changes: 2 additions & 2 deletions loader/loader.rc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "winres.h"

// All set through CMake
#define VER_FILE_VERSION 1, 3, 302, 0
#define VER_FILE_DESCRIPTION_STR "1.3.302.Dev Build"
#define VER_FILE_VERSION 1, 4, 303, 0
#define VER_FILE_DESCRIPTION_STR "1.4.303.Dev Build"
#define VER_FILE_VERSION_STR "Vulkan Loader - Dev Build"
#define VER_COPYRIGHT_STR "Copyright (C) 2015-2024"

Expand Down
239 changes: 239 additions & 0 deletions loader/trampoline.c
Original file line number Diff line number Diff line change
Expand Up @@ -3586,3 +3586,242 @@ LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit2(VkQueue queue, uint3
}
return disp->QueueSubmit2(queue, submitCount, pSubmits, fence);
}

// ---- Vulkan core 1.4 trampolines

// Instance

// Device

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetRenderingAreaGranularity(VkDevice device,
const VkRenderingAreaInfo *pRenderingAreaInfo,
VkExtent2D *pGranularity) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkGetRenderingAreaGranularity: Invalid device "
"[VUID-vkGetRenderingAreaGranularity-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->GetRenderingAreaGranularity(device, pRenderingAreaInfo, pGranularity);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSet(VkCommandBuffer commandBuffer,
VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
uint32_t set, uint32_t descriptorWriteCount,
const VkWriteDescriptorSet *pDescriptorWrites) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdPushDescriptorSet: Invalid commandBuffer "
"[VUID-vkCmdPushDescriptorSet-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdPushDescriptorSet(commandBuffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate(VkCommandBuffer commandBuffer,
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
VkPipelineLayout layout, uint32_t set,
const void *pData) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdPushDescriptorSetWithTemplate: Invalid commandBuffer "
"[VUID-vkCmdPushDescriptorSetWithTemplate-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdPushDescriptorSetWithTemplate(commandBuffer, descriptorUpdateTemplate, layout, set, pData);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStipple(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor,
uint16_t lineStipplePattern) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdSetLineStipple: Invalid commandBuffer "
"[VUID-vkCmdSetLineStipple-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdSetLineStipple(commandBuffer, lineStippleFactor, lineStipplePattern);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer2(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset,
VkDeviceSize size, VkIndexType indexType) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdBindIndexBuffer2: Invalid commandBuffer "
"[VUID-vkCmdBindIndexBuffer2-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdBindIndexBuffer2(commandBuffer, buffer, offset, size, indexType);
}

LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCopyMemoryToImage(VkDevice device,
const VkCopyMemoryToImageInfo *pCopyMemoryToImageInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCopyMemoryToImage: Invalid device "
"[VUID-vkCopyMemoryToImage-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
return disp->CopyMemoryToImage(device, pCopyMemoryToImageInfo);
}

LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCopyImageToMemory(VkDevice device,
const VkCopyImageToMemoryInfo *pCopyImageToMemoryInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCopyImageToMemory: Invalid device "
"[VUID-vkCopyImageToMemory-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
return disp->CopyImageToMemory(device, pCopyImageToMemoryInfo);
}

LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCopyImageToImage(VkDevice device,
const VkCopyImageToImageInfo *pCopyImageToImageInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCopyImageToImage: Invalid device "
"[VUID-vkCopyImageToImage-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
return disp->CopyImageToImage(device, pCopyImageToImageInfo);
}

LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkTransitionImageLayout(VkDevice device, uint32_t transitionCount,
const VkHostImageLayoutTransitionInfo *pTransitions) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkTransitionImageLayout: Invalid device "
"[VUID-vkTransitionImageLayout-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
return disp->TransitionImageLayout(device, transitionCount, pTransitions);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageSubresourceLayout(VkDevice device,
const VkDeviceImageSubresourceInfo *pInfo,
VkSubresourceLayout2 *pLayout) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkGetDeviceImageSubresourceLayout: Invalid device "
"[VUID-vkGetDeviceImageSubresourceLayout-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->GetDeviceImageSubresourceLayout(device, pInfo, pLayout);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout2(VkDevice device, VkImage image,
const VkImageSubresource2 *pSubresource,
VkSubresourceLayout2 *pLayout) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkGetImageSubresourceLayout2: Invalid device "
"[VUID-vkGetImageSubresourceLayout2-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->GetImageSubresourceLayout2(device, image, pSubresource, pLayout);
}

LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkMapMemory2(VkDevice device, const VkMemoryMapInfo *pMemoryMapInfo, void **ppData) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkMapMemory2: Invalid device "
"[VUID-vkMapMemory2-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
return disp->MapMemory2(device, pMemoryMapInfo, ppData);
}

LOADER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkUnmapMemory2(VkDevice device, const VkMemoryUnmapInfo *pMemoryUnmapInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(device);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkUnmapMemory2: Invalid device "
"[VUID-vkUnmapMemory2-device-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
return disp->UnmapMemory2(device, pMemoryUnmapInfo);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets2(VkCommandBuffer commandBuffer,
const VkBindDescriptorSetsInfo *pBindDescriptorSetsInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdBindDescriptorSets2: Invalid commandBuffer "
"[VUID-vkCmdBindDescriptorSets2-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdBindDescriptorSets2(commandBuffer, pBindDescriptorSetsInfo);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants2(VkCommandBuffer commandBuffer,
const VkPushConstantsInfo *pPushConstantsInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdPushConstants2: Invalid commandBuffer "
"[VUID-vkCmdPushConstants2-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdPushConstants2(commandBuffer, pPushConstantsInfo);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSet2(VkCommandBuffer commandBuffer,
const VkPushDescriptorSetInfo *pPushDescriptorSetInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdPushDescriptorSet2: Invalid commandBuffer "
"[VUID-vkCmdPushDescriptorSet2-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdPushDescriptorSet2(commandBuffer, pPushDescriptorSetInfo);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate2(
VkCommandBuffer commandBuffer, const VkPushDescriptorSetWithTemplateInfo *pPushDescriptorSetWithTemplateInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdPushDescriptorSetWithTemplate2: Invalid commandBuffer "
"[VUID-vkCmdPushDescriptorSetWithTemplate2-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdPushDescriptorSetWithTemplate2(commandBuffer, pPushDescriptorSetWithTemplateInfo);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL
vkCmdSetRenderingAttachmentLocations(VkCommandBuffer commandBuffer, const VkRenderingAttachmentLocationInfo *pLocationInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdSetRenderingAttachmentLocations: Invalid commandBuffer "
"[VUID-vkCmdSetRenderingAttachmentLocations-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdSetRenderingAttachmentLocations(commandBuffer, pLocationInfo);
}

LOADER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdSetRenderingInputAttachmentIndices(
VkCommandBuffer commandBuffer, const VkRenderingInputAttachmentIndexInfo *pInputAttachmentIndexInfo) {
const VkLayerDispatchTable *disp = loader_get_dispatch(commandBuffer);
if (NULL == disp) {
loader_log(NULL, VULKAN_LOADER_FATAL_ERROR_BIT | VULKAN_LOADER_ERROR_BIT | VULKAN_LOADER_VALIDATION_BIT, 0,
"vkCmdSetRenderingInputAttachmentIndices: Invalid commandBuffer "
"[VUID-vkCmdSetRenderingInputAttachmentIndices-commandBuffer-parameter]");
abort(); /* Intentionally fail so user can correct issue. */
}
disp->CmdSetRenderingInputAttachmentIndices(commandBuffer, pInputAttachmentIndexInfo);
}
Loading

0 comments on commit ce2d68b

Please sign in to comment.