|
KiCad PCB EDA Suite
|
#include <rhi/rhi_vulkan_device.h>#include <rhi/rhi_present_mode.h>#include <wx/dynlib.h>#include <vulkan/vulkan.h>#include <trace_helpers.h>#include <core/profile.h>#include <array>#include <cstdio>#include <cstdlib>#include <vk_mem_alloc.h>#include <wx/log.h>#include <magic_enum.hpp>#include <present_blit_vert.h>#include <present_blit_frag.h>#include <atomic>#include <chrono>#include <cstring>#include <deque>#include <mutex>#include <optional>#include <string>#include <thread>#include <unordered_map>#include <vector>Go to the source code of this file.
Macros | |
| #define | VMA_STATIC_VULKAN_FUNCTIONS 0 |
| #define | VMA_DYNAMIC_VULKAN_FUNCTIONS 1 |
| #define | LOAD_INST_FN(fn) |
| #define | LOAD_DEV_FN(fn) |
Functions | |
| static const char * | VkResultToString (VkResult aResult) |
| static long long | VkElapsedMs (PROF_TIMER &aTimer) |
| static VKAPI_ATTR VkBool32 VKAPI_CALL | VulkanDebugCallback (VkDebugUtilsMessageSeverityFlagBitsEXT aSeverity, VkDebugUtilsMessageTypeFlagsEXT aType, const VkDebugUtilsMessengerCallbackDataEXT *aCallbackData, void *aUserData) |
| static VkFormat | RhiDefaultDepthFormat () |
| static VkBlendFactor | TranslateBlendFactor (RHI_BLEND_FACTOR factor) |
| static VkBlendOp | TranslateBlendOp (RHI_BLEND_OP op) |
| static VkCompareOp | TranslateCompareOp (RHI_COMPARE_OP op) |
| static VkFormat | TranslateVertexFormat (RHI_VERTEX_FORMAT format) |
| static VkPrimitiveTopology | TranslateTopology (RHI_PRIMITIVE_TOPOLOGY topology) |
| static VkDynamicState | TranslateDynamicState (RHI_DYNAMIC_STATE state) |
| static VkAccessFlags | LayoutToAccessMask (VkImageLayout layout) |
| static VkImageMemoryBarrier | imageBarrier (VkImage aImage, VkImageAspectFlags aAspect, VkImageLayout aOld, VkImageLayout aNew, VkAccessFlags aSrcAccess, VkAccessFlags aDstAccess) |
| static VkDescriptorType | TranslateBindingType (RHI_BINDING_TYPE type) |
| static VkShaderStageFlags | TranslateShaderStage (RHI_SHADER_STAGE stages) |
| static VK_ATTACHMENT | presentAttachment (VkFormat aFormat) |
| static VkAttachmentLoadOp | TranslateLoadOp (RHI_LOAD_OP op) |
| static VkAttachmentStoreOp | TranslateStoreOp (RHI_STORE_OP op) |
| static VkExtent2D | swapchainExtent (const VkSurfaceCapabilitiesKHR &aCaps, uint32_t aWidth, uint32_t aHeight) |
| std::unique_ptr< RHI_DEVICE > | RhiCreateVulkanDevice (bool enableValidation) |
| Create the Vulkan device, loading libvulkan at run time. | |
| #define LOAD_DEV_FN | ( | fn | ) |
Referenced by RHI_VULKAN_DEVICE::LoadDeviceFunctions().
| #define LOAD_INST_FN | ( | fn | ) |
Referenced by RHI_VULKAN_DEVICE::CreateVkInstance().
| #define VMA_DYNAMIC_VULKAN_FUNCTIONS 1 |
Definition at line 55 of file rhi_vulkan_device.cpp.
| #define VMA_STATIC_VULKAN_FUNCTIONS 0 |
Definition at line 54 of file rhi_vulkan_device.cpp.
|
static |
Definition at line 2532 of file rhi_vulkan_device.cpp.
Referenced by RHI_VULKAN_DEVICE::CopyFramebufferDepth(), RHI_VULKAN_DEVICE::Present(), RHI_VULKAN_DEVICE::ReadbackFramebufferPixels(), and RHI_VULKAN_DEVICE::TransitionTexture().
|
static |
Definition at line 2515 of file rhi_vulkan_device.cpp.
Referenced by RHI_VULKAN_DEVICE::TransitionTexture().
|
static |
Definition at line 2581 of file rhi_vulkan_device.cpp.
Referenced by RHI_VULKAN_DEVICE::CreateSwapchainResources(), and RHI_VULKAN_DEVICE::EnsurePresentBlit().
| std::unique_ptr< RHI_DEVICE > RhiCreateVulkanDevice | ( | bool | enableValidation = false | ) |
Create the Vulkan device, loading libvulkan at run time.
Returns nullptr if Vulkan is not available or no suitable GPU is found.
Definition at line 6006 of file rhi_vulkan_device.cpp.
Referenced by RhiCreatePlatformDevice().
|
static |
Definition at line 1328 of file rhi_vulkan_device.cpp.
Referenced by RHI_VULKAN_DEVICE::CreateFramebuffer(), RHI_VULKAN_DEVICE::CreatePipeline(), and RHI_VULKAN_DEVICE::CreateRenderPass().
|
static |
Definition at line 4816 of file rhi_vulkan_device.cpp.
Referenced by RHI_VULKAN_DEVICE::CreateSwapchain(), and RHI_VULKAN_DEVICE::ResizeSwapchain().
|
static |
Definition at line 2549 of file rhi_vulkan_device.cpp.
References COMBINED_TEXTURE_SAMPLER, STORAGE_BUFFER, STORAGE_BUFFER_READONLY, and UNIFORM_BUFFER.
Referenced by RHI_VULKAN_DEVICE::CreateBindGroup(), and RHI_VULKAN_DEVICE::createSetLayout().
|
static |
Definition at line 1345 of file rhi_vulkan_device.cpp.
References ONE, ONE_MINUS_SRC_ALPHA, SRC_ALPHA, and ZERO.
Referenced by RHI_VULKAN_DEVICE::CreatePipeline().
|
static |
Definition at line 1359 of file rhi_vulkan_device.cpp.
References ADD.
Referenced by RHI_VULKAN_DEVICE::CreatePipeline().
|
static |
Definition at line 1370 of file rhi_vulkan_device.cpp.
References LESS, and LESS_EQUAL.
Referenced by RHI_VULKAN_DEVICE::CreatePipeline().
|
static |
Definition at line 1409 of file rhi_vulkan_device.cpp.
References SCISSOR, and VIEWPORT.
Referenced by RHI_VULKAN_DEVICE::CreatePipeline().
|
static |
Definition at line 3706 of file rhi_vulkan_device.cpp.
References CLEAR, DONT_CARE, and LOAD.
Referenced by RHI_VULKAN_DEVICE::CreateRenderPass().
|
static |
Definition at line 2563 of file rhi_vulkan_device.cpp.
References COMPUTE, FRAGMENT, NONE, and VERTEX.
Referenced by RHI_VULKAN_DEVICE::createSetLayout().
|
static |
Definition at line 3719 of file rhi_vulkan_device.cpp.
References DONT_CARE, and STORE.
Referenced by RHI_VULKAN_DEVICE::CreateRenderPass().
|
static |
Definition at line 1398 of file rhi_vulkan_device.cpp.
References TRIANGLE_LIST.
Referenced by RHI_VULKAN_DEVICE::CreatePipeline().
|
static |
Definition at line 1382 of file rhi_vulkan_device.cpp.
References FLOAT16X2, FLOAT16X4, FLOAT32X2, FLOAT32X4, UINT16X2, and UINT8X4_NORM.
Referenced by RHI_VULKAN_DEVICE::CreatePipeline().
|
static |
Definition at line 106 of file rhi_vulkan_device.cpp.
References PROF_TIMER::msecs().
Referenced by RHI_VULKAN_DEVICE::Present().
|
static |
Definition at line 77 of file rhi_vulkan_device.cpp.
Referenced by RHI_VULKAN_DEVICE::CreatePipeline(), RHI_VULKAN_DEVICE::CreateShader(), RHI_VULKAN_DEVICE::createVkSwapchain(), and RHI_VULKAN_DEVICE::Present().
|
static |
Definition at line 1775 of file rhi_vulkan_device.cpp.
References traceRhi.
Referenced by RHI_VULKAN_DEVICE::CreateVkInstance().