Monado OpenXR Runtime
render_shaders.c File Reference

Shader loading code. More...

#include "vk/vk_mini_helpers.h"
#include "render/render_interface.h"
#include "shaders/blit.comp.h"
#include "shaders/clear.comp.h"
#include "shaders/layer.comp.h"
#include "shaders/distortion.comp.h"
#include "shaders/layer_cylinder.frag.h"
#include "shaders/layer_cylinder.vert.h"
#include "shaders/layer_equirect2.frag.h"
#include "shaders/layer_equirect2.vert.h"
#include "shaders/layer_projection.vert.h"
#include "shaders/layer_quad.vert.h"
#include "shaders/layer_shared.frag.h"
#include "shaders/mesh.frag.h"
#include "shaders/mesh.vert.h"
Include dependency graph for render_shaders.c:

Macros

#define LOAD(SHADER)
 

Functions

static XRT_CHECK_RESULT VkResult shader_load (struct vk_bundle *vk, const uint32_t *code, size_t size, VkShaderModule *out_module)
 
bool render_shaders_load (struct render_shaders *s, struct vk_bundle *vk)
 Loads all of the shaders that the compositor uses. More...
 
void render_shaders_close (struct render_shaders *s, struct vk_bundle *vk)
 Unload and cleanup shaders. More...
 

Detailed Description

Macro Definition Documentation

◆ LOAD

#define LOAD (   SHADER)
Value:
do { \
const uint32_t *code = shaders_##SHADER; \
size_t size = sizeof(shaders_##SHADER); \
VkResult ret = shader_load(vk, /* vk_bundle */ \
code, /* code */ \
size, /* size */ \
&s->SHADER); /* out */ \
if (ret != VK_SUCCESS) { \
VK_ERROR(vk, "Failed to load shader '" #SHADER "'"); \
render_shaders_close(s, vk); \
return false; \
} \
VK_NAME_SHADER_MODULE(vk, s->SHADER, #SHADER); \
} while (false)