quakeforge/include/QF/Vulkan/qf_translucent.h
Bill Currie 614ca744ab [vulkan] Support multi-layer OIT rendering
This fixes fisheye rendering. I'm not too happy with always allocating
the cube OIT heads buffer, but that's for another day.
2023-06-26 18:00:46 +09:00

49 lines
1.2 KiB
C

#ifndef __QF_Vulkan_qf_translucent_h
#define __QF_Vulkan_qf_translucent_h
#include "QF/darray.h"
#include "QF/simd/types.h"
#include "QF/Vulkan/command.h"
typedef struct qfv_transfrag_s {
vec4f_t color;
float depth;
int32_t next;
} qfv_transfrag_t;
typedef struct qfv_transtate_s {
int32_t numFragments;
int32_t maxFragments;
} qfv_transtate_t;
typedef struct translucentframe_s {
VkDescriptorSet flat;
VkDescriptorSet cube;
VkImage heads;
VkImage cube_heads;
VkBuffer state;
} translucentframe_t;
typedef struct translucentframeset_s
DARRAY_TYPE (translucentframe_t) translucentframeset_t;
typedef struct translucentctx_s {
translucentframeset_t frames;
struct qfv_resource_s *resources;
int maxFragments;
} translucentctx_t;
struct vulkan_ctx_s;
void Vulkan_Translucent_Init (struct vulkan_ctx_s *ctx);
void Vulkan_Translucent_Setup (struct vulkan_ctx_s *ctx);
void Vulkan_Translucent_Shutdown (struct vulkan_ctx_s *ctx);
VkDescriptorSet Vulkan_Translucent_Descriptors (struct vulkan_ctx_s *ctx,
int frame)__attribute__((pure));
void Vulkan_Translucent_CreateBuffers (struct vulkan_ctx_s *ctx,
VkExtent2D extent);
#endif//__QF_Vulkan_qf_translucent_h