summaryrefslogtreecommitdiff
path: root/include/render/shader.h
blob: 0e827df6067e1ee785795709609f0bc4f9b4452e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef _RENDER_SHADER_H_
#define _RENDER_SHADER_H_

#include <stdbool.h>
#include <vulkan/vulkan.h>

struct renderer;

struct shader {
	size_t len;
	uint8_t *code;
	VkShaderStageFlagBits stage;
};

struct shader_input {
	size_t desc_count;
	VkVertexInputBindingDescription *descs;
	size_t attr_count;
	VkVertexInputAttributeDescription *attrs;
};

VkResult shader_create_module(struct renderer *ren, const size_t len, uint8_t code[len], VkShaderModule *module);
bool shader_load(const char *filename, struct shader *shader);

#endif