2022-10-15 23:26:58 +02:00
|
|
|
#pragma once
|
|
|
|
|
2023-01-16 21:41:37 +01:00
|
|
|
#include "vk_core.h"
|
2022-10-15 23:26:58 +02:00
|
|
|
|
2023-01-16 21:41:37 +01:00
|
|
|
enum {
|
|
|
|
MEATPIPE_RES_WRITE = (1<<0),
|
|
|
|
MEATPIPE_RES_CREATE = (1<<1),
|
|
|
|
// TMP ..
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char name[64];
|
|
|
|
uint32_t descriptor_type;
|
|
|
|
int count;
|
|
|
|
uint32_t flags;
|
|
|
|
union {
|
|
|
|
uint32_t image_format;
|
|
|
|
};
|
2023-01-28 21:55:53 +01:00
|
|
|
|
2023-01-30 19:21:18 +01:00
|
|
|
// Index+1 of resource image to read data from if this resource is a "previous frame" contents of another one.
|
|
|
|
// Value of zero means that it is a standalone resource. The real index is the value - 1.
|
|
|
|
int prev_frame_index_plus_1;
|
2023-01-16 21:41:37 +01:00
|
|
|
} vk_meatpipe_resource_t;
|
|
|
|
|
|
|
|
struct vk_meatpipe_pass_s;
|
2022-10-15 23:26:58 +02:00
|
|
|
typedef struct {
|
2022-10-22 22:04:00 +02:00
|
|
|
int passes_count;
|
2023-01-16 21:41:37 +01:00
|
|
|
struct vk_meatpipe_pass_s *passes;
|
|
|
|
|
|
|
|
int resources_count;
|
|
|
|
vk_meatpipe_resource_t *resources;
|
2022-10-15 23:26:58 +02:00
|
|
|
} vk_meatpipe_t;
|
|
|
|
|
2023-01-16 21:41:37 +01:00
|
|
|
vk_meatpipe_t* R_VkMeatpipeCreateFromFile(const char *filename);
|
2022-10-15 23:26:58 +02:00
|
|
|
void R_VkMeatpipeDestroy(vk_meatpipe_t *mp);
|
2022-10-22 23:43:41 +02:00
|
|
|
|
2023-01-17 07:57:48 +01:00
|
|
|
struct vk_resource_s;
|
|
|
|
typedef struct vk_resource_s* vk_resource_p;
|
2023-01-16 21:41:37 +01:00
|
|
|
typedef struct vk_meatpipe_perfrom_args_s {
|
|
|
|
int frame_set_slot; // 0 or 1, until we do num_frame_slots
|
|
|
|
int width, height;
|
2023-01-17 07:57:48 +01:00
|
|
|
const vk_resource_p *resources;
|
2023-01-16 21:41:37 +01:00
|
|
|
} vk_meatpipe_perfrom_args_t;
|
|
|
|
|
|
|
|
void R_VkMeatpipePerform(vk_meatpipe_t *mp, VkCommandBuffer cmdbuf, vk_meatpipe_perfrom_args_t args);
|