1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2024-12-01 13:24:20 +01:00
rpi-vk-driver/driver/vkExt.h

63 lines
1.9 KiB
C
Raw Normal View History

2018-05-07 17:13:39 +02:00
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
//we need something like the other platforms to create surfaces on the RPI
//so I created this little "extension"
//full spec in this file ;)
typedef enum VkRpiSurfaceCreateFlagsEXT {
2018-05-07 17:13:39 +02:00
//reserved
VK_RPI_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkRpiSurfaceCreateFlagsEXT;
2018-05-07 17:13:39 +02:00
typedef enum VkRpiAssemblyTypeEXT {
VK_RPI_ASSEMBLY_TYPE_COORDINATE = 0,
VK_RPI_ASSEMBLY_TYPE_VERTEX = 1,
VK_RPI_ASSEMBLY_TYPE_FRAGMENT = 2,
VK_RPI_ASSEMBLY_TYPE_COMPUTE = 3,
VK_RPI_ASSEMBLY_TYPE_MAX,
} VkRpiAssemblyTypeKHR;
typedef struct VkRpiSurfaceCreateInfoEXT {
2018-05-13 20:29:47 +02:00
VkStructureType sType;
const void* pNext;
VkRpiSurfaceCreateFlagsEXT flags; //reserved
2018-05-13 20:29:47 +02:00
//maybe include some other stuff dunno
} VkRpiSurfaceCreateInfoEXT;
2018-05-07 17:13:39 +02:00
typedef struct VkRpiShaderModuleAssemblyCreateInfoEXT {
VkStructureType sType;
const void* pNext;
char** asmStrings;
uint32_t* descriptorBindings;
uint32_t* descriptorSets;
VkDescriptorType* descriptorTypes;
uint32_t* descriptorCounts;
uint32_t* descriptorArrayElems;
uint32_t* numDescriptorBindings;
} VkRpiShaderModuleAssemblyCreateInfoEXT;
2018-05-12 14:24:25 +02:00
//extension name something like: VK_KHR_rpi_surface
//extension that allows developers to create a surface to render to on Raspbian Stretch Lite
VkResult vkCreateRpiSurfaceEXT(
2018-05-13 20:29:47 +02:00
VkInstance instance,
const VkRpiSurfaceCreateInfoEXT* pCreateInfo,
2018-05-13 20:29:47 +02:00
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
2018-05-07 17:13:39 +02:00
//extension that allows developers to submit QPU assembly directly and thus hand optimise code
VkResult vkCreateShaderModuleFromRpiAssemblyEXT(
VkDevice device,
VkRpiShaderModuleAssemblyCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkShaderModule* pShaderModule
);
2018-05-07 17:13:39 +02:00
#ifdef __cplusplus
}
#endif