Quake II RTX doxygen  1.0 dev
vkpt.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2018 Christoph Schied
3 Copyright (C) 2019, NVIDIA CORPORATION. All rights reserved.
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 #ifndef __VKPT_H__
21 #define __VKPT_H__
22 
23 #include <vulkan/vulkan.h>
24 #define HAVE_M_PI
25 #include <SDL.h>
26 #include <SDL_vulkan.h>
27 
28 #include "vk_util.h"
29 
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"
38 #include "client/client.h"
39 #include "refresh/refresh.h"
40 #include "refresh/images.h"
41 #include "refresh/models.h"
42 #include "system/hunk.h"
43 
44 #include "shader/global_ubo.h"
45 #include "shader/global_textures.h"
46 #include "shader/vertex_buffer.h"
47 
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))
51 
52 #define LOG_FUNC_(f) do {} while(0)
53 //#define LOG_FUNC_(f) Com_Printf("%s\n", f)
54 #define LOG_FUNC() LOG_FUNC_(__func__)
55 
56 #ifdef _DEBUG
57 #define _VK(...) \
58  do { \
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__); \
62  } \
63  } while(0)
64 #else
65 #define _VK(...) do { __VA_ARGS__; } while(0)
66 #endif
67 
68 /* see main.c to override default file path. By default it will strip away
69  * QVK_MOD_, fix the file ending, and convert to lower case */
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) \
109 
110 #ifndef VKPT_SHADER_DIR
111 #define VKPT_SHADER_DIR "shader_vkpt"
112 #endif
113 
114 #define SHADER_PATH_TEMPLATE VKPT_SHADER_DIR "/%s.spv"
115 
116 #define SHADER_STAGE(_module, _stage) \
117  { \
118  .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, \
119  .stage = _stage, \
120  .module = qvk.shader_modules[_module], \
121  .pName = "main" \
122  }
123 
124 #define SHADER_STAGE_SPEC(_module, _stage, _spec) \
125  { \
126  .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO, \
127  .stage = _stage, \
128  .module = qvk.shader_modules[_module], \
129  .pName = "main", \
130  .pSpecializationInfo = _spec, \
131  }
132 
134 #define SHADER_MODULE_DO(a) a,
136 #undef SHADER_MODULE_DO
138 };
139 
140 #define MAX_FRAMES_IN_FLIGHT 2
141 #define MAX_SWAPCHAIN_IMAGES 4
142 
143 typedef struct cmd_buf_group_s {
144  uint32_t count_per_frame;
145  uint32_t used_this_frame;
146  VkCommandBuffer* buffers;
147  VkCommandPool command_pool;
148 #ifdef _DEBUG
149  void** buffer_begin_addrs;
150 #endif
152 
153 typedef struct semaphore_group_s {
154  VkSemaphore image_available;
155  VkSemaphore render_finished;
156  VkSemaphore transfer_finished;
157  VkSemaphore trace_finished;
158  qboolean trace_signaled;
160 
161 typedef struct QVK_s {
162  VkInstance instance;
163  VkPhysicalDevice physical_device;
164  VkPhysicalDeviceMemoryProperties mem_properties;
165 
166  // number of GPUs we're rendering to --- if DG is disabled, this is 1
168 #ifdef VKPT_DEVICE_GROUPS
169  VkPhysicalDevice device_group_physical_devices[VKPT_MAX_GPUS];
170 #endif
171 
172  VkDevice device;
173  VkQueue queue_graphics;
174  VkQueue queue_compute;
175  VkQueue queue_transfer;
179  VkSurfaceKHR surface;
180  VkSwapchainKHR swap_chain;
181  VkSurfaceFormatKHR surf_format;
182  VkPresentModeKHR present_mode;
184  VkExtent2D extent_render;
185  VkExtent2D extent_render_prev;
186  VkExtent2D extent_unscaled;
187  uint32_t gpu_slice_width;
192 
197 
198  uint32_t num_extensions;
199  VkExtensionProperties *extensions;
200 
201  uint32_t num_layers;
202  VkLayerProperties *layers;
203 
204  VkDebugUtilsMessengerEXT dbg_messenger;
205 
208 
209 
212  uint64_t frame_counter;
213 
214  SDL_Window *window;
216  const char **sdl2_extensions;
217 
220  // when set, we'll do a WFI before acquire for this many frames
222 
224 
225  VkDescriptorSetLayout desc_set_layout_ubo;
226  VkDescriptorSet desc_set_ubo;
227 
228  VkDescriptorSetLayout desc_set_layout_textures;
229  VkDescriptorSet desc_set_textures_even;
230  VkDescriptorSet desc_set_textures_odd;
231  VkImage images [NUM_VKPT_IMAGES]; // todo: rename to make consistent
232  VkImageView images_views[NUM_VKPT_IMAGES]; // todo: rename to make consistent
233 
234 #ifdef VKPT_DEVICE_GROUPS
235  // local per-GPU image bindings for SLI
236  VkImage images_local[VKPT_MAX_GPUS][NUM_VKPT_IMAGES];
237  VkImageView images_views_local[VKPT_MAX_GPUS][NUM_VKPT_IMAGES];
238 #endif
239 
240  VkDescriptorSetLayout desc_set_layout_vertex_buffer;
241  VkDescriptorSet desc_set_vertex_buffer;
242 
248 
251 
254 
255  VkSampler tex_sampler,
258 
259  float sintab[256];
260 
262  VkDeviceMemory screenshot_image_memory;
264 
265 #ifdef VKPT_IMAGE_DUMPS
266  // host-visible image for dumping FB data through
267  VkImage dump_image;
268  VkDeviceMemory dump_image_memory;
269  VkDeviceSize dump_image_memory_size;
270 #endif
271 } QVK_t;
272 
273 extern QVK_t qvk;
274 
275 #define _VK_INST_EXTENSION_LIST \
276  _VK_INST_EXTENSION_DO(vkCmdBeginDebugUtilsLabelEXT) \
277  _VK_INST_EXTENSION_DO(vkCmdEndDebugUtilsLabelEXT) \
278  _VK_INST_EXTENSION_DO(vkEnumeratePhysicalDeviceGroupsKHR)
279 
280 #define _VK_INST_EXTENSION_DO(a) extern PFN_##a q##a;
282 #undef _VK_INST_EXTENSION_DO
283 
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)
307 
308 
309 #define _VK_EXTENSION_DO(a) extern PFN_##a q##a;
311 #undef _VK_EXTENSION_DO
312 
313 #define MAX_SKY_CLUSTERS 1024
314 
315 typedef struct light_poly_s {
316  float positions[9]; // 3x vec3_t
317  vec3_t off_center;
318  vec3_t color;
320  int cluster;
321  int style;
322 } light_poly_t;
323 
324 typedef struct bsp_model_s {
325  uint32_t idx_offset;
326  uint32_t idx_count;
327  vec3_t center;
328  vec3_t aabb_min;
329  vec3_t aabb_max;
330 
334 
335  qboolean transparent;
336 } bsp_model_t;
337 
338 typedef struct aabb_s {
339  vec3_t mins;
340  vec3_t maxs;
341 } aabb_t;
342 
343 typedef struct bsp_mesh_s {
344  uint32_t world_idx_count;
347 
349 
352 
354  uint32_t world_sky_count;
355 
358 
360  int *indices;
361  uint32_t *materials;
365 
367  int *clusters;
368 
372 
376 
380 
381  struct { vec3_t pos; vec3_t dir; } cameras[MAX_CAMERAS];
383 
384  char sky_visibility[VIS_MAX_BYTES];
385 
387 } bsp_mesh_t;
388 
389 void bsp_mesh_create_from_bsp(bsp_mesh_t *wm, bsp_t *bsp, const char* map_name);
390 void bsp_mesh_destroy(bsp_mesh_t *wm);
391 void bsp_mesh_register_textures(bsp_t *bsp);
392 
393 typedef struct vkpt_refdef_s {
396  refdef_t *fd;
397  float view_matrix[16];
398  float projection_matrix[16];
400 
401  float view_matrix_prev[16];
404  float z_near, z_far;
405 
408 
409  lightstyle_t prev_lightstyles[MAX_LIGHTSTYLES];
410 } vkpt_refdef_t;
411 
413 
414 typedef struct sun_light_s {
415  vec3_t direction;
417  vec3_t color;
420  qboolean visible;
421 } sun_light_t;
422 
423 void mult_matrix_matrix(float *p, const float *a, const float *b);
424 void mult_matrix_vector(float *p, const float *a, const float *b);
425 void create_entity_matrix(float matrix[16], entity_t *e, qboolean enable_left_hand);
426 void create_projection_matrix(float matrix[16], float znear, float zfar, float fov_x, float fov_y);
427 void create_view_matrix(float matrix[16], refdef_t *fd);
428 void inverse(const float *m, float *inv);
429 void create_orthographic_matrix(float matrix[16], float xmin, float xmax,
430  float ymin, float ymax, float znear, float zfar);
431 
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) \
458 
459 enum {
460 #define PROFILER_DO(a, ...) a,
462 #undef PROFILER_DO
464 };
465 
466 #define NUM_PROFILER_QUERIES_PER_FRAME (NUM_PROFILER_ENTRIES * 2)
467 
468 typedef enum {
472 
473 typedef struct EntityUploadInfo
474 {
475  uint32_t num_instances;
476  uint32_t num_vertices;
488 
489 VkDescriptorSet qvk_get_current_desc_set_textures();
490 
491 VkResult vkpt_profiler_initialize();
492 VkResult vkpt_profiler_destroy();
493 VkResult vkpt_profiler_query(VkCommandBuffer cmd_buf, int idx, VKPTProfilerAction action);
494 VkResult vkpt_profiler_next_frame(VkCommandBuffer cmd_buf);
495 void draw_profiler(int enable_asvgf);
496 double vkpt_get_profiler_result(int idx);
497 
498 VkResult vkpt_readback(struct ReadbackBuffer* dst);
499 
500 VkResult vkpt_textures_initialize();
501 VkResult vkpt_textures_destroy();
503 VkResult vkpt_textures_upload_envmap(int w, int h, byte *data);
510 
511 VkCommandBuffer vkpt_begin_command_buffer(cmd_buf_group_t* group);
514 void vkpt_wait_idle(VkQueue queue, cmd_buf_group_t* group);
515 
517  VkCommandBuffer cmd_buf,
518  VkQueue queue,
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,
527  VkFence fence);
528 
530  VkCommandBuffer cmd_buf,
531  VkQueue queue,
532  qboolean all_gpus);
533 
534 
535 #define ALL_GPUS (-1)
536 void set_current_gpu(VkCommandBuffer cmd_buf, int gpu_index);
537 
538 VkResult allocate_gpu_memory(VkMemoryRequirements mem_req, VkDeviceMemory* pMemory);
539 
540 #ifdef VKPT_DEVICE_GROUPS
541 void vkpt_mgpu_global_barrier(VkCommandBuffer cmd_buf);
542 
543 void
544 vkpt_mgpu_image_copy(VkCommandBuffer cmd_buf,
545  int src_image_index,
546  int dst_image_index,
547  int src_gpu_index,
548  int dst_gpu_index,
549  VkOffset2D src_offset,
550  VkOffset2D dst_offset,
551  VkExtent2D size);
552 #endif
553 
554 void
555 vkpt_image_copy(VkCommandBuffer cmd_buf,
556  int src_image_index,
557  int dst_image_index,
558  VkOffset2D src_offset,
559  VkOffset2D dst_offset,
560  VkExtent2D size);
561 
562 VkResult vkpt_draw_initialize();
563 VkResult vkpt_draw_destroy();
564 VkResult vkpt_draw_destroy_pipelines();
565 VkResult vkpt_draw_create_pipelines();
566 VkResult vkpt_draw_submit_stretch_pics(VkCommandBuffer cmd_buf);
567 VkResult vkpt_final_blit_simple(VkCommandBuffer cmd_buf);
568 VkResult vkpt_final_blit_filtered(VkCommandBuffer cmd_buf);
570 
571 VkResult vkpt_uniform_buffer_create();
572 VkResult vkpt_uniform_buffer_destroy();
573 VkResult vkpt_uniform_buffer_update(VkCommandBuffer command_buffer);
574 
575 VkResult vkpt_vertex_buffer_create();
576 VkResult vkpt_vertex_buffer_destroy();
580 VkResult vkpt_vertex_buffer_create_instance(VkCommandBuffer cmd_buf, uint32_t num_instances, qboolean update_world_animations);
584 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);
585 VkResult vkpt_light_buffer_upload_staging(VkCommandBuffer cmd_buf);
586 VkResult vkpt_light_stats_create(bsp_mesh_t *bsp_mesh);
587 VkResult vkpt_light_stats_destroy();
588 
589 VkResult vkpt_load_shader_modules();
590 VkResult vkpt_destroy_shader_modules();
591 VkResult vkpt_create_images();
592 VkResult vkpt_destroy_images();
593 
594 VkResult vkpt_pt_init();
595 VkResult vkpt_pt_destroy();
596 VkResult vkpt_pt_create_pipelines();
597 VkResult vkpt_pt_destroy_pipelines();
598 
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);
601 VkResult vkpt_pt_destroy_static();
602 VkResult vkpt_pt_trace_primary_rays(VkCommandBuffer cmd_buf);
603 VkResult vkpt_pt_trace_reflections(VkCommandBuffer cmd_buf, int bounce);
604 VkResult vkpt_pt_trace_lighting(VkCommandBuffer cmd_buf, float num_bounce_rays);
606 VkResult vkpt_pt_create_all_dynamic(VkCommandBuffer cmd_buf, int idx, VkBuffer vertex_buffer, const EntityUploadInfo* upload_info);
607 
608 VkResult vkpt_asvgf_initialize();
609 VkResult vkpt_asvgf_destroy();
610 VkResult vkpt_asvgf_create_pipelines();
612 VkResult vkpt_asvgf_filter(VkCommandBuffer cmd_buf, qboolean enable_lf);
613 VkResult vkpt_compositing(VkCommandBuffer cmd_buf);
614 VkResult vkpt_interleave(VkCommandBuffer cmd_buf);
615 VkResult vkpt_taa(VkCommandBuffer cmd_buf);
616 VkResult vkpt_asvgf_create_gradient_samples(VkCommandBuffer cmd_buf, uint32_t frame_num, int do_gradient_samples);
617 
618 VkResult vkpt_bloom_initialize();
619 VkResult vkpt_bloom_destroy();
620 VkResult vkpt_bloom_create_pipelines();
622 void vkpt_bloom_reset();
623 void vkpt_bloom_update(QVKUniformBuffer_t * ubo, float frame_time, qboolean under_water, qboolean menu_mode);
624 VkResult vkpt_bloom_record_cmd_buffer(VkCommandBuffer cmd_buf);
625 
627 VkResult vkpt_tone_mapping_destroy();
629 VkResult vkpt_tone_mapping_reset(VkCommandBuffer cmd_buf);
631 VkResult vkpt_tone_mapping_record_cmd_buffer(VkCommandBuffer cmd_buf, float frame_time);
633 
634 VkResult vkpt_shadow_map_initialize();
635 VkResult vkpt_shadow_map_destroy();
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);
639 VkImageView vkpt_shadow_map_get_view();
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);
641 
642 qerror_t load_img(const char *name, image_t *image);
643 // Transparency module API
644 
645 qboolean initialize_transparency();
646 void destroy_transparency();
647 
648 void update_transparency(VkCommandBuffer command_buffer, const float* view_matrix,
649  const particle_t* particles, int particle_num, const entity_t* entities, int entity_num);
650 
651 void build_transparency_blas(VkCommandBuffer cmd_buf);
652 
653 VkAccelerationStructureNV get_transparency_particle_blas();
654 VkAccelerationStructureNV get_transparency_beam_blas();
655 VkAccelerationStructureNV get_transparency_sprite_blas();
660 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);
661 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);
662 qboolean get_triangle_off_center(const float* positions, float* center, float* anti_center);
663 
664 VkResult vkpt_initialize_god_rays();
665 VkResult vkpt_destroy_god_rays();
668 VkResult vkpt_god_rays_update_images();
669 VkResult vkpt_god_rays_noop();
670 qboolean vkpt_god_rays_enabled(const sun_light_t* sun_light);
671 void vkpt_record_god_rays_trace_command_buffer(VkCommandBuffer command_buffer, int pass);
672 void vkpt_record_god_rays_filter_command_buffer(VkCommandBuffer command_buffer);
674  QVKUniformBuffer_t * ubo,
675  const aabb_t* world_aabb,
676  const float* proj,
677  const float* view,
678  const float* shadowmap_viewproj,
679  float shadowmap_depth_scale);
680 
681 void vkpt_freecam_reset();
682 void vkpt_freecam_update(float frame_time);
684 
685 typedef struct maliasframe_s {
686  vec3_t scale;
687  vec3_t translate;
688  vec3_t bounds[2];
689  vec_t radius;
690 } maliasframe_t;
691 
692 typedef struct maliasmesh_s {
693  int numverts;
694  int numtris;
695  int numindices;
696  int idx_offset; /* offset in vertex buffer on device */
697  int vertex_offset; /* offset in vertex buffer on device */
698  int *indices;
699  vec3_t *positions;
700  vec3_t *normals;
701  vec2_t *tex_coords;
702  vec4_t *tangents;
703  struct pbr_material_s *materials[MAX_ALIAS_SKINS];
704  int numskins;
705 } maliasmesh_t;
706 
707 // needed for model.c
708 #define TESS_MAX_VERTICES 16384
709 #define TESS_MAX_INDICES (3 * TESS_MAX_VERTICES)
710 
711 #define QGL_INDEX_TYPE GLuint
712 
713 typedef struct {
714  color_t colors[2]; // 0 - actual color, 1 - transparency (for text drawing)
715  float scale;
716  float alpha_scale;
717 } drawStatic_t;
718 
719 extern drawStatic_t draw;
720 
721 static inline void begin_perf_marker(VkCommandBuffer command_buffer, int index, const char* name)
722 {
723  _VK(vkpt_profiler_query(command_buffer, index, PROFILER_START));
724 
725  const VkDebugUtilsLabelEXT label = {
726  .sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
727  .pLabelName = name
728  };
729 
730  if (qvkCmdBeginDebugUtilsLabelEXT != NULL)
731  qvkCmdBeginDebugUtilsLabelEXT(command_buffer, &label);
732 }
733 
734 static inline void end_perf_marker(VkCommandBuffer command_buffer, int index)
735 {
736  if (qvkCmdEndDebugUtilsLabelEXT != NULL)
737  qvkCmdEndDebugUtilsLabelEXT(command_buffer);
738 
739  _VK(vkpt_profiler_query(command_buffer, index, PROFILER_STOP));
740 }
741 
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)
744 
745 void R_SetClipRect_RTX(const clipRect_t *clip);
746 void R_ClearColor_RTX(void);
747 void R_SetAlpha_RTX(float alpha);
748 void R_SetAlphaScale_RTX(float alpha);
749 void R_SetColor_RTX(uint32_t color);
750 void R_LightPoint_RTX(vec3_t origin, vec3_t light);
751 void R_SetScale_RTX(float scale);
752 void R_DrawStretchPic_RTX(int x, int y, int w, int h, qhandle_t pic);
753 void R_DrawPic_RTX(int x, int y, qhandle_t pic);
754 void R_TileClear_RTX(int x, int y, int w, int h, qhandle_t pic);
755 void R_DrawFill8_RTX(int x, int y, int w, int h, int c);
756 void R_DrawFill32_RTX(int x, int y, int w, int h, uint32_t color);
757 void R_DrawChar_RTX(int x, int y, int flags, int c, qhandle_t font);
758 int R_DrawString_RTX(int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font);
759 qboolean R_InterceptKey_RTX(unsigned key, qboolean down);
760 
761 void IMG_Load_RTX(image_t *image, byte *pic);
762 void IMG_Unload_RTX(image_t *image);
763 byte *IMG_ReadPixels_RTX(int *width, int *height, int *rowbytes);
764 
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);
767 void MOD_Reference_RTX(model_t *model);
768 
769 #endif /*__VKPT_H__*/
770 
QVK_s::desc_set_ubo
VkDescriptorSet desc_set_ubo
Definition: vkpt.h:226
QVK_s::win_height
int win_height
Definition: vkpt.h:211
sun_light_s
Definition: vkpt.h:414
bsp_mesh_s::num_clusters
int num_clusters
Definition: vkpt.h:366
get_transparency_counts
void get_transparency_counts(int *particle_num, int *beam_num, int *sprite_num)
Definition: transparency.c:256
drawStatic_t::alpha_scale
float alpha_scale
Definition: vkpt.h:716
maliasmesh_s
Definition: gl.h:232
vkpt_profiler_next_frame
VkResult vkpt_profiler_next_frame(VkCommandBuffer cmd_buf)
Definition: profiler.c:66
QVKUniformBuffer_s
Definition: global_ubo.h:247
cmd_buf_group_s::used_this_frame
uint32_t used_this_frame
Definition: vkpt.h:145
light_poly_s
Definition: vkpt.h:315
vkpt_vertex_buffer_upload_models_to_staging
VkResult vkpt_vertex_buffer_upload_models_to_staging()
Definition: vertex_buffer.c:412
vkpt_record_god_rays_filter_command_buffer
void vkpt_record_god_rays_filter_command_buffer(VkCommandBuffer command_buffer)
Definition: god_rays.c:169
QVK_s::frame_counter
uint64_t frame_counter
Definition: vkpt.h:212
vkpt_freecam_update
void vkpt_freecam_update(float frame_time)
Definition: freecam.c:120
maliasmesh_s::numindices
int numindices
Definition: gl.h:235
vkpt_final_blit_simple
VkResult vkpt_final_blit_simple(VkCommandBuffer cmd_buf)
Definition: draw.c:535
PROFILER_START
@ PROFILER_START
Definition: vkpt.h:469
QVK_s::sintab
float sintab[256]
Definition: vkpt.h:259
VKPTProfilerAction
VKPTProfilerAction
Definition: vkpt.h:468
vkpt_asvgf_destroy_pipelines
VkResult vkpt_asvgf_destroy_pipelines()
Definition: asvgf.c:185
QVK_s::num_swap_chain_images
uint32_t num_swap_chain_images
Definition: vkpt.h:189
vkpt_tone_mapping_destroy_pipelines
VkResult vkpt_tone_mapping_destroy_pipelines()
Definition: tone_mapping.c:207
_VK_EXTENSION_LIST
#define _VK_EXTENSION_LIST
Definition: vkpt.h:284
MAX_FRAMES_IN_FLIGHT
#define MAX_FRAMES_IN_FLIGHT
Definition: vkpt.h:140
bsp_mesh_s::sky_visibility
char sky_visibility[VIS_MAX_BYTES]
Definition: vkpt.h:384
height
static int height
Definition: physical_sky.c:39
R_SetAlpha_RTX
void R_SetAlpha_RTX(float alpha)
Definition: draw.c:650
maliasframe_s::scale
vec3_t scale
Definition: gl.h:226
bsp_mesh_s::cluster_aabbs
aabb_t * cluster_aabbs
Definition: vkpt.h:386
draw_profiler
void draw_profiler(int enable_asvgf)
Definition: profiler.c:134
end_perf_marker
static void end_perf_marker(VkCommandBuffer command_buffer, int index)
Definition: vkpt.h:734
image_t
struct image_s image_t
Definition: material.h:27
sun_light_s::use_physical_sky
qboolean use_physical_sky
Definition: vkpt.h:419
IMG_Unload_RTX
void IMG_Unload_RTX(image_t *image)
Definition: textures.c:639
vkpt_create_images
VkResult vkpt_create_images()
Definition: textures.c:1442
QVK_s::buf_tonemap
BufferResource_t buf_tonemap
Definition: vkpt.h:252
bsp_mesh_s::clusters
int * clusters
Definition: vkpt.h:367
vertex_buffer.h
EntityUploadInfo::viewer_model_vertex_num
uint32_t viewer_model_vertex_num
Definition: vkpt.h:481
vkpt_asvgf_create_pipelines
VkResult vkpt_asvgf_create_pipelines()
Definition: asvgf.c:91
maliasmesh_s::vertex_offset
int vertex_offset
Definition: vkpt.h:697
get_triangle_off_center
qboolean get_triangle_off_center(const float *positions, float *center, float *anti_center)
Definition: bsp_mesh.c:282
vkpt_reset_accumulation
void vkpt_reset_accumulation()
Definition: main.c:219
vkpt_begin_command_buffer
VkCommandBuffer vkpt_begin_command_buffer(cmd_buf_group_t *group)
Definition: main.c:3301
QVK_s::device
VkDevice device
Definition: vkpt.h:172
set_current_gpu
void set_current_gpu(VkCommandBuffer cmd_buf, int gpu_index)
Definition: vk_util.c:426
vkpt_uniform_buffer_destroy
VkResult vkpt_uniform_buffer_destroy()
Definition: uniform_buffer.c:127
bsp_mesh_s::texel_density
float * texel_density
Definition: vkpt.h:362
QVK_SHADER_MODULES
QVK_SHADER_MODULES
Definition: vkpt.h:133
vkpt_uniform_buffer_update
VkResult vkpt_uniform_buffer_update(VkCommandBuffer command_buffer)
Definition: uniform_buffer.c:142
EntityUploadInfo::dynamic_vertex_num
uint32_t dynamic_vertex_num
Definition: vkpt.h:477
cmd_buf_group_s::count_per_frame
uint32_t count_per_frame
Definition: vkpt.h:144
vkpt_vertex_buffer_upload_staging
VkResult vkpt_vertex_buffer_upload_staging()
Definition: vertex_buffer.c:36
get_transparency_particle_blas
VkAccelerationStructureNV get_transparency_particle_blas()
Definition: transparency.c:226
EntityUploadInfo::weapon_left_handed
qboolean weapon_left_handed
Definition: vkpt.h:486
vkpt_wait_idle
void vkpt_wait_idle(VkQueue queue, cmd_buf_group_t *group)
Definition: main.c:3405
R_DrawPic_RTX
void R_DrawPic_RTX(int x, int y, qhandle_t pic)
Definition: draw.c:691
MOD_LoadMD3_RTX
qerror_t MOD_LoadMD3_RTX(model_t *model, const void *rawdata, size_t length)
MAX_SKY_CLUSTERS
#define MAX_SKY_CLUSTERS
Definition: vkpt.h:313
create_view_matrix
void create_view_matrix(float matrix[16], refdef_t *fd)
Definition: matrix.c:131
vkpt_light_stats_destroy
VkResult vkpt_light_stats_destroy()
Definition: vertex_buffer.c:748
bsp_model_s::light_polys
light_poly_t * light_polys
Definition: vkpt.h:333
bsp_mesh_s
Definition: vkpt.h:343
vkpt_textures_destroy_unused
void vkpt_textures_destroy_unused()
Definition: textures.c:144
bsp_mesh_s::all_lava_emissive
qboolean all_lava_emissive
Definition: vkpt.h:379
QVK_s::instance
VkInstance instance
Definition: vkpt.h:162
QVK_s
Definition: vkpt.h:161
IMG_ReadPixels_RTX
byte * IMG_ReadPixels_RTX(int *width, int *height, int *rowbytes)
Definition: main.c:3028
particles
static cparticle_t particles[MAX_PARTICLES]
Definition: effects.c:830
QVK_s::cmd_buffers_transfer
cmd_buf_group_t cmd_buffers_transfer
Definition: vkpt.h:195
QVKInstanceBuffer_s
Definition: global_ubo.h:253
vkpt_asvgf_filter
VkResult vkpt_asvgf_filter(VkCommandBuffer cmd_buf, qboolean enable_lf)
Definition: asvgf.c:325
vkpt_taa
VkResult vkpt_taa(VkCommandBuffer cmd_buf)
Definition: asvgf.c:555
light_poly_s::color
vec3_t color
Definition: vkpt.h:318
QVK_s::buf_vertex
BufferResource_t buf_vertex
Definition: vkpt.h:243
QVK_s::extensions
VkExtensionProperties * extensions
Definition: vkpt.h:199
vkpt_god_rays_noop
VkResult vkpt_god_rays_noop()
Definition: god_rays.c:116
mult_matrix_vector
void mult_matrix_vector(float *p, const float *a, const float *b)
Definition: matrix.c:295
light_poly_s::material
struct pbr_material_s * material
Definition: vkpt.h:319
vkpt_init_light_textures
void vkpt_init_light_textures()
vkpt_textures_destroy
VkResult vkpt_textures_destroy()
Definition: textures.c:1045
vkpt_shadow_map_get_view
VkImageView vkpt_shadow_map_get_view()
Definition: shadow_map.c:203
qvk_get_current_desc_set_textures
VkDescriptorSet qvk_get_current_desc_set_textures()
Definition: main.c:1847
vkpt_refdef_s::view_projection_matrix_prev
float view_projection_matrix_prev[16]
Definition: vkpt.h:403
bsp_mesh_s::tex_coords
float * tex_coords
Definition: vkpt.h:359
QVK_s::current_frame_index
uint32_t current_frame_index
Definition: vkpt.h:219
QVK_s::tex_sampler
VkSampler tex_sampler
Definition: vkpt.h:255
vkpt_light_buffer_upload_to_staging
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)
Definition: vertex_buffer.c:310
cmd_buf_group_t
struct cmd_buf_group_s cmd_buf_group_t
QVK_s::buf_readback
BufferResource_t buf_readback
Definition: vkpt.h:249
vkpt_tone_mapping_reset
VkResult vkpt_tone_mapping_reset(VkCommandBuffer cmd_buf)
Definition: tone_mapping.c:176
QVK_s::gpu_slice_width
uint32_t gpu_slice_width
Definition: vkpt.h:187
semaphore_group_s
Definition: vkpt.h:153
QVK_s::sdl2_extensions
const char ** sdl2_extensions
Definition: vkpt.h:216
vkpt_vertex_buffer_destroy
VkResult vkpt_vertex_buffer_destroy()
Definition: vertex_buffer.c:675
global_textures.h
vkpt_normalize_normal_map
void vkpt_normalize_normal_map(image_t *image)
Definition: textures.c:592
vkpt_bloom_reset
void vkpt_bloom_reset()
Definition: bloom.c:76
QVK_s::fence_vertex_sync
VkFence fence_vertex_sync
Definition: vkpt.h:207
vkpt_god_rays_enabled
qboolean vkpt_god_rays_enabled(const sun_light_t *sun_light)
Definition: god_rays.c:379
bsp_mesh_s::num_models
int num_models
Definition: vkpt.h:346
bsp_mesh_s::num_cluster_lights
int num_cluster_lights
Definition: vkpt.h:369
bsp_mesh_s::pos
vec3_t pos
Definition: vkpt.h:381
vkpt_readback
VkResult vkpt_readback(struct ReadbackBuffer *dst)
Definition: vertex_buffer.c:659
vkpt_profiler_initialize
VkResult vkpt_profiler_initialize()
Definition: profiler.c:30
vkpt_textures_end_registration
VkResult vkpt_textures_end_registration()
Definition: textures.c:1087
QVK_s::queue_compute
VkQueue queue_compute
Definition: vkpt.h:174
bsp_mesh_s::allocated_light_polys
int allocated_light_polys
Definition: vkpt.h:374
vkpt_bloom_create_pipelines
VkResult vkpt_bloom_create_pipelines()
Definition: bloom.c:176
vkpt_refdef_s::z_near
float z_near
Definition: vkpt.h:404
vkpt_compositing
VkResult vkpt_compositing(VkCommandBuffer cmd_buf)
Definition: asvgf.c:460
bsp_mesh_s::dir
vec3_t dir
Definition: vkpt.h:381
bsp_mesh_s::tangents
float * tangents
Definition: vkpt.h:359
vkpt_shadow_map_destroy_pipelines
VkResult vkpt_shadow_map_destroy_pipelines()
Definition: shadow_map.c:351
QVK_t
struct QVK_s QVK_t
vkpt_vertex_buffer_upload_bsp_mesh_to_staging
VkResult vkpt_vertex_buffer_upload_bsp_mesh_to_staging(bsp_mesh_t *bsp_mesh)
Definition: vertex_buffer.c:90
aabb_s::mins
vec3_t mins
Definition: vkpt.h:339
QVK_s::cmd_buffers_graphics
cmd_buf_group_t cmd_buffers_graphics
Definition: vkpt.h:193
bsp_mesh_s::num_indices
int num_indices
Definition: vkpt.h:363
QVK_s::shader_modules
VkShaderModule shader_modules[NUM_QVK_SHADER_MODULES]
Definition: vkpt.h:223
create_entity_matrix
void create_entity_matrix(float matrix[16], entity_t *e, qboolean enable_left_hand)
Definition: matrix.c:23
semaphore_group_t
struct semaphore_group_s semaphore_group_t
bsp_model_s::center
vec3_t center
Definition: vkpt.h:327
EntityUploadInfo
struct EntityUploadInfo EntityUploadInfo
vkpt_initialize_god_rays
VkResult vkpt_initialize_god_rays()
Definition: god_rays.c:51
vkpt_pt_update_descripter_set_bindings
VkResult vkpt_pt_update_descripter_set_bindings(int idx)
Definition: path_tracer.c:251
sun_light_s::direction_envmap
vec3_t direction_envmap
Definition: vkpt.h:416
vkpt_textures_initialize
VkResult vkpt_textures_initialize()
Definition: textures.c:821
maliasmesh_s::tex_coords
vec2_t * tex_coords
Definition: vkpt.h:701
QVK_s::dbg_messenger
VkDebugUtilsMessengerEXT dbg_messenger
Definition: vkpt.h:204
vkpt_bloom_destroy
VkResult vkpt_bloom_destroy()
Definition: bloom.c:165
bsp_mesh_s::num_vertices
int num_vertices
Definition: vkpt.h:364
bsp_model_s::aabb_min
vec3_t aabb_min
Definition: vkpt.h:328
QVK_s::physical_device
VkPhysicalDevice physical_device
Definition: vkpt.h:163
maliasframe_s::translate
vec3_t translate
Definition: gl.h:227
QVK_s::desc_set_textures_even
VkDescriptorSet desc_set_textures_even
Definition: vkpt.h:229
sun_light_s::visible
qboolean visible
Definition: vkpt.h:420
QVK_s::screenshot_image_memory
VkDeviceMemory screenshot_image_memory
Definition: vkpt.h:262
maliasmesh_s::numverts
int numverts
Definition: gl.h:233
MOD_Reference_RTX
void MOD_Reference_RTX(model_t *model)
Definition: models.c:731
width
static int width
Definition: physical_sky.c:38
QVK_s::mem_properties
VkPhysicalDeviceMemoryProperties mem_properties
Definition: vkpt.h:164
vkpt_refdef_s::fd
refdef_t * fd
Definition: vkpt.h:396
maliasmesh_s::positions
vec3_t * positions
Definition: vkpt.h:699
vkpt_bloom_update
void vkpt_bloom_update(QVKUniformBuffer_t *ubo, float frame_time, qboolean under_water, qboolean menu_mode)
Definition: bloom.c:88
bsp_mesh_register_textures
void bsp_mesh_register_textures(bsp_t *bsp)
Definition: bsp_mesh.c:1781
_VK
#define _VK(...)
Definition: vkpt.h:65
_VK_INST_EXTENSION_LIST
#define _VK_INST_EXTENSION_LIST
Definition: vkpt.h:275
vkpt_refdef_s::bsp_mesh_world
bsp_mesh_t bsp_mesh_world
Definition: vkpt.h:406
vkpt_tone_mapping_destroy
VkResult vkpt_tone_mapping_destroy()
Definition: tone_mapping.c:126
vkpt_god_rays_destroy_pipelines
VkResult vkpt_god_rays_destroy_pipelines()
Definition: god_rays.c:85
bsp_model_s::idx_count
uint32_t idx_count
Definition: vkpt.h:326
allocate_gpu_memory
VkResult allocate_gpu_memory(VkMemoryRequirements mem_req, VkDeviceMemory *pMemory)
Definition: vk_util.c:402
bsp_mesh_s::sky_clusters
uint32_t sky_clusters[MAX_SKY_CLUSTERS]
Definition: vkpt.h:377
QVK_s::semaphores
semaphore_group_t semaphores[MAX_FRAMES_IN_FLIGHT][VKPT_MAX_GPUS]
Definition: vkpt.h:196
maliasframe_s::bounds
vec3_t bounds[2]
Definition: gl.h:228
QVK_s::queue_idx_compute
int32_t queue_idx_compute
Definition: vkpt.h:177
bsp_mesh_s::cluster_lights
int * cluster_lights
Definition: vkpt.h:371
vkpt_refdef_s::view_matrix
float view_matrix[16]
Definition: vkpt.h:397
PROFILER_LIST
#define PROFILER_LIST
Definition: vkpt.h:432
bsp_mesh_t
struct bsp_mesh_s bsp_mesh_t
bsp_mesh_s::cluster_light_offsets
int * cluster_light_offsets
Definition: vkpt.h:370
vkpt_reset_command_buffers
void vkpt_reset_command_buffers(cmd_buf_group_t *group)
Definition: main.c:3392
vkpt_god_rays_create_pipelines
VkResult vkpt_god_rays_create_pipelines()
Definition: god_rays.c:73
QVK_s::queue_idx_graphics
int32_t queue_idx_graphics
Definition: vkpt.h:176
QVK_s::extent_screen_images
VkExtent2D extent_screen_images
Definition: vkpt.h:183
QVK_s::desc_set_vertex_buffer
VkDescriptorSet desc_set_vertex_buffer
Definition: vkpt.h:241
vkpt_submit_command_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)
Definition: main.c:3411
QVK_s::current_swap_chain_image_index
uint32_t current_swap_chain_image_index
Definition: vkpt.h:218
cmd_buf_group_s
Definition: vkpt.h:143
vkpt_vertex_buffer_create_pipelines
VkResult vkpt_vertex_buffer_create_pipelines()
Definition: vertex_buffer.c:759
vkpt_destroy_images
VkResult vkpt_destroy_images()
Definition: textures.c:1757
maliasframe_s::radius
vec_t radius
Definition: gl.h:229
QVK_s::queue_idx_transfer
int32_t queue_idx_transfer
Definition: vkpt.h:178
vkpt_refdef_s::prev_lightstyles
lightstyle_t prev_lightstyles[MAX_LIGHTSTYLES]
Definition: vkpt.h:409
semaphore_group_s::trace_signaled
qboolean trace_signaled
Definition: vkpt.h:158
PROFILER_STOP
@ PROFILER_STOP
Definition: vkpt.h:470
pbr_material_s
Definition: material.h:33
vkpt_pt_create_pipelines
VkResult vkpt_pt_create_pipelines()
Definition: path_tracer.c:1216
maliasmesh_s::materials
struct pbr_material_s * materials[MAX_ALIAS_SKINS]
Definition: vkpt.h:703
vkpt_god_rays_update_images
VkResult vkpt_god_rays_update_images()
Definition: god_rays.c:108
QVK_s::buf_sun_color
BufferResource_t buf_sun_color
Definition: vkpt.h:253
vkpt_pt_destroy_pipelines
VkResult vkpt_pt_destroy_pipelines()
Definition: path_tracer.c:1410
vkpt_tone_mapping_record_cmd_buffer
VkResult vkpt_tone_mapping_record_cmd_buffer(VkCommandBuffer cmd_buf, float frame_time)
Definition: tone_mapping.c:241
R_SetClipRect_RTX
void R_SetClipRect_RTX(const clipRect_t *clip)
Definition: draw.c:629
light_poly_t
struct light_poly_s light_poly_t
vkpt_image_copy
void vkpt_image_copy(VkCommandBuffer cmd_buf, int src_image_index, int dst_image_index, VkOffset2D src_offset, VkOffset2D dst_offset, VkExtent2D size)
Definition: mgpu.c:111
bsp_model_s::allocated_light_polys
int allocated_light_polys
Definition: vkpt.h:332
vkpt_record_god_rays_trace_command_buffer
void vkpt_record_god_rays_trace_command_buffer(VkCommandBuffer command_buffer, int pass)
Definition: god_rays.c:140
aabb_t
struct aabb_s aabb_t
vkpt_pt_init
VkResult vkpt_pt_init()
Definition: path_tracer.c:134
semaphore_group_s::transfer_finished
VkSemaphore transfer_finished
Definition: vkpt.h:156
vkpt_bloom_initialize
VkResult vkpt_bloom_initialize()
Definition: bloom.c:127
QVK_s::swap_chain_images
VkImage swap_chain_images[MAX_SWAPCHAIN_IMAGES]
Definition: vkpt.h:190
m
static struct mdfour * m
Definition: mdfour.c:32
QVK_s::swap_chain
VkSwapchainKHR swap_chain
Definition: vkpt.h:180
cmd_buf_group_s::buffers
VkCommandBuffer * buffers
Definition: vkpt.h:146
origin
static vec3_t origin
Definition: mesh.c:27
bsp_mesh_s::materials
uint32_t * materials
Definition: vkpt.h:361
bsp_mesh_s::models
bsp_model_t * models
Definition: vkpt.h:345
NUM_QVK_SHADER_MODULES
@ NUM_QVK_SHADER_MODULES
Definition: vkpt.h:137
vkpt_light_buffer_reset_counts
void vkpt_light_buffer_reset_counts()
Definition: vertex_buffer.c:131
vkpt_shadow_map_destroy
VkResult vkpt_shadow_map_destroy()
Definition: shadow_map.c:182
vkpt_pt_create_toplevel
VkResult vkpt_pt_create_toplevel(VkCommandBuffer cmd_buf, int idx, qboolean include_world, qboolean weapon_left_handed)
Definition: path_tracer.c:852
vkpt_build_cylinder_light
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)
Definition: transparency.c:408
QVK_s::images
VkImage images[NUM_VKPT_IMAGES]
Definition: vkpt.h:231
QVK_s::screenshot_image
VkImage screenshot_image
Definition: vkpt.h:261
vkpt_shadow_map_setup
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)
Definition: shadow_map.c:460
light_poly_s::style
int style
Definition: vkpt.h:321
ReadbackBuffer
Definition: vertex_buffer.h:134
vkpt_shadow_map_initialize
VkResult vkpt_shadow_map_initialize()
Definition: shadow_map.c:87
beam_num
unsigned int beam_num
Definition: transparency.c:51
bsp_model_s
Definition: vkpt.h:324
inverse
void inverse(const float *m, float *inv)
Definition: matrix.c:158
vkpt_pt_trace_lighting
VkResult vkpt_pt_trace_lighting(VkCommandBuffer cmd_buf, float num_bounce_rays)
Definition: path_tracer.c:1105
QVK_s::win_width
int win_width
Definition: vkpt.h:210
QVK_s::present_mode
VkPresentModeKHR present_mode
Definition: vkpt.h:182
sprite_num
unsigned int sprite_num
Definition: transparency.c:52
cmd_buf_group_s::command_pool
VkCommandPool command_pool
Definition: vkpt.h:147
vkpt_tone_mapping_request_reset
void vkpt_tone_mapping_request_reset()
Definition: tone_mapping.c:138
sun_light_s::angular_size_rad
float angular_size_rad
Definition: vkpt.h:418
vkpt_draw_destroy_pipelines
VkResult vkpt_draw_destroy_pipelines()
Definition: draw.c:309
build_transparency_blas
void build_transparency_blas(VkCommandBuffer cmd_buf)
Definition: transparency.c:217
vkpt_pt_create_static
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)
Definition: path_tracer.c:574
vkpt_profiler_destroy
VkResult vkpt_profiler_destroy()
Definition: profiler.c:42
NUM_LIGHT_STATS_BUFFERS
#define NUM_LIGHT_STATS_BUFFERS
Definition: constants.h:44
vkpt_freecam_reset
void vkpt_freecam_reset()
Definition: freecam.c:55
VKPT_MAX_GPUS
#define VKPT_MAX_GPUS
Definition: vk_util.h:30
vkpt_interleave
VkResult vkpt_interleave(VkCommandBuffer cmd_buf)
Definition: asvgf.c:492
maliasmesh_s::tangents
vec4_t * tangents
Definition: vkpt.h:702
vkpt_textures_upload_envmap
VkResult vkpt_textures_upload_envmap(int w, int h, byte *data)
Definition: textures.c:150
bsp_mesh_s::world_sky_count
uint32_t world_sky_count
Definition: vkpt.h:354
sun_light_s::color
vec3_t color
Definition: vkpt.h:417
maliasmesh_s::indices
int * indices
Definition: vkpt.h:698
MAX_CAMERAS
#define MAX_CAMERAS
Definition: constants.h:48
vertex_buffer
VkBuffer vertex_buffer
Definition: transparency.c:64
semaphore_group_s::render_finished
VkSemaphore render_finished
Definition: vkpt.h:155
update_transparency
void update_transparency(VkCommandBuffer command_buffer, const float *view_matrix, const particle_t *particles, int particle_num, const entity_t *entities, int entity_num)
Definition: transparency.c:171
vkpt_light_buffer_upload_staging
VkResult vkpt_light_buffer_upload_staging(VkCommandBuffer cmd_buf)
Definition: vertex_buffer.c:69
QVK_s::layers
VkLayerProperties * layers
Definition: vkpt.h:202
NUM_PROFILER_ENTRIES
@ NUM_PROFILER_ENTRIES
Definition: vkpt.h:463
R_DrawFill32_RTX
void R_DrawFill32_RTX(int x, int y, int w, int h, uint32_t color)
Definition: draw.c:717
vkpt_refdef_s::projection_matrix_prev
float projection_matrix_prev[16]
Definition: vkpt.h:402
R_DrawStretchPic_RTX
void R_DrawStretchPic_RTX(int x, int y, int w, int h, qhandle_t pic)
Definition: draw.c:682
get_transparency_sprite_info_buffer_view
VkBufferView get_transparency_sprite_info_buffer_view()
Definition: transparency.c:251
get_transparency_sprite_blas
VkAccelerationStructureNV get_transparency_sprite_blas()
Definition: transparency.c:236
light_poly_s::off_center
vec3_t off_center
Definition: vkpt.h:317
sun_light_t
struct sun_light_s sun_light_t
R_SetColor_RTX
void R_SetColor_RTX(uint32_t color)
Definition: draw.c:663
QVK_s::tex_sampler_linear_clamp
VkSampler tex_sampler_linear_clamp
Definition: vkpt.h:257
R_ClearColor_RTX
void R_ClearColor_RTX(void)
Definition: draw.c:643
vkpt_shadow_map_render
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)
Definition: shadow_map.c:364
QVK_s::desc_set_textures_odd
VkDescriptorSet desc_set_textures_odd
Definition: vkpt.h:230
QVK_s::cmd_buffers_compute
cmd_buf_group_t cmd_buffers_compute
Definition: vkpt.h:194
vkpt_tone_mapping_create_pipelines
VkResult vkpt_tone_mapping_create_pipelines()
Definition: tone_mapping.c:146
get_transparency_beam_blas
VkAccelerationStructureNV get_transparency_beam_blas()
Definition: transparency.c:231
sun_light_s::direction
vec3_t direction
Definition: vkpt.h:415
vkpt_bloom_destroy_pipelines
VkResult vkpt_bloom_destroy_pipelines()
Definition: bloom.c:196
R_InterceptKey_RTX
qboolean R_InterceptKey_RTX(unsigned key, qboolean down)
Definition: freecam.c:185
create_orthographic_matrix
void create_orthographic_matrix(float matrix[16], float xmin, float xmax, float ymin, float ymax, float znear, float zfar)
Definition: matrix.c:100
QVK_s::num_sdl2_extensions
uint32_t num_sdl2_extensions
Definition: vkpt.h:215
maliasmesh_s::idx_offset
int idx_offset
Definition: vkpt.h:696
vkpt_get_profiler_result
double vkpt_get_profiler_result(int idx)
Definition: profiler.c:183
R_DrawString_RTX
int R_DrawString_RTX(int x, int y, int flags, size_t maxlen, const char *s, qhandle_t font)
Definition: draw.c:756
QVK_s::screenshot_image_memory_size
VkDeviceSize screenshot_image_memory_size
Definition: vkpt.h:263
particle_num
unsigned int particle_num
Definition: transparency.c:50
maliasmesh_t
struct maliasmesh_s maliasmesh_t
QVK_s::buf_light
BufferResource_t buf_light
Definition: vkpt.h:245
vkpt_refdef
vkpt_refdef_t vkpt_refdef
Definition: main.c:372
QVK_s::gpu_slice_width_prev
uint32_t gpu_slice_width_prev
Definition: vkpt.h:188
R_LightPoint_RTX
void R_LightPoint_RTX(vec3_t origin, vec3_t light)
Definition: draw.c:670
vkpt_textures_prefetch
void vkpt_textures_prefetch()
Definition: textures.c:75
bsp_mesh_s::world_transparent_count
uint32_t world_transparent_count
Definition: vkpt.h:351
bsp_model_s::aabb_max
vec3_t aabb_max
Definition: vkpt.h:329
bsp_mesh_s::indices
int * indices
Definition: vkpt.h:360
c
statCounters_t c
Definition: main.c:30
num_model_lights
static int num_model_lights
Definition: main.c:1266
vkpt_load_shader_modules
VkResult vkpt_load_shader_modules()
Definition: main.c:1162
vkpt_destroy_shader_modules
VkResult vkpt_destroy_shader_modules()
Definition: main.c:1180
initialize_transparency
qboolean initialize_transparency()
Definition: transparency.c:114
vkpt_refdef_s::view_matrix_prev
float view_matrix_prev[16]
Definition: vkpt.h:401
bsp_mesh_s::num_sky_clusters
int num_sky_clusters
Definition: vkpt.h:378
bsp_mesh_s::light_polys
light_poly_t * light_polys
Definition: vkpt.h:375
QVK_s::window
SDL_Window * window
Definition: vkpt.h:214
vkpt_tone_mapping_initialize
VkResult vkpt_tone_mapping_initialize()
Definition: tone_mapping.c:76
drawStatic_t
Definition: gl.h:401
vkpt_asvgf_destroy
VkResult vkpt_asvgf_destroy()
Definition: asvgf.c:81
vkpt_refdef_s::bsp_mesh_world_loaded
int bsp_mesh_world_loaded
Definition: vkpt.h:407
QVK_s::wait_for_idle_frames
uint32_t wait_for_idle_frames
Definition: vkpt.h:221
vkpt_free_command_buffers
void vkpt_free_command_buffers(cmd_buf_group_t *group)
Definition: main.c:3373
bsp_model_s::num_light_polys
int num_light_polys
Definition: vkpt.h:331
vkpt_refdef_s::projection_matrix
float projection_matrix[16]
Definition: vkpt.h:398
vk_util.h
bsp_mesh_s::world_custom_sky_offset
uint32_t world_custom_sky_offset
Definition: vkpt.h:356
bsp_mesh_s::num_light_polys
int num_light_polys
Definition: vkpt.h:373
QVK_s::extent_render
VkExtent2D extent_render
Definition: vkpt.h:184
bsp_mesh_create_from_bsp
void bsp_mesh_create_from_bsp(bsp_mesh_t *wm, bsp_t *bsp, const char *map_name)
Definition: bsp_mesh.c:1623
vkpt_refdef_s::z_far
float z_far
Definition: vkpt.h:404
vkpt_draw_clear_stretch_pics
VkResult vkpt_draw_clear_stretch_pics()
Definition: draw.c:492
vkpt_submit_command_buffer_simple
void vkpt_submit_command_buffer_simple(VkCommandBuffer cmd_buf, VkQueue queue, qboolean all_gpus)
Definition: main.c:3473
BufferResource_s
Definition: vk_util.h:33
bsp_mesh_s::positions
float * positions
Definition: vkpt.h:359
vkpt_uniform_buffer_create
VkResult vkpt_uniform_buffer_create()
Definition: uniform_buffer.c:30
vkpt_pt_create_all_dynamic
VkResult vkpt_pt_create_all_dynamic(VkCommandBuffer cmd_buf, int idx, VkBuffer vertex_buffer, const EntityUploadInfo *upload_info)
Definition: path_tracer.c:781
R_SetAlphaScale_RTX
void R_SetAlphaScale_RTX(float alpha)
Definition: draw.c:657
begin_perf_marker
static void begin_perf_marker(VkCommandBuffer command_buffer, int index, const char *name)
Definition: vkpt.h:721
vkpt_pt_trace_primary_rays
VkResult vkpt_pt_trace_primary_rays(VkCommandBuffer cmd_buf)
Definition: path_tracer.c:1009
QVK_s::tex_sampler_nearest
VkSampler tex_sampler_nearest
Definition: vkpt.h:256
QVK_s::extent_unscaled
VkExtent2D extent_unscaled
Definition: vkpt.h:186
EntityUploadInfo
Definition: vkpt.h:473
QVK_s::buf_light_staging
BufferResource_t buf_light_staging[MAX_FRAMES_IN_FLIGHT]
Definition: vkpt.h:246
EntityUploadInfo::explosions_vertex_offset
uint32_t explosions_vertex_offset
Definition: vkpt.h:484
destroy_transparency
void destroy_transparency()
Definition: transparency.c:151
EntityUploadInfo::explosions_vertex_num
uint32_t explosions_vertex_num
Definition: vkpt.h:485
client.h
QVK_s::num_layers
uint32_t num_layers
Definition: vkpt.h:201
EntityUploadInfo::transparent_model_vertex_num
uint32_t transparent_model_vertex_num
Definition: vkpt.h:479
R_TileClear_RTX
void R_TileClear_RTX(int x, int y, int w, int h, qhandle_t pic)
Definition: draw.c:700
aabb_s
Definition: vkpt.h:338
maliasmesh_s::numtris
int numtris
Definition: gl.h:234
vkpt_refdef_s::uniform_instance_buffer
QVKInstanceBuffer_t uniform_instance_buffer
Definition: vkpt.h:395
maliasmesh_s::normals
vec3_t * normals
Definition: vkpt.h:700
vkpt_vertex_buffer_create
VkResult vkpt_vertex_buffer_create()
Definition: vertex_buffer.c:492
NUM_VKPT_IMAGES
@ NUM_VKPT_IMAGES
Definition: global_textures.h:157
LIST_SHADER_MODULES
#define LIST_SHADER_MODULES
Definition: vkpt.h:70
maliasframe_t
struct maliasframe_s maliasframe_t
vkpt_light_stats_create
VkResult vkpt_light_stats_create(bsp_mesh_t *bsp_mesh)
Definition: vertex_buffer.c:699
bsp_mesh_s::world_idx_count
uint32_t world_idx_count
Definition: vkpt.h:344
QVK_s::images_views
VkImageView images_views[NUM_VKPT_IMAGES]
Definition: vkpt.h:232
QVK_s::fences_frame_sync
VkFence fences_frame_sync[MAX_FRAMES_IN_FLIGHT]
Definition: vkpt.h:206
vkpt_pt_trace_reflections
VkResult vkpt_pt_trace_reflections(VkCommandBuffer cmd_buf, int bounce)
Definition: path_tracer.c:1063
bsp_mesh_s::world_sky_offset
uint32_t world_sky_offset
Definition: vkpt.h:353
EntityUploadInfo::viewer_weapon_vertex_num
uint32_t viewer_weapon_vertex_num
Definition: vkpt.h:483
vkpt_vertex_buffer_destroy_pipelines
VkResult vkpt_vertex_buffer_destroy_pipelines()
Definition: vertex_buffer.c:800
R_DrawFill8_RTX
void R_DrawFill8_RTX(int x, int y, int w, int h, int c)
Definition: draw.c:708
bsp_mesh_s::world_aabb
aabb_t world_aabb
Definition: vkpt.h:348
color
static vec4_t color
Definition: mesh.c:33
R_DrawChar_RTX
void R_DrawChar_RTX(int x, int y, int flags, int c, qhandle_t font)
Definition: draw.c:750
get_transparency_particle_color_buffer_view
VkBufferView get_transparency_particle_color_buffer_view()
Definition: transparency.c:241
vkpt_build_beam_lights
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)
Definition: transparency.c:492
vkpt_god_rays_prepare_ubo
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)
Definition: god_rays.c:203
vkpt_asvgf_create_gradient_samples
VkResult vkpt_asvgf_create_gradient_samples(VkCommandBuffer cmd_buf, uint32_t frame_num, int do_gradient_samples)
Definition: asvgf.c:251
vkpt_bloom_record_cmd_buffer
VkResult vkpt_bloom_record_cmd_buffer(VkCommandBuffer cmd_buf)
Definition: bloom.c:301
vkpt_shadow_map_create_pipelines
VkResult vkpt_shadow_map_create_pipelines()
Definition: shadow_map.c:209
QVK_s::buf_light_stats
BufferResource_t buf_light_stats[NUM_LIGHT_STATS_BUFFERS]
Definition: vkpt.h:247
QVK_s::desc_set_layout_textures
VkDescriptorSetLayout desc_set_layout_textures
Definition: vkpt.h:228
bsp_mesh_s::world_transparent_offset
uint32_t world_transparent_offset
Definition: vkpt.h:350
vkpt_extract_emissive_texture_info
void vkpt_extract_emissive_texture_info(image_t *image)
Definition: textures.c:532
QVK_s::desc_set_layout_ubo
VkDescriptorSetLayout desc_set_layout_ubo
Definition: vkpt.h:225
QVK_s::buf_readback_staging
BufferResource_t buf_readback_staging[MAX_FRAMES_IN_FLIGHT]
Definition: vkpt.h:250
aabb_s::maxs
vec3_t maxs
Definition: vkpt.h:340
create_projection_matrix
void create_projection_matrix(float matrix[16], float znear, float zfar, float fov_x, float fov_y)
Definition: matrix.c:63
qvk
QVK_t qvk
Definition: main.c:377
EntityUploadInfo::num_vertices
uint32_t num_vertices
Definition: vkpt.h:476
R_SetScale_RTX
void R_SetScale_RTX(float scale)
Definition: draw.c:676
vkpt_asvgf_initialize
VkResult vkpt_asvgf_initialize()
Definition: asvgf.c:45
QVK_s::surf_format
VkSurfaceFormatKHR surf_format
Definition: vkpt.h:181
semaphore_group_s::image_available
VkSemaphore image_available
Definition: vkpt.h:154
vkpt_vertex_buffer_create_instance
VkResult vkpt_vertex_buffer_create_instance(VkCommandBuffer cmd_buf, uint32_t num_instances, qboolean update_world_animations)
Definition: vertex_buffer.c:818
get_transparency_beam_color_buffer_view
VkBufferView get_transparency_beam_color_buffer_view()
Definition: transparency.c:246
bsp_model_t
struct bsp_model_s bsp_model_t
semaphore_group_s::trace_finished
VkSemaphore trace_finished
Definition: vkpt.h:157
load_img
qerror_t load_img(const char *name, image_t *image)
Definition: images.c:927
QVK_s::swap_chain_image_views
VkImageView swap_chain_image_views[MAX_SWAPCHAIN_IMAGES]
Definition: vkpt.h:191
vkpt_pt_destroy
VkResult vkpt_pt_destroy()
Definition: path_tracer.c:1196
vkpt_draw_initialize
VkResult vkpt_draw_initialize()
Definition: draw.c:217
MOD_LoadMD2_RTX
qerror_t MOD_LoadMD2_RTX(model_t *model, const void *rawdata, size_t length)
Definition: models.c:186
vkpt_destroy_god_rays
VkResult vkpt_destroy_god_rays()
Definition: god_rays.c:65
vkpt_refdef_s
Definition: vkpt.h:393
maliasframe_s
Definition: gl.h:225
bsp_mesh_destroy
void bsp_mesh_destroy(bsp_mesh_t *wm)
Definition: bsp_mesh.c:1760
QVK_s::surface
VkSurfaceKHR surface
Definition: vkpt.h:179
vkpt_pt_destroy_static
VkResult vkpt_pt_destroy_static()
Definition: path_tracer.c:345
EntityUploadInfo::viewer_model_vertex_offset
uint32_t viewer_model_vertex_offset
Definition: vkpt.h:480
vkpt_textures_update_descriptor_set
void vkpt_textures_update_descriptor_set()
Definition: textures.c:1346
bsp_model_s::idx_offset
uint32_t idx_offset
Definition: vkpt.h:325
global_ubo.h
QVK_s::extent_render_prev
VkExtent2D extent_render_prev
Definition: vkpt.h:185
vkpt_refdef_s::uniform_buffer
QVKUniformBuffer_t uniform_buffer
Definition: vkpt.h:394
IMG_Load_RTX
void IMG_Load_RTX(image_t *image, byte *pic)
Definition: textures.c:632
light_poly_s::cluster
int cluster
Definition: vkpt.h:320
vkpt_final_blit_filtered
VkResult vkpt_final_blit_filtered(VkCommandBuffer cmd_buf)
Definition: draw.c:604
vkpt_refdef_t
struct vkpt_refdef_s vkpt_refdef_t
QVK_s::buf_vertex_staging
BufferResource_t buf_vertex_staging
Definition: vkpt.h:244
EntityUploadInfo::transparent_model_vertex_offset
uint32_t transparent_model_vertex_offset
Definition: vkpt.h:478
maliasmesh_s::numskins
int numskins
Definition: gl.h:240
QVK_s::queue_graphics
VkQueue queue_graphics
Definition: vkpt.h:173
QVK_s::device_count
int device_count
Definition: vkpt.h:167
mult_matrix_matrix
void mult_matrix_matrix(float *p, const float *a, const float *b)
Definition: matrix.c:281
QVK_s::queue_transfer
VkQueue queue_transfer
Definition: vkpt.h:175
QVK_s::num_extensions
uint32_t num_extensions
Definition: vkpt.h:198
vkpt_draw_destroy
VkResult vkpt_draw_destroy()
Definition: draw.c:295
MAX_SWAPCHAIN_IMAGES
#define MAX_SWAPCHAIN_IMAGES
Definition: vkpt.h:141
bsp_mesh_s::world_custom_sky_count
uint32_t world_custom_sky_count
Definition: vkpt.h:357
light_poly_s::positions
float positions[9]
Definition: vkpt.h:316
bsp_mesh_s::cameras
struct bsp_mesh_s::@19 cameras[MAX_CAMERAS]
vkpt_refdef_s::view_projection_matrix
float view_projection_matrix[16]
Definition: vkpt.h:399
vkpt_profiler_query
VkResult vkpt_profiler_query(VkCommandBuffer cmd_buf, int idx, VKPTProfilerAction action)
Definition: profiler.c:49
QVK_s::desc_set_layout_vertex_buffer
VkDescriptorSetLayout desc_set_layout_vertex_buffer
Definition: vkpt.h:240
bsp_model_s::transparent
qboolean transparent
Definition: vkpt.h:335
vkpt_draw_submit_stretch_pics
VkResult vkpt_draw_submit_stretch_pics(VkCommandBuffer cmd_buf)
Definition: draw.c:499
draw
drawStatic_t draw
Definition: draw.c:21
EntityUploadInfo::num_instances
uint32_t num_instances
Definition: vkpt.h:475
bsp_mesh_s::num_cameras
int num_cameras
Definition: vkpt.h:382
vkpt_draw_create_pipelines
VkResult vkpt_draw_create_pipelines()
Definition: draw.c:323
EntityUploadInfo::viewer_weapon_vertex_offset
uint32_t viewer_weapon_vertex_offset
Definition: vkpt.h:482