2021-01-18 19:54:48 +01:00
# pragma once
# include "vk_core.h"
# include "xash3d_types.h"
2022-02-11 07:46:23 +01:00
# define MAX_CONCURRENT_FRAMES 2
2023-04-01 06:01:17 +02:00
// TODO most of the things below should not be global. Instead, they should be passed as an argument/context to all the drawing functions that want this info
2021-01-18 19:54:48 +01:00
typedef struct vk_framectl_s {
2023-04-01 06:01:17 +02:00
// TODO only used from 2d and r_speeds, remove
2021-11-02 17:18:09 +01:00
uint32_t width , height ;
2021-07-04 20:18:28 +02:00
2022-02-05 06:55:42 +01:00
// TODO move these into renderer and 2d
2021-07-04 20:18:28 +02:00
struct {
// Used when the entire rendering is traditional triangle rasterization
// Discards and clears color buffer
VkRenderPass raster ;
// Used for 2D overlay rendering after ray tracing pass
// Preserves color buffer contents
VkRenderPass after_ray_tracing ;
} render_pass ;
2023-03-21 17:57:23 +01:00
qboolean rtx_enabled ;
2021-01-18 19:54:48 +01:00
} vk_framectl_t ;
extern vk_framectl_t vk_frame ;
qboolean VK_FrameCtlInit ( void ) ;
void VK_FrameCtlShutdown ( void ) ;
void R_BeginFrame ( qboolean clearScene ) ;
2021-02-20 23:54:57 +01:00
void VK_RenderFrame ( const struct ref_viewpass_s * rvp ) ;
2021-01-18 19:54:48 +01:00
void R_EndFrame ( void ) ;
2021-08-22 21:57:11 +02:00
qboolean VID_ScreenShot ( const char * filename , int shot_type ) ;