nngn
Loading...
Searching...
No Matches
types.h File Reference
#include "os/platform.h"
#include "utils/macros.h"
#include "utils/utils.h"
#include "vulkan.h"
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  nngn
 
namespace  nngn::detail
 

Macros

#define NNGN_VK_TYPES(f)
 X-macro that operates on Vulkan types.
 
#define C(x, _)
 
#define X(x, n, c)   c(C, x, n)
 
#define C(x, n)
 
#define X(x, n, c)   c(C, x, n)
 
#define X(x, n, _)
 

Typedefs

template<typename T >
using nngn::vk_create_info_type
 Maps types to *CretaeInfo structures.
 

Functions

 nngn::detail::NNGN_APPLY2 (C, VkBuffer, BUFFER) NNGN_IGNORE2(C
 
COMMAND_BUFFER nngn::detail::NNGN_APPLY2 (C, VkCommandPool, COMMAND_POOL) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL nngn::detail::NNGN_IGNORE2 (C, VkDescriptorSet, DESCRIPTOR_SET) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT nngn::detail::NNGN_IGNORE2 (C, VkDeviceMemory, DEVICE_MEMORY) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE nngn::detail::NNGN_APPLY2 (C, VkFramebuffer, FRAMEBUFFER) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE nngn::detail::NNGN_APPLY2 (C, VkImageView, IMAGE_VIEW) NNGN_IGNORE2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE nngn::detail::NNGN_IGNORE2 (C, VkQueue, QUEUE) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE PIPELINE_CACHE nngn::detail::NNGN_APPLY2 (C, VkPipelineLayout, PIPELINE_LAYOUT) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE PIPELINE_CACHE RENDER_PASS nngn::detail::NNGN_APPLY2 (C, VkSampler, SAMPLER) NNGN_APPLY2(C
 
 nngn::NNGN_APPLY2 (C, VkBuffer, BUFFER) NNGN_IGNORE2(C
 
COMMAND_BUFFER nngn::NNGN_APPLY2 (C, VkCommandPool, COMMAND_POOL) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL nngn::NNGN_IGNORE2 (C, VkDescriptorSet, DESCRIPTOR_SET) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT nngn::NNGN_IGNORE2 (C, VkDeviceMemory, DEVICE_MEMORY) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE nngn::NNGN_APPLY2 (C, VkFramebuffer, FRAMEBUFFER) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE nngn::NNGN_APPLY2 (C, VkImageView, IMAGE_VIEW) NNGN_IGNORE2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE nngn::NNGN_IGNORE2 (C, VkQueue, QUEUE) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE PIPELINE_CACHE nngn::NNGN_APPLY2 (C, VkPipelineLayout, PIPELINE_LAYOUT) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE PIPELINE_CACHE RENDER_PASS nngn::NNGN_APPLY2 (C, VkSampler, SAMPLER) NNGN_APPLY2(C
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE PIPELINE_CACHE RENDER_PASS SEMAPHORE nngn::NNGN_APPLY2 (C, VkShaderModule, SHADER_MODULE) template<> inline const expr auto vk_obj_type< VkBuffer >
 

Variables

template<typename T >
constexpr empty nngn::vk_struct_type = {}
 Maps types to VkStructureType values.
 
template<typename T >
constexpr empty nngn::vk_obj_type = {}
 Maps types to VkObjectType values.
 
 nngn::detail::VkCommandBuffer
 
COMMAND_BUFFER nngn::detail::VkDescriptorPool
 
COMMAND_BUFFER DESCRIPTOR_POOL nngn::detail::VkDescriptorSetLayout
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT nngn::detail::VkFence
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE nngn::detail::VkImage
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE nngn::detail::VkPipeline
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE nngn::detail::VkPipelineCache
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE PIPELINE_CACHE nngn::detail::VkRenderPass
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE PIPELINE_CACHE RENDER_PASS nngn::detail::VkSemaphore
 
 nngn::VkCommandBuffer
 
COMMAND_BUFFER nngn::VkDescriptorPool
 
COMMAND_BUFFER DESCRIPTOR_POOL nngn::VkDescriptorSetLayout
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT nngn::VkFence
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE nngn::VkImage
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE nngn::VkPipeline
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE nngn::VkPipelineCache
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE PIPELINE_CACHE nngn::VkRenderPass
 
COMMAND_BUFFER DESCRIPTOR_POOL DESCRIPTOR_SET_LAYOUT FENCE IMAGE PIPELINE PIPELINE_CACHE RENDER_PASS nngn::VkSemaphore
 
template<>
constexpr auto nngn::vk_obj_type< VkCommandBuffer > = VK_OBJECT_TYPE_COMMAND_BUFFER
 
template<>
constexpr auto nngn::vk_obj_type< VkCommandPool > = VK_OBJECT_TYPE_COMMAND_POOL
 
template<>
constexpr auto nngn::vk_obj_type< VkDescriptorPool > = VK_OBJECT_TYPE_DESCRIPTOR_POOL
 
template<>
constexpr auto nngn::vk_obj_type< VkDescriptorSet > = VK_OBJECT_TYPE_DESCRIPTOR_SET
 
template<>
constexpr auto nngn::vk_obj_type< VkDescriptorSetLayout > = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT
 
template<>
constexpr auto nngn::vk_obj_type< VkDeviceMemory > = VK_OBJECT_TYPE_DEVICE_MEMORY
 
template<>
constexpr auto nngn::vk_obj_type< VkFence > = VK_OBJECT_TYPE_FENCE
 
template<>
constexpr auto nngn::vk_obj_type< VkFramebuffer > = VK_OBJECT_TYPE_FRAMEBUFFER
 
template<>
constexpr auto nngn::vk_obj_type< VkImage > = VK_OBJECT_TYPE_IMAGE
 
template<>
constexpr auto nngn::vk_obj_type< VkImageView > = VK_OBJECT_TYPE_IMAGE_VIEW
 
template<>
constexpr auto nngn::vk_obj_type< VkPipeline > = VK_OBJECT_TYPE_PIPELINE
 
template<>
constexpr auto nngn::vk_obj_type< VkQueue > = VK_OBJECT_TYPE_QUEUE
 
template<>
constexpr auto nngn::vk_obj_type< VkPipelineCache > = VK_OBJECT_TYPE_PIPELINE_CACHE
 
template<>
constexpr auto nngn::vk_obj_type< VkPipelineLayout > = VK_OBJECT_TYPE_PIPELINE_LAYOUT
 
template<>
constexpr auto nngn::vk_obj_type< VkRenderPass > = VK_OBJECT_TYPE_RENDER_PASS
 
template<>
constexpr auto nngn::vk_obj_type< VkSampler > = VK_OBJECT_TYPE_SAMPLER
 
template<>
constexpr auto nngn::vk_obj_type< VkSemaphore > = VK_OBJECT_TYPE_SEMAPHORE
 
template<>
constexpr auto nngn::vk_obj_type< VkShaderModule > = VK_OBJECT_TYPE_SHADER_MODULE
 

Macro Definition Documentation

◆ C [1/2]

#define C ( x,
_ )
Value:
template<> struct vk_create_info_type_impl<x> \
{ using type = x ## CreateInfo; };

◆ C [2/2]

#define C ( x,
n )
Value:
template<> inline constexpr auto vk_struct_type<x> = \
VK_STRUCTURE_TYPE_ ## n ## _CREATE_INFO;
local n
Definition dump_lights.lua:5

◆ NNGN_VK_TYPES

#define NNGN_VK_TYPES ( f)
Value:
f(VkBuffer, BUFFER, NNGN_APPLY2) \
f(VkCommandBuffer, COMMAND_BUFFER, NNGN_IGNORE2) \
f(VkCommandPool, COMMAND_POOL, NNGN_APPLY2) \
f(VkDescriptorPool, DESCRIPTOR_POOL, NNGN_APPLY2) \
f(VkDescriptorSet, DESCRIPTOR_SET, NNGN_IGNORE2) \
f(VkDescriptorSetLayout, DESCRIPTOR_SET_LAYOUT, NNGN_APPLY2) \
f(VkDeviceMemory, DEVICE_MEMORY, NNGN_IGNORE2) \
f(VkFence, FENCE, NNGN_APPLY2) \
f(VkFramebuffer, FRAMEBUFFER, NNGN_APPLY2) \
f(VkImage, IMAGE, NNGN_APPLY2) \
f(VkImageView, IMAGE_VIEW, NNGN_APPLY2) \
f(VkPipeline, PIPELINE, NNGN_IGNORE2) \
f(VkQueue, QUEUE, NNGN_IGNORE2) \
f(VkPipelineCache, PIPELINE_CACHE, NNGN_APPLY2) \
f(VkPipelineLayout, PIPELINE_LAYOUT, NNGN_APPLY2) \
f(VkRenderPass, RENDER_PASS, NNGN_APPLY2) \
f(VkSampler, SAMPLER, NNGN_APPLY2) \
f(VkSemaphore, SEMAPHORE, NNGN_APPLY2) \
f(VkShaderModule, SHADER_MODULE, NNGN_APPLY2)
#define NNGN_APPLY2(f, x0, x1)
Definition macros.h:5
#define NNGN_IGNORE2(f, x0, x1)
Definition macros.h:7
local function f()) end

X-macro that operates on Vulkan types.

Fields: Vulkan type, enum name fragment, create info function.

◆ X [1/3]

#define X ( x,
n,
_ )
Value:
template<> inline constexpr auto vk_obj_type<x> = \
VK_OBJECT_TYPE_ ## n;

◆ X [2/3]

#define X ( x,
n,
c )   c(C, x, n)

◆ X [3/3]

#define X ( x,
n,
c )   c(C, x, n)