Classes | Macros | Functions | Variables
tests/vulkan.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#include <signal.h>
#include <GLFW/glfw3.h>
Include dependency graph for tests/vulkan.c:

Go to the source code of this file.

Classes

struct  demo
 
struct  SwapchainBuffers
 
struct  texture_object
 

Macros

#define APP_LONG_NAME   "The Vulkan Triangle Demo Program"
 
#define APP_SHORT_NAME   "tri"
 
#define ARRAY_SIZE(a)   (sizeof(a) / sizeof(a[0]))
 
#define DEMO_TEXTURE_COUNT   1
 
#define ERR_EXIT(err_msg, err_class)
 
#define GET_DEVICE_PROC_ADDR(dev, entrypoint)
 
#define GET_INSTANCE_PROC_ADDR(inst, entrypoint)
 
#define GLFW_INCLUDE_NONE
 
#define GLFW_INCLUDE_VULKAN
 
#define U_ASSERT_ONLY
 
#define VERTEX_BUFFER_BIND_ID   0
 

Functions

VKAPI_ATTR VkBool32 VKAPI_CALL BreakCallback (VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg, void *pUserData)
 
VKAPI_ATTR VkBool32 VKAPI_CALL dbgFunc (VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, uint64_t srcObject, size_t location, int32_t msgCode, const char *pLayerPrefix, const char *pMsg, void *pUserData)
 
static VkBool32 demo_check_layers (uint32_t check_count, const char **check_names, uint32_t layer_count, VkLayerProperties *layers)
 
static void demo_cleanup (struct demo *demo)
 
static void demo_create_window (struct demo *demo)
 
static void demo_destroy_texture_image (struct demo *demo, struct texture_object *tex_obj)
 
static void demo_draw (struct demo *demo)
 
static void demo_draw_build_cmd (struct demo *demo)
 
static void demo_error_callback (int error, const char *description)
 
static void demo_flush_init_cmd (struct demo *demo)
 
static void demo_init (struct demo *demo, const int argc, const char *argv[])
 
static void demo_init_connection (struct demo *demo)
 
static void demo_init_device (struct demo *demo)
 
static void demo_init_vk (struct demo *demo)
 
static void demo_init_vk_swapchain (struct demo *demo)
 
static void demo_key_callback (GLFWwindow *window, int key, int scancode, int action, int mods)
 
static void demo_prepare (struct demo *demo)
 
static void demo_prepare_buffers (struct demo *demo)
 
static void demo_prepare_depth (struct demo *demo)
 
static void demo_prepare_descriptor_layout (struct demo *demo)
 
static void demo_prepare_descriptor_pool (struct demo *demo)
 
static void demo_prepare_descriptor_set (struct demo *demo)
 
static void demo_prepare_framebuffers (struct demo *demo)
 
static VkShaderModule demo_prepare_fs (struct demo *demo)
 
static void demo_prepare_pipeline (struct demo *demo)
 
static void demo_prepare_render_pass (struct demo *demo)
 
static VkShaderModule demo_prepare_shader_module (struct demo *demo, const void *code, size_t size)
 
static void demo_prepare_texture_image (struct demo *demo, const uint32_t *tex_colors, struct texture_object *tex_obj, VkImageTiling tiling, VkImageUsageFlags usage, VkFlags required_props)
 
static void demo_prepare_textures (struct demo *demo)
 
static void demo_prepare_vertices (struct demo *demo)
 
static VkShaderModule demo_prepare_vs (struct demo *demo)
 
static void demo_refresh_callback (GLFWwindow *window)
 
static void demo_resize (struct demo *demo)
 
static void demo_resize_callback (GLFWwindow *window, int width, int height)
 
static void demo_run (struct demo *demo)
 
static void demo_set_image_layout (struct demo *demo, VkImage image, VkImageAspectFlags aspectMask, VkImageLayout old_image_layout, VkImageLayout new_image_layout, VkAccessFlagBits srcAccessMask)
 
int main (const int argc, const char *argv[])
 
static bool memory_type_from_properties (struct demo *demo, uint32_t typeBits, VkFlags requirements_mask, uint32_t *typeIndex)
 

Variables

static const char fragShaderCode []
 
static int validation_error = 0
 
static const char vertShaderCode []
 

Macro Definition Documentation

#define APP_LONG_NAME   "The Vulkan Triangle Demo Program"

Definition at line 51 of file tests/vulkan.c.

#define APP_SHORT_NAME   "tri"

Definition at line 50 of file tests/vulkan.c.

#define ARRAY_SIZE (   a)    (sizeof(a) / sizeof(a[0]))

Definition at line 53 of file tests/vulkan.c.

#define DEMO_TEXTURE_COUNT   1

Definition at line 48 of file tests/vulkan.c.

#define ERR_EXIT (   err_msg,
  err_class 
)
Value:
do { \
printf(err_msg); \
fflush(stdout); \
exit(1); \
} while (0)
static const textual_icon exit
Definition: model-views.h:254

Definition at line 61 of file tests/vulkan.c.

#define GET_DEVICE_PROC_ADDR (   dev,
  entrypoint 
)
Value:
{ \
demo->fp##entrypoint = \
(PFN_vk##entrypoint)vkGetDeviceProcAddr(dev, "vk" #entrypoint); \
if (demo->fp##entrypoint == NULL) { \
ERR_EXIT("vkGetDeviceProcAddr failed to find vk" #entrypoint, \
"vkGetDeviceProcAddr Failure"); \
} \
}
#define ERR_EXIT(err_msg, err_class)
Definition: tests/vulkan.c:61
#define NULL
Definition: tinycthread.c:47
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetDeviceProcAddr(VkDevice device, const char *pName)

Definition at line 78 of file tests/vulkan.c.

#define GET_INSTANCE_PROC_ADDR (   inst,
  entrypoint 
)
Value:
{ \
demo->fp##entrypoint = \
(PFN_vk##entrypoint)vkGetInstanceProcAddr(inst, "vk" #entrypoint); \
if (demo->fp##entrypoint == NULL) { \
ERR_EXIT("vkGetInstanceProcAddr failed to find vk" #entrypoint, \
"vkGetInstanceProcAddr Failure"); \
} \
}
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName)
#define ERR_EXIT(err_msg, err_class)
Definition: tests/vulkan.c:61
#define NULL
Definition: tinycthread.c:47

Definition at line 68 of file tests/vulkan.c.

#define GLFW_INCLUDE_NONE

Definition at line 44 of file tests/vulkan.c.

#define GLFW_INCLUDE_VULKAN

Definition at line 45 of file tests/vulkan.c.

#define U_ASSERT_ONLY

Definition at line 58 of file tests/vulkan.c.

#define VERTEX_BUFFER_BIND_ID   0

Definition at line 49 of file tests/vulkan.c.

Function Documentation

VKAPI_ATTR VkBool32 VKAPI_CALL BreakCallback ( VkFlags  msgFlags,
VkDebugReportObjectTypeEXT  objType,
uint64_t  srcObject,
size_t  location,
int32_t  msgCode,
const char *  pLayerPrefix,
const char *  pMsg,
void pUserData 
)

Definition at line 248 of file tests/vulkan.c.

VKAPI_ATTR VkBool32 VKAPI_CALL dbgFunc ( VkFlags  msgFlags,
VkDebugReportObjectTypeEXT  objType,
uint64_t  srcObject,
size_t  location,
int32_t  msgCode,
const char *  pLayerPrefix,
const char *  pMsg,
void pUserData 
)

Definition at line 363 of file tests/vulkan.c.

static VkBool32 demo_check_layers ( uint32_t  check_count,
const char **  check_names,
uint32_t  layer_count,
VkLayerProperties layers 
)
static

Definition at line 1674 of file tests/vulkan.c.

static void demo_cleanup ( struct demo demo)
static

Definition at line 2173 of file tests/vulkan.c.

static void demo_create_window ( struct demo demo)
static

Definition at line 1649 of file tests/vulkan.c.

static void demo_destroy_texture_image ( struct demo demo,
struct texture_object tex_obj 
)
static

Definition at line 1030 of file tests/vulkan.c.

static void demo_draw ( struct demo demo)
static

Definition at line 616 of file tests/vulkan.c.

static void demo_draw_build_cmd ( struct demo demo)
static

Definition at line 520 of file tests/vulkan.c.

static void demo_error_callback ( int  error,
const char *  description 
)
static

Definition at line 1606 of file tests/vulkan.c.

static void demo_flush_init_cmd ( struct demo demo)
static

Definition at line 419 of file tests/vulkan.c.

static void demo_init ( struct demo demo,
const int  argc,
const char *  argv[] 
)
static

Definition at line 2131 of file tests/vulkan.c.

static void demo_init_connection ( struct demo demo)
static

Definition at line 2115 of file tests/vulkan.c.

static void demo_init_device ( struct demo demo)
static

Definition at line 1980 of file tests/vulkan.c.

static void demo_init_vk ( struct demo demo)
static

Definition at line 1694 of file tests/vulkan.c.

static void demo_init_vk_swapchain ( struct demo demo)
static

Definition at line 2020 of file tests/vulkan.c.

static void demo_key_callback ( GLFWwindow window,
int  key,
int  scancode,
int  action,
int  mods 
)
static

Definition at line 1611 of file tests/vulkan.c.

static void demo_prepare ( struct demo demo)
static

Definition at line 1569 of file tests/vulkan.c.

static void demo_prepare_buffers ( struct demo demo)
static

Definition at line 706 of file tests/vulkan.c.

static void demo_prepare_depth ( struct demo demo)
static

Definition at line 865 of file tests/vulkan.c.

static void demo_prepare_descriptor_layout ( struct demo demo)
static

Definition at line 1241 of file tests/vulkan.c.

static void demo_prepare_descriptor_pool ( struct demo demo)
static

Definition at line 1489 of file tests/vulkan.c.

static void demo_prepare_descriptor_set ( struct demo demo)
static

Definition at line 1508 of file tests/vulkan.c.

static void demo_prepare_framebuffers ( struct demo demo)
static

Definition at line 1540 of file tests/vulkan.c.

static VkShaderModule demo_prepare_fs ( struct demo demo)
static

Definition at line 1362 of file tests/vulkan.c.

static void demo_prepare_pipeline ( struct demo demo)
static

Definition at line 1371 of file tests/vulkan.c.

static void demo_prepare_render_pass ( struct demo demo)
static

Definition at line 1273 of file tests/vulkan.c.

static VkShaderModule demo_prepare_shader_module ( struct demo demo,
const void code,
size_t  size 
)
static

Definition at line 1336 of file tests/vulkan.c.

static void demo_prepare_texture_image ( struct demo demo,
const uint32_t tex_colors,
struct texture_object tex_obj,
VkImageTiling  tiling,
VkImageUsageFlags  usage,
VkFlags  required_props 
)
static

Definition at line 941 of file tests/vulkan.c.

static void demo_prepare_textures ( struct demo demo)
static

Definition at line 1037 of file tests/vulkan.c.

static void demo_prepare_vertices ( struct demo demo)
static

Definition at line 1161 of file tests/vulkan.c.

static VkShaderModule demo_prepare_vs ( struct demo demo)
static

Definition at line 1353 of file tests/vulkan.c.

static void demo_refresh_callback ( GLFWwindow window)
static

Definition at line 1616 of file tests/vulkan.c.

static void demo_resize ( struct demo demo)
static

Definition at line 2227 of file tests/vulkan.c.

static void demo_resize_callback ( GLFWwindow window,
int  width,
int  height 
)
static

Definition at line 1621 of file tests/vulkan.c.

static void demo_run ( struct demo demo)
static

Definition at line 1628 of file tests/vulkan.c.

static void demo_set_image_layout ( struct demo demo,
VkImage  image,
VkImageAspectFlags  aspectMask,
VkImageLayout  old_image_layout,
VkImageLayout  new_image_layout,
VkAccessFlagBits  srcAccessMask 
)
static

Definition at line 450 of file tests/vulkan.c.

int main ( const int  argc,
const char *  argv[] 
)

Definition at line 2277 of file tests/vulkan.c.

static bool memory_type_from_properties ( struct demo demo,
uint32_t  typeBits,
VkFlags  requirements_mask,
uint32_t typeIndex 
)
static

Definition at line 399 of file tests/vulkan.c.

Variable Documentation

const char fragShaderCode[]
static

Definition at line 88 of file tests/vulkan.c.

int validation_error = 0
static

Definition at line 245 of file tests/vulkan.c.

const char vertShaderCode[]
static

Definition at line 144 of file tests/vulkan.c.



librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:30