2021-01-10 16:24:15 +00:00
|
|
|
#ifndef __QF_Vulkan_barrier_h
|
|
|
|
#define __QF_Vulkan_barrier_h
|
|
|
|
|
2022-05-04 04:55:56 +00:00
|
|
|
#ifndef VK_NO_PROTOTYPES
|
|
|
|
#define VK_NO_PROTOTYPES
|
|
|
|
#endif
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
|
2022-10-03 00:09:34 +00:00
|
|
|
typedef struct qfv_imagebarrier_s {
|
2021-04-24 03:42:29 +00:00
|
|
|
VkPipelineStageFlags srcStages;
|
|
|
|
VkPipelineStageFlags dstStages;
|
|
|
|
VkImageMemoryBarrier barrier;
|
|
|
|
} qfv_imagebarrier_t;
|
2021-01-10 16:24:15 +00:00
|
|
|
|
2022-10-03 00:09:34 +00:00
|
|
|
typedef struct qfv_bufferbarrier_s {
|
2021-04-24 06:47:31 +00:00
|
|
|
VkPipelineStageFlags srcStages;
|
|
|
|
VkPipelineStageFlags dstStages;
|
|
|
|
VkBufferMemoryBarrier barrier;
|
|
|
|
} qfv_bufferbarrier_t;
|
|
|
|
|
2021-12-16 13:53:19 +00:00
|
|
|
// image layout transitions
|
2021-01-10 16:24:15 +00:00
|
|
|
enum {
|
|
|
|
qfv_LT_Undefined_to_TransferDst,
|
2022-11-30 18:00:47 +00:00
|
|
|
qfv_LT_Undefined_to_General,
|
2023-08-02 08:51:04 +00:00
|
|
|
qfv_LT_Undefined_to_ShaderReadOnly,
|
2021-04-24 03:42:29 +00:00
|
|
|
qfv_LT_TransferDst_to_TransferSrc,
|
2022-11-30 18:00:47 +00:00
|
|
|
qfv_LT_TransferDst_to_General,
|
2021-01-10 16:24:15 +00:00
|
|
|
qfv_LT_TransferDst_to_ShaderReadOnly,
|
2021-04-24 03:42:29 +00:00
|
|
|
qfv_LT_TransferSrc_to_ShaderReadOnly,
|
2021-01-21 08:13:17 +00:00
|
|
|
qfv_LT_ShaderReadOnly_to_TransferDst,
|
2021-01-10 16:24:15 +00:00
|
|
|
qfv_LT_Undefined_to_DepthStencil,
|
|
|
|
qfv_LT_Undefined_to_Color,
|
|
|
|
};
|
|
|
|
|
2021-12-16 13:53:19 +00:00
|
|
|
// buffer barriers
|
2021-04-24 06:47:31 +00:00
|
|
|
enum {
|
|
|
|
qfv_BB_Unknown_to_TransferWrite,
|
|
|
|
qfv_BB_TransferWrite_to_VertexAttrRead,
|
|
|
|
qfv_BB_TransferWrite_to_IndexRead,
|
|
|
|
qfv_BB_TransferWrite_to_UniformRead,
|
2022-11-30 18:00:47 +00:00
|
|
|
qfv_BB_TransferWrite_to_ShaderRW,
|
2021-12-16 14:02:16 +00:00
|
|
|
qfv_BB_ShaderRW_to_ShaderRO,
|
|
|
|
qfv_BB_ShaderRW_to_ShaderRO_VA,
|
|
|
|
qfv_BB_ShaderRO_to_ShaderWrite,
|
|
|
|
qfv_BB_ShaderRO_VA_to_ShaderWrite,
|
|
|
|
qfv_BB_ShaderWrite_to_ShaderRO,
|
|
|
|
qfv_BB_ShaderWrite_to_ShaderRW,
|
2021-04-24 06:47:31 +00:00
|
|
|
};
|
|
|
|
|
2021-04-24 03:42:29 +00:00
|
|
|
extern const qfv_imagebarrier_t imageBarriers[];
|
2021-04-24 06:47:31 +00:00
|
|
|
extern const qfv_bufferbarrier_t bufferBarriers[];
|
2021-01-10 16:24:15 +00:00
|
|
|
|
|
|
|
#endif//__QF_Vulkan_barrier_h
|