Quake II RTX doxygen
1.0 dev
|
|
Go to the documentation of this file.
23 #include <vulkan/vulkan.h>
26 #include <SDL_vulkan.h>
30 #include "shared/shared.h"
31 #include "common/bsp.h"
32 #include "common/cmd.h"
33 #include "common/common.h"
34 #include "common/cvar.h"
35 #include "common/files.h"
36 #include "common/math.h"
37 #include "client/video.h"
39 #include "refresh/refresh.h"
40 #include "refresh/images.h"
41 #include "refresh/models.h"
42 #include "system/hunk.h"
48 #define LENGTH(a) ((sizeof (a)) / (sizeof(*(a))))
49 #define MIN(a,b) ((a) < (b) ? (a) : (b))
50 #define MAX(a,b) ((a) > (b) ? (a) : (b))
52 #define LOG_FUNC_(f) do {} while(0)
54 #define LOG_FUNC() LOG_FUNC_(__func__)
59 VkResult _res = __VA_ARGS__; \
60 if(_res != VK_SUCCESS) { \
61 Com_EPrintf("error %d executing %s! %s:%d\n", _res, # __VA_ARGS__, __FILE__, __LINE__); \
65 #define _VK(...) do { __VA_ARGS__; } while(0)
70 #define LIST_SHADER_MODULES \
71 SHADER_MODULE_DO(QVK_MOD_STRETCH_PIC_VERT) \
72 SHADER_MODULE_DO(QVK_MOD_STRETCH_PIC_FRAG) \
73 SHADER_MODULE_DO(QVK_MOD_FINAL_BLIT_VERT) \
74 SHADER_MODULE_DO(QVK_MOD_FINAL_BLIT_LANCZOS_FRAG) \
75 SHADER_MODULE_DO(QVK_MOD_PRIMARY_RAYS_RGEN) \
76 SHADER_MODULE_DO(QVK_MOD_REFLECT_REFRACT_RGEN) \
77 SHADER_MODULE_DO(QVK_MOD_DIRECT_LIGHTING_RGEN) \
78 SHADER_MODULE_DO(QVK_MOD_INDIRECT_LIGHTING_RGEN) \
79 SHADER_MODULE_DO(QVK_MOD_PATH_TRACER_RCHIT) \
80 SHADER_MODULE_DO(QVK_MOD_PATH_TRACER_PARTICLE_RAHIT) \
81 SHADER_MODULE_DO(QVK_MOD_PATH_TRACER_BEAM_RAHIT) \
82 SHADER_MODULE_DO(QVK_MOD_PATH_TRACER_RMISS) \
83 SHADER_MODULE_DO(QVK_MOD_PATH_TRACER_SHADOW_RMISS) \
84 SHADER_MODULE_DO(QVK_MOD_PATH_TRACER_EXPLOSION_RAHIT) \
85 SHADER_MODULE_DO(QVK_MOD_PATH_TRACER_SPRITE_RAHIT) \
86 SHADER_MODULE_DO(QVK_MOD_INSTANCE_GEOMETRY_COMP) \
87 SHADER_MODULE_DO(QVK_MOD_ANIMATE_MATERIALS_COMP) \
88 SHADER_MODULE_DO(QVK_MOD_ASVGF_SEED_RNG_COMP) \
89 SHADER_MODULE_DO(QVK_MOD_ASVGF_FWD_PROJECT_COMP) \
90 SHADER_MODULE_DO(QVK_MOD_ASVGF_GRADIENT_IMG_COMP) \
91 SHADER_MODULE_DO(QVK_MOD_ASVGF_GRADIENT_ATROUS_COMP) \
92 SHADER_MODULE_DO(QVK_MOD_ASVGF_ATROUS_COMP) \
93 SHADER_MODULE_DO(QVK_MOD_ASVGF_LF_COMP) \
94 SHADER_MODULE_DO(QVK_MOD_ASVGF_TEMPORAL_COMP) \
95 SHADER_MODULE_DO(QVK_MOD_ASVGF_TAA_COMP) \
96 SHADER_MODULE_DO(QVK_MOD_BLOOM_BLUR_COMP) \
97 SHADER_MODULE_DO(QVK_MOD_BLOOM_COMPOSITE_COMP) \
98 SHADER_MODULE_DO(QVK_MOD_TONE_MAPPING_HISTOGRAM_COMP) \
99 SHADER_MODULE_DO(QVK_MOD_TONE_MAPPING_CURVE_COMP) \
100 SHADER_MODULE_DO(QVK_MOD_TONE_MAPPING_APPLY_COMP) \
101 SHADER_MODULE_DO(QVK_MOD_PHYSICAL_SKY_COMP) \
102 SHADER_MODULE_DO(QVK_MOD_PHYSICAL_SKY_SPACE_COMP) \
103 SHADER_MODULE_DO(QVK_MOD_SKY_BUFFER_RESOLVE_COMP) \
104 SHADER_MODULE_DO(QVK_MOD_CHECKERBOARD_INTERLEAVE_COMP) \
105 SHADER_MODULE_DO(QVK_MOD_GOD_RAYS_COMP) \
106 SHADER_MODULE_DO(QVK_MOD_GOD_RAYS_FILTER_COMP) \
107 SHADER_MODULE_DO(QVK_MOD_SHADOW_MAP_VERT) \
108 SHADER_MODULE_DO(QVK_MOD_COMPOSITING_COMP) \
110 #ifndef VKPT_SHADER_DIR
111 #define VKPT_SHADER_DIR "shader_vkpt"
114 #define SHADER_PATH_TEMPLATE VKPT_SHADER_DIR "/%s.spv"
116 #define SHADER_STAGE(_module, _stage) \
118 .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, \
120 .module = qvk.shader_modules[_module], \
124 #define SHADER_STAGE_SPEC(_module, _stage, _spec) \
126 .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, \
128 .module = qvk.shader_modules[_module], \
130 .pSpecializationInfo = _spec, \
134 #define SHADER_MODULE_DO(a) a,
136 #undef SHADER_MODULE_DO
140 #define MAX_FRAMES_IN_FLIGHT 2
141 #define MAX_SWAPCHAIN_IMAGES 4
149 void** buffer_begin_addrs;
168 #ifdef VKPT_DEVICE_GROUPS
169 VkPhysicalDevice device_group_physical_devices[
VKPT_MAX_GPUS];
234 #ifdef VKPT_DEVICE_GROUPS
265 #ifdef VKPT_IMAGE_DUMPS
268 VkDeviceMemory dump_image_memory;
269 VkDeviceSize dump_image_memory_size;
275 #define _VK_INST_EXTENSION_LIST \
276 _VK_INST_EXTENSION_DO(vkCmdBeginDebugUtilsLabelEXT) \
277 _VK_INST_EXTENSION_DO(vkCmdEndDebugUtilsLabelEXT) \
278 _VK_INST_EXTENSION_DO(vkEnumeratePhysicalDeviceGroupsKHR)
280 #define _VK_INST_EXTENSION_DO(a) extern PFN_##a q##a;
282 #undef _VK_INST_EXTENSION_DO
284 #define _VK_EXTENSION_LIST \
285 _VK_EXTENSION_DO(vkCreateAccelerationStructureNV) \
286 _VK_EXTENSION_DO(vkCreateAccelerationStructureNV) \
287 _VK_EXTENSION_DO(vkDestroyAccelerationStructureNV) \
288 _VK_EXTENSION_DO(vkGetAccelerationStructureMemoryRequirementsNV) \
289 _VK_EXTENSION_DO(vkBindAccelerationStructureMemoryNV) \
290 _VK_EXTENSION_DO(vkCmdBuildAccelerationStructureNV) \
291 _VK_EXTENSION_DO(vkCmdCopyAccelerationStructureNV) \
292 _VK_EXTENSION_DO(vkCmdTraceRaysNV) \
293 _VK_EXTENSION_DO(vkCreateRayTracingPipelinesNV) \
294 _VK_EXTENSION_DO(vkGetRayTracingShaderGroupHandlesNV) \
295 _VK_EXTENSION_DO(vkGetAccelerationStructureHandleNV) \
296 _VK_EXTENSION_DO(vkCmdWriteAccelerationStructuresPropertiesNV) \
297 _VK_EXTENSION_DO(vkCompileDeferredNV) \
298 _VK_EXTENSION_DO(vkDebugMarkerSetObjectNameEXT) \
299 _VK_EXTENSION_DO(vkGetDeviceGroupPeerMemoryFeaturesKHR) \
300 _VK_EXTENSION_DO(vkCmdSetDeviceMaskKHR) \
301 _VK_EXTENSION_DO(vkCmdDispatchBaseKHR) \
302 _VK_EXTENSION_DO(vkGetDeviceGroupPresentCapabilitiesKHR) \
303 _VK_EXTENSION_DO(vkGetDeviceGroupSurfacePresentModesKHR) \
304 _VK_EXTENSION_DO(vkGetPhysicalDevicePresentRectanglesKHR) \
305 _VK_EXTENSION_DO(vkAcquireNextImage2KHR) \
306 _VK_EXTENSION_DO(vkBindImageMemory2KHR)
309 #define _VK_EXTENSION_DO(a) extern PFN_##a q##a;
311 #undef _VK_EXTENSION_DO
313 #define MAX_SKY_CLUSTERS 1024
428 void inverse(
const float *
m,
float *inv);
430 float ymin,
float ymax,
float znear,
float zfar);
432 #define PROFILER_LIST \
433 PROFILER_DO(PROFILER_FRAME_TIME, 0) \
434 PROFILER_DO(PROFILER_INSTANCE_GEOMETRY, 1) \
435 PROFILER_DO(PROFILER_BVH_UPDATE, 1) \
436 PROFILER_DO(PROFILER_ASVGF_GRADIENT_SAMPLES, 1) \
437 PROFILER_DO(PROFILER_ASVGF_DO_GRADIENT_SAMPLES, 2) \
438 PROFILER_DO(PROFILER_PRIMARY_RAYS, 1) \
439 PROFILER_DO(PROFILER_REFLECT_REFRACT_1, 1) \
440 PROFILER_DO(PROFILER_REFLECT_REFRACT_2, 1) \
441 PROFILER_DO(PROFILER_DIRECT_LIGHTING, 1) \
442 PROFILER_DO(PROFILER_INDIRECT_LIGHTING, 1) \
443 PROFILER_DO(PROFILER_ASVGF_FULL, 1) \
444 PROFILER_DO(PROFILER_ASVGF_RECONSTRUCT_GRADIENT, 2) \
445 PROFILER_DO(PROFILER_ASVGF_TEMPORAL, 2) \
446 PROFILER_DO(PROFILER_ASVGF_ATROUS, 2) \
447 PROFILER_DO(PROFILER_MGPU_TRANSFERS, 1) \
448 PROFILER_DO(PROFILER_INTERLEAVE, 1) \
449 PROFILER_DO(PROFILER_ASVGF_TAA, 2) \
450 PROFILER_DO(PROFILER_BLOOM, 1) \
451 PROFILER_DO(PROFILER_TONE_MAPPING, 1) \
452 PROFILER_DO(PROFILER_UPDATE_ENVIRONMENT, 1) \
453 PROFILER_DO(PROFILER_GOD_RAYS, 1) \
454 PROFILER_DO(PROFILER_GOD_RAYS_REFLECT_REFRACT, 1) \
455 PROFILER_DO(PROFILER_GOD_RAYS_FILTER, 1) \
456 PROFILER_DO(PROFILER_SHADOW_MAP, 1) \
457 PROFILER_DO(PROFILER_COMPOSITING, 1) \
460 #define PROFILER_DO(a, ...) a,
466 #define NUM_PROFILER_QUERIES_PER_FRAME (NUM_PROFILER_ENTRIES * 2)
517 VkCommandBuffer cmd_buf,
519 uint32_t execute_device_mask,
520 int wait_semaphore_count,
521 VkSemaphore* wait_semaphores,
522 VkPipelineStageFlags* wait_stages,
523 uint32_t* wait_device_indices,
524 int signal_semaphore_count,
525 VkSemaphore* signal_semaphores,
526 uint32_t* signal_device_indices,
530 VkCommandBuffer cmd_buf,
535 #define ALL_GPUS (-1)
540 #ifdef VKPT_DEVICE_GROUPS
541 void vkpt_mgpu_global_barrier(VkCommandBuffer cmd_buf);
544 vkpt_mgpu_image_copy(VkCommandBuffer cmd_buf,
549 VkOffset2D src_offset,
550 VkOffset2D dst_offset,
558 VkOffset2D src_offset,
559 VkOffset2D dst_offset,
599 VkResult
vkpt_pt_create_toplevel(VkCommandBuffer cmd_buf,
int idx, qboolean include_world, qboolean weapon_left_handed);
600 VkResult
vkpt_pt_create_static(VkBuffer
vertex_buffer,
size_t buffer_offset,
int num_vertices,
int num_vertices_transparent,
int num_vertices_sky,
int num_vertices_custom_sky);
615 VkResult
vkpt_taa(VkCommandBuffer cmd_buf);
638 VkResult
vkpt_shadow_map_render(VkCommandBuffer cmd_buf,
float* view_projection_matrix,
int num_static_verts,
int num_dynamic_verts,
int transparent_offset,
int num_transparent_verts);
640 void vkpt_shadow_map_setup(
const sun_light_t* light,
const float* bbox_min,
const float* bbox_max,
float* VP,
float* depth_scale, qboolean random_sampling);
678 const float* shadowmap_viewproj,
679 float shadowmap_depth_scale);
708 #define TESS_MAX_VERTICES 16384
709 #define TESS_MAX_INDICES (3 * TESS_MAX_VERTICES)
711 #define QGL_INDEX_TYPE GLuint
721 static inline void begin_perf_marker(VkCommandBuffer command_buffer,
int index,
const char* name)
725 const VkDebugUtilsLabelEXT label = {
726 .sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
730 if (qvkCmdBeginDebugUtilsLabelEXT != NULL)
731 qvkCmdBeginDebugUtilsLabelEXT(command_buffer, &label);
736 if (qvkCmdEndDebugUtilsLabelEXT != NULL)
737 qvkCmdEndDebugUtilsLabelEXT(command_buffer);
742 #define BEGIN_PERF_MARKER(command_buffer, name) begin_perf_marker(command_buffer, name, #name)
743 #define END_PERF_MARKER(command_buffer, name) end_perf_marker(command_buffer, name)
758 int R_DrawString_RTX(
int x,
int y,
int flags,
size_t maxlen,
const char *s, qhandle_t font);
765 qerror_t
MOD_LoadMD2_RTX(model_t *model,
const void *rawdata,
size_t length);
766 qerror_t
MOD_LoadMD3_RTX(model_t *model,
const void *rawdata,
size_t length);
VkDescriptorSet desc_set_ubo
void get_transparency_counts(int *particle_num, int *beam_num, int *sprite_num)
VkResult vkpt_profiler_next_frame(VkCommandBuffer cmd_buf)
VkResult vkpt_vertex_buffer_upload_models_to_staging()
void vkpt_record_god_rays_filter_command_buffer(VkCommandBuffer command_buffer)
void vkpt_freecam_update(float frame_time)
VkResult vkpt_final_blit_simple(VkCommandBuffer cmd_buf)
VkResult vkpt_asvgf_destroy_pipelines()
uint32_t num_swap_chain_images
VkResult vkpt_tone_mapping_destroy_pipelines()
#define _VK_EXTENSION_LIST
#define MAX_FRAMES_IN_FLIGHT
char sky_visibility[VIS_MAX_BYTES]
void R_SetAlpha_RTX(float alpha)
void draw_profiler(int enable_asvgf)
static void end_perf_marker(VkCommandBuffer command_buffer, int index)
qboolean use_physical_sky
void IMG_Unload_RTX(image_t *image)
VkResult vkpt_create_images()
BufferResource_t buf_tonemap
uint32_t viewer_model_vertex_num
VkResult vkpt_asvgf_create_pipelines()
qboolean get_triangle_off_center(const float *positions, float *center, float *anti_center)
void vkpt_reset_accumulation()
VkCommandBuffer vkpt_begin_command_buffer(cmd_buf_group_t *group)
void set_current_gpu(VkCommandBuffer cmd_buf, int gpu_index)
VkResult vkpt_uniform_buffer_destroy()
VkResult vkpt_uniform_buffer_update(VkCommandBuffer command_buffer)
uint32_t dynamic_vertex_num
VkResult vkpt_vertex_buffer_upload_staging()
VkAccelerationStructureNV get_transparency_particle_blas()
qboolean weapon_left_handed
void vkpt_wait_idle(VkQueue queue, cmd_buf_group_t *group)
void R_DrawPic_RTX(int x, int y, qhandle_t pic)
qerror_t MOD_LoadMD3_RTX(model_t *model, const void *rawdata, size_t length)
void create_view_matrix(float matrix[16], refdef_t *fd)
VkResult vkpt_light_stats_destroy()
light_poly_t * light_polys
void vkpt_textures_destroy_unused()
qboolean all_lava_emissive
byte * IMG_ReadPixels_RTX(int *width, int *height, int *rowbytes)
static cparticle_t particles[MAX_PARTICLES]
cmd_buf_group_t cmd_buffers_transfer
VkResult vkpt_asvgf_filter(VkCommandBuffer cmd_buf, qboolean enable_lf)
VkResult vkpt_taa(VkCommandBuffer cmd_buf)
BufferResource_t buf_vertex
VkExtensionProperties * extensions
VkResult vkpt_god_rays_noop()
void mult_matrix_vector(float *p, const float *a, const float *b)
struct pbr_material_s * material
void vkpt_init_light_textures()
VkResult vkpt_textures_destroy()
VkImageView vkpt_shadow_map_get_view()
VkDescriptorSet qvk_get_current_desc_set_textures()
float view_projection_matrix_prev[16]
uint32_t current_frame_index
VkResult vkpt_light_buffer_upload_to_staging(qboolean render_world, bsp_mesh_t *bsp_mesh, bsp_t *bsp, int num_model_lights, light_poly_t *transformed_model_lights, const float *sky_radiance)
struct cmd_buf_group_s cmd_buf_group_t
BufferResource_t buf_readback
VkResult vkpt_tone_mapping_reset(VkCommandBuffer cmd_buf)
const char ** sdl2_extensions
VkResult vkpt_vertex_buffer_destroy()
void vkpt_normalize_normal_map(image_t *image)
VkFence fence_vertex_sync
qboolean vkpt_god_rays_enabled(const sun_light_t *sun_light)
VkResult vkpt_readback(struct ReadbackBuffer *dst)
VkResult vkpt_profiler_initialize()
VkResult vkpt_textures_end_registration()
int allocated_light_polys
VkResult vkpt_bloom_create_pipelines()
VkResult vkpt_compositing(VkCommandBuffer cmd_buf)
VkResult vkpt_shadow_map_destroy_pipelines()
VkResult vkpt_vertex_buffer_upload_bsp_mesh_to_staging(bsp_mesh_t *bsp_mesh)
cmd_buf_group_t cmd_buffers_graphics
VkShaderModule shader_modules[NUM_QVK_SHADER_MODULES]
void create_entity_matrix(float matrix[16], entity_t *e, qboolean enable_left_hand)
struct semaphore_group_s semaphore_group_t
struct EntityUploadInfo EntityUploadInfo
VkResult vkpt_initialize_god_rays()
VkResult vkpt_pt_update_descripter_set_bindings(int idx)
VkResult vkpt_textures_initialize()
VkDebugUtilsMessengerEXT dbg_messenger
VkResult vkpt_bloom_destroy()
VkPhysicalDevice physical_device
VkDescriptorSet desc_set_textures_even
VkDeviceMemory screenshot_image_memory
void MOD_Reference_RTX(model_t *model)
VkPhysicalDeviceMemoryProperties mem_properties
void vkpt_bloom_update(QVKUniformBuffer_t *ubo, float frame_time, qboolean under_water, qboolean menu_mode)
void bsp_mesh_register_textures(bsp_t *bsp)
#define _VK_INST_EXTENSION_LIST
bsp_mesh_t bsp_mesh_world
VkResult vkpt_tone_mapping_destroy()
VkResult vkpt_god_rays_destroy_pipelines()
VkResult allocate_gpu_memory(VkMemoryRequirements mem_req, VkDeviceMemory *pMemory)
uint32_t sky_clusters[MAX_SKY_CLUSTERS]
semaphore_group_t semaphores[MAX_FRAMES_IN_FLIGHT][VKPT_MAX_GPUS]
int32_t queue_idx_compute
struct bsp_mesh_s bsp_mesh_t
int * cluster_light_offsets
void vkpt_reset_command_buffers(cmd_buf_group_t *group)
VkResult vkpt_god_rays_create_pipelines()
int32_t queue_idx_graphics
VkExtent2D extent_screen_images
VkDescriptorSet desc_set_vertex_buffer
void vkpt_submit_command_buffer(VkCommandBuffer cmd_buf, VkQueue queue, uint32_t execute_device_mask, int wait_semaphore_count, VkSemaphore *wait_semaphores, VkPipelineStageFlags *wait_stages, uint32_t *wait_device_indices, int signal_semaphore_count, VkSemaphore *signal_semaphores, uint32_t *signal_device_indices, VkFence fence)
uint32_t current_swap_chain_image_index
VkResult vkpt_vertex_buffer_create_pipelines()
VkResult vkpt_destroy_images()
int32_t queue_idx_transfer
lightstyle_t prev_lightstyles[MAX_LIGHTSTYLES]
VkResult vkpt_pt_create_pipelines()
struct pbr_material_s * materials[MAX_ALIAS_SKINS]
VkResult vkpt_god_rays_update_images()
BufferResource_t buf_sun_color
VkResult vkpt_pt_destroy_pipelines()
VkResult vkpt_tone_mapping_record_cmd_buffer(VkCommandBuffer cmd_buf, float frame_time)
void R_SetClipRect_RTX(const clipRect_t *clip)
struct light_poly_s light_poly_t
void vkpt_image_copy(VkCommandBuffer cmd_buf, int src_image_index, int dst_image_index, VkOffset2D src_offset, VkOffset2D dst_offset, VkExtent2D size)
int allocated_light_polys
void vkpt_record_god_rays_trace_command_buffer(VkCommandBuffer command_buffer, int pass)
VkSemaphore transfer_finished
VkResult vkpt_bloom_initialize()
VkImage swap_chain_images[MAX_SWAPCHAIN_IMAGES]
VkSwapchainKHR swap_chain
VkCommandBuffer * buffers
void vkpt_light_buffer_reset_counts()
VkResult vkpt_shadow_map_destroy()
VkResult vkpt_pt_create_toplevel(VkCommandBuffer cmd_buf, int idx, qboolean include_world, qboolean weapon_left_handed)
qboolean vkpt_build_cylinder_light(light_poly_t *light_list, int *num_lights, int max_lights, bsp_t *bsp, vec3_t begin, vec3_t end, vec3_t color, float radius)
VkImage images[NUM_VKPT_IMAGES]
void vkpt_shadow_map_setup(const sun_light_t *light, const float *bbox_min, const float *bbox_max, float *VP, float *depth_scale, qboolean random_sampling)
VkResult vkpt_shadow_map_initialize()
void inverse(const float *m, float *inv)
VkResult vkpt_pt_trace_lighting(VkCommandBuffer cmd_buf, float num_bounce_rays)
VkPresentModeKHR present_mode
VkCommandPool command_pool
void vkpt_tone_mapping_request_reset()
VkResult vkpt_draw_destroy_pipelines()
void build_transparency_blas(VkCommandBuffer cmd_buf)
VkResult vkpt_pt_create_static(VkBuffer vertex_buffer, size_t buffer_offset, int num_vertices, int num_vertices_transparent, int num_vertices_sky, int num_vertices_custom_sky)
VkResult vkpt_profiler_destroy()
#define NUM_LIGHT_STATS_BUFFERS
void vkpt_freecam_reset()
VkResult vkpt_interleave(VkCommandBuffer cmd_buf)
VkResult vkpt_textures_upload_envmap(int w, int h, byte *data)
VkSemaphore render_finished
void update_transparency(VkCommandBuffer command_buffer, const float *view_matrix, const particle_t *particles, int particle_num, const entity_t *entities, int entity_num)
VkResult vkpt_light_buffer_upload_staging(VkCommandBuffer cmd_buf)
VkLayerProperties * layers
void R_DrawFill32_RTX(int x, int y, int w, int h, uint32_t color)
float projection_matrix_prev[16]
void R_DrawStretchPic_RTX(int x, int y, int w, int h, qhandle_t pic)
VkBufferView get_transparency_sprite_info_buffer_view()
VkAccelerationStructureNV get_transparency_sprite_blas()
struct sun_light_s sun_light_t
void R_SetColor_RTX(uint32_t color)
VkSampler tex_sampler_linear_clamp
void R_ClearColor_RTX(void)
VkResult vkpt_shadow_map_render(VkCommandBuffer cmd_buf, float *view_projection_matrix, int num_static_verts, int num_dynamic_verts, int transparent_offset, int num_transparent_verts)
VkDescriptorSet desc_set_textures_odd
cmd_buf_group_t cmd_buffers_compute
VkResult vkpt_tone_mapping_create_pipelines()
VkAccelerationStructureNV get_transparency_beam_blas()
VkResult vkpt_bloom_destroy_pipelines()
qboolean R_InterceptKey_RTX(unsigned key, qboolean down)
void create_orthographic_matrix(float matrix[16], float xmin, float xmax, float ymin, float ymax, float znear, float zfar)
uint32_t num_sdl2_extensions
double vkpt_get_profiler_result(int idx)
int R_DrawString_RTX(int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font)
VkDeviceSize screenshot_image_memory_size
unsigned int particle_num
struct maliasmesh_s maliasmesh_t
BufferResource_t buf_light
vkpt_refdef_t vkpt_refdef
uint32_t gpu_slice_width_prev
void R_LightPoint_RTX(vec3_t origin, vec3_t light)
void vkpt_textures_prefetch()
uint32_t world_transparent_count
static int num_model_lights
VkResult vkpt_load_shader_modules()
VkResult vkpt_destroy_shader_modules()
qboolean initialize_transparency()
float view_matrix_prev[16]
light_poly_t * light_polys
VkResult vkpt_tone_mapping_initialize()
VkResult vkpt_asvgf_destroy()
int bsp_mesh_world_loaded
uint32_t wait_for_idle_frames
void vkpt_free_command_buffers(cmd_buf_group_t *group)
float projection_matrix[16]
uint32_t world_custom_sky_offset
void bsp_mesh_create_from_bsp(bsp_mesh_t *wm, bsp_t *bsp, const char *map_name)
VkResult vkpt_draw_clear_stretch_pics()
void vkpt_submit_command_buffer_simple(VkCommandBuffer cmd_buf, VkQueue queue, qboolean all_gpus)
VkResult vkpt_uniform_buffer_create()
VkResult vkpt_pt_create_all_dynamic(VkCommandBuffer cmd_buf, int idx, VkBuffer vertex_buffer, const EntityUploadInfo *upload_info)
void R_SetAlphaScale_RTX(float alpha)
static void begin_perf_marker(VkCommandBuffer command_buffer, int index, const char *name)
VkResult vkpt_pt_trace_primary_rays(VkCommandBuffer cmd_buf)
VkSampler tex_sampler_nearest
VkExtent2D extent_unscaled
BufferResource_t buf_light_staging[MAX_FRAMES_IN_FLIGHT]
uint32_t explosions_vertex_offset
void destroy_transparency()
uint32_t explosions_vertex_num
uint32_t transparent_model_vertex_num
void R_TileClear_RTX(int x, int y, int w, int h, qhandle_t pic)
QVKInstanceBuffer_t uniform_instance_buffer
VkResult vkpt_vertex_buffer_create()
#define LIST_SHADER_MODULES
struct maliasframe_s maliasframe_t
VkResult vkpt_light_stats_create(bsp_mesh_t *bsp_mesh)
VkImageView images_views[NUM_VKPT_IMAGES]
VkFence fences_frame_sync[MAX_FRAMES_IN_FLIGHT]
VkResult vkpt_pt_trace_reflections(VkCommandBuffer cmd_buf, int bounce)
uint32_t world_sky_offset
uint32_t viewer_weapon_vertex_num
VkResult vkpt_vertex_buffer_destroy_pipelines()
void R_DrawFill8_RTX(int x, int y, int w, int h, int c)
void R_DrawChar_RTX(int x, int y, int flags, int c, qhandle_t font)
VkBufferView get_transparency_particle_color_buffer_view()
void vkpt_build_beam_lights(light_poly_t *light_list, int *num_lights, int max_lights, bsp_t *bsp, entity_t *entities, int num_entites, float adapted_luminance)
void vkpt_god_rays_prepare_ubo(QVKUniformBuffer_t *ubo, const aabb_t *world_aabb, const float *proj, const float *view, const float *shadowmap_viewproj, float shadowmap_depth_scale)
VkResult vkpt_asvgf_create_gradient_samples(VkCommandBuffer cmd_buf, uint32_t frame_num, int do_gradient_samples)
VkResult vkpt_bloom_record_cmd_buffer(VkCommandBuffer cmd_buf)
VkResult vkpt_shadow_map_create_pipelines()
BufferResource_t buf_light_stats[NUM_LIGHT_STATS_BUFFERS]
VkDescriptorSetLayout desc_set_layout_textures
uint32_t world_transparent_offset
void vkpt_extract_emissive_texture_info(image_t *image)
VkDescriptorSetLayout desc_set_layout_ubo
BufferResource_t buf_readback_staging[MAX_FRAMES_IN_FLIGHT]
void create_projection_matrix(float matrix[16], float znear, float zfar, float fov_x, float fov_y)
void R_SetScale_RTX(float scale)
VkResult vkpt_asvgf_initialize()
VkSurfaceFormatKHR surf_format
VkSemaphore image_available
VkResult vkpt_vertex_buffer_create_instance(VkCommandBuffer cmd_buf, uint32_t num_instances, qboolean update_world_animations)
VkBufferView get_transparency_beam_color_buffer_view()
struct bsp_model_s bsp_model_t
VkSemaphore trace_finished
qerror_t load_img(const char *name, image_t *image)
VkImageView swap_chain_image_views[MAX_SWAPCHAIN_IMAGES]
VkResult vkpt_pt_destroy()
VkResult vkpt_draw_initialize()
qerror_t MOD_LoadMD2_RTX(model_t *model, const void *rawdata, size_t length)
VkResult vkpt_destroy_god_rays()
void bsp_mesh_destroy(bsp_mesh_t *wm)
VkResult vkpt_pt_destroy_static()
uint32_t viewer_model_vertex_offset
void vkpt_textures_update_descriptor_set()
VkExtent2D extent_render_prev
QVKUniformBuffer_t uniform_buffer
void IMG_Load_RTX(image_t *image, byte *pic)
VkResult vkpt_final_blit_filtered(VkCommandBuffer cmd_buf)
struct vkpt_refdef_s vkpt_refdef_t
BufferResource_t buf_vertex_staging
uint32_t transparent_model_vertex_offset
void mult_matrix_matrix(float *p, const float *a, const float *b)
VkResult vkpt_draw_destroy()
#define MAX_SWAPCHAIN_IMAGES
uint32_t world_custom_sky_count
struct bsp_mesh_s::@19 cameras[MAX_CAMERAS]
float view_projection_matrix[16]
VkResult vkpt_profiler_query(VkCommandBuffer cmd_buf, int idx, VKPTProfilerAction action)
VkDescriptorSetLayout desc_set_layout_vertex_buffer
VkResult vkpt_draw_submit_stretch_pics(VkCommandBuffer cmd_buf)
VkResult vkpt_draw_create_pipelines()
uint32_t viewer_weapon_vertex_offset