mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 00:30:57 +00:00
[vulkan] Get window resize working again
The biggest change was splitting up the job resources into per-render-pass resources, allowing individual render passes to reallocate their resources without affecting any others. After that, it was just getting translucency and capture working after a window resize.
This commit is contained in:
parent
45e09673c7
commit
cd4791c5d3
11 changed files with 439 additions and 290 deletions
|
@ -14,7 +14,7 @@ struct tex_s;
|
|||
typedef void (*capfunc_t) (struct tex_s *screencap, void *data);
|
||||
|
||||
typedef struct qfv_capture_frame_s {
|
||||
VkBuffer buffer;
|
||||
struct qfv_resobj_s *buffer;
|
||||
byte *data;
|
||||
|
||||
bool initiated;
|
||||
|
@ -27,12 +27,10 @@ typedef struct qfv_capture_frame_set_s
|
|||
|
||||
typedef struct qfv_capturectx_s {
|
||||
qfv_capture_frame_set_t frames;
|
||||
struct qfv_device_s *device;
|
||||
VkExtent2D extent;
|
||||
size_t imgsize;
|
||||
size_t memsize;
|
||||
byte *data;
|
||||
VkDeviceMemory memory;
|
||||
struct qfv_resource_s *resources;
|
||||
} qfv_capturectx_t;
|
||||
|
||||
struct vulkan_ctx_s;
|
||||
|
|
|
@ -21,9 +21,12 @@ typedef struct qfv_transtate_s {
|
|||
typedef struct translucentframe_s {
|
||||
VkDescriptorSet flat;
|
||||
VkDescriptorSet cube;
|
||||
VkImage heads;
|
||||
VkImage cube_heads;
|
||||
VkBuffer state;
|
||||
struct qfv_resobj_s *heads;
|
||||
struct qfv_resobj_s *cube_heads;
|
||||
struct qfv_resobj_s *heads_view;
|
||||
struct qfv_resobj_s *cube_heads_view;
|
||||
struct qfv_resobj_s *state;
|
||||
struct qfv_resobj_s *frags;
|
||||
} translucentframe_t;
|
||||
|
||||
typedef struct translucentframeset_s
|
||||
|
@ -32,6 +35,7 @@ typedef struct translucentframeset_s
|
|||
typedef struct translucentctx_s {
|
||||
translucentframeset_t frames;
|
||||
struct qfv_resource_s *resources;
|
||||
VkExtent2D extent;
|
||||
|
||||
int maxFragments;
|
||||
} translucentctx_t;
|
||||
|
@ -43,7 +47,5 @@ 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
|
||||
|
|
|
@ -81,6 +81,7 @@ typedef struct qfv_imageinfo_s {
|
|||
VkImageTiling tiling;
|
||||
VkImageUsageFlags usage;
|
||||
VkImageLayout initialLayout;
|
||||
struct qfv_resobj_s *object;
|
||||
} qfv_imageinfo_t;
|
||||
|
||||
typedef struct qfv_imageviewinfo_s {
|
||||
|
@ -91,6 +92,7 @@ typedef struct qfv_imageviewinfo_s {
|
|||
VkFormat format;
|
||||
VkComponentMapping components;
|
||||
VkImageSubresourceRange subresourceRange;
|
||||
struct qfv_resobj_s *object;
|
||||
} qfv_imageviewinfo_t;
|
||||
|
||||
typedef struct qfv_bufferinfo_s {
|
||||
|
@ -355,6 +357,8 @@ typedef struct qfv_renderpass_s {
|
|||
qfv_framebufferinfo_t *framebufferinfo;
|
||||
VkImageView output;
|
||||
qfv_reference_t outputref;
|
||||
|
||||
struct qfv_resource_s *resources;
|
||||
} qfv_renderpass_t;
|
||||
|
||||
typedef struct qfv_render_s {
|
||||
|
@ -386,9 +390,6 @@ typedef struct qfv_step_s {
|
|||
|
||||
typedef struct qfv_job_s {
|
||||
qfv_label_t label;
|
||||
struct qfv_resource_s *resources;
|
||||
struct qfv_resobj_s *images;
|
||||
struct qfv_resobj_s *image_views;
|
||||
|
||||
uint32_t num_renderpasses;
|
||||
uint32_t num_pipelines;
|
||||
|
@ -440,7 +441,9 @@ void QFV_Render_Init (struct vulkan_ctx_s *ctx);
|
|||
void QFV_Render_Shutdown (struct vulkan_ctx_s *ctx);
|
||||
void QFV_Render_AddTasks (struct vulkan_ctx_s *ctx, exprsym_t *task_sys);
|
||||
|
||||
void QFV_CreateFramebuffer (struct vulkan_ctx_s *ctx, qfv_renderpass_t *rp);
|
||||
void QFV_DestroyFramebuffer (struct vulkan_ctx_s *ctx, qfv_renderpass_t *rp);
|
||||
void QFV_CreateFramebuffer (struct vulkan_ctx_s *ctx, qfv_renderpass_t *rp,
|
||||
VkExtent2D extent);
|
||||
|
||||
struct qfv_dsmanager_s *
|
||||
QFV_Render_DSManager (struct vulkan_ctx_s *ctx,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue