vkQuake2 doxygen  1.0 dev
vk_rmain.c File Reference
#include "vk_local.h"

Go to the source code of this file.

Macros

#define NUM_BEAM_SEGS   6
 

Functions

void Vk_Strings_f (void)
 
void Vk_Mem_f (void)
 
qboolean R_CullBox (vec3_t mins, vec3_t maxs)
 
void R_RotateForEntity (entity_t *e, float *mvMatrix)
 
void R_DrawSpriteModel (entity_t *e)
 
void R_DrawNullModel (void)
 
void R_DrawEntitiesOnList (void)
 
void Vk_DrawParticles (int num_particles, const particle_t particles[], const unsigned colortable[768])
 
void R_DrawParticles (void)
 
void R_PolyBlend (void)
 
int SignbitsForPlane (cplane_t *out)
 
void R_SetFrustum (float fovx, float fovy)
 
void R_SetupFrame (void)
 
void Mat_Identity (float *matrix)
 
void Mat_Mul (float *m1, float *m2, float *res)
 
void Mat_Translate (float *matrix, float x, float y, float z)
 
void Mat_Rotate (float *matrix, float deg, float x, float y, float z)
 
void Mat_Scale (float *matrix, float x, float y, float z)
 
void Mat_Perspective (float *matrix, float *correction_matrix, float fovy, float aspect, float zNear, float zFar)
 
void Mat_Ortho (float *matrix, float left, float right, float bottom, float top, float zNear, float zFar)
 
void R_SetupVulkan (void)
 
void R_Flash (void)
 
void R_RenderView (refdef_t *fd)
 
void R_EndWorldRenderpass (void)
 
void R_SetVulkan2D (void)
 
void R_SetLightLevel (void)
 
void R_RenderFrame (refdef_t *fd)
 
void R_Register (void)
 
qboolean R_SetMode (void)
 
qboolean R_Init (void *hinstance, void *hWnd)
 
void R_Shutdown (void)
 
void R_BeginFrame (float camera_separation)
 
void R_EndFrame (void)
 
void R_SetPalette (const unsigned char *palette)
 
void R_DrawBeam (entity_t *e)
 
void R_BeginRegistration (char *map)
 
struct model_sR_RegisterModel (char *name)
 
struct image_sR_RegisterSkin (char *name)
 
void R_SetSky (char *name, float rotate, vec3_t axis)
 
void R_EndRegistration (void)
 
struct image_sDraw_FindPic (char *name)
 
void Draw_Pic (int x, int y, char *name)
 
void Draw_Char (int x, int y, int c)
 
void Draw_TileClear (int x, int y, int w, int h, char *name)
 
void Draw_Fill (int x, int y, int w, int h, int c)
 
void Draw_FadeScreen (void)
 
refexport_t GetRefAPI (refimport_t rimp)
 
void Sys_Error (char *error,...)
 
void Com_Printf (char *fmt,...)
 

Variables

viddef_t vid
 
refimport_t ri
 
model_tr_worldmodel
 
vkconfig_t vk_config
 
vkstate_t vk_state
 
image_tr_notexture
 
image_tr_particletexture
 
entity_tcurrententity
 
model_tcurrentmodel
 
cplane_t frustum [4]
 
int r_visframecount
 
int r_framecount
 
int c_brush_polys
 
int c_alias_polys
 
float v_blend [4]
 
vec3_t vup
 
vec3_t vpn
 
vec3_t vright
 
vec3_t r_origin
 
float r_projection_matrix [16]
 
float r_proj_aspect
 
float r_proj_fovx
 
float r_proj_fovy
 
float r_view_matrix [16]
 
float r_viewproj_matrix [16]
 
static float r_vulkan_correction [16]
 
refdef_t r_newrefdef
 
int r_viewcluster
 
int r_viewcluster2
 
int r_oldviewcluster
 
int r_oldviewcluster2
 
cvar_tr_norefresh
 
cvar_tr_drawentities
 
cvar_tr_drawworld
 
cvar_tr_speeds
 
cvar_tr_fullbright
 
cvar_tr_novis
 
cvar_tr_nocull
 
cvar_tr_lerpmodels
 
cvar_tr_lefthand
 
cvar_tr_lightlevel
 
cvar_tvk_validation
 
cvar_tvk_mode
 
cvar_tvk_bitdepth
 
cvar_tvk_log
 
cvar_tvk_picmip
 
cvar_tvk_skymip
 
cvar_tvk_round_down
 
cvar_tvk_flashblend
 
cvar_tvk_finish
 
cvar_tvk_clear
 
cvar_tvk_lockpvs
 
cvar_tvk_polyblend
 
cvar_tvk_modulate
 
cvar_tvk_shadows
 
cvar_tvk_particle_size
 
cvar_tvk_particle_att_a
 
cvar_tvk_particle_att_b
 
cvar_tvk_particle_att_c
 
cvar_tvk_particle_min_size
 
cvar_tvk_particle_max_size
 
cvar_tvk_point_particles
 
cvar_tvk_postprocess
 
cvar_tvk_dynamic
 
cvar_tvk_msaa
 
cvar_tvk_showtris
 
cvar_tvk_lightmap
 
cvar_tvk_texturemode
 
cvar_tvk_lmaptexturemode
 
cvar_tvk_aniso
 
cvar_tvk_mip_nearfilter
 
cvar_tvk_sampleshading
 
cvar_tvk_vsync
 
cvar_tvk_device_idx
 
cvar_tvid_fullscreen
 
cvar_tvid_gamma
 
cvar_tvid_ref
 
cvar_tviewsize
 
unsigned r_rawpalette [256]
 

Macro Definition Documentation

◆ NUM_BEAM_SEGS

#define NUM_BEAM_SEGS   6

Function Documentation

◆ Com_Printf()

void Com_Printf ( char *  fmt,
  ... 
)

Definition at line 1497 of file vk_rmain.c.

1498 {
1499  va_list argptr;
1500  char text[1024];
1501 
1502  va_start (argptr, fmt);
1503  vsnprintf (text, 1024, fmt, argptr);
1504  va_end (argptr);
1505 
1506  ri.Con_Printf (PRINT_ALL, "%s", text);
1507 }

◆ Draw_Char()

void Draw_Char ( int  x,
int  y,
int  c 
)

Definition at line 242 of file r_draw.c.

243 {
244  byte *dest;
245  byte *source;
246  byte *src;
247  int drawline;
248  int row, col, f, i, v, skip = 0;
249  int fstep, tbyte, sv;
250 
251  num &= 255;
252 
253  if (num == 32 || num == 32 + 128)
254  return;
255 
256  if (y <= -8)
257  return; // totally off screen
258 
259  // if ( ( y + 8 ) >= vid.height )
260  if ((y + 8) > vid.height) // PGM - status text was missing in sw...
261  return;
262 
263  cvar_t *scale = ri.Cvar_Get("hudscale", "1", 0);
264 
265 #ifdef PARANOID
266  if (y > vid.height - 8 || x < 0 || x > vid.width - 8)
267  ri.Sys_Error(ERR_FATAL, "Con_DrawCharacter: (%i, %i)", x, y);
268  if (num < 0 || num > 255)
269  ri.Sys_Error(ERR_FATAL, "Con_DrawCharacter: char %i", num);
270 #endif
271 
272  row = num >> 4;
273  col = num & 15;
274  source = draw_chars->pixels[0] + (row << 10) + (col << 3);
275 
276  if (y < 0)
277  { // clipped
278  skip = y;
279  drawline = 8 * scale->value + y;
280  source -= 128 * y;
281  y = 0;
282  }
283  else
284  drawline = 8 * scale->value;
285 
286  dest = vid.buffer + y*vid.rowbytes + x;
287  fstep = 0x8000 / scale->value;
288 
289  for (v = 0; v < drawline; v++, dest += vid.rowbytes)
290  {
291  sv = (skip + v) / scale->value;
292  src = source + sv * draw_chars->width;
293  f = 0;
294 
295  for (i = 0; i < 8 * scale->value; i += 4)
296  {
297  if ((tbyte = src[f >> 15]) != TRANSPARENT_COLOR)
298  dest[i] = tbyte;
299  f += fstep;
300 
301  if ((tbyte = src[f >> 15]) != TRANSPARENT_COLOR)
302  dest[i + 1] = tbyte;
303  f += fstep;
304 
305  if ((tbyte = src[f >> 15]) != TRANSPARENT_COLOR)
306  dest[i + 2] = tbyte;
307  f += fstep;
308 
309  if ((tbyte = src[f >> 15]) != TRANSPARENT_COLOR)
310  dest[i + 3] = tbyte;
311  f += fstep;
312  }
313  }
314 }

Referenced by GetRefAPI().

◆ Draw_FadeScreen()

void Draw_FadeScreen ( void  )

Definition at line 620 of file r_draw.c.

621 {
622  int x, y;
623  byte *pbuf;
624  int t;
625 
626  for (y = 0; y < vid.height; y++)
627  {
628  pbuf = (byte *)(vid.buffer + vid.rowbytes*y);
629  t = (y & 1) << 1;
630 
631  for (x = 0; x < vid.width; x++)
632  {
633  if ((x & 3) != t)
634  pbuf[x] = 0;
635  }
636  }
637 }

Referenced by GetRefAPI().

◆ Draw_Fill()

void Draw_Fill ( int  x,
int  y,
int  w,
int  h,
int  c 
)

Definition at line 586 of file r_draw.c.

587 {
588  byte *dest;
589  int u, v;
590 
591  if (x + w > vid.width)
592  w = vid.width - x;
593  if (y + h > vid.height)
594  h = vid.height - y;
595  if (x < 0)
596  {
597  w += x;
598  x = 0;
599  }
600  if (y < 0)
601  {
602  h += y;
603  y = 0;
604  }
605  if (w < 0 || h < 0)
606  return;
607  dest = vid.buffer + y*vid.rowbytes + x;
608  for (v = 0; v < h; v++, dest += vid.rowbytes)
609  for (u = 0; u < w; u++)
610  dest[u] = c;
611 }

Referenced by GetRefAPI().

◆ Draw_FindPic()

struct image_s* Draw_FindPic ( char *  name)

Definition at line 37 of file r_draw.c.

38 {
39  image_t *image;
40  char fullname[MAX_QPATH];
41 
42  if (name[0] != '/' && name[0] != '\\')
43  {
44  Com_sprintf(fullname, sizeof(fullname), "pics/%s.pcx", name);
45  image = R_FindImage(fullname, it_pic);
46  }
47  else
48  image = R_FindImage(name + 1, it_pic);
49 
50  return image;
51 }

Referenced by Draw_GetPicSize(), Draw_InitLocal(), Draw_Pic(), Draw_StretchPic(), Draw_TileClear(), and GetRefAPI().

◆ Draw_Pic()

void Draw_Pic ( int  x,
int  y,
char *  name 
)

Definition at line 438 of file r_draw.c.

439 {
440  image_t *pic;
441  byte *dest, *source;
442  int v, u;
443  int tbyte;
444  int height;
445 
446  pic = Draw_FindPic(name);
447  if (!pic)
448  {
449  ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", name);
450  return;
451  }
452 
453  cvar_t *scale = ri.Cvar_Get("hudscale", "1", 0);
454  if (scale->value > 1.f)
455  {
456  Draw_StretchPicImplementation(x, y, pic->width*scale->value, pic->height*scale->value, pic);
457  return;
458  }
459 
460  if ((x < 0) ||
461  (x + pic->width > vid.width) ||
462  (y + pic->height > vid.height))
463  return; // ri.Sys_Error (ERR_FATAL,"Draw_Pic: bad coordinates");
464 
465  height = pic->height;
466  source = pic->pixels[0];
467  if (y < 0)
468  {
469  height += y;
470  source += pic->width*-y;
471  y = 0;
472  }
473 
474  dest = vid.buffer + y * vid.rowbytes + x;
475 
476  if (!pic->transparent)
477  {
478  for (v = 0; v < height; v++)
479  {
480  memcpy(dest, source, pic->width);
481  dest += vid.rowbytes;
482  source += pic->width;
483  }
484  }
485  else
486  {
487  if (pic->width & 7)
488  { // general
489  for (v = 0; v < height; v++)
490  {
491  for (u = 0; u < pic->width; u++)
492  if ((tbyte = source[u]) != TRANSPARENT_COLOR)
493  dest[u] = tbyte;
494 
495  dest += vid.rowbytes;
496  source += pic->width;
497  }
498  }
499  else
500  { // unwound
501  for (v = 0; v < height; v++)
502  {
503  for (u = 0; u < pic->width; u += 8)
504  {
505  if ((tbyte = source[u]) != TRANSPARENT_COLOR)
506  dest[u] = tbyte;
507  if ((tbyte = source[u + 1]) != TRANSPARENT_COLOR)
508  dest[u + 1] = tbyte;
509  if ((tbyte = source[u + 2]) != TRANSPARENT_COLOR)
510  dest[u + 2] = tbyte;
511  if ((tbyte = source[u + 3]) != TRANSPARENT_COLOR)
512  dest[u + 3] = tbyte;
513  if ((tbyte = source[u + 4]) != TRANSPARENT_COLOR)
514  dest[u + 4] = tbyte;
515  if ((tbyte = source[u + 5]) != TRANSPARENT_COLOR)
516  dest[u + 5] = tbyte;
517  if ((tbyte = source[u + 6]) != TRANSPARENT_COLOR)
518  dest[u + 6] = tbyte;
519  if ((tbyte = source[u + 7]) != TRANSPARENT_COLOR)
520  dest[u + 7] = tbyte;
521  }
522  dest += vid.rowbytes;
523  source += pic->width;
524  }
525  }
526  }
527 }

Referenced by GetRefAPI().

◆ Draw_TileClear()

void Draw_TileClear ( int  x,
int  y,
int  w,
int  h,
char *  name 
)

Definition at line 537 of file r_draw.c.

538 {
539  int i, j;
540  byte *psrc;
541  byte *pdest;
542  image_t *pic;
543  int x2;
544 
545  if (x < 0)
546  {
547  w += x;
548  x = 0;
549  }
550  if (y < 0)
551  {
552  h += y;
553  y = 0;
554  }
555  if (x + w > vid.width)
556  w = vid.width - x;
557  if (y + h > vid.height)
558  h = vid.height - y;
559  if (w <= 0 || h <= 0)
560  return;
561 
562  pic = Draw_FindPic(name);
563  if (!pic)
564  {
565  ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", name);
566  return;
567  }
568  x2 = x + w;
570  for (i = 0; i < h; i++, pdest += vid.rowbytes)
571  {
572  psrc = pic->pixels[0] + pic->width * ((i + y) & 63);
573  for (j = x; j < x2; j++)
574  pdest[j] = psrc[j & 63];
575  }
576 }

Referenced by GetRefAPI().

◆ GetRefAPI()

refexport_t GetRefAPI ( refimport_t  rimp)

Definition at line 1440 of file vk_rmain.c.

1441 {
1442  refexport_t re;
1443 
1444  ri = rimp;
1445 
1447 
1452  re.SetSky = R_SetSky;
1454 
1456 
1458  re.DrawPic = Draw_Pic;
1460  re.DrawChar = Draw_Char;
1462  re.DrawFill = Draw_Fill;
1464 
1466 
1467  re.Init = R_Init;
1469 
1474 
1476 
1477  Swap_Init ();
1478 
1479  return re;
1480 }

◆ Mat_Identity()

void Mat_Identity ( float *  matrix)

Definition at line 675 of file vk_rmain.c.

676 {
677  matrix[0] = 1.f;
678  matrix[1] = 0.f;
679  matrix[2] = 0.f;
680  matrix[3] = 0.f;
681  matrix[4] = 0.f;
682  matrix[5] = 1.f;
683  matrix[6] = 0.f;
684  matrix[7] = 0.f;
685  matrix[8] = 0.f;
686  matrix[9] = 0.f;
687  matrix[10] = 1.f;
688  matrix[11] = 0.f;
689  matrix[12] = 0.f;
690  matrix[13] = 0.f;
691  matrix[14] = 0.f;
692  matrix[15] = 1.f;
693 }

Referenced by EmitWaterPolys(), R_DrawAliasModel(), R_DrawBrushModel(), R_DrawNullModel(), R_DrawSkyBox(), R_SetupVulkan(), and Vk_RenderLightmappedPoly().

◆ Mat_Mul()

void Mat_Mul ( float *  m1,
float *  m2,
float *  res 
)

Definition at line 695 of file vk_rmain.c.

696 {
697  float mul[16] = { m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12],
698  m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13],
699  m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14],
700  m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15],
701  m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12],
702  m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13],
703  m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14],
704  m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15],
705  m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12],
706  m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13],
707  m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14],
708  m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15],
709  m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12],
710  m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13],
711  m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14],
712  m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]
713  };
714 
715  memcpy(res, mul, sizeof(float) * 16);
716 }

Referenced by Mat_Ortho(), Mat_Perspective(), Mat_Rotate(), Mat_Scale(), Mat_Translate(), R_DrawAliasModel(), and R_SetupVulkan().

◆ Mat_Ortho()

void Mat_Ortho ( float *  matrix,
float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
)

Definition at line 784 of file vk_rmain.c.

786 {
787  float proj[16];
788  memset(proj, 0, sizeof(float) * 16);
789  proj[0] = 2.f / (right - left);
790  proj[3] = (right + left) / (right - left);
791  proj[5] = 2.f / (top - bottom);
792  proj[7] = (top + bottom) / (top - bottom);
793  proj[10] = -2.f / (zFar - zNear);
794  proj[11] = -(zFar + zNear) / (zFar - zNear);
795  proj[15] = 1.f;
796 
797  // Convert projection matrix to Vulkan coordinate system (https://matthewwellings.com/blog/the-new-vulkan-coordinate-system/)
798  Mat_Mul(proj, r_vulkan_correction, matrix);
799 }

◆ Mat_Perspective()

void Mat_Perspective ( float *  matrix,
float *  correction_matrix,
float  fovy,
float  aspect,
float  zNear,
float  zFar 
)

Definition at line 756 of file vk_rmain.c.

758 {
759  float xmin, xmax, ymin, ymax;
760 
761  ymax = zNear * tan(fovy * M_PI / 360.0);
762  ymin = -ymax;
763 
764  xmin = ymin * aspect;
765  xmax = ymax * aspect;
766 
767  xmin += -(2 * vk_state.camera_separation) / zNear;
768  xmax += -(2 * vk_state.camera_separation) / zNear;
769 
770  float proj[16];
771  memset(proj, 0, sizeof(float) * 16);
772  proj[0] = 2.f * zNear / (xmax - xmin);
773  proj[2] = (xmax + xmin) / (xmax - xmin);
774  proj[5] = 2.f * zNear / (ymax - ymin);
775  proj[6] = (ymax + ymin) / (ymax - ymin);
776  proj[10] = -(zFar + zNear) / (zFar - zNear);
777  proj[11] = -1.f;
778  proj[14] = -2.f * zFar * zNear / (zFar - zNear);
779 
780  // Convert projection matrix to Vulkan coordinate system (https://matthewwellings.com/blog/the-new-vulkan-coordinate-system/)
781  Mat_Mul(proj, correction_matrix, matrix);
782 }

Referenced by R_DrawAliasModel(), and R_SetupVulkan().

◆ Mat_Rotate()

void Mat_Rotate ( float *  matrix,
float  deg,
float  x,
float  y,
float  z 
)

Definition at line 728 of file vk_rmain.c.

729 {
730  double c = cos(deg * M_PI / 180.0);
731  double s = sin(deg * M_PI / 180.0);
732  double cd = 1.0 - c;
733  vec3_t r = { x, y, z };
735 
736  float rot[16] = { r[0]*r[0]*cd + c, r[1]*r[0]*cd + r[2]*s, r[0]*r[2]*cd - r[1]*s, 0.f,
737  r[0]*r[1]*cd - r[2]*s, r[1]*r[1]*cd + c, r[1]*r[2]*cd + r[0]*s, 0.f,
738  r[0]*r[2]*cd + r[1]*s, r[1]*r[2]*cd - r[0]*s, r[2]*r[2]*cd + c, 0.f,
739  0.f, 0.f, 0.f, 1.f
740  };
741 
742  Mat_Mul(matrix, rot, matrix);
743 }

Referenced by R_DrawSkyBox(), R_RotateForEntity(), and R_SetupVulkan().

◆ Mat_Scale()

void Mat_Scale ( float *  matrix,
float  x,
float  y,
float  z 
)

Definition at line 745 of file vk_rmain.c.

746 {
747  float s[16] = { x, 0.f, 0.f, 0.f,
748  0.f, y, 0.f, 0.f,
749  0.f, 0.f, z, 0.f,
750  0.f, 0.f, 0.f, 1.f
751  };
752 
753  Mat_Mul(matrix, s, matrix);
754 }

Referenced by R_DrawAliasModel().

◆ Mat_Translate()

void Mat_Translate ( float *  matrix,
float  x,
float  y,
float  z 
)

Definition at line 718 of file vk_rmain.c.

719 {
720  float t[16] = { 1.f, 0.f, 0.f, 0.f,
721  0.f, 1.f, 0.f, 0.f,
722  0.f, 0.f, 1.f, 0.f,
723  x, y, z, 1.f };
724 
725  Mat_Mul(matrix, t, matrix);
726 }

Referenced by R_DrawSkyBox(), R_RotateForEntity(), and R_SetupVulkan().

◆ R_BeginFrame()

void R_BeginFrame ( float  camera_separation)

Definition at line 1220 of file vk_rmain.c.

1221 {
1222  // if ri.Sys_Error() had been issued mid-frame, we might end up here without properly submitting the image, so call QVk_EndFrame to be safe
1223  QVk_EndFrame(true);
1224  /*
1225  ** change modes if necessary
1226  */
1230  {
1232  {
1234  {
1236  vk_texturemode->modified = false;
1237  }
1239  {
1241  vk_lmaptexturemode->modified = false;
1242  }
1243 
1244  vk_aniso->modified = false;
1245  }
1246  else
1247  {
1248  cvar_t *ref = ri.Cvar_Get("vid_ref", "vk", 0);
1249  ref->modified = true;
1250  }
1251  }
1252 
1253  if (vk_log->modified)
1254  {
1256  vk_log->modified = false;
1257  }
1258 
1259  if (vk_log->value)
1260  {
1262  }
1263 
1264  Vkimp_BeginFrame(camera_separation);
1265 
1266  VkResult swapChainValid = QVk_BeginFrame();
1267  // if the swapchain is invalid, just recreate the video system and revert to safe windowed mode
1268  if (swapChainValid != VK_SUCCESS)
1269  {
1270  vid_ref->modified = true;
1271  vid_fullscreen->value = false;
1272  ri.Cvar_SetValue("vid_fullscreen", 0);
1273  }
1274  else
1275  {
1277  }
1278 }

Referenced by GetRefAPI().

◆ R_BeginRegistration()

void R_BeginRegistration ( char *  map)

Definition at line 1213 of file r_model.c.

1214 {
1215  char fullname[MAX_QPATH];
1216  cvar_t *flushmap;
1217 
1219  r_oldviewcluster = -1; // force markleafs
1220  Com_sprintf(fullname, sizeof(fullname), "maps/%s.bsp", model);
1221 
1222  D_FlushCaches();
1223  // explicitly free the old map if different
1224  // this guarantees that mod_known[0] is the world map
1225  flushmap = ri.Cvar_Get("flushmap", "0", 0);
1226  if (strcmp(mod_known[0].name, fullname) || flushmap->value)
1227  Mod_Free(&mod_known[0]);
1228  r_worldmodel = R_RegisterModel(fullname);
1229  R_NewMap();
1230 }

Referenced by GetRefAPI().

◆ R_CullBox()

qboolean R_CullBox ( vec3_t  mins,
vec3_t  maxs 
)

Definition at line 136 of file vk_rmain.c.

137 {
138  int i;
139 
140  if (r_nocull->value)
141  return false;
142 
143  for (i=0 ; i<4 ; i++)
144  if ( BOX_ON_PLANE_SIDE(mins, maxs, &frustum[i]) == 2)
145  return true;
146  return false;
147 }

Referenced by R_DrawBrushModel(), and R_RecursiveWorldNode().

◆ R_DrawBeam()

void R_DrawBeam ( entity_t e)

Definition at line 1328 of file vk_rmain.c.

1329 {
1330 #define NUM_BEAM_SEGS 6
1331 
1332  int i;
1333  float r, g, b;
1334 
1335  vec3_t perpvec;
1336  vec3_t direction, normalized_direction;
1337  vec3_t start_points[NUM_BEAM_SEGS], end_points[NUM_BEAM_SEGS];
1338  vec3_t oldorigin, origin;
1339 
1340  oldorigin[0] = e->oldorigin[0];
1341  oldorigin[1] = e->oldorigin[1];
1342  oldorigin[2] = e->oldorigin[2];
1343 
1344  origin[0] = e->origin[0];
1345  origin[1] = e->origin[1];
1346  origin[2] = e->origin[2];
1347 
1348  normalized_direction[0] = direction[0] = oldorigin[0] - origin[0];
1349  normalized_direction[1] = direction[1] = oldorigin[1] - origin[1];
1350  normalized_direction[2] = direction[2] = oldorigin[2] - origin[2];
1351 
1352  if (VectorNormalize(normalized_direction) == 0)
1353  return;
1354 
1355  PerpendicularVector(perpvec, normalized_direction);
1356  VectorScale(perpvec, e->frame / 2, perpvec);
1357 
1358  for (i = 0; i < 6; i++)
1359  {
1360  RotatePointAroundVector(start_points[i], normalized_direction, perpvec, (360.0 / NUM_BEAM_SEGS)*i);
1361  VectorAdd(start_points[i], origin, start_points[i]);
1362  VectorAdd(start_points[i], direction, end_points[i]);
1363  }
1364 
1365  r = (d_8to24table[e->skinnum & 0xFF]) & 0xFF;
1366  g = (d_8to24table[e->skinnum & 0xFF] >> 8) & 0xFF;
1367  b = (d_8to24table[e->skinnum & 0xFF] >> 16) & 0xFF;
1368 
1369  r *= 1 / 255.0F;
1370  g *= 1 / 255.0F;
1371  b *= 1 / 255.0F;
1372 
1373  float color[4] = { r, g, b, e->alpha };
1374 
1375  struct {
1376  float v[3];
1377  } beamvertex[NUM_BEAM_SEGS*4];
1378 
1379  for (i = 0; i < NUM_BEAM_SEGS; i++)
1380  {
1381  int idx = i * 4;
1382  beamvertex[idx].v[0] = start_points[i][0];
1383  beamvertex[idx].v[1] = start_points[i][1];
1384  beamvertex[idx].v[2] = start_points[i][2];
1385 
1386  beamvertex[idx + 1].v[0] = end_points[i][0];
1387  beamvertex[idx + 1].v[1] = end_points[i][1];
1388  beamvertex[idx + 1].v[2] = end_points[i][2];
1389 
1390  beamvertex[idx + 2].v[0] = start_points[(i + 1) % NUM_BEAM_SEGS][0];
1391  beamvertex[idx + 2].v[1] = start_points[(i + 1) % NUM_BEAM_SEGS][1];
1392  beamvertex[idx + 2].v[2] = start_points[(i + 1) % NUM_BEAM_SEGS][2];
1393 
1394  beamvertex[idx + 3].v[0] = end_points[(i + 1) % NUM_BEAM_SEGS][0];
1395  beamvertex[idx + 3].v[1] = end_points[(i + 1) % NUM_BEAM_SEGS][1];
1396  beamvertex[idx + 3].v[2] = end_points[(i + 1) % NUM_BEAM_SEGS][2];
1397  }
1398 
1400 
1401  VkBuffer vbo;
1402  VkDeviceSize vboOffset;
1403  uint32_t uboOffset;
1404  VkDescriptorSet uboDescriptorSet;
1405  uint8_t *vertData = QVk_GetVertexBuffer(sizeof(beamvertex), &vbo, &vboOffset);
1406  uint8_t *uboData = QVk_GetUniformBuffer(sizeof(color), &uboOffset, &uboDescriptorSet);
1407  memcpy(vertData, beamvertex, sizeof(beamvertex));
1408  memcpy(uboData, color, sizeof(color));
1409 
1410  vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawBeamPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset);
1411  vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
1412  vkCmdDraw(vk_activeCmdbuffer, NUM_BEAM_SEGS * 4, 1, 0, 0);
1413 }

Referenced by R_DrawEntitiesOnList().

◆ R_DrawEntitiesOnList()

void R_DrawEntitiesOnList ( void  )

Definition at line 306 of file vk_rmain.c.

307 {
308  int i;
309 
310  if (!r_drawentities->value)
311  return;
312 
313  // draw non-transparent first
314  for (i = 0; i<r_newrefdef.num_entities; i++)
315  {
318  continue; // solid
319 
320  if (currententity->flags & RF_BEAM)
321  {
323  }
324  else
325  {
327  if (!currentmodel)
328  {
329  R_DrawNullModel();
330  continue;
331  }
332  switch (currentmodel->type)
333  {
334  case mod_alias:
336  break;
337  case mod_brush:
339  break;
340  case mod_sprite:
342  break;
343  default:
344  ri.Sys_Error(ERR_DROP, "Bad modeltype");
345  break;
346  }
347  }
348  }
349 
350  // draw transparent entities
351  // we could sort these if it ever becomes a problem...
352  for (i = 0; i<r_newrefdef.num_entities; i++)
353  {
356  continue; // solid
357 
358  if (currententity->flags & RF_BEAM)
359  {
361  }
362  else
363  {
365 
366  if (!currentmodel)
367  {
368  R_DrawNullModel();
369  continue;
370  }
371  switch (currentmodel->type)
372  {
373  case mod_alias:
375  break;
376  case mod_brush:
378  break;
379  case mod_sprite:
381  break;
382  default:
383  ri.Sys_Error(ERR_DROP, "Bad modeltype");
384  break;
385  }
386  }
387  }
388 }

Referenced by R_RenderView().

◆ R_DrawNullModel()

void R_DrawNullModel ( void  )

Definition at line 235 of file vk_rmain.c.

236 {
238  int i,j;
239 
241  shadelight[0] = shadelight[1] = shadelight[2] = 1.0F;
242  else
244 
245  float model[16];
246  Mat_Identity(model);
248 
249  vec3_t verts[24];
250  verts[0][0] = 0.f;
251  verts[0][1] = 0.f;
252  verts[0][2] = -16.f;
253  verts[1][0] = shadelight[0];
254  verts[1][1] = shadelight[1];
255  verts[1][2] = shadelight[2];
256 
257  for (i = 2, j = 0; i < 12; i+=2, j++)
258  {
259  verts[i][0] = 16 * cos(j*M_PI / 2);
260  verts[i][1] = 16 * sin(j*M_PI / 2);
261  verts[i][2] = 0.f;
262  verts[i+1][0] = shadelight[0];
263  verts[i+1][1] = shadelight[1];
264  verts[i+1][2] = shadelight[2];
265  }
266 
267  verts[12][0] = 0.f;
268  verts[12][1] = 0.f;
269  verts[12][2] = 16.f;
270  verts[13][0] = shadelight[0];
271  verts[13][1] = shadelight[1];
272  verts[13][2] = shadelight[2];
273 
274  for (i = 23, j = 4; i > 13; i-=2, j--)
275  {
276  verts[i-1][0] = 16 * cos(j*M_PI / 2);
277  verts[i-1][1] = 16 * sin(j*M_PI / 2);
278  verts[i-1][2] = 0.f;
279  verts[i][0] = shadelight[0];
280  verts[i][1] = shadelight[1];
281  verts[i][2] = shadelight[2];
282  }
283 
284  VkBuffer vbo;
285  VkDeviceSize vboOffset;
286  uint32_t uboOffset;
287  VkDescriptorSet uboDescriptorSet;
288  uint8_t *vertData = QVk_GetVertexBuffer(sizeof(verts), &vbo, &vboOffset);
289  uint8_t *uboData = QVk_GetUniformBuffer(sizeof(model), &uboOffset, &uboDescriptorSet);
290  memcpy(vertData, verts, sizeof(verts));
291  memcpy(uboData, model, sizeof(model));
292 
294  vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawNullModelPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset);
295  vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
296  vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo(12), 0, VK_INDEX_TYPE_UINT16);
297  vkCmdDrawIndexed(vk_activeCmdbuffer, 12, 1, 0, 0, 0);
298  vkCmdDrawIndexed(vk_activeCmdbuffer, 12, 1, 0, 6, 0);
299 }

Referenced by R_DrawEntitiesOnList().

◆ R_DrawParticles()

void R_DrawParticles ( void  )

Definition at line 481 of file vk_rmain.c.

482 {
484  {
485  int i;
486  unsigned char color[4];
487  const particle_t *p;
488 
490  return;
491 
492  typedef struct {
493  float x, y, z, r, g, b, a;
494  } ppoint;
495 
496  struct {
497  float particleSize;
498  float particleScale;
499  float minPointSize;
500  float maxPointSize;
501  float att_a;
502  float att_b;
503  float att_c;
504  } particleUbo;
505 
506  particleUbo.particleSize = vk_particle_size->value;
507  particleUbo.particleScale = vid.width * ri.Cvar_Get("viewsize", "100", CVAR_ARCHIVE)->value / 102400;
508  particleUbo.minPointSize = vk_particle_min_size->value;
509  particleUbo.maxPointSize = vk_particle_max_size->value;
510  particleUbo.att_a = vk_particle_att_a->value;
511  particleUbo.att_b = vk_particle_att_b->value;
512  particleUbo.att_c = vk_particle_att_c->value;
513 
514  static ppoint visibleParticles[MAX_PARTICLES];
515 
516  for (i = 0, p = r_newrefdef.particles; i < r_newrefdef.num_particles; i++, p++)
517  {
518  *(int *)color = d_8to24table[p->color];
519 
520  float r = color[0] / 255.f;
521  float g = color[1] / 255.f;
522  float b = color[2] / 255.f;
523 
524  visibleParticles[i].x = p->origin[0];
525  visibleParticles[i].y = p->origin[1];
526  visibleParticles[i].z = p->origin[2];
527  visibleParticles[i].r = r;
528  visibleParticles[i].g = g;
529  visibleParticles[i].b = b;
530  visibleParticles[i].a = p->alpha;
531  }
532 
534 
535  VkBuffer vbo;
536  VkDeviceSize vboOffset;
537  uint32_t uboOffset;
538  VkDescriptorSet uboDescriptorSet;
539  uint8_t *vertData = QVk_GetVertexBuffer(sizeof(ppoint) * r_newrefdef.num_particles, &vbo, &vboOffset);
540  uint8_t *uboData = QVk_GetUniformBuffer(sizeof(particleUbo), &uboOffset, &uboDescriptorSet);
541  memcpy(vertData, &visibleParticles, sizeof(ppoint) * r_newrefdef.num_particles);
542  memcpy(uboData, &particleUbo, sizeof(particleUbo));
543  vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawPointParticlesPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset);
544  vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
545  vkCmdDraw(vk_activeCmdbuffer, r_newrefdef.num_particles, 1, 0, 0);
546  }
547  else
548  {
550  }
551 }

Referenced by R_RenderFrame(), and R_RenderView().

◆ R_DrawSpriteModel()

void R_DrawSpriteModel ( entity_t e)

Definition at line 173 of file vk_rmain.c.

174 {
175  float alpha = 1.0F;
176  vec3_t point;
177  dsprframe_t *frame;
178  float *up, *right;
179  dsprite_t *psprite;
180 
181  // don't even bother culling, because it's just a single
182  // polygon without a surface cache
183 
184  psprite = (dsprite_t *)currentmodel->extradata;
185 
186  e->frame %= psprite->numframes;
187 
188  frame = &psprite->frames[e->frame];
189 
190  // normal sprite
191  up = vup;
192  right = vright;
193 
194  if (e->flags & RF_TRANSLUCENT)
195  alpha = e->alpha;
196 
197  vec3_t spriteQuad[4];
198 
199  VectorMA(e->origin, -frame->origin_y, up, point);
200  VectorMA(point, -frame->origin_x, right, spriteQuad[0]);
201  VectorMA(e->origin, frame->height - frame->origin_y, up, point);
202  VectorMA(point, -frame->origin_x, right, spriteQuad[1]);
203  VectorMA(e->origin, frame->height - frame->origin_y, up, point);
204  VectorMA(point, frame->width - frame->origin_x, right, spriteQuad[2]);
205  VectorMA(e->origin, -frame->origin_y, up, point);
206  VectorMA(point, frame->width - frame->origin_x, right, spriteQuad[3]);
207 
208  float quadVerts[] = { spriteQuad[0][0], spriteQuad[0][1], spriteQuad[0][2], 0.f, 1.f,
209  spriteQuad[1][0], spriteQuad[1][1], spriteQuad[1][2], 0.f, 0.f,
210  spriteQuad[2][0], spriteQuad[2][1], spriteQuad[2][2], 1.f, 0.f,
211  spriteQuad[0][0], spriteQuad[0][1], spriteQuad[0][2], 0.f, 1.f,
212  spriteQuad[2][0], spriteQuad[2][1], spriteQuad[2][2], 1.f, 0.f,
213  spriteQuad[3][0], spriteQuad[3][1], spriteQuad[3][2], 1.f, 1.f };
214 
215  vkCmdPushConstants(vk_activeCmdbuffer, vk_drawSpritePipeline.layout, VK_SHADER_STAGE_VERTEX_BIT, sizeof(r_viewproj_matrix), sizeof(float), &alpha);
217 
218  VkBuffer vbo;
219  VkDeviceSize vboOffset;
220  uint8_t *vertData = QVk_GetVertexBuffer(sizeof(quadVerts), &vbo, &vboOffset);
221  memcpy(vertData, quadVerts, sizeof(quadVerts));
222 
223  vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
224  vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawSpritePipeline.layout, 0, 1, &currentmodel->skins[e->frame]->vk_texture.descriptorSet, 0, NULL);
225  vkCmdDraw(vk_activeCmdbuffer, 6, 1, 0, 0);
226 }

Referenced by R_DrawEntitiesOnList().

◆ R_EndFrame()

void R_EndFrame ( void  )

Definition at line 1285 of file vk_rmain.c.

1286 {
1287  QVk_EndFrame(false);
1288 }

Referenced by GetRefAPI().

◆ R_EndRegistration()

void R_EndRegistration ( void  )

Definition at line 1282 of file r_model.c.

1283 {
1284  int i;
1285  model_t *mod;
1286 
1287  for (i = 0, mod = mod_known; i < mod_numknown; i++, mod++)
1288  {
1289  if (!mod->name[0])
1290  continue;
1292  { // don't need this model
1293  Hunk_Free(mod->extradata);
1294  memset(mod, 0, sizeof(*mod));
1295  }
1296  else
1297  { // make sure it is paged in
1299  }
1300  }
1301 
1303 }

Referenced by GetRefAPI().

◆ R_EndWorldRenderpass()

void R_EndWorldRenderpass ( void  )

Definition at line 925 of file vk_rmain.c.

926 {
927  // this may happen if swapchain image acquisition fails
928  if (!vk_frameStarted)
929  return;
930 
931  // finish rendering world view to offsceen buffer
932  vkCmdEndRenderPass(vk_activeCmdbuffer);
933 
934  // apply postprocessing effects (underwater view warp if the player is submerged in liquid) to offscreen buffer
936  float pushConsts[] = { r_newrefdef.rdflags & RDF_UNDERWATER ? r_newrefdef.time : 0.f, viewsize->value / 100, vid.width, vid.height };
937  vkCmdPushConstants(vk_activeCmdbuffer, vk_worldWarpPipeline.layout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(pushConsts), pushConsts);
938  vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_worldWarpPipeline.layout, 0, 1, &vk_colorbuffer.descriptorSet, 0, NULL);
940  vkCmdDraw(vk_activeCmdbuffer, 3, 1, 0, 0);
941  vkCmdEndRenderPass(vk_activeCmdbuffer);
942 
943  // start drawing UI
945 }

Referenced by GetRefAPI(), and R_SetVulkan2D().

◆ R_Flash()

void R_Flash ( void  )

Definition at line 856 of file vk_rmain.c.

857 {
858  R_PolyBlend ();
859 }

Referenced by R_RenderView().

◆ R_Init()

qboolean R_Init ( void hinstance,
void hWnd 
)

Definition at line 1149 of file vk_rmain.c.

1150 {
1151  ri.Con_Printf(PRINT_ALL, "ref_vk version: "REF_VERSION"\n");
1152 
1153  R_Register();
1154 
1155  // create the window (OS-specific)
1156  if (!Vkimp_Init(hinstance, hWnd))
1157  {
1158  return false;
1159  }
1160 
1161  // set our "safe" modes
1162  vk_state.prev_mode = 6;
1163  // set video mode/screen resolution
1164  if (!R_SetMode())
1165  {
1166  ri.Con_Printf(PRINT_ALL, "ref_vk::R_Init() - could not R_SetMode()\n");
1167  return false;
1168  }
1169  ri.Vid_MenuInit();
1170 
1171  // window is ready, initialize Vulkan now
1172  if (!QVk_Init())
1173  {
1174  ri.Con_Printf(PRINT_ALL, "ref_vk::R_Init() - could not initialize Vulkan!\n");
1175  return false;
1176  }
1177 
1178  ri.Con_Printf(PRINT_ALL, "Successfully initialized Vulkan!\n");
1179  // print device information during startup
1180  Vk_Strings_f();
1181 
1182  Vk_InitImages();
1183  Mod_Init();
1185  Draw_InitLocal();
1186 
1187  return true;
1188 }

Referenced by GetRefAPI().

◆ R_PolyBlend()

void R_PolyBlend ( void  )

Definition at line 558 of file vk_rmain.c.

559 {
560  if (!vk_polyblend->value)
561  return;
562  if (!v_blend[3])
563  return;
564 
565  float polyTransform[] = { 0.f, 0.f, vid.width, vid.height, v_blend[0], v_blend[1], v_blend[2], v_blend[3] };
566  QVk_DrawColorRect(polyTransform, sizeof(polyTransform), RP_WORLD);
567 }

Referenced by R_Flash().

◆ R_Register()

void R_Register ( void  )

Definition at line 1020 of file vk_rmain.c.

1021 {
1022  r_lefthand = ri.Cvar_Get("hand", "0", CVAR_USERINFO | CVAR_ARCHIVE);
1023  r_norefresh = ri.Cvar_Get("r_norefresh", "0", 0);
1024  r_fullbright = ri.Cvar_Get("r_fullbright", "0", 0);
1025  r_drawentities = ri.Cvar_Get("r_drawentities", "1", 0);
1026  r_drawworld = ri.Cvar_Get("r_drawworld", "1", 0);
1027  r_novis = ri.Cvar_Get("r_novis", "0", 0);
1028  r_nocull = ri.Cvar_Get("r_nocull", "0", 0);
1029  r_lerpmodels = ri.Cvar_Get("r_lerpmodels", "1", 0);
1030  r_speeds = ri.Cvar_Get("r_speeds", "0", 0);
1031  r_lightlevel = ri.Cvar_Get("r_lightlevel", "0", 0);
1032 #if defined(_DEBUG)
1033  vk_validation = ri.Cvar_Get("vk_validation", "2", 0);
1034 #else
1035  vk_validation = ri.Cvar_Get("vk_validation", "0", 0);
1036 #endif
1037  vk_mode = ri.Cvar_Get("vk_mode", "11", CVAR_ARCHIVE);
1038  vk_bitdepth = ri.Cvar_Get("vk_bitdepth", "0", 0);
1039  vk_log = ri.Cvar_Get("vk_log", "0", 0);
1040  vk_picmip = ri.Cvar_Get("vk_picmip", "0", 0);
1041  vk_skymip = ri.Cvar_Get("vk_skymip", "0", 0);
1042  vk_round_down = ri.Cvar_Get("vk_round_down", "1", 0);
1043  vk_flashblend = ri.Cvar_Get("vk_flashblend", "0", 0);
1044  vk_finish = ri.Cvar_Get("vk_finish", "0", CVAR_ARCHIVE);
1045  vk_clear = ri.Cvar_Get("vk_clear", "0", CVAR_ARCHIVE);
1046  vk_lockpvs = ri.Cvar_Get("vk_lockpvs", "0", 0);
1047  vk_polyblend = ri.Cvar_Get("vk_polyblend", "1", 0);
1048  vk_modulate = ri.Cvar_Get("vk_modulate", "1", CVAR_ARCHIVE);
1049  vk_shadows = ri.Cvar_Get("vk_shadows", "0", CVAR_ARCHIVE);
1050  vk_particle_size = ri.Cvar_Get("vk_particle_size", "40", CVAR_ARCHIVE);
1051  vk_particle_att_a = ri.Cvar_Get("vk_particle_att_a", "0.01", CVAR_ARCHIVE);
1052  vk_particle_att_b = ri.Cvar_Get("vk_particle_att_b", "0.0", CVAR_ARCHIVE);
1053  vk_particle_att_c = ri.Cvar_Get("vk_particle_att_c", "0.01", CVAR_ARCHIVE);
1054  vk_particle_min_size = ri.Cvar_Get("vk_particle_min_size", "2", CVAR_ARCHIVE);
1055  vk_particle_max_size = ri.Cvar_Get("vk_particle_max_size", "40", CVAR_ARCHIVE);
1056  vk_point_particles = ri.Cvar_Get("vk_point_particles", "1", CVAR_ARCHIVE);
1057  vk_postprocess = ri.Cvar_Get("vk_postprocess", "1", CVAR_ARCHIVE);
1058  vk_dynamic = ri.Cvar_Get("vk_dynamic", "1", 0);
1059  vk_msaa = ri.Cvar_Get("vk_msaa", "0", CVAR_ARCHIVE);
1060  vk_showtris = ri.Cvar_Get("vk_showtris", "0", 0);
1061  vk_lightmap = ri.Cvar_Get("vk_lightmap", "0", 0);
1062  vk_texturemode = ri.Cvar_Get("vk_texturemode", "VK_MIPMAP_LINEAR", CVAR_ARCHIVE);
1063  vk_lmaptexturemode = ri.Cvar_Get("vk_lmaptexturemode", "VK_MIPMAP_LINEAR", CVAR_ARCHIVE);
1064  vk_aniso = ri.Cvar_Get("vk_aniso", "1", CVAR_ARCHIVE);
1065  vk_mip_nearfilter = ri.Cvar_Get("vk_mip_nearfilter", "0", CVAR_ARCHIVE);
1066  vk_sampleshading = ri.Cvar_Get("vk_sampleshading", "1", CVAR_ARCHIVE);
1067  vk_vsync = ri.Cvar_Get("vk_vsync", "0", CVAR_ARCHIVE);
1068  vk_device_idx = ri.Cvar_Get("vk_device", "-1", CVAR_ARCHIVE);
1069  // clamp vk_msaa to accepted range so that video menu doesn't crash on us
1070  if (vk_msaa->value < 0)
1071  ri.Cvar_Set("vk_msaa", "0");
1072  else if (vk_msaa->value > 4)
1073  ri.Cvar_Set("vk_msaa", "4");
1074 
1075  vid_fullscreen = ri.Cvar_Get("vid_fullscreen", "0", CVAR_ARCHIVE);
1076  vid_gamma = ri.Cvar_Get("vid_gamma", "1.0", CVAR_ARCHIVE);
1077  vid_ref = ri.Cvar_Get("vid_ref", "soft", CVAR_ARCHIVE);
1078  viewsize = ri.Cvar_Get("viewsize", "100", CVAR_ARCHIVE);
1079 
1080  ri.Cmd_AddCommand("vk_strings", Vk_Strings_f);
1081  ri.Cmd_AddCommand("vk_mem", Vk_Mem_f);
1082  ri.Cmd_AddCommand("imagelist", Vk_ImageList_f);
1083  ri.Cmd_AddCommand("screenshot", Vk_ScreenShot_f);
1084 }

Referenced by R_Init().

◆ R_RegisterModel()

struct model_s* R_RegisterModel ( char *  name)

Definition at line 1239 of file r_model.c.

1240 {
1241  model_t *mod;
1242  int i;
1243  dsprite_t *sprout;
1244  dmdl_t *pheader;
1245 
1246  mod = Mod_ForName(name, false);
1247  if (mod)
1248  {
1250 
1251  // register any images used by the models
1252  if (mod->type == mod_sprite)
1253  {
1254  sprout = (dsprite_t *)mod->extradata;
1255  for (i = 0; i < sprout->numframes; i++)
1256  mod->skins[i] = R_FindImage(sprout->frames[i].name, it_sprite);
1257  }
1258  else if (mod->type == mod_alias)
1259  {
1260  pheader = (dmdl_t *)mod->extradata;
1261  for (i = 0; i < pheader->num_skins; i++)
1262  mod->skins[i] = R_FindImage((char *)pheader + pheader->ofs_skins + i*MAX_SKINNAME, it_skin);
1263  //PGM
1264  mod->numframes = pheader->num_frames;
1265  //PGM
1266  }
1267  else if (mod->type == mod_brush)
1268  {
1269  for (i = 0; i < mod->numtexinfo; i++)
1271  }
1272  }
1273  return mod;
1274 }

Referenced by GetRefAPI(), and R_BeginRegistration().

◆ R_RegisterSkin()

struct image_s* R_RegisterSkin ( char *  name)

Definition at line 550 of file r_image.c.

551 {
552  return R_FindImage (name, it_skin);
553 }

Referenced by GetRefAPI().

◆ R_RenderFrame()

void R_RenderFrame ( refdef_t fd)

Definition at line 1012 of file vk_rmain.c.

1013 {
1014  R_RenderView( fd );
1015  R_SetLightLevel ();
1016  R_SetVulkan2D ();
1017 }

Referenced by GetRefAPI().

◆ R_RenderView()

void R_RenderView ( refdef_t fd)

Definition at line 868 of file vk_rmain.c.

869 {
870  if (r_norefresh->value)
871  return;
872 
873  r_newrefdef = *fd;
874 
876  ri.Sys_Error(ERR_DROP, "R_RenderView: NULL worldmodel");
877 
878  if (r_speeds->value)
879  {
880  c_brush_polys = 0;
881  c_alias_polys = 0;
882  }
883 
884  VkRect2D scissor = {
885  .offset = { r_newrefdef.x, r_newrefdef.y },
886  .extent = { r_newrefdef.width, r_newrefdef.height }
887  };
888 
889  vkCmdSetScissor(vk_activeCmdbuffer, 0, 1, &scissor);
890 
891  R_PushDlights();
892 
893  // added for compatibility sake with OpenGL implementation - don't use it!
894  if (vk_finish->value)
895  vkDeviceWaitIdle(vk_device.logical);
896 
897  R_SetupFrame();
898 
899  R_SetupVulkan();
900 
901  R_MarkLeaves(); // done here so we know if we're in water
902 
903  R_DrawWorld();
904 
906 
907  R_RenderDlights();
908 
909  R_DrawParticles();
910 
912 
913  R_Flash();
914 
915  if (r_speeds->value)
916  {
917  ri.Con_Printf(PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n",
922  }
923 }

Referenced by R_RenderFrame().

◆ R_RotateForEntity()

void R_RotateForEntity ( entity_t e,
float *  mvMatrix 
)

Definition at line 150 of file vk_rmain.c.

151 {
152  Mat_Rotate(mvMatrix, -e->angles[2], 1.f, 0.f, 0.f);
153  Mat_Rotate(mvMatrix, -e->angles[0], 0.f, 1.f, 0.f);
154  Mat_Rotate(mvMatrix, e->angles[1], 0.f, 0.f, 1.f);
155  Mat_Translate(mvMatrix, e->origin[0], e->origin[1], e->origin[2]);
156 }

Referenced by R_DrawNullModel().

◆ R_SetFrustum()

void R_SetFrustum ( float  fovx,
float  fovy 
)

Definition at line 587 of file vk_rmain.c.

588 {
589  // rotate VPN right by FOV_X/2 degrees
590  RotatePointAroundVector(frustum[0].normal, vup, vpn, -(90 - fovx / 2));
591  // rotate VPN left by FOV_X/2 degrees
592  RotatePointAroundVector(frustum[1].normal, vup, vpn, 90 - fovx / 2);
593  // rotate VPN up by FOV_X/2 degrees
594  RotatePointAroundVector(frustum[2].normal, vright, vpn, 90 - fovy / 2);
595  // rotate VPN down by FOV_X/2 degrees
596  RotatePointAroundVector(frustum[3].normal, vright, vpn, -(90 - fovy / 2));
597 
598  for (int i = 0; i < 4; i++)
599  {
601  frustum[i].dist = DotProduct(r_origin, frustum[i].normal);
603  }
604 }

Referenced by R_SetupVulkan().

◆ R_SetLightLevel()

void R_SetLightLevel ( void  )

Definition at line 977 of file vk_rmain.c.

978 {
980 
982  return;
983 
984  // save off light value for server to look at (BIG HACK!)
985 
987 
988  // pick the greatest component, which should be the same
989  // as the mono value returned by software
990  if (shadelight[0] > shadelight[1])
991  {
992  if (shadelight[0] > shadelight[2])
993  r_lightlevel->value = 150 * shadelight[0];
994  else
995  r_lightlevel->value = 150 * shadelight[2];
996  }
997  else
998  {
999  if (shadelight[1] > shadelight[2])
1000  r_lightlevel->value = 150 * shadelight[1];
1001  else
1002  r_lightlevel->value = 150 * shadelight[2];
1003  }
1004 }

Referenced by R_RenderFrame().

◆ R_SetMode()

qboolean R_SetMode ( void  )

Definition at line 1091 of file vk_rmain.c.

1092 {
1093  rserr_t err;
1094  qboolean fullscreen;
1095 
1096  fullscreen = vid_fullscreen->value;
1097 
1098  vid_gamma->modified = false;
1099  vid_fullscreen->modified = false;
1100  vk_mode->modified = false;
1101  vk_msaa->modified = false;
1102  vk_clear->modified = false;
1103  vk_validation->modified = false;
1104  vk_mip_nearfilter->modified = false;
1105  vk_sampleshading->modified = false;
1106  vk_vsync->modified = false;
1107  vk_device_idx->modified = false;
1108  vk_picmip->modified = false;
1109  // refresh texture samplers
1110  vk_texturemode->modified = true;
1111  vk_lmaptexturemode->modified = true;
1112 
1113  if ((err = Vkimp_SetMode((int*)&vid.width, (int*)&vid.height, vk_mode->value, fullscreen)) == rserr_ok)
1114  {
1116  }
1117  else
1118  {
1119  if (err == rserr_invalid_fullscreen)
1120  {
1121  ri.Cvar_SetValue("vid_fullscreen", 0);
1122  vid_fullscreen->modified = false;
1123  ri.Con_Printf(PRINT_ALL, "ref_vk::R_SetMode() - fullscreen unavailable in this mode\n");
1124  if ((err = Vkimp_SetMode((int*)&vid.width, (int*)&vid.height, vk_mode->value, false)) == rserr_ok)
1125  return true;
1126  }
1127  else if (err == rserr_invalid_mode)
1128  {
1129  ri.Cvar_SetValue("vk_mode", vk_state.prev_mode);
1130  vk_mode->modified = false;
1131  ri.Con_Printf(PRINT_ALL, "ref_vk::R_SetMode() - invalid mode\n");
1132  }
1133 
1134  // try setting it back to something safe
1135  if ((err = Vkimp_SetMode((int*)&vid.width, (int*)&vid.height, vk_state.prev_mode, false)) != rserr_ok)
1136  {
1137  ri.Con_Printf(PRINT_ALL, "ref_vk::R_SetMode() - could not revert to safe mode\n");
1138  return false;
1139  }
1140  }
1141  return true;
1142 }

Referenced by R_Init().

◆ R_SetPalette()

void R_SetPalette ( const unsigned char *  palette)

Definition at line 1297 of file vk_rmain.c.

1298 {
1299  int i;
1300 
1301  byte *rp = (byte *)r_rawpalette;
1302 
1303  if (palette)
1304  {
1305  for (i = 0; i < 256; i++)
1306  {
1307  rp[i * 4 + 0] = palette[i * 3 + 0];
1308  rp[i * 4 + 1] = palette[i * 3 + 1];
1309  rp[i * 4 + 2] = palette[i * 3 + 2];
1310  rp[i * 4 + 3] = 0xff;
1311  }
1312  }
1313  else
1314  {
1315  for (i = 0; i < 256; i++)
1316  {
1317  rp[i * 4 + 0] = d_8to24table[i] & 0xff;
1318  rp[i * 4 + 1] = (d_8to24table[i] >> 8) & 0xff;
1319  rp[i * 4 + 2] = (d_8to24table[i] >> 16) & 0xff;
1320  rp[i * 4 + 3] = 0xff;
1321  }
1322  }
1323 }

Referenced by GetRefAPI().

◆ R_SetSky()

void R_SetSky ( char *  name,
float  rotate,
vec3_t  axis 
)

Definition at line 1401 of file r_main.c.

1402 {
1403  int i;
1404  char pathname[MAX_QPATH];
1405 
1406  strncpy(skyname, name, sizeof(skyname)-1);
1407  skyrotate = rotate;
1408  VectorCopy(axis, skyaxis);
1409 
1410  for (i = 0; i < 6; i++)
1411  {
1412  Com_sprintf(pathname, sizeof(pathname), "env/%s%s.pcx", skyname, suf[r_skysideimage[i]]);
1413  r_skytexinfo[i].image = R_FindImage(pathname, it_sky);
1414  }
1415 }

Referenced by GetRefAPI().

◆ R_SetupFrame()

void R_SetupFrame ( void  )

Definition at line 613 of file vk_rmain.c.

614 {
615  int i;
616  mleaf_t *leaf;
617 
618  r_framecount++;
619 
620  // build the transformation matrix for the given view angles
622 
624 
625  // current viewcluster
627  {
632 
633  // check above and below so crossing solid water doesn't draw wrong
634  if (!leaf->contents)
635  { // look down a bit
636  vec3_t temp;
637 
638  VectorCopy(r_origin, temp);
639  temp[2] -= 16;
640  leaf = Mod_PointInLeaf(temp, r_worldmodel);
641  if (!(leaf->contents & CONTENTS_SOLID) &&
642  (leaf->cluster != r_viewcluster2))
643  r_viewcluster2 = leaf->cluster;
644  }
645  else
646  { // look up a bit
647  vec3_t temp;
648 
649  VectorCopy(r_origin, temp);
650  temp[2] += 16;
651  leaf = Mod_PointInLeaf(temp, r_worldmodel);
652  if (!(leaf->contents & CONTENTS_SOLID) &&
653  (leaf->cluster != r_viewcluster2))
654  r_viewcluster2 = leaf->cluster;
655  }
656  }
657 
658  for (i = 0; i < 4; i++)
660 
661  c_brush_polys = 0;
662  c_alias_polys = 0;
663 
664  // clear out the portion of the screen that the NOWORLDMODEL defines
665  // unlike OpenGL, draw a rectangle in proper location - it's easier to do in Vulkan
667  {
668  float clearArea[] = { (float)r_newrefdef.x / vid.width, (float)r_newrefdef.y / vid.height,
669  (float)r_newrefdef.width / vid.width, (float)r_newrefdef.height / vid.height,
670  .3f, .3f, .3f, 1.f };
671  QVk_DrawColorRect(clearArea, sizeof(clearArea), RP_UI);
672  }
673 }

Referenced by R_RenderFrame(), and R_RenderView().

◆ R_SetupVulkan()

void R_SetupVulkan ( void  )

Definition at line 807 of file vk_rmain.c.

808 {
809  int x, x2, y2, y, w, h;
810 
811  //
812  // set up viewport
813  //
814  x = floor(r_newrefdef.x * vid.width / vid.width);
815  x2 = ceil((r_newrefdef.x + r_newrefdef.width) * vid.width / vid.width);
816  y = floor(vid.height - r_newrefdef.y * vid.height / vid.height);
818 
819  w = x2 - x;
820  h = y - y2;
821 
822  VkViewport viewport = {
823  .x = x,
824  .y = vid.height - h - y2,
825  .width = w,
826  .height = h,
827  .minDepth = 0.f,
828  .maxDepth = 1.f,
829  };
830  vkCmdSetViewport(vk_activeCmdbuffer, 0, 1, &viewport);
831 
832  // set up projection matrix
837 
839 
840  // set up view matrix
842  // put Z going up
844  Mat_Rotate(r_view_matrix, -r_newrefdef.viewangles[1], 0.f, 0.f, 1.f);
845  Mat_Rotate(r_view_matrix, -r_newrefdef.viewangles[0], 0.f, 1.f, 0.f);
846  Mat_Rotate(r_view_matrix, -r_newrefdef.viewangles[2], 1.f, 0.f, 0.f);
847  Mat_Rotate(r_view_matrix, 90.f, 0.f, 0.f, 1.f);
848  Mat_Rotate(r_view_matrix, -90.f, 1.f, 0.f, 0.f);
849 
850  // precalculate view-projection matrix
852  // view-projection matrix will always be stored as the first push constant item, so set no offset
853  vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTexQuadPipeline.layout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(r_viewproj_matrix), r_viewproj_matrix);
854 }

Referenced by R_RenderView().

◆ R_SetVulkan2D()

void R_SetVulkan2D ( void  )

Definition at line 947 of file vk_rmain.c.

948 {
949  // player configuration screen renders a model using the UI renderpass, so skip finishing RP_WORLD twice
952 
953  extern VkViewport vk_viewport;
954  extern VkRect2D vk_scissor;
955  vkCmdSetViewport(vk_activeCmdbuffer, 0, 1, &vk_viewport);
956  vkCmdSetScissor(vk_activeCmdbuffer, 0, 1, &vk_scissor);
957 
958  // first, blit offscreen color buffer with warped/postprocessed world view
959  // skip this step if we're in player config screen since it uses RP_UI and draws directly to swapchain
961  {
962  float pushConsts[] = { vk_postprocess->value, vid_gamma->value };
963  vkCmdPushConstants(vk_activeCmdbuffer, vk_postprocessPipeline.layout, VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(pushConsts), pushConsts);
964  vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_postprocessPipeline.layout, 0, 1, &vk_colorbufferWarp.descriptorSet, 0, NULL);
966  vkCmdDraw(vk_activeCmdbuffer, 3, 1, 0, 0);
967  }
968 }

Referenced by R_RenderFrame().

◆ R_Shutdown()

void R_Shutdown ( void  )

Definition at line 1195 of file vk_rmain.c.

1196 {
1197  ri.Cmd_RemoveCommand("vk_strings");
1198  ri.Cmd_RemoveCommand("vk_mem");
1199  ri.Cmd_RemoveCommand("imagelist");
1200  ri.Cmd_RemoveCommand("screenshot");
1201 
1202  vkDeviceWaitIdle(vk_device.logical);
1203 
1204  Mod_FreeAll();
1206 
1207  // Shutdown Vulkan subsystem
1208  QVk_Shutdown();
1209  // shut down OS specific Vulkan stuff (in our case: window)
1210  Vkimp_Shutdown();
1211 }

Referenced by GetRefAPI().

◆ SignbitsForPlane()

int SignbitsForPlane ( cplane_t out)

Definition at line 571 of file vk_rmain.c.

572 {
573  int bits, j;
574 
575  // for fast box on planeside test
576 
577  bits = 0;
578  for (j = 0; j<3; j++)
579  {
580  if (out->normal[j] < 0)
581  bits |= 1 << j;
582  }
583  return bits;
584 }

Referenced by R_SetFrustum().

◆ Sys_Error()

void Sys_Error ( char *  error,
  ... 
)

Definition at line 1485 of file vk_rmain.c.

1486 {
1487  va_list argptr;
1488  char text[1024];
1489 
1490  va_start (argptr, error);
1491  vsnprintf (text, 1024, error, argptr);
1492  va_end (argptr);
1493 
1494  ri.Sys_Error (ERR_FATAL, "%s", text);
1495 }

Referenced by COM_BlockSequenceCheckByte(), COM_BlockSequenceCRCByte(), Com_Error(), Hunk_Alloc(), Hunk_Begin(), Hunk_End(), Qcommon_Init(), QVk_BeginFrame(), QVk_EndFrame(), QVk_GetStagingBuffer(), and Sys_FindFirst().

◆ Vk_DrawParticles()

void Vk_DrawParticles ( int  num_particles,
const particle_t  particles[],
const unsigned  colortable[768] 
)

Definition at line 394 of file vk_rmain.c.

395 {
396  const particle_t *p;
397  int i;
398  vec3_t up, right;
399  float scale;
400  byte color[4];
401 
402  if (!num_particles)
403  return;
404 
405  VectorScale(vup, 1.5, up);
406  VectorScale(vright, 1.5, right);
407 
408  typedef struct {
409  float x,y,z,r,g,b,a,u,v;
410  } pvertex;
411 
412  static pvertex visibleParticles[MAX_PARTICLES*3];
413 
414  for (p = particles, i = 0; i < num_particles; i++, p++)
415  {
416  // hack a scale up to keep particles from disapearing
417  scale = (p->origin[0] - r_origin[0]) * vpn[0] +
418  (p->origin[1] - r_origin[1]) * vpn[1] +
419  (p->origin[2] - r_origin[2]) * vpn[2];
420 
421  if (scale < 20)
422  scale = 1;
423  else
424  scale = 1 + scale * 0.004;
425 
426  *(int *)color = colortable[p->color];
427 
428  int idx = i * 3;
429  float r = color[0] / 255.f;
430  float g = color[1] / 255.f;
431  float b = color[2] / 255.f;
432 
433  visibleParticles[idx].x = p->origin[0];
434  visibleParticles[idx].y = p->origin[1];
435  visibleParticles[idx].z = p->origin[2];
436  visibleParticles[idx].r = r;
437  visibleParticles[idx].g = g;
438  visibleParticles[idx].b = b;
439  visibleParticles[idx].a = p->alpha;
440  visibleParticles[idx].u = 0.0625;
441  visibleParticles[idx].v = 0.0625;
442 
443  visibleParticles[idx + 1].x = p->origin[0] + up[0] * scale;
444  visibleParticles[idx + 1].y = p->origin[1] + up[1] * scale;
445  visibleParticles[idx + 1].z = p->origin[2] + up[2] * scale;
446  visibleParticles[idx + 1].r = r;
447  visibleParticles[idx + 1].g = g;
448  visibleParticles[idx + 1].b = b;
449  visibleParticles[idx + 1].a = p->alpha;
450  visibleParticles[idx + 1].u = 1.0625;
451  visibleParticles[idx + 1].v = 0.0625;
452 
453  visibleParticles[idx + 2].x = p->origin[0] + right[0] * scale;
454  visibleParticles[idx + 2].y = p->origin[1] + right[1] * scale;
455  visibleParticles[idx + 2].z = p->origin[2] + right[2] * scale;
456  visibleParticles[idx + 2].r = r;
457  visibleParticles[idx + 2].g = g;
458  visibleParticles[idx + 2].b = b;
459  visibleParticles[idx + 2].a = p->alpha;
460  visibleParticles[idx + 2].u = 0.0625;
461  visibleParticles[idx + 2].v = 1.0625;
462  }
463 
465 
466  VkBuffer vbo;
467  VkDeviceSize vboOffset;
468  uint8_t *vertData = QVk_GetVertexBuffer(3 * sizeof(pvertex) * num_particles, &vbo, &vboOffset);
469  memcpy(vertData, &visibleParticles, 3 * sizeof(pvertex) * num_particles);
470 
471  vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawParticlesPipeline.layout, 0, 1, &r_particletexture->vk_texture.descriptorSet, 0, NULL);
472  vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
473  vkCmdDraw(vk_activeCmdbuffer, 3 * num_particles, 1, 0, 0);
474 }

Referenced by R_DrawParticles().

◆ Vk_Mem_f()

void Vk_Mem_f ( void  )

Definition at line 278 of file vk_rmisc.c.

279 {
280  ri.Con_Printf(PRINT_ALL, "\nDynamic buffer stats: \n");
281  ri.Con_Printf(PRINT_ALL, "Vertex : %u/%ukB (%.1f%% max: %ukB)\n", vk_config.vertex_buffer_usage / 1024,
285  ri.Con_Printf(PRINT_ALL, "Index : %u/%uB (%.1f%% max: %uB)\n", vk_config.index_buffer_usage,
289  ri.Con_Printf(PRINT_ALL, "Uniform: %u/%ukB (%.1f%% max: %ukB)\n", vk_config.uniform_buffer_usage / 1024,
293  ri.Con_Printf(PRINT_ALL, "Tri fan: %u/%u (%.1f%% max: %u)\n", vk_config.triangle_fan_index_usage,
297 }

Referenced by R_Register().

◆ Vk_Strings_f()

void Vk_Strings_f ( void  )

Definition at line 177 of file vk_rmisc.c.

178 {
179  int i = 0;
180  char ver[] = { "vkQuake2 v"VKQUAKE2_VERSION };
181  for (i = 0; i < strlen(ver); i++)
182  ver[i] += 128;
183 
184  uint32_t numDevices = 0;
185  int usedDevice = 0;
186  VkPhysicalDevice physicalDevices[32]; // make an assumption that nobody has more than 32 GPUs :-)
187  VkPhysicalDeviceProperties deviceProperties;
188  qboolean isPreferred = false;
189  int preferredDevice = (int)vk_device_idx->value;
190  int msaa = (int)ri.Cvar_Get("vk_msaa", "0", CVAR_ARCHIVE)->value;
191  uint32_t driverMajor = VK_VERSION_MAJOR(vk_device.properties.driverVersion);
192  uint32_t driverMinor = VK_VERSION_MINOR(vk_device.properties.driverVersion);
193  uint32_t driverPatch = VK_VERSION_PATCH(vk_device.properties.driverVersion);
194 
195  // NVIDIA driver version decoding scheme
196  if (vk_device.properties.vendorID == 0x10DE)
197  {
198  driverMajor = ((uint32_t)(vk_device.properties.driverVersion) >> 22) & 0x3ff;
199  driverMinor = ((uint32_t)(vk_device.properties.driverVersion) >> 14) & 0x0ff;
200 
201  uint32_t secondary = ((uint32_t)(vk_device.properties.driverVersion) >> 6) & 0x0ff;
202  uint32_t tertiary = vk_device.properties.driverVersion & 0x03f;
203 
204  driverPatch = (secondary << 8) | tertiary;
205  }
206 
207  VK_VERIFY(vkEnumeratePhysicalDevices(vk_instance, &numDevices, NULL));
208  VK_VERIFY(vkEnumeratePhysicalDevices(vk_instance, &numDevices, physicalDevices));
209 
210  if (preferredDevice >= numDevices) preferredDevice = -1;
211 
212  ri.Con_Printf(PRINT_ALL, "\n%s\n", ver);
213  ri.Con_Printf(PRINT_ALL, "------------------------------------\n");
214  ri.Con_Printf(PRINT_ALL, "Vulkan API: %d.%d\n", VK_VERSION_MAJOR(vk_config.vk_version),
215  VK_VERSION_MINOR(vk_config.vk_version));
216  ri.Con_Printf(PRINT_ALL, "Header version: %d\n", VK_HEADER_VERSION);
217  ri.Con_Printf(PRINT_ALL, "Devices found:\n");
218  for (i = 0; i < numDevices; ++i)
219  {
220  vkGetPhysicalDeviceProperties(physicalDevices[i], &deviceProperties);
221  isPreferred = (preferredDevice == i) || (preferredDevice < 0 && deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU);
222  if (isPreferred) usedDevice = i;
223  ri.Con_Printf(PRINT_ALL, "%s#%d: %s\n", isPreferred && numDevices > 1 ? "* " : " ", i, deviceProperties.deviceName);
224  }
225  ri.Con_Printf(PRINT_ALL, "Using device #%d:\n", usedDevice);
226  ri.Con_Printf(PRINT_ALL, " deviceName: %s\n", vk_device.properties.deviceName);
227  ri.Con_Printf(PRINT_ALL, " resolution: %dx%d", vid.width, vid.height);
228  if (msaa > 0)
229  ri.Con_Printf(PRINT_ALL, " (MSAAx%d)\n", 2 << (msaa - 1));
230  else
231  ri.Con_Printf(PRINT_ALL, "\n");
232 #ifndef __linux__
233  // Intel on Windows and MacOS (Linux uses semver for Mesa drivers)
234  if (vk_device.properties.vendorID == 0x8086)
235  ri.Con_Printf(PRINT_ALL, " driverVersion: %d (0x%X)\n", vk_device.properties.driverVersion, vk_device.properties.driverVersion);
236  else
237 #endif
238  ri.Con_Printf(PRINT_ALL, " driverVersion: %d.%d.%d (0x%X)\n", driverMajor, driverMinor, driverPatch, vk_device.properties.driverVersion);
239 
240  ri.Con_Printf(PRINT_ALL, " apiVersion: %d.%d.%d\n", VK_VERSION_MAJOR(vk_device.properties.apiVersion),
241  VK_VERSION_MINOR(vk_device.properties.apiVersion),
242  VK_VERSION_PATCH(vk_device.properties.apiVersion));
243  ri.Con_Printf(PRINT_ALL, " deviceID: %d\n", vk_device.properties.deviceID);
244  ri.Con_Printf(PRINT_ALL, " vendorID: 0x%X (%s)\n", vk_device.properties.vendorID, vk_config.vendor_name);
245  ri.Con_Printf(PRINT_ALL, " deviceType: %s\n", vk_config.device_type);
246  ri.Con_Printf(PRINT_ALL, " gfx/present/transfer: %d/%d/%d\n", vk_device.gfxFamilyIndex,
249  ri.Con_Printf(PRINT_ALL, "Present mode: %s\n", vk_config.present_mode);
250  ri.Con_Printf(PRINT_ALL, "Swapchain image format: %d\n", vk_swapchain.format);
251  ri.Con_Printf(PRINT_ALL, "Supported present modes: ");
252 
253  i = 0;
255  {
257  }
258  ri.Con_Printf(PRINT_ALL, "\nEnabled extensions: ");
259 
260  i = 0;
261  while(vk_config.extensions[i])
262  {
264  }
265  ri.Con_Printf(PRINT_ALL, "\nEnabled layers: ");
266 
267  i = 0;
268  while(vk_config.layers[i])
269  {
270  ri.Con_Printf(PRINT_ALL, "%s ", vk_config.layers[i++]);
271  }
272  ri.Con_Printf(PRINT_ALL, "\n");
273 }

Referenced by R_Init(), and R_Register().

Variable Documentation

◆ c_alias_polys

int c_alias_polys

Definition at line 44 of file vk_rmain.c.

Referenced by R_RenderView(), and R_SetupFrame().

◆ c_brush_polys

◆ currententity

entity_t* currententity

Definition at line 36 of file vk_rmain.c.

Referenced by R_DrawEntitiesOnList(), and R_DrawNullModel().

◆ currentmodel

◆ frustum

cplane_t frustum[4]

Definition at line 39 of file vk_rmain.c.

Referenced by R_CullAliasModel(), R_CullBox(), and R_SetFrustum().

◆ r_drawentities

cvar_t* r_drawentities

Definition at line 79 of file vk_rmain.c.

Referenced by R_DrawEntitiesOnList(), and R_Register().

◆ r_drawworld

cvar_t* r_drawworld

Definition at line 80 of file vk_rmain.c.

Referenced by R_DrawWorld(), R_Register(), and R_RenderWorld().

◆ r_framecount

◆ r_fullbright

cvar_t* r_fullbright

◆ r_lefthand

cvar_t* r_lefthand

Definition at line 86 of file vk_rmain.c.

Referenced by R_AliasDrawModel(), R_AliasPreparePoints(), R_DrawAliasModel(), and R_Register().

◆ r_lerpmodels

cvar_t* r_lerpmodels

Definition at line 85 of file vk_rmain.c.

Referenced by R_AliasDrawModel(), R_DrawAliasModel(), and R_Register().

◆ r_lightlevel

cvar_t* r_lightlevel

Definition at line 88 of file vk_rmain.c.

Referenced by R_AliasSetupLighting(), R_DrawAliasModel(), R_Register(), and R_SetLightLevel().

◆ r_newrefdef

◆ r_nocull

cvar_t* r_nocull

Definition at line 84 of file vk_rmain.c.

Referenced by R_CullBox(), and R_Register().

◆ r_norefresh

cvar_t* r_norefresh

Definition at line 78 of file vk_rmain.c.

Referenced by R_Register(), and R_RenderView().

◆ r_notexture

◆ r_novis

cvar_t* r_novis

Definition at line 83 of file vk_rmain.c.

Referenced by R_Register().

◆ r_oldviewcluster

int r_oldviewcluster

Definition at line 76 of file vk_rmain.c.

Referenced by R_SetupFrame().

◆ r_oldviewcluster2

int r_oldviewcluster2

Definition at line 76 of file vk_rmain.c.

Referenced by R_SetupFrame().

◆ r_origin

◆ r_particletexture

image_t* r_particletexture

◆ r_proj_aspect

float r_proj_aspect

Definition at line 60 of file vk_rmain.c.

Referenced by R_DrawAliasModel(), and R_SetupVulkan().

◆ r_proj_fovx

float r_proj_fovx

Definition at line 61 of file vk_rmain.c.

Referenced by R_SetupVulkan().

◆ r_proj_fovy

float r_proj_fovy

Definition at line 62 of file vk_rmain.c.

Referenced by R_DrawAliasModel(), and R_SetupVulkan().

◆ r_projection_matrix

float r_projection_matrix[16]

Definition at line 59 of file vk_rmain.c.

Referenced by R_DrawAliasModel(), and R_SetupVulkan().

◆ r_rawpalette

unsigned r_rawpalette[256]

Definition at line 1295 of file vk_rmain.c.

Referenced by Draw_StretchRaw(), and R_SetPalette().

◆ r_speeds

cvar_t* r_speeds

Definition at line 81 of file vk_rmain.c.

Referenced by R_Register(), and R_RenderView().

◆ r_view_matrix

float r_view_matrix[16]

Definition at line 63 of file vk_rmain.c.

Referenced by R_DrawAliasModel(), and R_SetupVulkan().

◆ r_viewcluster

int r_viewcluster

Definition at line 76 of file vk_rmain.c.

Referenced by R_BeginRegistration(), R_MarkLeaves(), and R_SetupFrame().

◆ r_viewcluster2

int r_viewcluster2

Definition at line 76 of file vk_rmain.c.

Referenced by R_SetupFrame().

◆ r_viewproj_matrix

float r_viewproj_matrix[16]

◆ r_visframecount

int r_visframecount

Definition at line 41 of file vk_rmain.c.

Referenced by R_MarkLeaves(), R_RecursiveClipBPoly(), and R_RecursiveWorldNode().

◆ r_vulkan_correction

float r_vulkan_correction[16]
static
Initial value:
= { 1.f, 0.f, 0.f, 0.f,
0.f, -1.f, 0.f, 0.f,
0.f, 0.f, .5f, 0.f,
0.f, 0.f, .5f, 1.f
}

Definition at line 66 of file vk_rmain.c.

Referenced by Mat_Ortho(), and R_SetupVulkan().

◆ r_worldmodel

◆ ri

Definition at line 26 of file vk_rmain.c.

Referenced by CalcSurfaceExtents(), ClipSkyPolygon(), Com_Printf(), CreateDrawBuffers(), CreateFramebuffers(), CreateRenderpasses(), D_SCAlloc(), D_SCDump(), DDRAW_Init(), DDRAW_SetPalette(), DDRAW_Shutdown(), debugUtilsCallback(), DIB_Init(), DIB_SetPalette(), Draw_Char(), Draw_Fill(), Draw_GetPalette(), Draw_GetPicSize(), Draw_InitLocal(), Draw_Pic(), Draw_StretchPic(), Draw_StretchPicImplementation(), Draw_TileClear(), GetRefAPI(), getSwapPresentMode(), GL_CreateSurfaceLightmap(), GL_ImageList_f(), GL_InitImages(), GL_LoadPic(), GL_LoadWal(), GL_ScreenShot_f(), GL_Strings_f(), GL_TextureAlphaMode(), GL_TextureMode(), GL_TextureSolidMode(), GL_Upload32(), GL_Upload8(), GLimp_BeginFrame(), GLimp_EnableLogging(), GLimp_EndFrame(), GLimp_Init(), GLimp_InitGL(), GLimp_SetMode(), GLimp_Shutdown(), LM_UploadBlock(), LoadPCX(), LoadTGA(), Mod_ForName(), Mod_LoadAliasModel(), Mod_LoadBrushModel(), Mod_LoadEdges(), Mod_LoadFaces(), Mod_LoadLeafs(), Mod_LoadMarksurfaces(), Mod_LoadNodes(), Mod_LoadPlanes(), Mod_LoadSpriteModel(), Mod_LoadSubmodels(), Mod_LoadSurfedges(), Mod_LoadTexinfo(), Mod_LoadVertexes(), Mod_Modellist_f(), Mod_PointInLeaf(), QGL_Init(), QVk_BeginFrame(), QVk_CreateDevice(), QVk_CreateSwapchain(), QVk_CreateValidationLayers(), QVk_EndFrame(), QVk_GetIndexBuffer(), QVk_GetTriangleFanIbo(), QVk_GetUniformBuffer(), QVk_GetVertexBuffer(), QVk_Init(), QVk_Shutdown(), R_AliasDrawModel(), R_AliasSetupFrames(), R_AliasSetupSkin(), R_BeginFrame(), R_BeginRegistration(), R_BlendLightmaps(), R_BuildLightMap(), R_ClipAndDrawPoly(), R_CullAliasModel(), R_DrawAliasModel(), R_DrawEntitiesOnList(), R_DrawParticles(), R_DrawSprite(), R_FindFreeImage(), R_ImageList_f(), R_Init(), R_InitCaches(), R_InitSkyBox(), R_LoadWal(), R_PrintAliasStats(), R_PrintDSpeeds(), R_PrintTimes(), R_RecursiveClipBPoly(), R_Register(), R_RenderView(), R_ScreenShot_f(), R_SetMode(), R_Shutdown(), selectPhysicalDevice(), SubdividePolygon(), SWimp_SetMode(), SWimp_Shutdown(), Sys_Error(), Sys_MakeCodeWriteable(), VID_CreateWindow(), VID_LoadRefresh(), Vk_CreateSurfaceLightmap(), Vk_ImageList_f(), Vk_InitImages(), Vk_LmapTextureMode(), Vk_LoadPic(), Vk_LoadWal(), Vk_Mem_f(), Vk_ScreenShot_f(), Vk_Strings_f(), Vk_TextureMode(), Vk_Upload32(), Vk_Upload8(), Vkimp_BeginFrame(), Vkimp_EnableLogging(), Vkimp_Init(), Vkimp_SetMode(), and WritePCXfile().

◆ v_blend

float v_blend[4]

Definition at line 46 of file vk_rmain.c.

Referenced by R_PolyBlend(), and R_SetupFrame().

◆ vid

◆ vid_fullscreen

◆ vid_gamma

cvar_t* vid_gamma

◆ vid_ref

◆ viewsize

cvar_t* viewsize

Definition at line 127 of file vk_rmain.c.

Referenced by R_EndWorldRenderpass(), R_Register(), and V_RenderView().

◆ vk_aniso

cvar_t* vk_aniso

Definition at line 118 of file vk_rmain.c.

Referenced by R_BeginFrame(), and R_Register().

◆ vk_bitdepth

cvar_t* vk_bitdepth

Definition at line 92 of file vk_rmain.c.

Referenced by R_Register(), VID_CreateWindow(), Vkimp_BeginFrame(), and Vkimp_SetMode().

◆ vk_clear

cvar_t* vk_clear

Definition at line 99 of file vk_rmain.c.

Referenced by QVk_Init(), R_BeginFrame(), R_Register(), and R_SetMode().

◆ vk_config

◆ vk_device_idx

cvar_t* vk_device_idx

Definition at line 122 of file vk_rmain.c.

Referenced by QVk_Init(), R_BeginFrame(), R_Register(), R_SetMode(), and Vk_Strings_f().

◆ vk_dynamic

cvar_t* vk_dynamic

Definition at line 112 of file vk_rmain.c.

Referenced by R_Register(), R_RenderBrushPoly(), and Vk_RenderLightmappedPoly().

◆ vk_finish

cvar_t* vk_finish

Definition at line 98 of file vk_rmain.c.

Referenced by R_Register(), and R_RenderView().

◆ vk_flashblend

cvar_t* vk_flashblend

Definition at line 97 of file vk_rmain.c.

Referenced by R_DrawInlineBModel(), R_PushDlights(), R_Register(), and R_RenderDlights().

◆ vk_lightmap

cvar_t* vk_lightmap

Definition at line 115 of file vk_rmain.c.

Referenced by R_Register(), and Vk_RenderLightmappedPoly().

◆ vk_lmaptexturemode

cvar_t* vk_lmaptexturemode

Definition at line 117 of file vk_rmain.c.

Referenced by R_BeginFrame(), R_Register(), and R_SetMode().

◆ vk_lockpvs

cvar_t* vk_lockpvs

Definition at line 100 of file vk_rmain.c.

Referenced by R_MarkLeaves(), and R_Register().

◆ vk_log

cvar_t* vk_log

Definition at line 93 of file vk_rmain.c.

Referenced by R_BeginFrame(), and R_Register().

◆ vk_mip_nearfilter

cvar_t* vk_mip_nearfilter

Definition at line 119 of file vk_rmain.c.

Referenced by generateMipmaps(), R_BeginFrame(), R_Register(), and R_SetMode().

◆ vk_mode

cvar_t* vk_mode

Definition at line 91 of file vk_rmain.c.

Referenced by R_BeginFrame(), R_Register(), and R_SetMode().

◆ vk_modulate

cvar_t* vk_modulate

Definition at line 102 of file vk_rmain.c.

Referenced by R_BuildLightMap(), R_LightPoint(), R_Register(), and RecursiveLightPoint().

◆ vk_msaa

cvar_t* vk_msaa

Definition at line 113 of file vk_rmain.c.

Referenced by GetSampleCount(), QVk_Init(), R_BeginFrame(), R_Register(), and R_SetMode().

◆ vk_particle_att_a

cvar_t* vk_particle_att_a

Definition at line 105 of file vk_rmain.c.

Referenced by R_DrawParticles(), and R_Register().

◆ vk_particle_att_b

cvar_t* vk_particle_att_b

Definition at line 106 of file vk_rmain.c.

Referenced by R_DrawParticles(), and R_Register().

◆ vk_particle_att_c

cvar_t* vk_particle_att_c

Definition at line 107 of file vk_rmain.c.

Referenced by R_DrawParticles(), and R_Register().

◆ vk_particle_max_size

cvar_t* vk_particle_max_size

Definition at line 109 of file vk_rmain.c.

Referenced by R_DrawParticles(), and R_Register().

◆ vk_particle_min_size

cvar_t* vk_particle_min_size

Definition at line 108 of file vk_rmain.c.

Referenced by R_DrawParticles(), and R_Register().

◆ vk_particle_size

cvar_t* vk_particle_size

Definition at line 104 of file vk_rmain.c.

Referenced by R_DrawParticles(), and R_Register().

◆ vk_picmip

cvar_t* vk_picmip

Definition at line 94 of file vk_rmain.c.

Referenced by R_BeginFrame(), R_Register(), and R_SetMode().

◆ vk_point_particles

cvar_t* vk_point_particles

Definition at line 110 of file vk_rmain.c.

Referenced by R_DrawParticles(), and R_Register().

◆ vk_polyblend

cvar_t* vk_polyblend

Definition at line 101 of file vk_rmain.c.

Referenced by R_PolyBlend(), and R_Register().

◆ vk_postprocess

cvar_t* vk_postprocess

Definition at line 111 of file vk_rmain.c.

Referenced by R_Register(), and R_SetVulkan2D().

◆ vk_round_down

cvar_t* vk_round_down

Definition at line 96 of file vk_rmain.c.

Referenced by R_Register(), and Vk_Upload32().

◆ vk_sampleshading

cvar_t* vk_sampleshading

Definition at line 120 of file vk_rmain.c.

Referenced by R_BeginFrame(), R_Register(), and R_SetMode().

◆ vk_shadows

cvar_t* vk_shadows

Definition at line 103 of file vk_rmain.c.

Referenced by R_DrawAliasModel(), and R_Register().

◆ vk_showtris

cvar_t* vk_showtris

◆ vk_skymip

cvar_t* vk_skymip

Definition at line 95 of file vk_rmain.c.

Referenced by R_Register(), and R_SetSky().

◆ vk_state

◆ vk_texturemode

cvar_t* vk_texturemode

Definition at line 116 of file vk_rmain.c.

Referenced by R_BeginFrame(), R_Register(), and R_SetMode().

◆ vk_validation

cvar_t* vk_validation

◆ vk_vsync

cvar_t* vk_vsync

Definition at line 121 of file vk_rmain.c.

Referenced by R_BeginFrame(), R_Register(), and R_SetMode().

◆ vpn

◆ vright

◆ vup

Vk_LmapTextureMode
void Vk_LmapTextureMode(char *string)
Definition: vk_image.c:705
R_DrawNullModel
void R_DrawNullModel(void)
Definition: vk_rmain.c:235
r_drawworld
cvar_t * r_drawworld
Definition: vk_rmain.c:80
RF_TRANSLUCENT
#define RF_TRANSLUCENT
Definition: q_shared.h:604
viewsize
cvar_t * viewsize
Definition: vk_rmain.c:127
image_s::vk_texture
qvktexture_t vk_texture
Definition: vk_local.h:116
it_sprite
@ it_sprite
Definition: r_local.h:65
dsprframe_t::name
char name[MAX_SKINNAME]
Definition: qfiles.h:178
R_DrawParticles
void R_DrawParticles(void)
Definition: vk_rmain.c:481
refexport_t::RegisterSkin
struct image_s *(* RegisterSkin)(char *name)
Definition: ref.h:159
sv
server_t sv
Definition: sv_init.c:24
cplane_s::normal
vec3_t normal
Definition: q_shared.h:415
r_skytexinfo
mtexinfo_t r_skytexinfo[6]
Definition: r_rast.c:70
v_blend
float v_blend[4]
Definition: vk_rmain.c:46
refdef_t::vieworg
float vieworg[3]
Definition: ref.h:106
refimport_t::Cmd_RemoveCommand
void(* Cmd_RemoveCommand)(char *name)
Definition: ref.h:197
R_SetFrustum
void R_SetFrustum(float fovx, float fovy)
Definition: vk_rmain.c:587
rserr_t
rserr_t
Definition: r_local.h:103
y2
GLdouble GLdouble GLdouble y2
Definition: qgl_win.c:301
Draw_FindPic
struct image_s * Draw_FindPic(char *name)
Definition: r_draw.c:37
cplane_s::type
byte type
Definition: q_shared.h:417
height
GLsizei height
Definition: qgl_win.c:69
QVk_Shutdown
void QVk_Shutdown(void)
Definition: vk_common.c:1376
MAX_QPATH
#define MAX_QPATH
Definition: q_shared.h:80
qvkdevice_t::logical
VkDevice logical
Definition: qvk.h:40
entity_s::origin
float origin[3]
Definition: ref.h:57
entity_s::model
struct model_s * model
Definition: ref.h:51
vk_aniso
cvar_t * vk_aniso
Definition: vk_rmain.c:118
Draw_TileClear
void Draw_TileClear(int x, int y, int w, int h, char *name)
Definition: r_draw.c:537
vk_particle_size
cvar_t * vk_particle_size
Definition: vk_rmain.c:104
R_RotateForEntity
void R_RotateForEntity(entity_t *e, float *mvMatrix)
Definition: vk_rmain.c:150
vk_drawSpritePipeline
qvkpipeline_t vk_drawSpritePipeline
Definition: vk_common.c:149
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
r_rawpalette
unsigned r_rawpalette[256]
Definition: vk_rmain.c:1295
QVk_DrawColorRect
void QVk_DrawColorRect(float *ubo, VkDeviceSize uboSize, qvkrenderpasstype_t rpType)
Definition: vk_common.c:2253
Swap_Init
void Swap_Init(void)
Definition: q_shared.c:1011
c_visible_lightmaps
int c_visible_lightmaps
Definition: gl_rsurf.c:40
QVk_BeginFrame
VkResult QVk_BeginFrame(void)
Definition: vk_common.c:1824
mod_known
model_t mod_known[MAX_MOD_KNOWN]
Definition: r_model.c:38
vk_colorbuffer
qvktexture_t vk_colorbuffer
Definition: vk_common.c:104
viddef_t::buffer
pixel_t * buffer
Definition: r_local.h:94
BOX_ON_PLANE_SIDE
#define BOX_ON_PLANE_SIDE(emins, emaxs, p)
Definition: q_shared.h:197
vk_particle_att_b
cvar_t * vk_particle_att_b
Definition: vk_rmain.c:106
skyname
char skyname[MAX_QPATH]
Definition: r_main.c:32
vid
viddef_t vid
Definition: vk_rmain.c:24
R_PushDlights
void R_PushDlights(model_t *model)
Definition: r_light.c:94
bottom
GLdouble GLdouble bottom
Definition: qgl_win.c:159
vk_instance
VkInstance vk_instance
Definition: vk_common.c:46
Vkimp_LogNewFrame
void Vkimp_LogNewFrame(void)
Definition: vk_common.c:2356
vkconfig_t::device_type
const char * device_type
Definition: vk_local.h:308
Draw_StretchRaw
void Draw_StretchRaw(int x, int y, int w, int h, int cols, int rows, byte *data)
Definition: r_draw.c:423
Hunk_Free
void Hunk_Free(void *base)
Definition: q_shwin.c:99
ri
refimport_t ri
Definition: r_main.c:25
vk_state
vkstate_t vk_state
Definition: vk_rmain.c:31
r_fullbright
cvar_t * r_fullbright
Definition: vk_rmain.c:82
vk_polyblend
cvar_t * vk_polyblend
Definition: vk_rmain.c:101
vk_viewport
VkViewport vk_viewport
Definition: vk_common.c:114
refexport_t::DrawStretchRaw
void(* DrawStretchRaw)(int x, int y, int w, int h, int cols, int rows, byte *data)
Definition: ref.h:175
v
GLdouble v
Definition: qgl_win.c:143
VKQUAKE2_VERSION
#define VKQUAKE2_VERSION
Definition: vk_local.h:47
cvar_s::modified
qboolean modified
Definition: q_shared.h:330
ri
refimport_t ri
Definition: vk_rmain.c:26
zNear
GLdouble GLdouble GLdouble GLdouble zNear
Definition: qgl_win.c:159
cplane_s::signbits
byte signbits
Definition: q_shared.h:418
dsprframe_t::height
int height
Definition: qfiles.h:176
vup
vec3_t vup
Definition: vk_rmain.c:54
vk_flashblend
cvar_t * vk_flashblend
Definition: vk_rmain.c:97
refexport_t::RegisterPic
struct image_s *(* RegisterPic)(char *name)
Definition: ref.h:160
r_skysideimage
int r_skysideimage[6]
Definition: r_main.c:1399
refexport_t::DrawFill
void(* DrawFill)(int x, int y, int w, int h, int c)
Definition: ref.h:171
qvkdevice_t::properties
VkPhysicalDeviceProperties properties
Definition: qvk.h:41
vk_particle_att_a
cvar_t * vk_particle_att_a
Definition: vk_rmain.c:105
vk_particle_max_size
cvar_t * vk_particle_max_size
Definition: vk_rmain.c:109
Mod_PointInLeaf
mleaf_t * Mod_PointInLeaf(vec3_t p, model_t *model)
Definition: r_model.c:188
R_LightPoint
void R_LightPoint(vec3_t p, vec3_t color)
Definition: r_light.c:226
vk_log
cvar_t * vk_log
Definition: vk_rmain.c:93
R_EndRegistration
void R_EndRegistration(void)
Definition: r_model.c:1282
r_norefresh
cvar_t * r_norefresh
Definition: vk_rmain.c:78
x2
GLdouble GLdouble x2
Definition: qgl_win.c:301
vpn
vec3_t vpn
Definition: vk_rmain.c:55
vkstate_t::prev_mode
int prev_mode
Definition: vk_local.h:335
refimport_t::Cvar_Get
cvar_t *(* Cvar_Get)(char *name, char *value, int flags)
Definition: ref.h:216
Vkimp_Shutdown
void Vkimp_Shutdown(void)
Definition: vk_imp.c:274
cvar_s::string
char * string
Definition: q_shared.h:327
VectorScale
void VectorScale(vec3_t in, vec_t scale, vec3_t out)
Definition: q_shared.c:782
R_FindImage
image_t * R_FindImage(char *name, imagetype_t type)
Definition: r_image.c:491
qboolean
qboolean
Definition: q_shared.h:63
x
GLint GLenum GLint x
Definition: qgl_win.c:116
QVk_GetTriangleFanIbo
VkBuffer QVk_GetTriangleFanIbo(VkDeviceSize indexCount)
Definition: vk_common.c:2198
R_DrawEntitiesOnList
void R_DrawEntitiesOnList(void)
Definition: vk_rmain.c:306
z
GLdouble GLdouble z
Definition: qgl_win.c:283
entity_s::skinnum
int skinnum
Definition: ref.h:70
Mat_Rotate
void Mat_Rotate(float *matrix, float deg, float x, float y, float z)
Definition: vk_rmain.c:728
i
int i
Definition: q_shared.c:305
R_BeginFrame
void R_BeginFrame(float camera_separation)
Definition: vk_rmain.c:1220
vkconfig_t::uniform_buffer_max_usage
uint32_t uniform_buffer_max_usage
Definition: vk_local.h:320
R_SetVulkan2D
void R_SetVulkan2D(void)
Definition: vk_rmain.c:947
API_VERSION
#define API_VERSION
Definition: ref.h:128
refdef_t::y
int y
Definition: ref.h:104
skyaxis
vec3_t skyaxis
Definition: r_main.c:35
Draw_Char
void Draw_Char(int x, int y, int c)
Definition: r_draw.c:242
vkconfig_t::uniform_buffer_usage
uint32_t uniform_buffer_usage
Definition: vk_local.h:319
RP_WORLD_WARP
@ RP_WORLD_WARP
Definition: qvk.h:198
model_s
Definition: r_model.h:171
vkconfig_t::layers
const char * layers[256]
Definition: vk_local.h:312
vk_drawParticlesPipeline
qvkpipeline_t vk_drawParticlesPipeline
Definition: vk_common.c:147
Vk_TextureMode
void Vk_TextureMode(char *string)
Definition: vk_image.c:657
frustum
cplane_t frustum[4]
Definition: vk_rmain.c:39
qvkdevice_t::gfxFamilyIndex
int gfxFamilyIndex
Definition: qvk.h:46
refimport_t::Cvar_Set
cvar_t *(* Cvar_Set)(char *name, char *value)
Definition: ref.h:217
r_oldviewcluster
int r_oldviewcluster
Definition: r_local.h:791
r_vulkan_correction
static float r_vulkan_correction[16]
Definition: vk_rmain.c:66
Vk_DrawParticles
void Vk_DrawParticles(int num_particles, const particle_t particles[], const unsigned colortable[768])
Definition: vk_rmain.c:394
R_RegisterModel
struct model_s * R_RegisterModel(char *name)
Definition: r_model.c:1239
refdef_t::rdflags
int rdflags
Definition: ref.h:110
Vk_Mem_f
void Vk_Mem_f(void)
Definition: vk_rmisc.c:278
vk_texturemode
cvar_t * vk_texturemode
Definition: vk_rmain.c:116
CONTENTS_SOLID
#define CONTENTS_SOLID
Definition: qfiles.h:333
c_alias_polys
int c_alias_polys
Definition: vk_rmain.c:44
entity_s::flags
int flags
Definition: ref.h:76
vk_device_idx
cvar_t * vk_device_idx
Definition: vk_rmain.c:122
M_PI
#define M_PI
Definition: q_shared.h:142
SignbitsForPlane
int SignbitsForPlane(cplane_t *out)
Definition: vk_rmain.c:571
image_s::registration_sequence
int registration_sequence
Definition: r_local.h:77
refexport_t::AppActivate
void(* AppActivate)(qboolean activate)
Definition: ref.h:185
mleaf_s::contents
int contents
Definition: r_model.h:146
vk_finish
cvar_t * vk_finish
Definition: vk_rmain.c:98
r_lerpmodels
cvar_t * r_lerpmodels
Definition: vk_rmain.c:85
R_EndFrame
void R_EndFrame(void)
Definition: vk_rmain.c:1285
skip
static void skip(vorb *z, int n)
Definition: stb_vorbis.c:1336
cvar_s
Definition: q_shared.h:324
mod_brush
@ mod_brush
Definition: r_model.h:169
vk_colorbufferWarp
qvktexture_t vk_colorbufferWarp
Definition: vk_common.c:106
Vk_ScreenShot_f
void Vk_ScreenShot_f(void)
Definition: vk_rmisc.c:101
mleaf_s
Definition: r_model.h:143
vk_scissor
VkRect2D vk_scissor
Definition: vk_common.c:115
vk_drawTexQuadPipeline
qvkpipeline_t vk_drawTexQuadPipeline
Definition: vk_common.c:138
model_s::extradata
void * extradata
Definition: r_model.h:235
Vkimp_BeginFrame
void Vkimp_BeginFrame(float camera_separation)
Definition: vk_imp.c:350
vk_device
qvkdevice_t vk_device
Definition: vk_common.c:51
R_Flash
void R_Flash(void)
Definition: vk_rmain.c:856
R_DrawBeam
void R_DrawBeam(entity_t *e)
Definition: vk_rmain.c:1328
vkconfig_t::triangle_fan_index_count
uint32_t triangle_fan_index_count
Definition: vk_local.h:324
vk_modulate
cvar_t * vk_modulate
Definition: vk_rmain.c:102
refexport_t::EndRegistration
void(* EndRegistration)(void)
Definition: ref.h:162
vkconfig_t::index_buffer_size
uint32_t index_buffer_size
Definition: vk_local.h:318
refexport_t::EndFrame
void(* EndFrame)(void)
Definition: ref.h:182
j
GLint j
Definition: qgl_win.c:150
QVk_GetVertexBuffer
uint8_t * QVk_GetVertexBuffer(VkDeviceSize size, VkBuffer *dstBuffer, VkDeviceSize *dstOffset)
Definition: vk_common.c:2019
vk_bitdepth
cvar_t * vk_bitdepth
Definition: vk_rmain.c:92
Draw_FadeScreen
void Draw_FadeScreen(void)
Definition: r_draw.c:620
qvkdevice_t::presentFamilyIndex
int presentFamilyIndex
Definition: qvk.h:47
vk_postprocessPipeline
qvkpipeline_t vk_postprocessPipeline
Definition: vk_common.c:160
Mod_FreeAll
void Mod_FreeAll(void)
Definition: r_model.c:1324
r_speeds
cvar_t * r_speeds
Definition: vk_rmain.c:81
mod_numknown
int mod_numknown
Definition: r_model.c:39
QVk_BeginRenderpass
void QVk_BeginRenderpass(qvkrenderpasstype_t rpType)
Definition: vk_common.c:1946
qvktexture_t::descriptorSet
VkDescriptorSet descriptorSet
Definition: qvk.h:87
R_FreeUnusedImages
void R_FreeUnusedImages(void)
Definition: r_image.c:564
dsprite_t
Definition: qfiles.h:181
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: q_shared.c:93
r_novis
cvar_t * r_novis
Definition: vk_rmain.c:83
vkconfig_t::index_buffer_usage
uint32_t index_buffer_usage
Definition: vk_local.h:316
RF_BEAM
#define RF_BEAM
Definition: q_shared.h:606
ref
GLclampf ref
Definition: qgl_win.c:64
model_s::registration_sequence
int registration_sequence
Definition: r_model.h:175
refimport_t::Con_Printf
void(* Con_Printf)(int print_level, char *str,...)
Definition: ref.h:202
u
static int u
Definition: r_part.c:472
vk_particle_min_size
cvar_t * vk_particle_min_size
Definition: vk_rmain.c:108
PRINT_ALL
#define PRINT_ALL
Definition: qcommon.h:751
r_lefthand
cvar_t * r_lefthand
Definition: vk_rmain.c:86
mtexinfo_s::image
image_t * image
Definition: r_model.h:87
refexport_t::DrawFadeScreen
void(* DrawFadeScreen)(void)
Definition: ref.h:172
r_origin
vec3_t r_origin
Definition: vk_rmain.c:57
R_RegisterModel
struct model_s * R_RegisterModel(char *name)
Definition: r_model.c:1239
c_brush_polys
int c_brush_polys
Definition: vk_rmain.c:44
RDF_NOWORLDMODEL
#define RDF_NOWORLDMODEL
Definition: q_shared.h:622
vkconfig_t::present_mode
const char * present_mode
Definition: vk_local.h:309
Draw_Pic
void Draw_Pic(int x, int y, char *name)
Definition: r_draw.c:438
vkconfig_t::extensions
const char * extensions[256]
Definition: vk_local.h:311
r_projection_matrix
float r_projection_matrix[16]
Definition: vk_rmain.c:59
model_s::numframes
int numframes
Definition: r_model.h:178
D_FlushCaches
void D_FlushCaches(void)
Definition: r_surf.c:481
Draw_InitLocal
void Draw_InitLocal(void)
Definition: r_draw.c:222
vk_validation
cvar_t * vk_validation
Definition: vk_rmain.c:90
Vk_Strings_f
void Vk_Strings_f(void)
Definition: vk_rmisc.c:177
it_pic
@ it_pic
Definition: r_local.h:67
R_DrawSpriteModel
void R_DrawSpriteModel(entity_t *e)
Definition: vk_rmain.c:173
qvkswapchain_t::format
VkFormat format
Definition: qvk.h:55
model_s::texinfo
mtexinfo_t * texinfo
Definition: r_model.h:218
entity_s::alpha
float alpha
Definition: ref.h:73
viddef_t::rowbytes
int rowbytes
Definition: r_local.h:97
Mod_ForName
model_t * Mod_ForName(char *name, qboolean crash)
Definition: r_model.c:90
r
GLdouble GLdouble r
Definition: qgl_win.c:336
image_s::height
int height
Definition: r_local.h:75
viddef_t::width
unsigned width
Definition: vid.h:29
Draw_StretchPicImplementation
void Draw_StretchPicImplementation(int x, int y, int w, int h, image_t *pic)
Definition: r_draw.c:342
model_s::type
modtype_t type
Definition: r_model.h:177
R_SetLightLevel
void R_SetLightLevel(void)
Definition: vk_rmain.c:977
Vkimp_EnableLogging
void Vkimp_EnableLogging(qboolean enable)
Definition: vk_common.c:2328
refimport_t::Cmd_AddCommand
void(* Cmd_AddCommand)(char *name, void(*cmd)(void))
Definition: ref.h:196
vk_skymip
cvar_t * vk_skymip
Definition: vk_rmain.c:95
Vkimp_SetMode
rserr_t Vkimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen)
Definition: vk_imp.c:186
R_SetSky
void R_SetSky(char *name, float rotate, vec3_t axis)
Definition: r_main.c:1401
skyrotate
float skyrotate
Definition: r_main.c:34
vk_shadows
cvar_t * vk_shadows
Definition: vk_rmain.c:103
vk_showtris
cvar_t * vk_showtris
Definition: vk_rmain.c:114
R_NewMap
void R_NewMap(void)
Definition: r_main.c:415
r_proj_fovy
float r_proj_fovy
Definition: vk_rmain.c:62
vkconfig_t::index_buffer_max_usage
uint32_t index_buffer_max_usage
Definition: vk_local.h:317
particle_t::alpha
float alpha
Definition: ref.h:93
rserr_invalid_mode
@ rserr_invalid_mode
Definition: r_local.h:108
QVk_GetUniformBuffer
uint8_t * QVk_GetUniformBuffer(VkDeviceSize size, uint32_t *dstOffset, VkDescriptorSet *dstUboDescriptorSet)
Definition: vk_common.c:2100
PerpendicularVector
void PerpendicularVector(vec3_t dst, const vec3_t src)
Definition: q_shared.c:152
vk_drawPointParticlesPipeline
qvkpipeline_t vk_drawPointParticlesPipeline
Definition: vk_common.c:148
t
GLdouble t
Definition: qgl_win.c:328
vk_swapchain
qvkswapchain_t vk_swapchain
Definition: vk_common.c:63
vk_drawNullModelPipeline
qvkpipeline_t vk_drawNullModelPipeline
Definition: vk_common.c:146
mleaf_s::cluster
int cluster
Definition: r_model.h:154
vk_mode
cvar_t * vk_mode
Definition: vk_rmain.c:91
vk_activeCmdbuffer
VkCommandBuffer vk_activeCmdbuffer
Definition: vk_common.c:127
refimport_t::Sys_Error
void(* Sys_Error)(int err_level, char *str,...)
Definition: ref.h:194
r_newrefdef
refdef_t r_newrefdef
Definition: vk_rmain.c:74
dmdl_t::num_skins
int num_skins
Definition: qfiles.h:146
r_nocull
cvar_t * r_nocull
Definition: vk_rmain.c:84
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:162
CVAR_ARCHIVE
#define CVAR_ARCHIVE
Definition: q_shared.h:316
viddef_t::height
unsigned height
Definition: vid.h:29
vk_picmip
cvar_t * vk_picmip
Definition: vk_rmain.c:94
R_BeginRegistration
void R_BeginRegistration(char *map)
Definition: r_model.c:1213
refexport_t
Definition: ref.h:133
vk_lmaptexturemode
cvar_t * vk_lmaptexturemode
Definition: vk_rmain.c:117
vkconfig_t::vk_version
uint32_t vk_version
Definition: vk_local.h:306
r_worldmodel
model_t * r_worldmodel
Definition: r_main.c:41
vkconfig_t::vertex_buffer_usage
uint32_t vertex_buffer_usage
Definition: vk_local.h:313
cvar_s::value
float value
Definition: q_shared.h:331
cplane_s::dist
float dist
Definition: q_shared.h:416
R_RenderView
void R_RenderView(refdef_t *fd)
Definition: vk_rmain.c:868
vid_gamma
cvar_t * vid_gamma
Definition: vk_rmain.c:125
error
static int error(vorb *f, enum STBVorbisError e)
Definition: stb_vorbis.c:865
Mat_Identity
void Mat_Identity(float *matrix)
Definition: vk_rmain.c:675
Mod_Init
void Mod_Init(void)
Definition: r_model.c:78
vk_vsync
cvar_t * vk_vsync
Definition: vk_rmain.c:121
r_worldmodel
model_t * r_worldmodel
Definition: vk_rmain.c:28
refdef_t::blend
float blend[4]
Definition: ref.h:108
Draw_Fill
void Draw_Fill(int x, int y, int w, int h, int c)
Definition: r_draw.c:586
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: q_shared.c:681
R_PolyBlend
void R_PolyBlend(void)
Definition: vk_rmain.c:558
R_RegisterSkin
struct image_s * R_RegisterSkin(char *name)
Definition: r_image.c:550
NULL
#define NULL
Definition: q_shared.h:67
refexport_t::DrawGetPicSize
void(* DrawGetPicSize)(int *w, int *h, char *name)
Definition: ref.h:166
refdef_t::time
float time
Definition: ref.h:109
refexport_t::CinematicSetPalette
void(* CinematicSetPalette)(const unsigned char *palette)
Definition: ref.h:180
vk_worldWarpPipeline
qvkpipeline_t vk_worldWarpPipeline
Definition: vk_common.c:159
r_view_matrix
float r_view_matrix[16]
Definition: vk_rmain.c:63
Mat_Perspective
void Mat_Perspective(float *matrix, float *correction_matrix, float fovy, float aspect, float zNear, float zFar)
Definition: vk_rmain.c:756
image_s::pixels
byte * pixels[4]
Definition: r_local.h:78
image_s::width
int width
Definition: r_local.h:75
vid_fullscreen
cvar_t * vid_fullscreen
Definition: vk_rmain.c:124
vk_config
vkconfig_t vk_config
Definition: vk_rmain.c:30
particle_t
Definition: ref.h:89
refexport_t::DrawPic
void(* DrawPic)(int x, int y, char *name)
Definition: ref.h:167
R_SetMode
qboolean R_SetMode(void)
Definition: vk_rmain.c:1091
alpha
GLfloat GLfloat GLfloat alpha
Definition: qgl_win.c:74
R_SetPalette
void R_SetPalette(const unsigned char *palette)
Definition: vk_rmain.c:1297
refdef_t::num_particles
int num_particles
Definition: ref.h:122
refdef_t::height
int height
Definition: ref.h:104
R_EndWorldRenderpass
void R_EndWorldRenderpass(void)
Definition: vk_rmain.c:925
image_s::transparent
qboolean transparent
Definition: r_local.h:76
refexport_t::RegisterModel
struct model_s *(* RegisterModel)(char *name)
Definition: ref.h:158
ERR_DROP
#define ERR_DROP
Definition: qcommon.h:744
dsprite_t::frames
dsprframe_t frames[1]
Definition: qfiles.h:185
it_skin
@ it_skin
Definition: r_local.h:64
vk_drawBeamPipeline
qvkpipeline_t vk_drawBeamPipeline
Definition: vk_common.c:153
dsprframe_t::width
int width
Definition: qfiles.h:176
qvkpipeline_t::layout
VkPipelineLayout layout
Definition: qvk.h:154
particle_t::origin
vec3_t origin
Definition: ref.h:91
name
cvar_t * name
Definition: cl_main.c:79
REF_VERSION
#define REF_VERSION
Definition: r_local.h:36
R_DrawWorld
void R_DrawWorld(void)
Definition: gl_rsurf.c:1197
VK_VERIFY
#define VK_VERIFY(x)
Definition: vk_local.h:59
ERR_FATAL
#define ERR_FATAL
Definition: qcommon.h:743
refexport_t::BeginRegistration
void(* BeginRegistration)(char *map)
Definition: ref.h:157
vright
vec3_t vright
Definition: vk_rmain.c:56
mod_sprite
@ mod_sprite
Definition: r_model.h:169
r_proj_aspect
float r_proj_aspect
Definition: vk_rmain.c:60
VectorAdd
#define VectorAdd(a, b, c)
Definition: q_shared.h:164
vk_round_down
cvar_t * vk_round_down
Definition: vk_rmain.c:96
s
static fixed16_t s
Definition: r_scan.c:30
PLANE_ANYZ
#define PLANE_ANYZ
Definition: qfiles.h:314
y
GLint y
Definition: qgl_win.c:115
re
refexport_t re
Definition: vid_dll.c:32
r_oldviewcluster2
int r_oldviewcluster2
Definition: vk_rmain.c:76
RDF_UNDERWATER
#define RDF_UNDERWATER
Definition: q_shared.h:621
entity_s::frame
int frame
Definition: ref.h:58
vkconfig_t::vertex_buffer_max_usage
uint32_t vertex_buffer_max_usage
Definition: vk_local.h:314
vk_clear
cvar_t * vk_clear
Definition: vk_rmain.c:99
zFar
GLclampd zFar
Definition: qgl_win.c:125
refexport_t::BeginFrame
void(* BeginFrame)(float camera_separation)
Definition: ref.h:181
vkconfig_t::uniform_buffer_size
uint32_t uniform_buffer_size
Definition: vk_local.h:321
VectorCopy
#define VectorCopy(a, b)
Definition: q_shared.h:165
vk_dynamic
cvar_t * vk_dynamic
Definition: vk_rmain.c:112
R_Shutdown
void R_Shutdown(void)
Definition: vk_rmain.c:1195
model_s::skins
image_t * skins[MAX_MD2SKINS]
Definition: r_model.h:234
r_drawentities
cvar_t * r_drawentities
Definition: vk_rmain.c:79
QVk_EndFrame
VkResult QVk_EndFrame(qboolean force)
Definition: vk_common.c:1880
vk_frameStarted
qboolean vk_frameStarted
Definition: vk_common.c:135
refexport_t::EndWorldRenderpass
void(* EndWorldRenderpass)(void)
Definition: ref.h:183
refdef_t::particles
particle_t * particles
Definition: ref.h:123
vkconfig_t::vendor_name
const char * vendor_name
Definition: vk_local.h:307
RP_UI
@ RP_UI
Definition: qvk.h:197
currententity
entity_t * currententity
Definition: vk_rmain.c:36
d_8to24table
unsigned d_8to24table[256]
Definition: r_main.c:27
Vkimp_AppActivate
void Vkimp_AppActivate(qboolean active)
Definition: vk_imp.c:376
R_RenderDlights
void R_RenderDlights(void)
Definition: gl_light.c:77
r_proj_fovx
float r_proj_fovx
Definition: vk_rmain.c:61
model_s::name
char name[MAX_QPATH]
Definition: r_model.h:173
QVk_BindPipeline
void QVk_BindPipeline(qvkpipeline_t *pipeline)
Definition: vk_common.c:2284
refdef_t::num_entities
int num_entities
Definition: ref.h:116
refexport_t::SetSky
void(* SetSky)(char *name, float rotate, vec3_t axis)
Definition: ref.h:161
model_s::numtexinfo
int numtexinfo
Definition: r_model.h:217
suf
char * suf[6]
Definition: r_main.c:1398
Mat_Translate
void Mat_Translate(float *matrix, float x, float y, float z)
Definition: vk_rmain.c:718
up
static vec3_t up
Definition: p_view.c:29
r_viewcluster2
int r_viewcluster2
Definition: vk_rmain.c:76
dsprite_t::numframes
int numframes
Definition: qfiles.h:184
R_DrawBrushModel
void R_DrawBrushModel(entity_t *e)
Definition: gl_rsurf.c:957
vkstate_t::camera_separation
float camera_separation
Definition: vk_local.h:344
r_framecount
int r_framecount
Definition: vk_rmain.c:42
rserr_ok
@ rserr_ok
Definition: r_local.h:105
refimport_t::Vid_MenuInit
void(* Vid_MenuInit)(void)
Definition: ref.h:221
pdest
static byte * pdest
Definition: r_part.c:470
Draw_GetPicSize
void Draw_GetPicSize(int *w, int *h, char *pic)
Definition: r_draw.c:321
dsprframe_t::origin_y
int origin_y
Definition: qfiles.h:177
RF_FULLBRIGHT
#define RF_FULLBRIGHT
Definition: q_shared.h:602
Com_PageInMemory
void Com_PageInMemory(byte *buffer, int size)
Definition: q_shared.c:1161
R_SetupVulkan
void R_SetupVulkan(void)
Definition: vk_rmain.c:807
CVAR_USERINFO
#define CVAR_USERINFO
Definition: q_shared.h:317
vkconfig_t::triangle_fan_index_usage
uint32_t triangle_fan_index_usage
Definition: vk_local.h:322
R_Init
qboolean R_Init(void *hinstance, void *hWnd)
Definition: vk_rmain.c:1149
c_visible_textures
int c_visible_textures
Definition: gl_rsurf.c:41
VectorMA
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
Definition: q_shared.c:719
mod_alias
@ mod_alias
Definition: r_model.h:169
r_viewcluster
int r_viewcluster
Definition: vk_rmain.c:76
R_Register
void R_Register(void)
Definition: vk_rmain.c:1020
refdef_t::fov_x
float fov_x
Definition: ref.h:105
MAX_SKINNAME
#define MAX_SKINNAME
Definition: qfiles.h:93
currentmodel
model_t * currentmodel
Definition: vk_rmain.c:37
refexport_t::Shutdown
void(* Shutdown)(void)
Definition: ref.h:142
vk_lockpvs
cvar_t * vk_lockpvs
Definition: vk_rmain.c:100
refexport_t::DrawStretchPic
void(* DrawStretchPic)(int x, int y, int w, int h, char *name)
Definition: ref.h:168
refdef_t::fov_y
float fov_y
Definition: ref.h:105
particle_t::color
int color
Definition: ref.h:92
vk_device_idx
cvar_t * vk_device_idx
Definition: vk_rmain.c:122
QVk_Init
qboolean QVk_Init(void)
Definition: vk_common.c:1510
dmdl_t::ofs_skins
int ofs_skins
Definition: qfiles.h:153
vk_msaa
cvar_t * vk_msaa
Definition: vk_rmain.c:113
Vk_InitImages
void Vk_InitImages(void)
Definition: vk_image.c:1654
dsprframe_t
Definition: qfiles.h:174
refexport_t::api_version
int api_version
Definition: ref.h:136
vk_lightmap
cvar_t * vk_lightmap
Definition: vk_rmain.c:115
refdef_t::width
int width
Definition: ref.h:104
vk_mip_nearfilter
cvar_t * vk_mip_nearfilter
Definition: vk_rmain.c:119
refexport_t::DrawTileClear
void(* DrawTileClear)(int x, int y, int w, int h, char *name)
Definition: ref.h:170
refexport_t::DrawChar
void(* DrawChar)(int x, int y, int c)
Definition: ref.h:169
R_DrawAlphaSurfaces
void R_DrawAlphaSurfaces(void)
Definition: r_poly.c:1342
Draw_FindPic
image_t * Draw_FindPic(char *name)
Definition: r_draw.c:37
r_particletexture
image_t * r_particletexture
Definition: vk_rmain.c:34
r_oldviewcluster
int r_oldviewcluster
Definition: vk_rmain.c:76
dsprframe_t::origin_x
int origin_x
Definition: qfiles.h:177
R_SetupFrame
void R_SetupFrame(void)
Definition: vk_rmain.c:613
vk_sampleshading
cvar_t * vk_sampleshading
Definition: vk_rmain.c:120
w
GLdouble GLdouble GLdouble w
Definition: qgl_win.c:291
top
GLdouble GLdouble GLdouble top
Definition: qgl_win.c:159
right
GLdouble right
Definition: qgl_win.c:159
registration_sequence
int registration_sequence
Definition: r_model.c:44
refimport_t::Cvar_SetValue
void(* Cvar_SetValue)(char *name, float value)
Definition: ref.h:218
image_s
Definition: r_local.h:71
refdef_t::viewangles
float viewangles[3]
Definition: ref.h:107
particles
cparticle_t particles[MAX_PARTICLES]
Definition: cl_fx.c:887
refdef_t::entities
entity_t * entities
Definition: ref.h:117
refdef_t::x
int x
Definition: ref.h:104
Vkimp_Init
qboolean Vkimp_Init(void *hinstance, void *wndproc)
Definition: vk_imp.c:304
qvkdevice_t::transferFamilyIndex
int transferFamilyIndex
Definition: qvk.h:48
R_InitParticleTexture
void R_InitParticleTexture(void)
Definition: gl_rmisc.c:41
r_viewproj_matrix
float r_viewproj_matrix[16]
Definition: vk_rmain.c:64
Mod_Free
void Mod_Free(model_t *mod)
Definition: r_model.c:1313
R_MarkLeaves
void R_MarkLeaves(void)
Definition: r_main.c:467
Draw_StretchPic
void Draw_StretchPic(int x, int y, int w, int h, char *name)
Definition: r_draw.c:405
refexport_t::Init
qboolean(* Init)(void *hinstance, void *wndproc)
Definition: ref.h:139
vkconfig_t::vertex_buffer_size
uint32_t vertex_buffer_size
Definition: vk_local.h:315
R_RenderFrame
void R_RenderFrame(refdef_t *fd)
Definition: vk_rmain.c:1012
RP_WORLD
@ RP_WORLD
Definition: qvk.h:196
r_lightlevel
cvar_t * r_lightlevel
Definition: vk_rmain.c:88
vk_postprocess
cvar_t * vk_postprocess
Definition: vk_rmain.c:111
rserr_invalid_fullscreen
@ rserr_invalid_fullscreen
Definition: r_local.h:107
entity_s::oldorigin
float oldorigin[3]
Definition: ref.h:63
TRANSPARENT_COLOR
#define TRANSPARENT_COLOR
Definition: asm_i386.h:78
vk_particle_att_c
cvar_t * vk_particle_att_c
Definition: vk_rmain.c:107
vid_ref
cvar_t * vid_ref
Definition: vk_rmain.c:126
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:134
draw_chars
image_t * draw_chars
Definition: r_draw.c:26
NUM_BEAM_SEGS
#define NUM_BEAM_SEGS
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1223
refexport_t::RenderFrame
void(* RenderFrame)(refdef_t *fd)
Definition: ref.h:164
dmdl_t
Definition: qfiles.h:137
entity_s::angles
float angles[3]
Definition: ref.h:52
RotatePointAroundVector
void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
Definition: q_shared.c:32
dmdl_t::num_frames
int num_frames
Definition: qfiles.h:151
Vk_ImageList_f
void Vk_ImageList_f(void)
Definition: vk_image.c:535
vkconfig_t::triangle_fan_index_max_usage
uint32_t triangle_fan_index_max_usage
Definition: vk_local.h:323
vkconfig_t::supported_present_modes
const char * supported_present_modes[256]
Definition: vk_local.h:310
model_s::extradatasize
int extradatasize
Definition: r_model.h:236
Vk_ShutdownImages
void Vk_ShutdownImages(void)
Definition: vk_image.c:1704
vk_point_particles
cvar_t * vk_point_particles
Definition: vk_rmain.c:110
Mat_Mul
void Mat_Mul(float *m1, float *m2, float *res)
Definition: vk_rmain.c:695
it_sky
@ it_sky
Definition: r_local.h:68
R_DrawAliasModel
void R_DrawAliasModel(entity_t *e)
Definition: gl_mesh.c:519
vid
viddef_t vid
Definition: r_main.c:24
MAX_PARTICLES
#define MAX_PARTICLES
Definition: ref.h:27
shadelight
float shadelight[3]
Definition: r_local.h:645