mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-09 23:02:02 +00:00
Remove ref_vk, the Vulkan renderer ported from vkQuake2.
While having a Vulkan renderer in Yamagi Quake II sounded like a good idea, especially for cheap hardware with broken OpenGL drivers, the last weeks showed that the code is not ready for primetime. Some examples for critical problems: * Render glitches when using non-standard assets. Everything with more polygons and texture resultion than baseq2 seems to be broken. * The startup and shutdown code is a mess. While I fixes the most critical bug, there're a lot of cases left. Startup and shutdown mostly works by luck. * At least one memory leak in the model code. And neither @DanielGibson nor myself have deeper knowledge about Vulkan. We don't have the time and the motivation to learn it. While some community members did excellent work on ref_vk (especially @0lvin and @rg3), the community maintenance promised in the initial pull request never really materialized. Therefor we risk ending up with a renderer that we can't and won't maintain by ourself. Vulkan is not gone. The code will be recommitted in a separate repository at: https://github.com/yquake2/ref_vk We're willing to give community members commit access to that repository. Send a substantial pull request and ask for it.
This commit is contained in:
parent
76d61d9d8f
commit
8f6a085434
72 changed files with 0 additions and 19937 deletions
|
@ -1,331 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __VK_LOCAL_H__
|
||||
#define __VK_LOCAL_H__
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_vulkan.h>
|
||||
|
||||
|
||||
#include "../../ref_shared.h"
|
||||
#include "../volk/volk.h"
|
||||
#include "qvk.h"
|
||||
|
||||
// verify if VkResult is VK_SUCCESS
|
||||
#define VK_VERIFY(x) { \
|
||||
VkResult res = (x); \
|
||||
if(res != VK_SUCCESS) { \
|
||||
R_Printf(PRINT_ALL, "%s:%d: VkResult verification failed: %s\n", \
|
||||
__func__, __LINE__, QVk_GetError(res)); \
|
||||
} \
|
||||
}
|
||||
|
||||
// up / down
|
||||
#define PITCH 0
|
||||
|
||||
// left / right
|
||||
#define YAW 1
|
||||
|
||||
// fall over
|
||||
#define ROLL 2
|
||||
|
||||
extern viddef_t vid;
|
||||
|
||||
typedef struct image_s
|
||||
{
|
||||
char name[MAX_QPATH]; // game path, including extension
|
||||
imagetype_t type;
|
||||
int width, height; // source image
|
||||
int upload_width, upload_height; // after power of two and picmip
|
||||
int registration_sequence; // 0 = free
|
||||
struct msurface_s *texturechain; // for sort-by-texture world drawing
|
||||
qvktexture_t vk_texture; // Vulkan texture handle
|
||||
} image_t;
|
||||
|
||||
#define MAX_VKTEXTURES 1024
|
||||
|
||||
//===================================================================
|
||||
|
||||
typedef enum
|
||||
{
|
||||
rserr_ok,
|
||||
|
||||
rserr_invalid_fullscreen,
|
||||
rserr_invalid_mode,
|
||||
|
||||
rserr_unknown
|
||||
} rserr_t;
|
||||
|
||||
#include "model.h"
|
||||
|
||||
#define MAX_LBM_HEIGHT 480
|
||||
|
||||
#define BACKFACE_EPSILON 0.01
|
||||
|
||||
|
||||
//====================================================
|
||||
|
||||
extern image_t vktextures[MAX_VKTEXTURES];
|
||||
extern int numvktextures;
|
||||
|
||||
extern image_t *r_notexture;
|
||||
extern image_t *r_particletexture;
|
||||
extern image_t *r_squaretexture;
|
||||
extern int r_visframecount;
|
||||
extern int r_framecount;
|
||||
extern cplane_t frustum[4];
|
||||
extern int c_brush_polys, c_alias_polys;
|
||||
|
||||
//
|
||||
// view origin
|
||||
//
|
||||
extern vec3_t vup;
|
||||
extern vec3_t vpn;
|
||||
extern vec3_t vright;
|
||||
extern vec3_t r_origin;
|
||||
|
||||
//
|
||||
// screen size info
|
||||
//
|
||||
extern refdef_t r_newrefdef;
|
||||
extern int r_viewcluster, r_viewcluster2, r_oldviewcluster, r_oldviewcluster2;
|
||||
|
||||
extern cvar_t *r_lefthand;
|
||||
extern cvar_t *r_drawworld;
|
||||
extern cvar_t *r_novis;
|
||||
extern cvar_t *r_lerpmodels;
|
||||
extern cvar_t *r_lockpvs;
|
||||
extern cvar_t *r_modulate;
|
||||
extern cvar_t *r_vsync;
|
||||
extern cvar_t *r_clear;
|
||||
extern cvar_t *r_lightlevel; // FIXME: This is a HACK to get the client's light level
|
||||
extern cvar_t *r_gunfov;
|
||||
extern cvar_t *r_farsee;
|
||||
|
||||
extern cvar_t *vk_overbrightbits;
|
||||
extern cvar_t *vk_validation;
|
||||
extern cvar_t *vk_picmip;
|
||||
extern cvar_t *vk_skymip;
|
||||
extern cvar_t *vk_flashblend;
|
||||
extern cvar_t *vk_finish;
|
||||
extern cvar_t *vk_shadows;
|
||||
extern cvar_t *vk_dynamic;
|
||||
extern cvar_t *vk_msaa;
|
||||
extern cvar_t *vk_showtris;
|
||||
extern cvar_t *vk_lightmap;
|
||||
extern cvar_t *vk_texturemode;
|
||||
extern cvar_t *vk_lmaptexturemode;
|
||||
extern cvar_t *vk_aniso;
|
||||
extern cvar_t *vk_sampleshading;
|
||||
extern cvar_t *vk_device_idx;
|
||||
extern cvar_t *vk_retexturing;
|
||||
extern cvar_t *vk_nolerp_list;
|
||||
extern cvar_t *vk_pixel_size;
|
||||
extern cvar_t *r_fixsurfsky;
|
||||
|
||||
extern cvar_t *vid_fullscreen;
|
||||
extern cvar_t *vid_gamma;
|
||||
|
||||
extern int c_visible_lightmaps;
|
||||
extern int c_visible_textures;
|
||||
|
||||
extern float r_viewproj_matrix[16];
|
||||
|
||||
void R_LightPoint (vec3_t p, vec3_t color, entity_t *currententity);
|
||||
void R_PushDlights (void);
|
||||
|
||||
//====================================================================
|
||||
|
||||
extern model_t *r_worldmodel;
|
||||
|
||||
extern unsigned d_8to24table[256];
|
||||
|
||||
extern int registration_sequence;
|
||||
extern qvksampler_t vk_current_sampler;
|
||||
extern qvksampler_t vk_current_lmap_sampler;
|
||||
|
||||
void RE_Shutdown( void );
|
||||
|
||||
void Vk_ScreenShot_f (void);
|
||||
void R_DrawAliasModel (entity_t *currententity, model_t *currentmodel);
|
||||
void R_DrawBrushModel (entity_t *currententity, model_t *currentmodel);
|
||||
void R_DrawSpriteModel (entity_t *currententity, model_t *currentmodel);
|
||||
void R_DrawBeam (entity_t *currententity);
|
||||
void R_DrawWorld (void);
|
||||
void R_RenderDlights (void);
|
||||
void R_DrawAlphaSurfaces (void);
|
||||
void RE_InitParticleTexture (void);
|
||||
void Draw_InitLocal (void);
|
||||
void Vk_SubdivideSurface (msurface_t *fa, model_t *loadmodel);
|
||||
qboolean R_CullBox (vec3_t mins, vec3_t maxs);
|
||||
void R_RotateForEntity (entity_t *e, float *mvMatrix);
|
||||
void R_MarkLeaves (void);
|
||||
|
||||
void EmitWaterPolys (msurface_t *fa, image_t *texture,
|
||||
float *modelMatrix, float *color,
|
||||
qboolean solid_surface);
|
||||
void R_AddSkySurface (msurface_t *fa);
|
||||
void R_ClearSkyBox (void);
|
||||
void R_DrawSkyBox (void);
|
||||
void R_MarkLights (dlight_t *light, int bit, mnode_t *node);
|
||||
|
||||
struct image_s *RE_Draw_FindPic (char *name);
|
||||
|
||||
void RE_Draw_GetPicSize (int *w, int *h, char *name);
|
||||
void RE_Draw_PicScaled (int x, int y, char *name, float scale);
|
||||
void RE_Draw_StretchPic (int x, int y, int w, int h, char *name);
|
||||
void RE_Draw_CharScaled (int x, int y, int num, float scale);
|
||||
void RE_Draw_TileClear (int x, int y, int w, int h, char *name);
|
||||
void RE_Draw_Fill (int x, int y, int w, int h, int c);
|
||||
void RE_Draw_FadeScreen (void);
|
||||
void RE_Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data);
|
||||
|
||||
qboolean RE_EndWorldRenderpass( void );
|
||||
|
||||
struct image_s *RE_RegisterSkin (char *name);
|
||||
|
||||
void LoadPCX (char *filename, byte **pic, byte **palette, int *width, int *height);
|
||||
image_t *Vk_LoadPic(char *name, byte *pic, int width, int realwidth,
|
||||
int height, int realheight, imagetype_t type,
|
||||
int bits);
|
||||
image_t *Vk_FindImage (char *name, imagetype_t type);
|
||||
void Vk_TextureMode( char *string );
|
||||
void Vk_LmapTextureMode( char *string );
|
||||
void Vk_ImageList_f (void);
|
||||
|
||||
void Vk_BuildPolygonFromSurface(msurface_t *fa, model_t *currentmodel);
|
||||
void Vk_CreateSurfaceLightmap (msurface_t *surf);
|
||||
void Vk_EndBuildingLightmaps (void);
|
||||
void Vk_BeginBuildingLightmaps (model_t *m);
|
||||
|
||||
void Vk_InitImages (void);
|
||||
void Vk_ShutdownImages (void);
|
||||
void Vk_FreeUnusedImages (void);
|
||||
qboolean Vk_ImageHasFreeSpace(void);
|
||||
|
||||
void RE_BeginRegistration (char *model);
|
||||
struct model_s *RE_RegisterModel (char *name);
|
||||
struct image_s *RE_RegisterSkin (char *name);
|
||||
void RE_SetSky (char *name, float rotate, vec3_t axis);
|
||||
void RE_EndRegistration (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);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t vk_version;
|
||||
const char *vendor_name;
|
||||
const char *device_type;
|
||||
const char *present_mode;
|
||||
const char *supported_present_modes[256];
|
||||
const char *extensions[256];
|
||||
const char *layers[256];
|
||||
uint32_t vertex_buffer_usage;
|
||||
uint32_t vertex_buffer_max_usage;
|
||||
uint32_t vertex_buffer_size;
|
||||
uint32_t index_buffer_usage;
|
||||
uint32_t index_buffer_max_usage;
|
||||
uint32_t index_buffer_size;
|
||||
uint32_t uniform_buffer_usage;
|
||||
uint32_t uniform_buffer_max_usage;
|
||||
uint32_t uniform_buffer_size;
|
||||
uint32_t triangle_index_usage;
|
||||
uint32_t triangle_index_max_usage;
|
||||
uint32_t triangle_index_count;
|
||||
} vkconfig_t;
|
||||
|
||||
#define MAX_LIGHTMAPS 128
|
||||
#define DYNLIGHTMAP_OFFSET MAX_LIGHTMAPS
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float inverse_intensity;
|
||||
qboolean fullscreen;
|
||||
|
||||
int prev_mode;
|
||||
|
||||
unsigned char *d_16to8table;
|
||||
|
||||
qvktexture_t lightmap_textures[MAX_LIGHTMAPS*2];
|
||||
|
||||
int currenttextures[2];
|
||||
int currenttmu;
|
||||
|
||||
float camera_separation;
|
||||
qboolean stereo_enabled;
|
||||
|
||||
VkPipeline current_pipeline;
|
||||
qvkrenderpasstype_t current_renderpass;
|
||||
} vkstate_t;
|
||||
|
||||
extern vkconfig_t vk_config;
|
||||
extern vkstate_t vk_state;
|
||||
|
||||
/*
|
||||
====================================================================
|
||||
|
||||
IMPORTED FUNCTIONS
|
||||
|
||||
====================================================================
|
||||
*/
|
||||
|
||||
extern refimport_t ri;
|
||||
|
||||
|
||||
/*
|
||||
====================================================================
|
||||
|
||||
IMPLEMENTATION SPECIFIC FUNCTIONS
|
||||
|
||||
====================================================================
|
||||
*/
|
||||
|
||||
qboolean Vkimp_CreateSurface(SDL_Window *window);
|
||||
|
||||
// buffers reallocate
|
||||
typedef struct {
|
||||
float vertex[3];
|
||||
float texCoord[2];
|
||||
} polyvert_t;
|
||||
|
||||
typedef struct {
|
||||
float vertex[3];
|
||||
float texCoord[2];
|
||||
float texCoordLmap[2];
|
||||
} lmappolyvert_t;
|
||||
|
||||
extern polyvert_t *verts_buffer;
|
||||
extern lmappolyvert_t *lmappolyverts_buffer;
|
||||
|
||||
void Mesh_Init (void);
|
||||
void Mesh_Free (void);
|
||||
int Mesh_VertsRealloc(int count);
|
||||
|
||||
#endif
|
|
@ -1,254 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __VK_MODEL_H__
|
||||
#define __VK_MODEL_H__
|
||||
|
||||
/*
|
||||
|
||||
d*_t structures are on-disk representations
|
||||
m*_t structures are in-memory
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
BRUSH MODELS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// in memory representation
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
vec3_t position;
|
||||
} mvertex_t;
|
||||
|
||||
|
||||
#define SIDE_FRONT 0
|
||||
#define SIDE_BACK 1
|
||||
#define SIDE_ON 2
|
||||
|
||||
|
||||
#define SURF_PLANEBACK 2
|
||||
#define SURF_DRAWSKY 4
|
||||
#define SURF_DRAWTURB 0x10
|
||||
#define SURF_DRAWBACKGROUND 0x40
|
||||
#define SURF_UNDERWATER 0x80
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2];
|
||||
unsigned int cachededgeoffset;
|
||||
} medge_t;
|
||||
|
||||
typedef struct mtexinfo_s
|
||||
{
|
||||
float vecs[2][4];
|
||||
int flags;
|
||||
int numframes;
|
||||
struct mtexinfo_s *next; // animation chain
|
||||
image_t *image;
|
||||
} mtexinfo_t;
|
||||
|
||||
#define VERTEXSIZE 7
|
||||
|
||||
typedef struct vkpoly_s
|
||||
{
|
||||
struct vkpoly_s *next;
|
||||
struct vkpoly_s *chain;
|
||||
int numverts;
|
||||
int flags; // for SURF_UNDERWATER (not needed anymore?)
|
||||
float verts[4][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2)
|
||||
} vkpoly_t;
|
||||
|
||||
typedef struct msurface_s
|
||||
{
|
||||
int visframe; // should be drawn when node is crossed
|
||||
|
||||
cplane_t *plane;
|
||||
int flags;
|
||||
|
||||
int firstedge; // look up in model->surfedges[], negative numbers
|
||||
int numedges; // are backwards edges
|
||||
|
||||
short texturemins[2];
|
||||
short extents[2];
|
||||
|
||||
int light_s, light_t; // gl lightmap coordinates
|
||||
int dlight_s, dlight_t; // gl lightmap coordinates for dynamic lightmaps
|
||||
|
||||
vkpoly_t *polys; // multiple if warped
|
||||
struct msurface_s *texturechain;
|
||||
struct msurface_s *lightmapchain;
|
||||
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
// lighting info
|
||||
int dlightframe;
|
||||
int dlightbits;
|
||||
|
||||
int lightmaptexturenum;
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
float cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
|
||||
byte *samples; // [numstyles*surfsize]
|
||||
} msurface_t;
|
||||
|
||||
typedef struct mnode_s
|
||||
{
|
||||
// common with leaf
|
||||
int contents; // -1, to differentiate from leafs
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
float minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// node specific
|
||||
cplane_t *plane;
|
||||
struct mnode_s *children[2];
|
||||
|
||||
unsigned short firstsurface;
|
||||
unsigned short numsurfaces;
|
||||
} mnode_t;
|
||||
|
||||
|
||||
|
||||
typedef struct mleaf_s
|
||||
{
|
||||
// common with node
|
||||
int contents; // wil be a negative contents number
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
float minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// leaf specific
|
||||
int cluster;
|
||||
int area;
|
||||
|
||||
msurface_t **firstmarksurface;
|
||||
int nummarksurfaces;
|
||||
} mleaf_t;
|
||||
|
||||
|
||||
//===================================================================
|
||||
|
||||
//
|
||||
// Whole model
|
||||
//
|
||||
|
||||
typedef struct model_s
|
||||
{
|
||||
char name[MAX_QPATH];
|
||||
|
||||
int registration_sequence;
|
||||
|
||||
modtype_t type;
|
||||
int numframes;
|
||||
|
||||
int flags;
|
||||
|
||||
//
|
||||
// volume occupied by the model graphics
|
||||
//
|
||||
vec3_t mins, maxs;
|
||||
float radius;
|
||||
|
||||
//
|
||||
// solid volume for clipping
|
||||
//
|
||||
qboolean clipbox;
|
||||
vec3_t clipmins, clipmaxs;
|
||||
|
||||
//
|
||||
// brush model
|
||||
//
|
||||
int firstmodelsurface, nummodelsurfaces;
|
||||
int lightmap; // only for submodels
|
||||
|
||||
int numsubmodels;
|
||||
struct model_s *submodels;
|
||||
|
||||
int numplanes;
|
||||
cplane_t *planes;
|
||||
|
||||
int numleafs; // number of visible leafs, not counting 0
|
||||
mleaf_t *leafs;
|
||||
|
||||
int numvertexes;
|
||||
mvertex_t *vertexes;
|
||||
|
||||
int numedges;
|
||||
medge_t *edges;
|
||||
|
||||
int numnodes;
|
||||
int firstnode;
|
||||
mnode_t *nodes;
|
||||
|
||||
int numtexinfo;
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
int numsurfaces;
|
||||
msurface_t *surfaces;
|
||||
|
||||
int numsurfedges;
|
||||
int *surfedges;
|
||||
|
||||
int nummarksurfaces;
|
||||
msurface_t **marksurfaces;
|
||||
|
||||
dvis_t *vis;
|
||||
|
||||
byte *lightdata;
|
||||
|
||||
// for alias models and skins
|
||||
image_t *skins[MAX_MD2SKINS];
|
||||
|
||||
int extradatasize;
|
||||
void *extradata;
|
||||
|
||||
// submodules
|
||||
vec3_t origin; // for sounds or lights
|
||||
} model_t;
|
||||
|
||||
//============================================================================
|
||||
|
||||
void Mod_Init (void);
|
||||
mleaf_t *Mod_PointInLeaf (float *p, model_t *model);
|
||||
byte *Mod_ClusterPVS (int cluster, model_t *model);
|
||||
|
||||
void Mod_Modellist_f (void);
|
||||
|
||||
void *Hunk_Begin (int maxsize);
|
||||
void *Hunk_Alloc (int size);
|
||||
int Hunk_End (void);
|
||||
void Hunk_Free (void *base);
|
||||
|
||||
void Mod_FreeAll (void);
|
||||
void Mod_FreeModelsKnown (void);
|
||||
|
||||
#endif
|
|
@ -1,326 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
/*
|
||||
** QVK.H
|
||||
*/
|
||||
|
||||
#ifndef __QVK_H__
|
||||
#define __QVK_H__
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "local.h"
|
||||
#include "util.h"
|
||||
#include "shaders.h"
|
||||
|
||||
// Vulkan device
|
||||
typedef struct
|
||||
{
|
||||
VkPhysicalDevice physical;
|
||||
VkDevice logical;
|
||||
VkPhysicalDeviceMemoryProperties mem_properties;
|
||||
VkPhysicalDeviceProperties properties;
|
||||
VkPhysicalDeviceFeatures features;
|
||||
VkQueue gfxQueue;
|
||||
VkQueue presentQueue;
|
||||
VkQueue transferQueue;
|
||||
int gfxFamilyIndex;
|
||||
int presentFamilyIndex;
|
||||
int transferFamilyIndex;
|
||||
qboolean screenshotSupported;
|
||||
} qvkdevice_t;
|
||||
|
||||
// Vulkan swapchain
|
||||
typedef struct
|
||||
{
|
||||
VkSwapchainKHR sc;
|
||||
VkFormat format;
|
||||
VkPresentModeKHR presentMode;
|
||||
VkExtent2D extent;
|
||||
VkImage *images;
|
||||
int imageCount;
|
||||
} qvkswapchain_t;
|
||||
|
||||
// available sampler types
|
||||
typedef enum
|
||||
{
|
||||
S_NEAREST = 0,
|
||||
S_LINEAR = 1,
|
||||
S_MIPMAP_NEAREST = 2,
|
||||
S_MIPMAP_LINEAR = 3,
|
||||
S_NEAREST_UNNORMALIZED = 4,
|
||||
S_SAMPLER_CNT = 5
|
||||
} qvksampler_t;
|
||||
|
||||
#define NUM_SAMPLERS (S_SAMPLER_CNT * 2)
|
||||
|
||||
// texture object
|
||||
typedef struct
|
||||
{
|
||||
ImageResource_t resource;
|
||||
|
||||
VkImageView imageView;
|
||||
VkSharingMode sharingMode;
|
||||
VkSampleCountFlagBits sampleCount;
|
||||
VkFormat format;
|
||||
VkDescriptorSet descriptorSet;
|
||||
uint32_t mipLevels;
|
||||
qboolean clampToEdge;
|
||||
} qvktexture_t;
|
||||
|
||||
#define QVVKTEXTURE_INIT { \
|
||||
.resource = { \
|
||||
.image = VK_NULL_HANDLE, \
|
||||
.memory = VK_NULL_HANDLE, \
|
||||
.size = 0, \
|
||||
}, \
|
||||
.imageView = VK_NULL_HANDLE, \
|
||||
.sharingMode = VK_SHARING_MODE_MAX_ENUM, \
|
||||
.sampleCount = VK_SAMPLE_COUNT_1_BIT, \
|
||||
.format = VK_FORMAT_R8G8B8A8_UNORM, \
|
||||
.descriptorSet = VK_NULL_HANDLE, \
|
||||
.mipLevels = 1, \
|
||||
}
|
||||
|
||||
#define QVVKTEXTURE_CLEAR(i) { \
|
||||
(i).resource.image = VK_NULL_HANDLE; \
|
||||
(i).resource.memory = VK_NULL_HANDLE; \
|
||||
(i).resource.size = 0; \
|
||||
(i).imageView = VK_NULL_HANDLE; \
|
||||
(i).sharingMode = VK_SHARING_MODE_MAX_ENUM; \
|
||||
(i).sampleCount = VK_SAMPLE_COUNT_1_BIT; \
|
||||
(i).format = VK_FORMAT_R8G8B8A8_UNORM; \
|
||||
(i).mipLevels = 1; \
|
||||
}
|
||||
|
||||
// Vulkan renderpass
|
||||
typedef struct
|
||||
{
|
||||
VkRenderPass rp;
|
||||
VkAttachmentLoadOp colorLoadOp;
|
||||
VkSampleCountFlagBits sampleCount;
|
||||
} qvkrenderpass_t;
|
||||
|
||||
// Vulkan buffer
|
||||
typedef struct
|
||||
{
|
||||
VkDeviceSize currentOffset;
|
||||
|
||||
BufferResource_t resource;
|
||||
void *pMappedData;
|
||||
} qvkbuffer_t;
|
||||
|
||||
// Vulkan staging buffer
|
||||
typedef struct
|
||||
{
|
||||
VkDeviceSize currentOffset;
|
||||
VkCommandBuffer cmdBuffer;
|
||||
VkFence fence;
|
||||
qboolean submitted;
|
||||
|
||||
BufferResource_t resource;
|
||||
void *pMappedData;
|
||||
} qvkstagingbuffer_t;
|
||||
|
||||
// Vulkan buffer options
|
||||
typedef struct
|
||||
{
|
||||
VkBufferUsageFlags usage;
|
||||
VkMemoryPropertyFlags reqMemFlags;
|
||||
VkMemoryPropertyFlags prefMemFlags;
|
||||
} qvkbufferopts_t;
|
||||
|
||||
// Vulkan pipeline
|
||||
typedef struct
|
||||
{
|
||||
VkPipelineLayout layout;
|
||||
VkPipeline pl;
|
||||
VkPipelineCreateFlags flags;
|
||||
VkCullModeFlags cullMode;
|
||||
VkPrimitiveTopology topology;
|
||||
VkPipelineColorBlendAttachmentState blendOpts;
|
||||
VkBool32 depthTestEnable;
|
||||
VkBool32 depthWriteEnable;
|
||||
} qvkpipeline_t;
|
||||
|
||||
// Vulkan shader
|
||||
typedef struct
|
||||
{
|
||||
VkPipelineShaderStageCreateInfo createInfo;
|
||||
VkShaderModule module;
|
||||
} qvkshader_t;
|
||||
|
||||
#define QVKPIPELINE_INIT { \
|
||||
.layout = VK_NULL_HANDLE, \
|
||||
.pl = VK_NULL_HANDLE, \
|
||||
.flags = 0, \
|
||||
.cullMode = VK_CULL_MODE_BACK_BIT, \
|
||||
.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, \
|
||||
.blendOpts = { \
|
||||
.blendEnable = VK_FALSE, \
|
||||
.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA, \
|
||||
.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, \
|
||||
.colorBlendOp = VK_BLEND_OP_ADD, \
|
||||
.srcAlphaBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA, \
|
||||
.dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, \
|
||||
.alphaBlendOp = VK_BLEND_OP_ADD, \
|
||||
.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT \
|
||||
}, \
|
||||
.depthTestEnable = VK_TRUE, \
|
||||
.depthWriteEnable = VK_TRUE \
|
||||
}
|
||||
|
||||
// renderpass type
|
||||
typedef enum
|
||||
{
|
||||
RP_WORLD = 0, // renders game world to offscreen buffer
|
||||
RP_UI = 1, // render UI elements and game console
|
||||
RP_WORLD_WARP = 2, // perform postprocessing on RP_WORLD (underwater screen warp)
|
||||
RP_COUNT = 3
|
||||
} qvkrenderpasstype_t;
|
||||
|
||||
// Vulkan constants: command and dynamic buffer count
|
||||
#define NUM_CMDBUFFERS 2
|
||||
#define NUM_DYNBUFFERS 2
|
||||
|
||||
// Vulkan instance
|
||||
extern VkInstance vk_instance;
|
||||
// Vulkan surface
|
||||
extern VkSurfaceKHR vk_surface;
|
||||
// Vulkan device
|
||||
extern qvkdevice_t vk_device;
|
||||
// Vulkan swapchain
|
||||
extern qvkswapchain_t vk_swapchain;
|
||||
// Vulkan command buffer currently in use
|
||||
extern VkCommandBuffer vk_activeCmdbuffer;
|
||||
// Vulkan command pools
|
||||
extern VkCommandPool vk_commandPool[NUM_CMDBUFFERS];
|
||||
extern VkCommandPool vk_transferCommandPool;
|
||||
// Vulkan descriptor pool
|
||||
extern VkDescriptorPool vk_descriptorPool;
|
||||
// viewport/scissor
|
||||
extern VkViewport vk_viewport;
|
||||
extern VkRect2D vk_scissor;
|
||||
|
||||
// Vulkan descriptor sets
|
||||
extern VkDescriptorSetLayout vk_samplerDescSetLayout;
|
||||
|
||||
// *** pipelines ***
|
||||
extern qvkpipeline_t vk_drawTexQuadPipeline[RP_COUNT];
|
||||
extern qvkpipeline_t vk_drawColorQuadPipeline[RP_COUNT];
|
||||
extern qvkpipeline_t vk_drawModelPipelineFan[RP_COUNT];
|
||||
extern qvkpipeline_t vk_drawNoDepthModelPipelineFan;
|
||||
extern qvkpipeline_t vk_drawLefthandModelPipelineFan;
|
||||
extern qvkpipeline_t vk_drawNullModelPipeline;
|
||||
extern qvkpipeline_t vk_drawParticlesPipeline;
|
||||
extern qvkpipeline_t vk_drawPointParticlesPipeline;
|
||||
extern qvkpipeline_t vk_drawSpritePipeline;
|
||||
extern qvkpipeline_t vk_drawPolyPipeline;
|
||||
extern qvkpipeline_t vk_drawPolyLmapPipeline;
|
||||
extern qvkpipeline_t vk_drawPolyWarpPipeline;
|
||||
extern qvkpipeline_t vk_drawPolySolidWarpPipeline;
|
||||
extern qvkpipeline_t vk_drawBeamPipeline;
|
||||
extern qvkpipeline_t vk_drawSkyboxPipeline;
|
||||
extern qvkpipeline_t vk_drawDLightPipeline;
|
||||
extern qvkpipeline_t vk_showTrisPipeline;
|
||||
extern qvkpipeline_t vk_shadowsPipelineFan;
|
||||
extern qvkpipeline_t vk_worldWarpPipeline;
|
||||
extern qvkpipeline_t vk_postprocessPipeline;
|
||||
|
||||
// color buffer containing main game/world view
|
||||
extern qvktexture_t vk_colorbuffer;
|
||||
// color buffer with postprocessed game view
|
||||
extern qvktexture_t vk_colorbufferWarp;
|
||||
// indicator if the frame is currently being rendered
|
||||
extern qboolean vk_frameStarted;
|
||||
// Indicates if the renderer needs to be restarted.
|
||||
extern qboolean vk_restartNeeded;
|
||||
// is QVk initialized?
|
||||
extern qboolean vk_initialized;
|
||||
|
||||
// function pointers
|
||||
extern PFN_vkCreateDebugUtilsMessengerEXT qvkCreateDebugUtilsMessengerEXT;
|
||||
extern PFN_vkDestroyDebugUtilsMessengerEXT qvkDestroyDebugUtilsMessengerEXT;
|
||||
extern PFN_vkSetDebugUtilsObjectNameEXT qvkSetDebugUtilsObjectNameEXT;
|
||||
extern PFN_vkSetDebugUtilsObjectTagEXT qvkSetDebugUtilsObjectTagEXT;
|
||||
extern PFN_vkCmdBeginDebugUtilsLabelEXT qvkCmdBeginDebugUtilsLabelEXT;
|
||||
extern PFN_vkCmdEndDebugUtilsLabelEXT qvkCmdEndDebugUtilsLabelEXT;
|
||||
extern PFN_vkCmdInsertDebugUtilsLabelEXT qvkInsertDebugUtilsLabelEXT;
|
||||
|
||||
// The Interface Functions (tm)
|
||||
void QVk_SetWindow(SDL_Window*);
|
||||
qboolean QVk_Init(void);
|
||||
void QVk_PostInit(void);
|
||||
void QVk_WaitAndShutdownAll(void);
|
||||
void QVk_Shutdown(void);
|
||||
void QVk_Restart(void);
|
||||
void QVk_CreateValidationLayers(void);
|
||||
void QVk_DestroyValidationLayers(void);
|
||||
qboolean QVk_CreateDevice(int preferredDeviceIdx);
|
||||
VkResult QVk_CreateSwapchain(void);
|
||||
VkFormat QVk_FindDepthFormat(void);
|
||||
VkResult QVk_CreateCommandPool(VkCommandPool *commandPool, uint32_t queueFamilyIndex);
|
||||
VkResult QVk_CreateImageView(const VkImage *image, VkImageAspectFlags aspectFlags, VkImageView *imageView, VkFormat format, uint32_t mipLevels);
|
||||
VkResult QVk_CreateImage(uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, qvktexture_t *texture);
|
||||
void QVk_CreateDepthBuffer(VkSampleCountFlagBits sampleCount, qvktexture_t *depthBuffer);
|
||||
void QVk_CreateColorBuffer(VkSampleCountFlagBits sampleCount, qvktexture_t *colorBuffer, int extraFlags);
|
||||
void QVk_CreateTexture(qvktexture_t *texture, const unsigned char *data, uint32_t width, uint32_t height, qvksampler_t samplerType, qboolean clampToEdge);
|
||||
void QVk_UpdateTextureData(qvktexture_t *texture, const unsigned char *data, uint32_t offset_x, uint32_t offset_y, uint32_t width, uint32_t height);
|
||||
VkSampler QVk_UpdateTextureSampler(qvktexture_t *texture, qvksampler_t samplerType, qboolean clampToEdge);
|
||||
void QVk_ReadPixels(uint8_t *dstBuffer, const VkOffset2D *offset, const VkExtent2D *extent);
|
||||
VkResult QVk_BeginCommand(const VkCommandBuffer *commandBuffer);
|
||||
void QVk_SubmitCommand(const VkCommandBuffer *commandBuffer, const VkQueue *queue);
|
||||
VkCommandBuffer QVk_CreateCommandBuffer(const VkCommandPool *commandPool, VkCommandBufferLevel level);
|
||||
const char* QVk_GetError(VkResult errorCode);
|
||||
VkResult QVk_BeginFrame(const VkViewport* viewport, const VkRect2D* scissor);
|
||||
VkResult QVk_EndFrame(qboolean force);
|
||||
void QVk_BeginRenderpass(qvkrenderpasstype_t rpType);
|
||||
void QVk_FreeStagingBuffer(qvkstagingbuffer_t *buffer);
|
||||
VkResult QVk_CreateBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer, const qvkbufferopts_t options);
|
||||
void QVk_FreeBuffer(qvkbuffer_t *buffer);
|
||||
VkResult QVk_CreateStagingBuffer(VkDeviceSize size, qvkstagingbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
||||
VkResult QVk_CreateUniformBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
||||
void QVk_CreateVertexBuffer(const void *data, VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
||||
void QVk_CreateIndexBuffer(const void *data, VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
||||
qvkshader_t QVk_CreateShader(const uint32_t *shaderSrc, size_t shaderCodeSize, VkShaderStageFlagBits shaderStage);
|
||||
void QVk_CreatePipeline(const VkDescriptorSetLayout *descriptorLayout, const uint32_t descLayoutCount, const VkPipelineVertexInputStateCreateInfo *vertexInputInfo, qvkpipeline_t *pipeline, const qvkrenderpass_t *renderpass, const qvkshader_t *shaders, uint32_t shaderCount);
|
||||
void QVk_DestroyPipeline(qvkpipeline_t *pipeline);
|
||||
uint8_t* QVk_GetVertexBuffer(VkDeviceSize size, VkBuffer *dstBuffer, VkDeviceSize *dstOffset);
|
||||
uint8_t* QVk_GetUniformBuffer(VkDeviceSize size, uint32_t *dstOffset, VkDescriptorSet *dstUboDescriptorSet);
|
||||
uint8_t* QVk_GetStagingBuffer(VkDeviceSize size, int alignment, VkCommandBuffer *cmdBuffer, VkBuffer *buffer, uint32_t *dstOffset);
|
||||
VkBuffer QVk_GetTriangleFanIbo(VkDeviceSize indexCount);
|
||||
VkBuffer QVk_GetTriangleStripIbo(VkDeviceSize indexCount);
|
||||
void QVk_DrawColorRect(float *ubo, VkDeviceSize uboSize, qvkrenderpasstype_t rpType);
|
||||
void QVk_DrawTexRect(const float *ubo, VkDeviceSize uboSize, qvktexture_t *texture);
|
||||
void QVk_BindPipeline(qvkpipeline_t *pipeline);
|
||||
void QVk_SubmitStagingBuffers(void);
|
||||
void Qvk_MemoryBarrier(VkCommandBuffer cmdBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask);
|
||||
qboolean QVk_CheckExtent(void);
|
||||
|
||||
// debug label related functions
|
||||
void QVk_DebugSetObjectName(uint64_t obj, VkObjectType objType, const char *objName);
|
||||
void QVk_DebugSetObjectTag(uint64_t obj, VkObjectType objType, uint64_t tagName, size_t tagSize, const void *tagData);
|
||||
void QVk_DebugLabelBegin(const VkCommandBuffer *cmdBuffer, const char *labelName, const float r, const float g, const float b);
|
||||
void QVk_DebugLabelEnd(const VkCommandBuffer *cmdBuffer);
|
||||
void QVk_DebugLabelInsert(const VkCommandBuffer *cmdBuffer, const char *labelName, const float r, const float g, const float b);
|
||||
#endif
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
//
|
||||
// game shaders, compiled offline
|
||||
//
|
||||
|
||||
#ifndef __VK_SHADERS_H__
|
||||
#define __VK_SHADERS_H__
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
// textured quad (alpha)
|
||||
extern const uint32_t basic_vert_spv[];
|
||||
extern const size_t basic_vert_size;
|
||||
|
||||
extern const uint32_t basic_frag_spv[];
|
||||
extern const size_t basic_frag_size;
|
||||
|
||||
// colored quad (alpha)
|
||||
extern const uint32_t basic_color_quad_vert_spv[];
|
||||
extern const size_t basic_color_quad_vert_size;
|
||||
|
||||
extern const uint32_t basic_color_quad_frag_spv[];
|
||||
extern const size_t basic_color_quad_frag_size;
|
||||
|
||||
// textured model
|
||||
extern const uint32_t model_vert_spv[];
|
||||
extern const size_t model_vert_size;
|
||||
|
||||
extern const uint32_t model_frag_spv[];
|
||||
extern const size_t model_frag_size;
|
||||
|
||||
// null model
|
||||
extern const uint32_t nullmodel_vert_spv[];
|
||||
extern const size_t nullmodel_vert_size;
|
||||
|
||||
// particle (texture)
|
||||
extern const uint32_t particle_vert_spv[];
|
||||
extern const size_t particle_vert_size;
|
||||
|
||||
// particle (point)
|
||||
extern const uint32_t point_particle_vert_spv[];
|
||||
extern const size_t point_particle_vert_size;
|
||||
|
||||
extern const uint32_t point_particle_frag_spv[];
|
||||
extern const size_t point_particle_frag_size;
|
||||
|
||||
// sprite model
|
||||
extern const uint32_t sprite_vert_spv[];
|
||||
extern const size_t sprite_vert_size;
|
||||
|
||||
// beam
|
||||
extern const uint32_t beam_vert_spv[];
|
||||
extern const size_t beam_vert_size;
|
||||
|
||||
// skybox
|
||||
extern const uint32_t skybox_vert_spv[];
|
||||
extern const size_t skybox_vert_size;
|
||||
|
||||
// dynamic lights
|
||||
extern const uint32_t d_light_vert_spv[];
|
||||
extern const size_t d_light_vert_size;
|
||||
|
||||
// textured, alpha blended polygon
|
||||
extern const uint32_t polygon_vert_spv[];
|
||||
extern const size_t polygon_vert_size;
|
||||
|
||||
// textured, lightmapped polygon
|
||||
extern const uint32_t polygon_lmap_vert_spv[];
|
||||
extern const size_t polygon_lmap_vert_size;
|
||||
|
||||
extern const uint32_t polygon_lmap_frag_spv[];
|
||||
extern const size_t polygon_lmap_frag_size;
|
||||
|
||||
// warped polygon (liquids)
|
||||
extern const uint32_t polygon_warp_vert_spv[];
|
||||
extern const size_t polygon_warp_vert_size;
|
||||
|
||||
// entity shadows
|
||||
extern const uint32_t shadows_vert_spv[];
|
||||
extern const size_t shadows_vert_size;
|
||||
|
||||
// postprocess
|
||||
extern const uint32_t postprocess_vert_spv[];
|
||||
extern const size_t postprocess_vert_size;
|
||||
|
||||
extern const uint32_t postprocess_frag_spv[];
|
||||
extern const size_t postprocess_frag_size;
|
||||
|
||||
// underwater vision warp
|
||||
extern const uint32_t world_warp_vert_spv[];
|
||||
extern const size_t world_warp_vert_size;
|
||||
|
||||
extern const uint32_t world_warp_frag_spv[];
|
||||
extern const size_t world_warp_frag_size;
|
||||
|
||||
#endif
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018 Christoph Schied
|
||||
Copyright (C) 2020 Denis Pauk
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __VK_UTIL_H__
|
||||
#define __VK_UTIL_H__
|
||||
|
||||
#include "../volk/volk.h"
|
||||
|
||||
#define ROUNDUP(a, b) (((a) + ((b)-1)) & ~((b)-1))
|
||||
|
||||
typedef struct BufferResource_s {
|
||||
VkBuffer buffer;
|
||||
// shared memory used for buffer
|
||||
VkDeviceMemory memory;
|
||||
// image size
|
||||
VkDeviceSize size;
|
||||
// posision in shared memory
|
||||
VkDeviceSize offset;
|
||||
// is mapped?
|
||||
VkBool32 is_mapped;
|
||||
} BufferResource_t;
|
||||
|
||||
typedef struct ImageResource_s {
|
||||
VkImage image;
|
||||
// shared memory used for image
|
||||
VkDeviceMemory memory;
|
||||
// image size
|
||||
VkDeviceSize size;
|
||||
// posision in shared memory
|
||||
VkDeviceSize offset;
|
||||
} ImageResource_t;
|
||||
|
||||
VkResult buffer_create(BufferResource_t *buf,
|
||||
VkBufferCreateInfo buf_create_info,
|
||||
VkMemoryPropertyFlags mem_properties,
|
||||
VkMemoryPropertyFlags mem_preferences);
|
||||
|
||||
VkResult buffer_destroy(BufferResource_t *buf);
|
||||
void buffer_unmap(BufferResource_t *buf);
|
||||
void *buffer_map(BufferResource_t *buf);
|
||||
VkResult buffer_flush(BufferResource_t *buf);
|
||||
VkResult buffer_invalidate(BufferResource_t *buf);
|
||||
|
||||
VkResult image_create(ImageResource_t *img,
|
||||
VkImageCreateInfo img_create_info,
|
||||
VkMemoryPropertyFlags mem_properties,
|
||||
VkMemoryPropertyFlags mem_preferences);
|
||||
VkResult image_destroy(ImageResource_t *img);
|
||||
|
||||
void vulkan_memory_init(void);
|
||||
void vulkan_memory_types_show(void);
|
||||
void vulkan_memory_free_unused(void);
|
||||
void vulkan_memory_delete(void);
|
||||
|
||||
#endif /*__VK_UTIL_H__*/
|
|
@ -1,16 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t basic_color_quad_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x0000000d,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000b,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00060005,0x00000009,0x67617266,0x746e656d,0x6f6c6f43,0x00000072,0x00040005,
|
||||
0x0000000b,0x6f6c6f63,0x00000072,0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,
|
||||
0x0000000b,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,
|
||||
0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x00040020,
|
||||
0x00000008,0x00000003,0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003,0x00040020,
|
||||
0x0000000a,0x00000001,0x00000007,0x0004003b,0x0000000a,0x0000000b,0x00000001,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,0x00000007,
|
||||
0x0000000c,0x0000000b,0x0003003e,0x00000009,0x0000000c,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,48 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t basic_color_quad_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000032,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000001f,0x0000002d,
|
||||
0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,
|
||||
0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,0x6e69616d,0x00000000,
|
||||
0x00040005,0x00000009,0x736f5076,0x00000000,0x00050005,0x0000000b,0x65566e69,0x78657472,
|
||||
0x00000000,0x00060005,0x0000000e,0x67616d69,0x61725465,0x6f66736e,0x00006d72,0x00050006,
|
||||
0x0000000e,0x00000000,0x7366666f,0x00007465,0x00050006,0x0000000e,0x00000001,0x6c616373,
|
||||
0x00000065,0x00050006,0x0000000e,0x00000002,0x6f6c6f63,0x00000072,0x00030005,0x00000010,
|
||||
0x00007469,0x00060005,0x0000001d,0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,
|
||||
0x0000001d,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,0x0000001f,0x00000000,
|
||||
0x00040005,0x0000002d,0x6f6c6f63,0x00000072,0x00040047,0x0000000b,0x0000001e,0x00000000,
|
||||
0x00050048,0x0000000e,0x00000000,0x00000023,0x00000000,0x00050048,0x0000000e,0x00000001,
|
||||
0x00000023,0x00000008,0x00050048,0x0000000e,0x00000002,0x00000023,0x00000010,0x00030047,
|
||||
0x0000000e,0x00000002,0x00040047,0x00000010,0x00000022,0x00000000,0x00040047,0x00000010,
|
||||
0x00000021,0x00000000,0x00050048,0x0000001d,0x00000000,0x0000000b,0x00000000,0x00030047,
|
||||
0x0000001d,0x00000002,0x00040047,0x0000002d,0x0000001e,0x00000000,0x00020013,0x00000002,
|
||||
0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,
|
||||
0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x00040020,0x0000000a,
|
||||
0x00000001,0x00000007,0x0004003b,0x0000000a,0x0000000b,0x00000001,0x00040017,0x0000000d,
|
||||
0x00000006,0x00000004,0x0005001e,0x0000000e,0x00000007,0x00000007,0x0000000d,0x00040020,
|
||||
0x0000000f,0x00000002,0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000002,0x00040015,
|
||||
0x00000011,0x00000020,0x00000001,0x0004002b,0x00000011,0x00000012,0x00000001,0x00040020,
|
||||
0x00000013,0x00000002,0x00000007,0x0004002b,0x00000006,0x00000017,0x3f800000,0x0005002c,
|
||||
0x00000007,0x00000018,0x00000017,0x00000017,0x0003001e,0x0000001d,0x0000000d,0x00040020,
|
||||
0x0000001e,0x00000003,0x0000001d,0x0004003b,0x0000001e,0x0000001f,0x00000003,0x0004002b,
|
||||
0x00000011,0x00000020,0x00000000,0x0004002b,0x00000006,0x00000024,0x40000000,0x0004002b,
|
||||
0x00000006,0x00000027,0x00000000,0x00040020,0x0000002b,0x00000003,0x0000000d,0x0004003b,
|
||||
0x0000002b,0x0000002d,0x00000003,0x0004002b,0x00000011,0x0000002e,0x00000002,0x00040020,
|
||||
0x0000002f,0x00000002,0x0000000d,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,
|
||||
0x000200f8,0x00000005,0x0004003b,0x00000008,0x00000009,0x00000007,0x0004003d,0x00000007,
|
||||
0x0000000c,0x0000000b,0x00050041,0x00000013,0x00000014,0x00000010,0x00000012,0x0004003d,
|
||||
0x00000007,0x00000015,0x00000014,0x00050085,0x00000007,0x00000016,0x0000000c,0x00000015,
|
||||
0x00050041,0x00000013,0x00000019,0x00000010,0x00000012,0x0004003d,0x00000007,0x0000001a,
|
||||
0x00000019,0x00050083,0x00000007,0x0000001b,0x00000018,0x0000001a,0x00050083,0x00000007,
|
||||
0x0000001c,0x00000016,0x0000001b,0x0003003e,0x00000009,0x0000001c,0x0004003d,0x00000007,
|
||||
0x00000021,0x00000009,0x00050041,0x00000013,0x00000022,0x00000010,0x00000020,0x0004003d,
|
||||
0x00000007,0x00000023,0x00000022,0x0005008e,0x00000007,0x00000025,0x00000023,0x00000024,
|
||||
0x00050081,0x00000007,0x00000026,0x00000021,0x00000025,0x00050051,0x00000006,0x00000028,
|
||||
0x00000026,0x00000000,0x00050051,0x00000006,0x00000029,0x00000026,0x00000001,0x00070050,
|
||||
0x0000000d,0x0000002a,0x00000028,0x00000029,0x00000027,0x00000017,0x00050041,0x0000002b,
|
||||
0x0000002c,0x0000001f,0x00000020,0x0003003e,0x0000002c,0x0000002a,0x00050041,0x0000002f,
|
||||
0x00000030,0x00000010,0x0000002e,0x0004003d,0x0000000d,0x00000031,0x00000030,0x0003003e,
|
||||
0x0000002d,0x00000031,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,48 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t basic_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000038,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000011,0x00000015,
|
||||
0x0000001e,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000009,0x67617266,0x746e656d,0x6f6c6f43,
|
||||
0x00000072,0x00050005,0x0000000d,0x78655473,0x65727574,0x00000000,0x00050005,0x00000011,
|
||||
0x43786574,0x64726f6f,0x00000000,0x00040005,0x00000015,0x6f6c6f63,0x00000072,0x00050005,
|
||||
0x0000001e,0x65725461,0x6c6f6873,0x00000064,0x00060005,0x00000028,0x68737550,0x736e6f43,
|
||||
0x746e6174,0x00000000,0x00050006,0x00000028,0x00000000,0x6d6d6167,0x00000061,0x00030005,
|
||||
0x0000002a,0x00006370,0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,
|
||||
0x00000022,0x00000000,0x00040047,0x0000000d,0x00000021,0x00000000,0x00040047,0x00000011,
|
||||
0x0000001e,0x00000000,0x00040047,0x00000015,0x0000001e,0x00000001,0x00040047,0x0000001e,
|
||||
0x0000001e,0x00000002,0x00050048,0x00000028,0x00000000,0x00000023,0x00000044,0x00030047,
|
||||
0x00000028,0x00000002,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,
|
||||
0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x00040020,0x00000008,
|
||||
0x00000003,0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003,0x00090019,0x0000000a,
|
||||
0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,
|
||||
0x0000000b,0x0000000a,0x00040020,0x0000000c,0x00000000,0x0000000b,0x0004003b,0x0000000c,
|
||||
0x0000000d,0x00000000,0x00040017,0x0000000f,0x00000006,0x00000002,0x00040020,0x00000010,
|
||||
0x00000001,0x0000000f,0x0004003b,0x00000010,0x00000011,0x00000001,0x00040020,0x00000014,
|
||||
0x00000001,0x00000007,0x0004003b,0x00000014,0x00000015,0x00000001,0x00040015,0x00000018,
|
||||
0x00000020,0x00000000,0x0004002b,0x00000018,0x00000019,0x00000003,0x00040020,0x0000001a,
|
||||
0x00000003,0x00000006,0x00040020,0x0000001d,0x00000001,0x00000006,0x0004003b,0x0000001d,
|
||||
0x0000001e,0x00000001,0x00020014,0x00000020,0x00040017,0x00000025,0x00000006,0x00000003,
|
||||
0x0003001e,0x00000028,0x00000006,0x00040020,0x00000029,0x00000009,0x00000028,0x0004003b,
|
||||
0x00000029,0x0000002a,0x00000009,0x00040015,0x0000002b,0x00000020,0x00000001,0x0004002b,
|
||||
0x0000002b,0x0000002c,0x00000000,0x00040020,0x0000002d,0x00000009,0x00000006,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000b,
|
||||
0x0000000e,0x0000000d,0x0004003d,0x0000000f,0x00000012,0x00000011,0x00050057,0x00000007,
|
||||
0x00000013,0x0000000e,0x00000012,0x0004003d,0x00000007,0x00000016,0x00000015,0x00050085,
|
||||
0x00000007,0x00000017,0x00000013,0x00000016,0x0003003e,0x00000009,0x00000017,0x00050041,
|
||||
0x0000001a,0x0000001b,0x00000009,0x00000019,0x0004003d,0x00000006,0x0000001c,0x0000001b,
|
||||
0x0004003d,0x00000006,0x0000001f,0x0000001e,0x000500b8,0x00000020,0x00000021,0x0000001c,
|
||||
0x0000001f,0x000300f7,0x00000023,0x00000000,0x000400fa,0x00000021,0x00000022,0x00000023,
|
||||
0x000200f8,0x00000022,0x000100fc,0x000200f8,0x00000023,0x0004003d,0x00000007,0x00000026,
|
||||
0x00000009,0x0008004f,0x00000025,0x00000027,0x00000026,0x00000026,0x00000000,0x00000001,
|
||||
0x00000002,0x00050041,0x0000002d,0x0000002e,0x0000002a,0x0000002c,0x0004003d,0x00000006,
|
||||
0x0000002f,0x0000002e,0x00060050,0x00000025,0x00000030,0x0000002f,0x0000002f,0x0000002f,
|
||||
0x0007000c,0x00000025,0x00000031,0x00000001,0x0000001a,0x00000027,0x00000030,0x00050041,
|
||||
0x0000001a,0x00000032,0x00000009,0x00000019,0x0004003d,0x00000006,0x00000033,0x00000032,
|
||||
0x00050051,0x00000006,0x00000034,0x00000031,0x00000000,0x00050051,0x00000006,0x00000035,
|
||||
0x00000031,0x00000001,0x00050051,0x00000006,0x00000036,0x00000031,0x00000002,0x00070050,
|
||||
0x00000007,0x00000037,0x00000034,0x00000035,0x00000036,0x00000033,0x0003003e,0x00000009,
|
||||
0x00000037,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,61 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t basic_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x0000003e,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000001f,0x0000002e,
|
||||
0x0000002f,0x00000039,0x0000003c,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,
|
||||
0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00040005,0x00000009,0x736f5076,0x00000000,0x00050005,
|
||||
0x0000000b,0x65566e69,0x78657472,0x00000000,0x00060005,0x0000000d,0x67616d69,0x61725465,
|
||||
0x6f66736e,0x00006d72,0x00050006,0x0000000d,0x00000000,0x7366666f,0x00007465,0x00050006,
|
||||
0x0000000d,0x00000001,0x6c616373,0x00000065,0x00060006,0x0000000d,0x00000002,0x664f7675,
|
||||
0x74657366,0x00000000,0x00050006,0x0000000d,0x00000003,0x63537675,0x00656c61,0x00030005,
|
||||
0x0000000f,0x00007469,0x00060005,0x0000001d,0x505f6c67,0x65567265,0x78657472,0x00000000,
|
||||
0x00060006,0x0000001d,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,0x0000001f,
|
||||
0x00000000,0x00050005,0x0000002e,0x43786574,0x64726f6f,0x00000000,0x00050005,0x0000002f,
|
||||
0x65546e69,0x6f6f4378,0x00006472,0x00040005,0x00000039,0x6f6c6f63,0x00000072,0x00050005,
|
||||
0x0000003c,0x65725461,0x6c6f6873,0x00000064,0x00040047,0x0000000b,0x0000001e,0x00000000,
|
||||
0x00050048,0x0000000d,0x00000000,0x00000023,0x00000000,0x00050048,0x0000000d,0x00000001,
|
||||
0x00000023,0x00000008,0x00050048,0x0000000d,0x00000002,0x00000023,0x00000010,0x00050048,
|
||||
0x0000000d,0x00000003,0x00000023,0x00000018,0x00030047,0x0000000d,0x00000002,0x00040047,
|
||||
0x0000000f,0x00000022,0x00000001,0x00040047,0x0000000f,0x00000021,0x00000000,0x00050048,
|
||||
0x0000001d,0x00000000,0x0000000b,0x00000000,0x00030047,0x0000001d,0x00000002,0x00040047,
|
||||
0x0000002e,0x0000001e,0x00000000,0x00040047,0x0000002f,0x0000001e,0x00000001,0x00040047,
|
||||
0x00000039,0x0000001e,0x00000001,0x00040047,0x0000003c,0x0000001e,0x00000002,0x00020013,
|
||||
0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,
|
||||
0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x00040020,
|
||||
0x0000000a,0x00000001,0x00000007,0x0004003b,0x0000000a,0x0000000b,0x00000001,0x0006001e,
|
||||
0x0000000d,0x00000007,0x00000007,0x00000007,0x00000007,0x00040020,0x0000000e,0x00000002,
|
||||
0x0000000d,0x0004003b,0x0000000e,0x0000000f,0x00000002,0x00040015,0x00000010,0x00000020,
|
||||
0x00000001,0x0004002b,0x00000010,0x00000011,0x00000001,0x00040020,0x00000012,0x00000002,
|
||||
0x00000007,0x0004002b,0x00000006,0x00000016,0x3f800000,0x0005002c,0x00000007,0x00000017,
|
||||
0x00000016,0x00000016,0x00040017,0x0000001c,0x00000006,0x00000004,0x0003001e,0x0000001d,
|
||||
0x0000001c,0x00040020,0x0000001e,0x00000003,0x0000001d,0x0004003b,0x0000001e,0x0000001f,
|
||||
0x00000003,0x0004002b,0x00000010,0x00000020,0x00000000,0x0004002b,0x00000006,0x00000024,
|
||||
0x40000000,0x0004002b,0x00000006,0x00000027,0x00000000,0x00040020,0x0000002b,0x00000003,
|
||||
0x0000001c,0x00040020,0x0000002d,0x00000003,0x00000007,0x0004003b,0x0000002d,0x0000002e,
|
||||
0x00000003,0x0004003b,0x0000000a,0x0000002f,0x00000001,0x0004002b,0x00000010,0x00000031,
|
||||
0x00000003,0x0004002b,0x00000010,0x00000035,0x00000002,0x0004003b,0x0000002b,0x00000039,
|
||||
0x00000003,0x0007002c,0x0000001c,0x0000003a,0x00000016,0x00000016,0x00000016,0x00000016,
|
||||
0x00040020,0x0000003b,0x00000003,0x00000006,0x0004003b,0x0000003b,0x0000003c,0x00000003,
|
||||
0x0004002b,0x00000006,0x0000003d,0x3f2a7efa,0x00050036,0x00000002,0x00000004,0x00000000,
|
||||
0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,0x00000009,0x00000007,0x0004003d,
|
||||
0x00000007,0x0000000c,0x0000000b,0x00050041,0x00000012,0x00000013,0x0000000f,0x00000011,
|
||||
0x0004003d,0x00000007,0x00000014,0x00000013,0x00050085,0x00000007,0x00000015,0x0000000c,
|
||||
0x00000014,0x00050041,0x00000012,0x00000018,0x0000000f,0x00000011,0x0004003d,0x00000007,
|
||||
0x00000019,0x00000018,0x00050083,0x00000007,0x0000001a,0x00000017,0x00000019,0x00050083,
|
||||
0x00000007,0x0000001b,0x00000015,0x0000001a,0x0003003e,0x00000009,0x0000001b,0x0004003d,
|
||||
0x00000007,0x00000021,0x00000009,0x00050041,0x00000012,0x00000022,0x0000000f,0x00000020,
|
||||
0x0004003d,0x00000007,0x00000023,0x00000022,0x0005008e,0x00000007,0x00000025,0x00000023,
|
||||
0x00000024,0x00050081,0x00000007,0x00000026,0x00000021,0x00000025,0x00050051,0x00000006,
|
||||
0x00000028,0x00000026,0x00000000,0x00050051,0x00000006,0x00000029,0x00000026,0x00000001,
|
||||
0x00070050,0x0000001c,0x0000002a,0x00000028,0x00000029,0x00000027,0x00000016,0x00050041,
|
||||
0x0000002b,0x0000002c,0x0000001f,0x00000020,0x0003003e,0x0000002c,0x0000002a,0x0004003d,
|
||||
0x00000007,0x00000030,0x0000002f,0x00050041,0x00000012,0x00000032,0x0000000f,0x00000031,
|
||||
0x0004003d,0x00000007,0x00000033,0x00000032,0x00050085,0x00000007,0x00000034,0x00000030,
|
||||
0x00000033,0x00050041,0x00000012,0x00000036,0x0000000f,0x00000035,0x0004003d,0x00000007,
|
||||
0x00000037,0x00000036,0x00050081,0x00000007,0x00000038,0x00000034,0x00000037,0x0003003e,
|
||||
0x0000002e,0x00000038,0x0003003e,0x00000039,0x0000003a,0x0003003e,0x0000003c,0x0000003d,
|
||||
0x000100fd,0x00010038
|
||||
};
|
|
@ -1,42 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t beam_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000027,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000020,
|
||||
0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,
|
||||
0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,0x6e69616d,0x00000000,
|
||||
0x00060005,0x00000008,0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,0x00000008,
|
||||
0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,0x0000000a,0x00000000,0x00060005,
|
||||
0x0000000e,0x68737550,0x736e6f43,0x746e6174,0x00000000,0x00060006,0x0000000e,0x00000000,
|
||||
0x4d70766d,0x69727461,0x00000078,0x00030005,0x00000010,0x00006370,0x00050005,0x00000016,
|
||||
0x65566e69,0x78657472,0x00000000,0x00040005,0x00000020,0x6f6c6f63,0x00000072,0x00070005,
|
||||
0x00000021,0x66696e55,0x426d726f,0x65666675,0x6a624f72,0x00746365,0x00050006,0x00000021,
|
||||
0x00000000,0x6f6c6f63,0x00000072,0x00030005,0x00000023,0x006f6275,0x00050048,0x00000008,
|
||||
0x00000000,0x0000000b,0x00000000,0x00030047,0x00000008,0x00000002,0x00040048,0x0000000e,
|
||||
0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000,0x00000023,0x00000000,0x00050048,
|
||||
0x0000000e,0x00000000,0x00000007,0x00000010,0x00030047,0x0000000e,0x00000002,0x00040047,
|
||||
0x00000016,0x0000001e,0x00000000,0x00040047,0x00000020,0x0000001e,0x00000000,0x00050048,
|
||||
0x00000021,0x00000000,0x00000023,0x00000000,0x00030047,0x00000021,0x00000002,0x00040047,
|
||||
0x00000023,0x00000022,0x00000000,0x00040047,0x00000023,0x00000021,0x00000000,0x00020013,
|
||||
0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,
|
||||
0x00000007,0x00000006,0x00000004,0x0003001e,0x00000008,0x00000007,0x00040020,0x00000009,
|
||||
0x00000003,0x00000008,0x0004003b,0x00000009,0x0000000a,0x00000003,0x00040015,0x0000000b,
|
||||
0x00000020,0x00000001,0x0004002b,0x0000000b,0x0000000c,0x00000000,0x00040018,0x0000000d,
|
||||
0x00000007,0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000009,
|
||||
0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000009,0x00040020,0x00000011,0x00000009,
|
||||
0x0000000d,0x00040017,0x00000014,0x00000006,0x00000003,0x00040020,0x00000015,0x00000001,
|
||||
0x00000014,0x0004003b,0x00000015,0x00000016,0x00000001,0x0004002b,0x00000006,0x00000018,
|
||||
0x3f800000,0x00040020,0x0000001e,0x00000003,0x00000007,0x0004003b,0x0000001e,0x00000020,
|
||||
0x00000003,0x0003001e,0x00000021,0x00000007,0x00040020,0x00000022,0x00000002,0x00000021,
|
||||
0x0004003b,0x00000022,0x00000023,0x00000002,0x00040020,0x00000024,0x00000002,0x00000007,
|
||||
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,
|
||||
0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,0x00000012,
|
||||
0x0004003d,0x00000014,0x00000017,0x00000016,0x00050051,0x00000006,0x00000019,0x00000017,
|
||||
0x00000000,0x00050051,0x00000006,0x0000001a,0x00000017,0x00000001,0x00050051,0x00000006,
|
||||
0x0000001b,0x00000017,0x00000002,0x00070050,0x00000007,0x0000001c,0x00000019,0x0000001a,
|
||||
0x0000001b,0x00000018,0x00050091,0x00000007,0x0000001d,0x00000013,0x0000001c,0x00050041,
|
||||
0x0000001e,0x0000001f,0x0000000a,0x0000000c,0x0003003e,0x0000001f,0x0000001d,0x00050041,
|
||||
0x00000024,0x00000025,0x00000023,0x0000000c,0x0004003d,0x00000007,0x00000026,0x00000025,
|
||||
0x0003003e,0x00000020,0x00000026,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,41 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t d_light_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000027,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000020,
|
||||
0x00000021,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,
|
||||
0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,
|
||||
0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,0x0000000a,0x00000000,
|
||||
0x00070005,0x0000000e,0x66696e55,0x426d726f,0x65666675,0x6a624f72,0x00746365,0x00060006,
|
||||
0x0000000e,0x00000000,0x4d70766d,0x69727461,0x00000078,0x00030005,0x00000010,0x006f6275,
|
||||
0x00050005,0x00000016,0x65566e69,0x78657472,0x00000000,0x00040005,0x00000020,0x6f6c6f63,
|
||||
0x00000072,0x00040005,0x00000021,0x6f436e69,0x00726f6c,0x00050048,0x00000008,0x00000000,
|
||||
0x0000000b,0x00000000,0x00030047,0x00000008,0x00000002,0x00040048,0x0000000e,0x00000000,
|
||||
0x00000005,0x00050048,0x0000000e,0x00000000,0x00000023,0x00000000,0x00050048,0x0000000e,
|
||||
0x00000000,0x00000007,0x00000010,0x00030047,0x0000000e,0x00000002,0x00040047,0x00000010,
|
||||
0x00000022,0x00000000,0x00040047,0x00000010,0x00000021,0x00000000,0x00040047,0x00000016,
|
||||
0x0000001e,0x00000000,0x00040047,0x00000020,0x0000001e,0x00000000,0x00040047,0x00000021,
|
||||
0x0000001e,0x00000001,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,
|
||||
0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x0003001e,0x00000008,
|
||||
0x00000007,0x00040020,0x00000009,0x00000003,0x00000008,0x0004003b,0x00000009,0x0000000a,
|
||||
0x00000003,0x00040015,0x0000000b,0x00000020,0x00000001,0x0004002b,0x0000000b,0x0000000c,
|
||||
0x00000000,0x00040018,0x0000000d,0x00000007,0x00000004,0x0003001e,0x0000000e,0x0000000d,
|
||||
0x00040020,0x0000000f,0x00000002,0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000002,
|
||||
0x00040020,0x00000011,0x00000002,0x0000000d,0x00040017,0x00000014,0x00000006,0x00000003,
|
||||
0x00040020,0x00000015,0x00000001,0x00000014,0x0004003b,0x00000015,0x00000016,0x00000001,
|
||||
0x0004002b,0x00000006,0x00000018,0x3f800000,0x00040020,0x0000001e,0x00000003,0x00000007,
|
||||
0x0004003b,0x0000001e,0x00000020,0x00000003,0x0004003b,0x00000015,0x00000021,0x00000001,
|
||||
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,
|
||||
0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,0x00000012,
|
||||
0x0004003d,0x00000014,0x00000017,0x00000016,0x00050051,0x00000006,0x00000019,0x00000017,
|
||||
0x00000000,0x00050051,0x00000006,0x0000001a,0x00000017,0x00000001,0x00050051,0x00000006,
|
||||
0x0000001b,0x00000017,0x00000002,0x00070050,0x00000007,0x0000001c,0x00000019,0x0000001a,
|
||||
0x0000001b,0x00000018,0x00050091,0x00000007,0x0000001d,0x00000013,0x0000001c,0x00050041,
|
||||
0x0000001e,0x0000001f,0x0000000a,0x0000000c,0x0003003e,0x0000001f,0x0000001d,0x0004003d,
|
||||
0x00000014,0x00000022,0x00000021,0x00050051,0x00000006,0x00000023,0x00000022,0x00000000,
|
||||
0x00050051,0x00000006,0x00000024,0x00000022,0x00000001,0x00050051,0x00000006,0x00000025,
|
||||
0x00000022,0x00000002,0x00070050,0x00000007,0x00000026,0x00000023,0x00000024,0x00000025,
|
||||
0x00000018,0x0003003e,0x00000020,0x00000026,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,37 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t model_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000028,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000008,0x00000012,0x0000001a,
|
||||
0x0000001e,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00050005,0x00000008,0x74786574,0x64657275,0x00000000,
|
||||
0x00060005,0x00000012,0x67617266,0x746e656d,0x6f6c6f43,0x00000072,0x00050005,0x00000016,
|
||||
0x78655473,0x65727574,0x00000000,0x00050005,0x0000001a,0x43786574,0x64726f6f,0x00000000,
|
||||
0x00040005,0x0000001e,0x6f6c6f63,0x00000072,0x00030047,0x00000008,0x0000000e,0x00040047,
|
||||
0x00000008,0x0000001e,0x00000002,0x00040047,0x00000012,0x0000001e,0x00000000,0x00040047,
|
||||
0x00000016,0x00000022,0x00000000,0x00040047,0x00000016,0x00000021,0x00000000,0x00040047,
|
||||
0x0000001a,0x0000001e,0x00000001,0x00040047,0x0000001e,0x0000001e,0x00000000,0x00020013,
|
||||
0x00000002,0x00030021,0x00000003,0x00000002,0x00040015,0x00000006,0x00000020,0x00000001,
|
||||
0x00040020,0x00000007,0x00000001,0x00000006,0x0004003b,0x00000007,0x00000008,0x00000001,
|
||||
0x0004002b,0x00000006,0x0000000a,0x00000000,0x00020014,0x0000000b,0x00030016,0x0000000f,
|
||||
0x00000020,0x00040017,0x00000010,0x0000000f,0x00000004,0x00040020,0x00000011,0x00000003,
|
||||
0x00000010,0x0004003b,0x00000011,0x00000012,0x00000003,0x00090019,0x00000013,0x0000000f,
|
||||
0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x00000014,
|
||||
0x00000013,0x00040020,0x00000015,0x00000000,0x00000014,0x0004003b,0x00000015,0x00000016,
|
||||
0x00000000,0x00040017,0x00000018,0x0000000f,0x00000002,0x00040020,0x00000019,0x00000001,
|
||||
0x00000018,0x0004003b,0x00000019,0x0000001a,0x00000001,0x00040020,0x0000001d,0x00000001,
|
||||
0x00000010,0x0004003b,0x0000001d,0x0000001e,0x00000001,0x0004002b,0x0000000f,0x00000020,
|
||||
0x00000000,0x0004002b,0x0000000f,0x00000021,0x3f800000,0x00050036,0x00000002,0x00000004,
|
||||
0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,0x00000006,0x00000009,0x00000008,
|
||||
0x000500ab,0x0000000b,0x0000000c,0x00000009,0x0000000a,0x000300f7,0x0000000e,0x00000000,
|
||||
0x000400fa,0x0000000c,0x0000000d,0x00000026,0x000200f8,0x0000000d,0x0004003d,0x00000014,
|
||||
0x00000017,0x00000016,0x0004003d,0x00000018,0x0000001b,0x0000001a,0x00050057,0x00000010,
|
||||
0x0000001c,0x00000017,0x0000001b,0x0004003d,0x00000010,0x0000001f,0x0000001e,0x00070050,
|
||||
0x00000010,0x00000022,0x00000020,0x00000020,0x00000020,0x00000020,0x00070050,0x00000010,
|
||||
0x00000023,0x00000021,0x00000021,0x00000021,0x00000021,0x0008000c,0x00000010,0x00000024,
|
||||
0x00000001,0x0000002b,0x0000001f,0x00000022,0x00000023,0x00050085,0x00000010,0x00000025,
|
||||
0x0000001c,0x00000024,0x0003003e,0x00000012,0x00000025,0x000200f9,0x0000000e,0x000200f8,
|
||||
0x00000026,0x0004003d,0x00000010,0x00000027,0x0000001e,0x0003003e,0x00000012,0x00000027,
|
||||
0x000200f9,0x0000000e,0x000200f8,0x0000000e,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,59 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t model_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000037,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000027,
|
||||
0x00000029,0x0000002d,0x0000002f,0x00000032,0x00030003,0x00000002,0x000001c2,0x00090004,
|
||||
0x415f4c47,0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,
|
||||
0x00040005,0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,
|
||||
0x78657472,0x00000000,0x00060006,0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,
|
||||
0x00030005,0x0000000a,0x00000000,0x00060005,0x0000000e,0x68737550,0x736e6f43,0x746e6174,
|
||||
0x00000000,0x00060006,0x0000000e,0x00000000,0x614d7076,0x78697274,0x00000000,0x00030005,
|
||||
0x00000010,0x00006370,0x00070005,0x00000014,0x66696e55,0x426d726f,0x65666675,0x6a624f72,
|
||||
0x00746365,0x00050006,0x00000014,0x00000000,0x65646f6d,0x0000006c,0x00060006,0x00000014,
|
||||
0x00000001,0x74786574,0x64657275,0x00000000,0x00030005,0x00000016,0x006f6275,0x00050005,
|
||||
0x0000001d,0x65566e69,0x78657472,0x00000000,0x00040005,0x00000027,0x6f6c6f63,0x00000072,
|
||||
0x00040005,0x00000029,0x6f436e69,0x00726f6c,0x00050005,0x0000002d,0x43786574,0x64726f6f,
|
||||
0x00000000,0x00050005,0x0000002f,0x65546e69,0x6f6f4378,0x00006472,0x00050005,0x00000032,
|
||||
0x74786574,0x64657275,0x00000000,0x00050048,0x00000008,0x00000000,0x0000000b,0x00000000,
|
||||
0x00030047,0x00000008,0x00000002,0x00040048,0x0000000e,0x00000000,0x00000005,0x00050048,
|
||||
0x0000000e,0x00000000,0x00000023,0x00000000,0x00050048,0x0000000e,0x00000000,0x00000007,
|
||||
0x00000010,0x00030047,0x0000000e,0x00000002,0x00040048,0x00000014,0x00000000,0x00000005,
|
||||
0x00050048,0x00000014,0x00000000,0x00000023,0x00000000,0x00050048,0x00000014,0x00000000,
|
||||
0x00000007,0x00000010,0x00050048,0x00000014,0x00000001,0x00000023,0x00000040,0x00030047,
|
||||
0x00000014,0x00000002,0x00040047,0x00000016,0x00000022,0x00000001,0x00040047,0x00000016,
|
||||
0x00000021,0x00000000,0x00040047,0x0000001d,0x0000001e,0x00000000,0x00040047,0x00000027,
|
||||
0x0000001e,0x00000000,0x00040047,0x00000029,0x0000001e,0x00000001,0x00040047,0x0000002d,
|
||||
0x0000001e,0x00000001,0x00040047,0x0000002f,0x0000001e,0x00000002,0x00040047,0x00000032,
|
||||
0x0000001e,0x00000002,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,
|
||||
0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x0003001e,0x00000008,
|
||||
0x00000007,0x00040020,0x00000009,0x00000003,0x00000008,0x0004003b,0x00000009,0x0000000a,
|
||||
0x00000003,0x00040015,0x0000000b,0x00000020,0x00000001,0x0004002b,0x0000000b,0x0000000c,
|
||||
0x00000000,0x00040018,0x0000000d,0x00000007,0x00000004,0x0003001e,0x0000000e,0x0000000d,
|
||||
0x00040020,0x0000000f,0x00000009,0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000009,
|
||||
0x00040020,0x00000011,0x00000009,0x0000000d,0x0004001e,0x00000014,0x0000000d,0x0000000b,
|
||||
0x00040020,0x00000015,0x00000002,0x00000014,0x0004003b,0x00000015,0x00000016,0x00000002,
|
||||
0x00040020,0x00000017,0x00000002,0x0000000d,0x00040017,0x0000001b,0x00000006,0x00000003,
|
||||
0x00040020,0x0000001c,0x00000001,0x0000001b,0x0004003b,0x0000001c,0x0000001d,0x00000001,
|
||||
0x0004002b,0x00000006,0x0000001f,0x3f800000,0x00040020,0x00000025,0x00000003,0x00000007,
|
||||
0x0004003b,0x00000025,0x00000027,0x00000003,0x00040020,0x00000028,0x00000001,0x00000007,
|
||||
0x0004003b,0x00000028,0x00000029,0x00000001,0x00040017,0x0000002b,0x00000006,0x00000002,
|
||||
0x00040020,0x0000002c,0x00000003,0x0000002b,0x0004003b,0x0000002c,0x0000002d,0x00000003,
|
||||
0x00040020,0x0000002e,0x00000001,0x0000002b,0x0004003b,0x0000002e,0x0000002f,0x00000001,
|
||||
0x00040020,0x00000031,0x00000003,0x0000000b,0x0004003b,0x00000031,0x00000032,0x00000003,
|
||||
0x0004002b,0x0000000b,0x00000033,0x00000001,0x00040020,0x00000034,0x00000002,0x0000000b,
|
||||
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,
|
||||
0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,0x00000012,
|
||||
0x00050041,0x00000017,0x00000018,0x00000016,0x0000000c,0x0004003d,0x0000000d,0x00000019,
|
||||
0x00000018,0x00050092,0x0000000d,0x0000001a,0x00000013,0x00000019,0x0004003d,0x0000001b,
|
||||
0x0000001e,0x0000001d,0x00050051,0x00000006,0x00000020,0x0000001e,0x00000000,0x00050051,
|
||||
0x00000006,0x00000021,0x0000001e,0x00000001,0x00050051,0x00000006,0x00000022,0x0000001e,
|
||||
0x00000002,0x00070050,0x00000007,0x00000023,0x00000020,0x00000021,0x00000022,0x0000001f,
|
||||
0x00050091,0x00000007,0x00000024,0x0000001a,0x00000023,0x00050041,0x00000025,0x00000026,
|
||||
0x0000000a,0x0000000c,0x0003003e,0x00000026,0x00000024,0x0004003d,0x00000007,0x0000002a,
|
||||
0x00000029,0x0003003e,0x00000027,0x0000002a,0x0004003d,0x0000002b,0x00000030,0x0000002f,
|
||||
0x0003003e,0x0000002d,0x00000030,0x00050041,0x00000034,0x00000035,0x00000016,0x00000033,
|
||||
0x0004003d,0x0000000b,0x00000036,0x00000035,0x0003003e,0x00000032,0x00000036,0x000100fd,
|
||||
0x00010038
|
||||
};
|
|
@ -1,49 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t nullmodel_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x0000002e,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000027,
|
||||
0x00000028,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,
|
||||
0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,
|
||||
0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,0x0000000a,0x00000000,
|
||||
0x00060005,0x0000000e,0x68737550,0x736e6f43,0x746e6174,0x00000000,0x00060006,0x0000000e,
|
||||
0x00000000,0x614d7076,0x78697274,0x00000000,0x00030005,0x00000010,0x00006370,0x00070005,
|
||||
0x00000014,0x66696e55,0x426d726f,0x65666675,0x6a624f72,0x00746365,0x00050006,0x00000014,
|
||||
0x00000000,0x65646f6d,0x0000006c,0x00030005,0x00000016,0x006f6275,0x00050005,0x0000001d,
|
||||
0x65566e69,0x78657472,0x00000000,0x00040005,0x00000027,0x6f6c6f63,0x00000072,0x00040005,
|
||||
0x00000028,0x6f436e69,0x00726f6c,0x00050048,0x00000008,0x00000000,0x0000000b,0x00000000,
|
||||
0x00030047,0x00000008,0x00000002,0x00040048,0x0000000e,0x00000000,0x00000005,0x00050048,
|
||||
0x0000000e,0x00000000,0x00000023,0x00000000,0x00050048,0x0000000e,0x00000000,0x00000007,
|
||||
0x00000010,0x00030047,0x0000000e,0x00000002,0x00040048,0x00000014,0x00000000,0x00000005,
|
||||
0x00050048,0x00000014,0x00000000,0x00000023,0x00000000,0x00050048,0x00000014,0x00000000,
|
||||
0x00000007,0x00000010,0x00030047,0x00000014,0x00000002,0x00040047,0x00000016,0x00000022,
|
||||
0x00000000,0x00040047,0x00000016,0x00000021,0x00000000,0x00040047,0x0000001d,0x0000001e,
|
||||
0x00000000,0x00040047,0x00000027,0x0000001e,0x00000000,0x00040047,0x00000028,0x0000001e,
|
||||
0x00000001,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
|
||||
0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x0003001e,0x00000008,0x00000007,
|
||||
0x00040020,0x00000009,0x00000003,0x00000008,0x0004003b,0x00000009,0x0000000a,0x00000003,
|
||||
0x00040015,0x0000000b,0x00000020,0x00000001,0x0004002b,0x0000000b,0x0000000c,0x00000000,
|
||||
0x00040018,0x0000000d,0x00000007,0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,
|
||||
0x0000000f,0x00000009,0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000009,0x00040020,
|
||||
0x00000011,0x00000009,0x0000000d,0x0003001e,0x00000014,0x0000000d,0x00040020,0x00000015,
|
||||
0x00000002,0x00000014,0x0004003b,0x00000015,0x00000016,0x00000002,0x00040020,0x00000017,
|
||||
0x00000002,0x0000000d,0x00040017,0x0000001b,0x00000006,0x00000003,0x00040020,0x0000001c,
|
||||
0x00000001,0x0000001b,0x0004003b,0x0000001c,0x0000001d,0x00000001,0x0004002b,0x00000006,
|
||||
0x0000001f,0x3f800000,0x00040020,0x00000025,0x00000003,0x00000007,0x0004003b,0x00000025,
|
||||
0x00000027,0x00000003,0x0004003b,0x0000001c,0x00000028,0x00000001,0x00050036,0x00000002,
|
||||
0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,0x00000011,0x00000012,
|
||||
0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,0x00000012,0x00050041,0x00000017,
|
||||
0x00000018,0x00000016,0x0000000c,0x0004003d,0x0000000d,0x00000019,0x00000018,0x00050092,
|
||||
0x0000000d,0x0000001a,0x00000013,0x00000019,0x0004003d,0x0000001b,0x0000001e,0x0000001d,
|
||||
0x00050051,0x00000006,0x00000020,0x0000001e,0x00000000,0x00050051,0x00000006,0x00000021,
|
||||
0x0000001e,0x00000001,0x00050051,0x00000006,0x00000022,0x0000001e,0x00000002,0x00070050,
|
||||
0x00000007,0x00000023,0x00000020,0x00000021,0x00000022,0x0000001f,0x00050091,0x00000007,
|
||||
0x00000024,0x0000001a,0x00000023,0x00050041,0x00000025,0x00000026,0x0000000a,0x0000000c,
|
||||
0x0003003e,0x00000026,0x00000024,0x0004003d,0x0000001b,0x00000029,0x00000028,0x00050051,
|
||||
0x00000006,0x0000002a,0x00000029,0x00000000,0x00050051,0x00000006,0x0000002b,0x00000029,
|
||||
0x00000001,0x00050051,0x00000006,0x0000002c,0x00000029,0x00000002,0x00070050,0x00000007,
|
||||
0x0000002d,0x0000002a,0x0000002b,0x0000002c,0x0000001f,0x0003003e,0x00000027,0x0000002d,
|
||||
0x000100fd,0x00010038
|
||||
};
|
|
@ -1,47 +0,0 @@
|
|||
// 8.13.3743
|
||||
#pragma once
|
||||
const uint32_t particle_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x0000002d,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000022,
|
||||
0x00000024,0x00000026,0x00000028,0x0000002b,0x00030003,0x00000002,0x000001c2,0x00090004,
|
||||
0x415f4c47,0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,
|
||||
0x00040005,0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,
|
||||
0x78657472,0x00000000,0x00060006,0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,
|
||||
0x00030005,0x0000000a,0x00000000,0x00060005,0x0000000e,0x68737550,0x736e6f43,0x746e6174,
|
||||
0x00000000,0x00060006,0x0000000e,0x00000000,0x4d70766d,0x69727461,0x00000078,0x00030005,
|
||||
0x00000010,0x00006370,0x00050005,0x00000016,0x65566e69,0x78657472,0x00000000,0x00050005,
|
||||
0x00000022,0x43786574,0x64726f6f,0x00000000,0x00050005,0x00000024,0x65546e69,0x6f6f4378,
|
||||
0x00006472,0x00040005,0x00000026,0x6f6c6f63,0x00000072,0x00040005,0x00000028,0x6f436e69,
|
||||
0x00726f6c,0x00050005,0x0000002b,0x65725461,0x6c6f6873,0x00000064,0x00050048,0x00000008,
|
||||
0x00000000,0x0000000b,0x00000000,0x00030047,0x00000008,0x00000002,0x00040048,0x0000000e,
|
||||
0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000,0x00000023,0x00000000,0x00050048,
|
||||
0x0000000e,0x00000000,0x00000007,0x00000010,0x00030047,0x0000000e,0x00000002,0x00040047,
|
||||
0x00000016,0x0000001e,0x00000000,0x00040047,0x00000022,0x0000001e,0x00000000,0x00040047,
|
||||
0x00000024,0x0000001e,0x00000002,0x00040047,0x00000026,0x0000001e,0x00000001,0x00040047,
|
||||
0x00000028,0x0000001e,0x00000001,0x00040047,0x0000002b,0x0000001e,0x00000002,0x00020013,
|
||||
0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,
|
||||
0x00000007,0x00000006,0x00000004,0x0003001e,0x00000008,0x00000007,0x00040020,0x00000009,
|
||||
0x00000003,0x00000008,0x0004003b,0x00000009,0x0000000a,0x00000003,0x00040015,0x0000000b,
|
||||
0x00000020,0x00000001,0x0004002b,0x0000000b,0x0000000c,0x00000000,0x00040018,0x0000000d,
|
||||
0x00000007,0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000009,
|
||||
0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000009,0x00040020,0x00000011,0x00000009,
|
||||
0x0000000d,0x00040017,0x00000014,0x00000006,0x00000003,0x00040020,0x00000015,0x00000001,
|
||||
0x00000014,0x0004003b,0x00000015,0x00000016,0x00000001,0x0004002b,0x00000006,0x00000018,
|
||||
0x3f800000,0x00040020,0x0000001e,0x00000003,0x00000007,0x00040017,0x00000020,0x00000006,
|
||||
0x00000002,0x00040020,0x00000021,0x00000003,0x00000020,0x0004003b,0x00000021,0x00000022,
|
||||
0x00000003,0x00040020,0x00000023,0x00000001,0x00000020,0x0004003b,0x00000023,0x00000024,
|
||||
0x00000001,0x0004003b,0x0000001e,0x00000026,0x00000003,0x00040020,0x00000027,0x00000001,
|
||||
0x00000007,0x0004003b,0x00000027,0x00000028,0x00000001,0x00040020,0x0000002a,0x00000003,
|
||||
0x00000006,0x0004003b,0x0000002a,0x0000002b,0x00000003,0x0004002b,0x00000006,0x0000002c,
|
||||
0x3f000000,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,
|
||||
0x00050041,0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,
|
||||
0x00000012,0x0004003d,0x00000014,0x00000017,0x00000016,0x00050051,0x00000006,0x00000019,
|
||||
0x00000017,0x00000000,0x00050051,0x00000006,0x0000001a,0x00000017,0x00000001,0x00050051,
|
||||
0x00000006,0x0000001b,0x00000017,0x00000002,0x00070050,0x00000007,0x0000001c,0x00000019,
|
||||
0x0000001a,0x0000001b,0x00000018,0x00050091,0x00000007,0x0000001d,0x00000013,0x0000001c,
|
||||
0x00050041,0x0000001e,0x0000001f,0x0000000a,0x0000000c,0x0003003e,0x0000001f,0x0000001d,
|
||||
0x0004003d,0x00000020,0x00000025,0x00000024,0x0003003e,0x00000022,0x00000025,0x0004003d,
|
||||
0x00000007,0x00000029,0x00000028,0x0003003e,0x00000026,0x00000029,0x0003003e,0x0000002b,
|
||||
0x0000002c,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,28 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t point_particle_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000020,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000c,0x0000001c,0x0000001e,
|
||||
0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,
|
||||
0x6e69616d,0x00000000,0x00030005,0x00000009,0x00797863,0x00060005,0x0000000c,0x505f6c67,
|
||||
0x746e696f,0x726f6f43,0x00000064,0x00060005,0x0000001c,0x67617266,0x746e656d,0x6f6c6f43,
|
||||
0x00000072,0x00040005,0x0000001e,0x6f6c6f63,0x00000072,0x00040047,0x0000000c,0x0000000b,
|
||||
0x00000010,0x00040047,0x0000001c,0x0000001e,0x00000000,0x00040047,0x0000001e,0x0000001e,
|
||||
0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
|
||||
0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,
|
||||
0x00000007,0x0004002b,0x00000006,0x0000000a,0x40000000,0x00040020,0x0000000b,0x00000001,
|
||||
0x00000007,0x0004003b,0x0000000b,0x0000000c,0x00000001,0x0004002b,0x00000006,0x0000000f,
|
||||
0x3f800000,0x00020014,0x00000015,0x00040017,0x0000001a,0x00000006,0x00000004,0x00040020,
|
||||
0x0000001b,0x00000003,0x0000001a,0x0004003b,0x0000001b,0x0000001c,0x00000003,0x00040020,
|
||||
0x0000001d,0x00000001,0x0000001a,0x0004003b,0x0000001d,0x0000001e,0x00000001,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,
|
||||
0x00000009,0x00000007,0x0004003d,0x00000007,0x0000000d,0x0000000c,0x0005008e,0x00000007,
|
||||
0x0000000e,0x0000000d,0x0000000a,0x00050050,0x00000007,0x00000010,0x0000000f,0x0000000f,
|
||||
0x00050083,0x00000007,0x00000011,0x0000000e,0x00000010,0x0003003e,0x00000009,0x00000011,
|
||||
0x0004003d,0x00000007,0x00000012,0x00000009,0x0004003d,0x00000007,0x00000013,0x00000009,
|
||||
0x00050094,0x00000006,0x00000014,0x00000012,0x00000013,0x000500ba,0x00000015,0x00000016,
|
||||
0x00000014,0x0000000f,0x000300f7,0x00000018,0x00000000,0x000400fa,0x00000016,0x00000017,
|
||||
0x00000018,0x000200f8,0x00000017,0x000100fc,0x000200f8,0x00000018,0x0004003d,0x0000001a,
|
||||
0x0000001f,0x0000001e,0x0003003e,0x0000001c,0x0000001f,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,82 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t point_particle_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000055,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000051,
|
||||
0x00000053,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,
|
||||
0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,0x6e69616d,
|
||||
0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,
|
||||
0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00070006,0x00000008,0x00000001,
|
||||
0x505f6c67,0x746e696f,0x657a6953,0x00000000,0x00030005,0x0000000a,0x00000000,0x00060005,
|
||||
0x0000000e,0x68737550,0x736e6f43,0x746e6174,0x00000000,0x00060006,0x0000000e,0x00000000,
|
||||
0x4d70766d,0x69727461,0x00000078,0x00030005,0x00000010,0x00006370,0x00050005,0x00000016,
|
||||
0x65566e69,0x78657472,0x00000000,0x00050005,0x00000021,0x74736964,0x7474615f,0x00006e65,
|
||||
0x00070005,0x00000022,0x66696e55,0x426d726f,0x65666675,0x6a624f72,0x00746365,0x00060006,
|
||||
0x00000022,0x00000000,0x6e696f70,0x7a695374,0x00000065,0x00060006,0x00000022,0x00000001,
|
||||
0x6e696f70,0x61635374,0x0000656c,0x00070006,0x00000022,0x00000002,0x506e696d,0x746e696f,
|
||||
0x657a6953,0x00000000,0x00070006,0x00000022,0x00000003,0x5078616d,0x746e696f,0x657a6953,
|
||||
0x00000000,0x00050006,0x00000022,0x00000004,0x5f747461,0x00000061,0x00050006,0x00000022,
|
||||
0x00000005,0x5f747461,0x00000062,0x00050006,0x00000022,0x00000006,0x5f747461,0x00000063,
|
||||
0x00030005,0x00000024,0x006f6275,0x00040005,0x00000051,0x6f6c6f63,0x00000072,0x00040005,
|
||||
0x00000053,0x6f436e69,0x00726f6c,0x00050048,0x00000008,0x00000000,0x0000000b,0x00000000,
|
||||
0x00050048,0x00000008,0x00000001,0x0000000b,0x00000001,0x00030047,0x00000008,0x00000002,
|
||||
0x00040048,0x0000000e,0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000,0x00000023,
|
||||
0x00000000,0x00050048,0x0000000e,0x00000000,0x00000007,0x00000010,0x00030047,0x0000000e,
|
||||
0x00000002,0x00040047,0x00000016,0x0000001e,0x00000000,0x00050048,0x00000022,0x00000000,
|
||||
0x00000023,0x00000000,0x00050048,0x00000022,0x00000001,0x00000023,0x00000004,0x00050048,
|
||||
0x00000022,0x00000002,0x00000023,0x00000008,0x00050048,0x00000022,0x00000003,0x00000023,
|
||||
0x0000000c,0x00050048,0x00000022,0x00000004,0x00000023,0x00000010,0x00050048,0x00000022,
|
||||
0x00000005,0x00000023,0x00000014,0x00050048,0x00000022,0x00000006,0x00000023,0x00000018,
|
||||
0x00030047,0x00000022,0x00000002,0x00040047,0x00000024,0x00000022,0x00000000,0x00040047,
|
||||
0x00000024,0x00000021,0x00000000,0x00040047,0x00000051,0x0000001e,0x00000000,0x00040047,
|
||||
0x00000053,0x0000001e,0x00000001,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,
|
||||
0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x0004001e,
|
||||
0x00000008,0x00000007,0x00000006,0x00040020,0x00000009,0x00000003,0x00000008,0x0004003b,
|
||||
0x00000009,0x0000000a,0x00000003,0x00040015,0x0000000b,0x00000020,0x00000001,0x0004002b,
|
||||
0x0000000b,0x0000000c,0x00000000,0x00040018,0x0000000d,0x00000007,0x00000004,0x0003001e,
|
||||
0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000009,0x0000000e,0x0004003b,0x0000000f,
|
||||
0x00000010,0x00000009,0x00040020,0x00000011,0x00000009,0x0000000d,0x00040017,0x00000014,
|
||||
0x00000006,0x00000003,0x00040020,0x00000015,0x00000001,0x00000014,0x0004003b,0x00000015,
|
||||
0x00000016,0x00000001,0x0004002b,0x00000006,0x00000018,0x3f800000,0x00040020,0x0000001e,
|
||||
0x00000003,0x00000007,0x00040020,0x00000020,0x00000007,0x00000006,0x0009001e,0x00000022,
|
||||
0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00040020,
|
||||
0x00000023,0x00000002,0x00000022,0x0004003b,0x00000023,0x00000024,0x00000002,0x0004002b,
|
||||
0x0000000b,0x00000025,0x00000001,0x00040020,0x00000026,0x00000002,0x00000006,0x0004002b,
|
||||
0x0000000b,0x00000029,0x00000004,0x0004002b,0x0000000b,0x0000002c,0x00000005,0x00040015,
|
||||
0x0000002f,0x00000020,0x00000000,0x0004002b,0x0000002f,0x00000030,0x00000003,0x00040020,
|
||||
0x00000031,0x00000003,0x00000006,0x0004002b,0x0000000b,0x00000036,0x00000006,0x0004002b,
|
||||
0x0000000b,0x00000049,0x00000002,0x0004002b,0x0000000b,0x0000004c,0x00000003,0x0004003b,
|
||||
0x0000001e,0x00000051,0x00000003,0x00040020,0x00000052,0x00000001,0x00000007,0x0004003b,
|
||||
0x00000052,0x00000053,0x00000001,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,
|
||||
0x000200f8,0x00000005,0x0004003b,0x00000020,0x00000021,0x00000007,0x00050041,0x00000011,
|
||||
0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,0x00000012,0x0004003d,
|
||||
0x00000014,0x00000017,0x00000016,0x00050051,0x00000006,0x00000019,0x00000017,0x00000000,
|
||||
0x00050051,0x00000006,0x0000001a,0x00000017,0x00000001,0x00050051,0x00000006,0x0000001b,
|
||||
0x00000017,0x00000002,0x00070050,0x00000007,0x0000001c,0x00000019,0x0000001a,0x0000001b,
|
||||
0x00000018,0x00050091,0x00000007,0x0000001d,0x00000013,0x0000001c,0x00050041,0x0000001e,
|
||||
0x0000001f,0x0000000a,0x0000000c,0x0003003e,0x0000001f,0x0000001d,0x00050041,0x00000026,
|
||||
0x00000027,0x00000024,0x00000025,0x0004003d,0x00000006,0x00000028,0x00000027,0x00050041,
|
||||
0x00000026,0x0000002a,0x00000024,0x00000029,0x0004003d,0x00000006,0x0000002b,0x0000002a,
|
||||
0x00050041,0x00000026,0x0000002d,0x00000024,0x0000002c,0x0004003d,0x00000006,0x0000002e,
|
||||
0x0000002d,0x00060041,0x00000031,0x00000032,0x0000000a,0x0000000c,0x00000030,0x0004003d,
|
||||
0x00000006,0x00000033,0x00000032,0x00050085,0x00000006,0x00000034,0x0000002e,0x00000033,
|
||||
0x00050081,0x00000006,0x00000035,0x0000002b,0x00000034,0x00050041,0x00000026,0x00000037,
|
||||
0x00000024,0x00000036,0x0004003d,0x00000006,0x00000038,0x00000037,0x00060041,0x00000031,
|
||||
0x00000039,0x0000000a,0x0000000c,0x00000030,0x0004003d,0x00000006,0x0000003a,0x00000039,
|
||||
0x00050085,0x00000006,0x0000003b,0x00000038,0x0000003a,0x00060041,0x00000031,0x0000003c,
|
||||
0x0000000a,0x0000000c,0x00000030,0x0004003d,0x00000006,0x0000003d,0x0000003c,0x00050085,
|
||||
0x00000006,0x0000003e,0x0000003b,0x0000003d,0x00050081,0x00000006,0x0000003f,0x00000035,
|
||||
0x0000003e,0x00050088,0x00000006,0x00000040,0x00000028,0x0000003f,0x0003003e,0x00000021,
|
||||
0x00000040,0x00050041,0x00000026,0x00000041,0x00000024,0x00000025,0x0004003d,0x00000006,
|
||||
0x00000042,0x00000041,0x00050041,0x00000026,0x00000043,0x00000024,0x0000000c,0x0004003d,
|
||||
0x00000006,0x00000044,0x00000043,0x00050085,0x00000006,0x00000045,0x00000042,0x00000044,
|
||||
0x0004003d,0x00000006,0x00000046,0x00000021,0x0006000c,0x00000006,0x00000047,0x00000001,
|
||||
0x0000001f,0x00000046,0x00050085,0x00000006,0x00000048,0x00000045,0x00000047,0x00050041,
|
||||
0x00000026,0x0000004a,0x00000024,0x00000049,0x0004003d,0x00000006,0x0000004b,0x0000004a,
|
||||
0x00050041,0x00000026,0x0000004d,0x00000024,0x0000004c,0x0004003d,0x00000006,0x0000004e,
|
||||
0x0000004d,0x0008000c,0x00000006,0x0000004f,0x00000001,0x0000002b,0x00000048,0x0000004b,
|
||||
0x0000004e,0x00050041,0x00000031,0x00000050,0x0000000a,0x00000025,0x0003003e,0x00000050,
|
||||
0x0000004f,0x0004003d,0x00000007,0x00000054,0x00000053,0x0003003e,0x00000051,0x00000054,
|
||||
0x000100fd,0x00010038
|
||||
};
|
|
@ -1,40 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t polygon_lmap_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000029,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000011,0x00000017,0x0000001b,
|
||||
0x0000001e,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00040005,0x00000009,0x6f6c6f63,0x00000072,0x00050005,
|
||||
0x0000000d,0x78655473,0x65727574,0x00000000,0x00050005,0x00000011,0x43786574,0x64726f6f,
|
||||
0x00000000,0x00040005,0x00000014,0x6867696c,0x00000074,0x00050005,0x00000015,0x67694c73,
|
||||
0x616d7468,0x00000070,0x00060005,0x00000017,0x43786574,0x64726f6f,0x70616d4c,0x00000000,
|
||||
0x00060005,0x0000001b,0x67617266,0x746e656d,0x6f6c6f43,0x00000072,0x00060005,0x0000001e,
|
||||
0x77656976,0x6867694c,0x70616d74,0x00000073,0x00040047,0x0000000d,0x00000022,0x00000000,
|
||||
0x00040047,0x0000000d,0x00000021,0x00000000,0x00040047,0x00000011,0x0000001e,0x00000000,
|
||||
0x00040047,0x00000015,0x00000022,0x00000002,0x00040047,0x00000015,0x00000021,0x00000000,
|
||||
0x00040047,0x00000017,0x0000001e,0x00000001,0x00040047,0x0000001b,0x0000001e,0x00000000,
|
||||
0x00040047,0x0000001e,0x0000001e,0x00000002,0x00020013,0x00000002,0x00030021,0x00000003,
|
||||
0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,
|
||||
0x00040020,0x00000008,0x00000007,0x00000007,0x00090019,0x0000000a,0x00000006,0x00000001,
|
||||
0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a,
|
||||
0x00040020,0x0000000c,0x00000000,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000000,
|
||||
0x00040017,0x0000000f,0x00000006,0x00000002,0x00040020,0x00000010,0x00000001,0x0000000f,
|
||||
0x0004003b,0x00000010,0x00000011,0x00000001,0x0004003b,0x0000000c,0x00000015,0x00000000,
|
||||
0x0004003b,0x00000010,0x00000017,0x00000001,0x00040020,0x0000001a,0x00000003,0x00000007,
|
||||
0x0004003b,0x0000001a,0x0000001b,0x00000003,0x0004002b,0x00000006,0x0000001c,0x3f800000,
|
||||
0x00040020,0x0000001d,0x00000001,0x00000006,0x0004003b,0x0000001d,0x0000001e,0x00000001,
|
||||
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,
|
||||
0x00000008,0x00000009,0x00000007,0x0004003b,0x00000008,0x00000014,0x00000007,0x0004003d,
|
||||
0x0000000b,0x0000000e,0x0000000d,0x0004003d,0x0000000f,0x00000012,0x00000011,0x00050057,
|
||||
0x00000007,0x00000013,0x0000000e,0x00000012,0x0003003e,0x00000009,0x00000013,0x0004003d,
|
||||
0x0000000b,0x00000016,0x00000015,0x0004003d,0x0000000f,0x00000018,0x00000017,0x00050057,
|
||||
0x00000007,0x00000019,0x00000016,0x00000018,0x0003003e,0x00000014,0x00000019,0x0004003d,
|
||||
0x00000006,0x0000001f,0x0000001e,0x00050083,0x00000006,0x00000020,0x0000001c,0x0000001f,
|
||||
0x0004003d,0x00000007,0x00000021,0x00000009,0x0005008e,0x00000007,0x00000022,0x00000021,
|
||||
0x00000020,0x0004003d,0x00000007,0x00000023,0x00000014,0x00050085,0x00000007,0x00000024,
|
||||
0x00000022,0x00000023,0x0004003d,0x00000006,0x00000025,0x0000001e,0x0004003d,0x00000007,
|
||||
0x00000026,0x00000014,0x0005008e,0x00000007,0x00000027,0x00000026,0x00000025,0x00050081,
|
||||
0x00000007,0x00000028,0x00000024,0x00000027,0x0003003e,0x0000001b,0x00000028,0x000100fd,
|
||||
0x00010038
|
||||
};
|
|
@ -1,59 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t polygon_lmap_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000036,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029,
|
||||
0x0000002b,0x0000002d,0x0000002e,0x00000031,0x00030003,0x00000002,0x000001c2,0x00090004,
|
||||
0x415f4c47,0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,
|
||||
0x00040005,0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,
|
||||
0x78657472,0x00000000,0x00060006,0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,
|
||||
0x00030005,0x0000000a,0x00000000,0x00060005,0x0000000e,0x68737550,0x736e6f43,0x746e6174,
|
||||
0x00000000,0x00060006,0x0000000e,0x00000000,0x614d7076,0x78697274,0x00000000,0x00030005,
|
||||
0x00000010,0x00006370,0x00070005,0x00000014,0x66696e55,0x426d726f,0x65666675,0x6a624f72,
|
||||
0x00746365,0x00050006,0x00000014,0x00000000,0x65646f6d,0x0000006c,0x00070006,0x00000014,
|
||||
0x00000001,0x77656976,0x6867694c,0x70616d74,0x00000073,0x00030005,0x00000016,0x006f6275,
|
||||
0x00050005,0x0000001d,0x65566e69,0x78657472,0x00000000,0x00050005,0x00000029,0x43786574,
|
||||
0x64726f6f,0x00000000,0x00050005,0x0000002b,0x65546e69,0x6f6f4378,0x00006472,0x00060005,
|
||||
0x0000002d,0x43786574,0x64726f6f,0x70616d4c,0x00000000,0x00060005,0x0000002e,0x65546e69,
|
||||
0x6f6f4378,0x6d4c6472,0x00007061,0x00060005,0x00000031,0x77656976,0x6867694c,0x70616d74,
|
||||
0x00000073,0x00050048,0x00000008,0x00000000,0x0000000b,0x00000000,0x00030047,0x00000008,
|
||||
0x00000002,0x00040048,0x0000000e,0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000,
|
||||
0x00000023,0x00000000,0x00050048,0x0000000e,0x00000000,0x00000007,0x00000010,0x00030047,
|
||||
0x0000000e,0x00000002,0x00040048,0x00000014,0x00000000,0x00000005,0x00050048,0x00000014,
|
||||
0x00000000,0x00000023,0x00000000,0x00050048,0x00000014,0x00000000,0x00000007,0x00000010,
|
||||
0x00050048,0x00000014,0x00000001,0x00000023,0x00000040,0x00030047,0x00000014,0x00000002,
|
||||
0x00040047,0x00000016,0x00000022,0x00000001,0x00040047,0x00000016,0x00000021,0x00000000,
|
||||
0x00040047,0x0000001d,0x0000001e,0x00000000,0x00040047,0x00000029,0x0000001e,0x00000000,
|
||||
0x00040047,0x0000002b,0x0000001e,0x00000001,0x00040047,0x0000002d,0x0000001e,0x00000001,
|
||||
0x00040047,0x0000002e,0x0000001e,0x00000002,0x00040047,0x00000031,0x0000001e,0x00000002,
|
||||
0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,
|
||||
0x00040017,0x00000007,0x00000006,0x00000004,0x0003001e,0x00000008,0x00000007,0x00040020,
|
||||
0x00000009,0x00000003,0x00000008,0x0004003b,0x00000009,0x0000000a,0x00000003,0x00040015,
|
||||
0x0000000b,0x00000020,0x00000001,0x0004002b,0x0000000b,0x0000000c,0x00000000,0x00040018,
|
||||
0x0000000d,0x00000007,0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,
|
||||
0x00000009,0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000009,0x00040020,0x00000011,
|
||||
0x00000009,0x0000000d,0x0004001e,0x00000014,0x0000000d,0x00000006,0x00040020,0x00000015,
|
||||
0x00000002,0x00000014,0x0004003b,0x00000015,0x00000016,0x00000002,0x00040020,0x00000017,
|
||||
0x00000002,0x0000000d,0x00040017,0x0000001b,0x00000006,0x00000003,0x00040020,0x0000001c,
|
||||
0x00000001,0x0000001b,0x0004003b,0x0000001c,0x0000001d,0x00000001,0x0004002b,0x00000006,
|
||||
0x0000001f,0x3f800000,0x00040020,0x00000025,0x00000003,0x00000007,0x00040017,0x00000027,
|
||||
0x00000006,0x00000002,0x00040020,0x00000028,0x00000003,0x00000027,0x0004003b,0x00000028,
|
||||
0x00000029,0x00000003,0x00040020,0x0000002a,0x00000001,0x00000027,0x0004003b,0x0000002a,
|
||||
0x0000002b,0x00000001,0x0004003b,0x00000028,0x0000002d,0x00000003,0x0004003b,0x0000002a,
|
||||
0x0000002e,0x00000001,0x00040020,0x00000030,0x00000003,0x00000006,0x0004003b,0x00000030,
|
||||
0x00000031,0x00000003,0x0004002b,0x0000000b,0x00000032,0x00000001,0x00040020,0x00000033,
|
||||
0x00000002,0x00000006,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,
|
||||
0x00000005,0x00050041,0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d,
|
||||
0x00000013,0x00000012,0x00050041,0x00000017,0x00000018,0x00000016,0x0000000c,0x0004003d,
|
||||
0x0000000d,0x00000019,0x00000018,0x00050092,0x0000000d,0x0000001a,0x00000013,0x00000019,
|
||||
0x0004003d,0x0000001b,0x0000001e,0x0000001d,0x00050051,0x00000006,0x00000020,0x0000001e,
|
||||
0x00000000,0x00050051,0x00000006,0x00000021,0x0000001e,0x00000001,0x00050051,0x00000006,
|
||||
0x00000022,0x0000001e,0x00000002,0x00070050,0x00000007,0x00000023,0x00000020,0x00000021,
|
||||
0x00000022,0x0000001f,0x00050091,0x00000007,0x00000024,0x0000001a,0x00000023,0x00050041,
|
||||
0x00000025,0x00000026,0x0000000a,0x0000000c,0x0003003e,0x00000026,0x00000024,0x0004003d,
|
||||
0x00000027,0x0000002c,0x0000002b,0x0003003e,0x00000029,0x0000002c,0x0004003d,0x00000027,
|
||||
0x0000002f,0x0000002e,0x0003003e,0x0000002d,0x0000002f,0x00050041,0x00000033,0x00000034,
|
||||
0x00000016,0x00000032,0x0004003d,0x00000006,0x00000035,0x00000034,0x0003003e,0x00000031,
|
||||
0x00000035,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,51 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t polygon_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000030,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000022,
|
||||
0x00000024,0x00000026,0x0000002e,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,
|
||||
0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,0x78657472,
|
||||
0x00000000,0x00060006,0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,
|
||||
0x0000000a,0x00000000,0x00060005,0x0000000e,0x68737550,0x736e6f43,0x746e6174,0x00000000,
|
||||
0x00060006,0x0000000e,0x00000000,0x4d70766d,0x69727461,0x00000078,0x00030005,0x00000010,
|
||||
0x00006370,0x00050005,0x00000016,0x65566e69,0x78657472,0x00000000,0x00050005,0x00000022,
|
||||
0x43786574,0x64726f6f,0x00000000,0x00050005,0x00000024,0x65546e69,0x6f6f4378,0x00006472,
|
||||
0x00040005,0x00000026,0x6f6c6f63,0x00000072,0x00070005,0x00000027,0x66696e55,0x426d726f,
|
||||
0x65666675,0x6a624f72,0x00746365,0x00050006,0x00000027,0x00000000,0x6f6c6f63,0x00000072,
|
||||
0x00030005,0x00000029,0x006f6275,0x00050005,0x0000002e,0x65725461,0x6c6f6873,0x00000064,
|
||||
0x00050048,0x00000008,0x00000000,0x0000000b,0x00000000,0x00030047,0x00000008,0x00000002,
|
||||
0x00040048,0x0000000e,0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000,0x00000023,
|
||||
0x00000000,0x00050048,0x0000000e,0x00000000,0x00000007,0x00000010,0x00030047,0x0000000e,
|
||||
0x00000002,0x00040047,0x00000016,0x0000001e,0x00000000,0x00040047,0x00000022,0x0000001e,
|
||||
0x00000000,0x00040047,0x00000024,0x0000001e,0x00000001,0x00040047,0x00000026,0x0000001e,
|
||||
0x00000001,0x00050048,0x00000027,0x00000000,0x00000023,0x00000000,0x00030047,0x00000027,
|
||||
0x00000002,0x00040047,0x00000029,0x00000022,0x00000001,0x00040047,0x00000029,0x00000021,
|
||||
0x00000000,0x00040047,0x0000002e,0x0000001e,0x00000002,0x00020013,0x00000002,0x00030021,
|
||||
0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,
|
||||
0x00000004,0x0003001e,0x00000008,0x00000007,0x00040020,0x00000009,0x00000003,0x00000008,
|
||||
0x0004003b,0x00000009,0x0000000a,0x00000003,0x00040015,0x0000000b,0x00000020,0x00000001,
|
||||
0x0004002b,0x0000000b,0x0000000c,0x00000000,0x00040018,0x0000000d,0x00000007,0x00000004,
|
||||
0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000009,0x0000000e,0x0004003b,
|
||||
0x0000000f,0x00000010,0x00000009,0x00040020,0x00000011,0x00000009,0x0000000d,0x00040017,
|
||||
0x00000014,0x00000006,0x00000003,0x00040020,0x00000015,0x00000001,0x00000014,0x0004003b,
|
||||
0x00000015,0x00000016,0x00000001,0x0004002b,0x00000006,0x00000018,0x3f800000,0x00040020,
|
||||
0x0000001e,0x00000003,0x00000007,0x00040017,0x00000020,0x00000006,0x00000002,0x00040020,
|
||||
0x00000021,0x00000003,0x00000020,0x0004003b,0x00000021,0x00000022,0x00000003,0x00040020,
|
||||
0x00000023,0x00000001,0x00000020,0x0004003b,0x00000023,0x00000024,0x00000001,0x0004003b,
|
||||
0x0000001e,0x00000026,0x00000003,0x0003001e,0x00000027,0x00000007,0x00040020,0x00000028,
|
||||
0x00000002,0x00000027,0x0004003b,0x00000028,0x00000029,0x00000002,0x00040020,0x0000002a,
|
||||
0x00000002,0x00000007,0x00040020,0x0000002d,0x00000003,0x00000006,0x0004003b,0x0000002d,
|
||||
0x0000002e,0x00000003,0x0004002b,0x00000006,0x0000002f,0x00000000,0x00050036,0x00000002,
|
||||
0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,0x00000011,0x00000012,
|
||||
0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,0x00000012,0x0004003d,0x00000014,
|
||||
0x00000017,0x00000016,0x00050051,0x00000006,0x00000019,0x00000017,0x00000000,0x00050051,
|
||||
0x00000006,0x0000001a,0x00000017,0x00000001,0x00050051,0x00000006,0x0000001b,0x00000017,
|
||||
0x00000002,0x00070050,0x00000007,0x0000001c,0x00000019,0x0000001a,0x0000001b,0x00000018,
|
||||
0x00050091,0x00000007,0x0000001d,0x00000013,0x0000001c,0x00050041,0x0000001e,0x0000001f,
|
||||
0x0000000a,0x0000000c,0x0003003e,0x0000001f,0x0000001d,0x0004003d,0x00000020,0x00000025,
|
||||
0x00000024,0x0003003e,0x00000022,0x00000025,0x00050041,0x0000002a,0x0000002b,0x00000029,
|
||||
0x0000000c,0x0004003d,0x00000007,0x0000002c,0x0000002b,0x0003003e,0x00000026,0x0000002c,
|
||||
0x0003003e,0x0000002e,0x0000002f,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,80 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t polygon_warp_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000058,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029,
|
||||
0x0000002b,0x00000051,0x00000056,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,
|
||||
0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,0x78657472,
|
||||
0x00000000,0x00060006,0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,
|
||||
0x0000000a,0x00000000,0x00060005,0x0000000e,0x68737550,0x736e6f43,0x746e6174,0x00000000,
|
||||
0x00060006,0x0000000e,0x00000000,0x614d7076,0x78697274,0x00000000,0x00030005,0x00000010,
|
||||
0x00006370,0x00070005,0x00000014,0x66696e55,0x426d726f,0x65666675,0x6a624f72,0x00746365,
|
||||
0x00050006,0x00000014,0x00000000,0x65646f6d,0x0000006c,0x00050006,0x00000014,0x00000001,
|
||||
0x6f6c6f63,0x00000072,0x00050006,0x00000014,0x00000002,0x656d6974,0x00000000,0x00050006,
|
||||
0x00000014,0x00000003,0x6f726373,0x00006c6c,0x00030005,0x00000016,0x006f6275,0x00050005,
|
||||
0x0000001d,0x65566e69,0x78657472,0x00000000,0x00050005,0x00000029,0x43786574,0x64726f6f,
|
||||
0x00000000,0x00050005,0x0000002b,0x65546e69,0x6f6f4378,0x00006472,0x00040005,0x00000051,
|
||||
0x6f6c6f63,0x00000072,0x00050005,0x00000056,0x65725461,0x6c6f6873,0x00000064,0x00050048,
|
||||
0x00000008,0x00000000,0x0000000b,0x00000000,0x00030047,0x00000008,0x00000002,0x00040048,
|
||||
0x0000000e,0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000,0x00000023,0x00000000,
|
||||
0x00050048,0x0000000e,0x00000000,0x00000007,0x00000010,0x00030047,0x0000000e,0x00000002,
|
||||
0x00040048,0x00000014,0x00000000,0x00000005,0x00050048,0x00000014,0x00000000,0x00000023,
|
||||
0x00000000,0x00050048,0x00000014,0x00000000,0x00000007,0x00000010,0x00050048,0x00000014,
|
||||
0x00000001,0x00000023,0x00000040,0x00050048,0x00000014,0x00000002,0x00000023,0x00000050,
|
||||
0x00050048,0x00000014,0x00000003,0x00000023,0x00000054,0x00030047,0x00000014,0x00000002,
|
||||
0x00040047,0x00000016,0x00000022,0x00000001,0x00040047,0x00000016,0x00000021,0x00000000,
|
||||
0x00040047,0x0000001d,0x0000001e,0x00000000,0x00040047,0x00000029,0x0000001e,0x00000000,
|
||||
0x00040047,0x0000002b,0x0000001e,0x00000001,0x00040047,0x00000051,0x0000001e,0x00000001,
|
||||
0x00040047,0x00000056,0x0000001e,0x00000002,0x00020013,0x00000002,0x00030021,0x00000003,
|
||||
0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,
|
||||
0x0003001e,0x00000008,0x00000007,0x00040020,0x00000009,0x00000003,0x00000008,0x0004003b,
|
||||
0x00000009,0x0000000a,0x00000003,0x00040015,0x0000000b,0x00000020,0x00000001,0x0004002b,
|
||||
0x0000000b,0x0000000c,0x00000000,0x00040018,0x0000000d,0x00000007,0x00000004,0x0003001e,
|
||||
0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000009,0x0000000e,0x0004003b,0x0000000f,
|
||||
0x00000010,0x00000009,0x00040020,0x00000011,0x00000009,0x0000000d,0x0006001e,0x00000014,
|
||||
0x0000000d,0x00000007,0x00000006,0x00000006,0x00040020,0x00000015,0x00000002,0x00000014,
|
||||
0x0004003b,0x00000015,0x00000016,0x00000002,0x00040020,0x00000017,0x00000002,0x0000000d,
|
||||
0x00040017,0x0000001b,0x00000006,0x00000003,0x00040020,0x0000001c,0x00000001,0x0000001b,
|
||||
0x0004003b,0x0000001c,0x0000001d,0x00000001,0x0004002b,0x00000006,0x0000001f,0x3f800000,
|
||||
0x00040020,0x00000025,0x00000003,0x00000007,0x00040017,0x00000027,0x00000006,0x00000002,
|
||||
0x00040020,0x00000028,0x00000003,0x00000027,0x0004003b,0x00000028,0x00000029,0x00000003,
|
||||
0x00040020,0x0000002a,0x00000001,0x00000027,0x0004003b,0x0000002a,0x0000002b,0x00000001,
|
||||
0x0004002b,0x00000006,0x0000002d,0x40000000,0x0004002b,0x0000000b,0x0000002e,0x00000002,
|
||||
0x00040020,0x0000002f,0x00000002,0x00000006,0x00040015,0x00000033,0x00000020,0x00000000,
|
||||
0x0004002b,0x00000033,0x00000034,0x00000001,0x00040020,0x00000035,0x00000001,0x00000006,
|
||||
0x0004002b,0x00000006,0x00000038,0x4051eb85,0x0004002b,0x00000033,0x0000003f,0x00000000,
|
||||
0x0004002b,0x00000006,0x00000046,0x3d4ccccd,0x0004002b,0x0000000b,0x00000049,0x00000003,
|
||||
0x00040020,0x0000004c,0x00000003,0x00000006,0x0004003b,0x00000025,0x00000051,0x00000003,
|
||||
0x0004002b,0x0000000b,0x00000052,0x00000001,0x00040020,0x00000053,0x00000002,0x00000007,
|
||||
0x0004003b,0x0000004c,0x00000056,0x00000003,0x0004002b,0x00000006,0x00000057,0x00000000,
|
||||
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,
|
||||
0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,0x00000012,
|
||||
0x00050041,0x00000017,0x00000018,0x00000016,0x0000000c,0x0004003d,0x0000000d,0x00000019,
|
||||
0x00000018,0x00050092,0x0000000d,0x0000001a,0x00000013,0x00000019,0x0004003d,0x0000001b,
|
||||
0x0000001e,0x0000001d,0x00050051,0x00000006,0x00000020,0x0000001e,0x00000000,0x00050051,
|
||||
0x00000006,0x00000021,0x0000001e,0x00000001,0x00050051,0x00000006,0x00000022,0x0000001e,
|
||||
0x00000002,0x00070050,0x00000007,0x00000023,0x00000020,0x00000021,0x00000022,0x0000001f,
|
||||
0x00050091,0x00000007,0x00000024,0x0000001a,0x00000023,0x00050041,0x00000025,0x00000026,
|
||||
0x0000000a,0x0000000c,0x0003003e,0x00000026,0x00000024,0x0004003d,0x00000027,0x0000002c,
|
||||
0x0000002b,0x00050041,0x0000002f,0x00000030,0x00000016,0x0000002e,0x0004003d,0x00000006,
|
||||
0x00000031,0x00000030,0x00050085,0x00000006,0x00000032,0x0000002d,0x00000031,0x00050041,
|
||||
0x00000035,0x00000036,0x0000002b,0x00000034,0x0004003d,0x00000006,0x00000037,0x00000036,
|
||||
0x00050085,0x00000006,0x00000039,0x00000037,0x00000038,0x00050081,0x00000006,0x0000003a,
|
||||
0x00000032,0x00000039,0x0006000c,0x00000006,0x0000003b,0x00000001,0x0000000d,0x0000003a,
|
||||
0x00050041,0x0000002f,0x0000003c,0x00000016,0x0000002e,0x0004003d,0x00000006,0x0000003d,
|
||||
0x0000003c,0x00050085,0x00000006,0x0000003e,0x0000002d,0x0000003d,0x00050041,0x00000035,
|
||||
0x00000040,0x0000002b,0x0000003f,0x0004003d,0x00000006,0x00000041,0x00000040,0x00050085,
|
||||
0x00000006,0x00000042,0x00000041,0x00000038,0x00050081,0x00000006,0x00000043,0x0000003e,
|
||||
0x00000042,0x0006000c,0x00000006,0x00000044,0x00000001,0x0000000d,0x00000043,0x00050050,
|
||||
0x00000027,0x00000045,0x0000003b,0x00000044,0x0005008e,0x00000027,0x00000047,0x00000045,
|
||||
0x00000046,0x00050081,0x00000027,0x00000048,0x0000002c,0x00000047,0x0003003e,0x00000029,
|
||||
0x00000048,0x00050041,0x0000002f,0x0000004a,0x00000016,0x00000049,0x0004003d,0x00000006,
|
||||
0x0000004b,0x0000004a,0x00050041,0x0000004c,0x0000004d,0x00000029,0x0000003f,0x0004003d,
|
||||
0x00000006,0x0000004e,0x0000004d,0x00050081,0x00000006,0x0000004f,0x0000004e,0x0000004b,
|
||||
0x00050041,0x0000004c,0x00000050,0x00000029,0x0000003f,0x0003003e,0x00000050,0x0000004f,
|
||||
0x00050041,0x00000053,0x00000054,0x00000016,0x00000052,0x0004003d,0x00000007,0x00000055,
|
||||
0x00000054,0x0003003e,0x00000051,0x00000055,0x0003003e,0x00000056,0x00000057,0x000100fd,
|
||||
0x00010038
|
||||
};
|
|
@ -1,64 +0,0 @@
|
|||
// 1011.0.0
|
||||
#pragma once
|
||||
const uint32_t postprocess_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x0008000a,0x00000046,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000002c,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,
|
||||
0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,
|
||||
0x6e69616d,0x00000000,0x00060005,0x00000009,0x6f6e6e75,0x65546d72,0x6f6f4378,0x00006472,
|
||||
0x00050005,0x0000000b,0x43786574,0x64726f6f,0x00000000,0x00060005,0x0000000d,0x68737550,
|
||||
0x736e6f43,0x746e6174,0x00000000,0x00060006,0x0000000d,0x00000000,0x74736f70,0x636f7270,
|
||||
0x00737365,0x00050006,0x0000000d,0x00000001,0x6d6d6167,0x00000061,0x00060006,0x0000000d,
|
||||
0x00000002,0x57726373,0x68746469,0x00000000,0x00060006,0x0000000d,0x00000003,0x48726373,
|
||||
0x68676965,0x00000074,0x00050006,0x0000000d,0x00000004,0x7366666f,0x00587465,0x00050006,
|
||||
0x0000000d,0x00000005,0x7366666f,0x00597465,0x00030005,0x0000000f,0x00006370,0x00060005,
|
||||
0x0000002c,0x67617266,0x746e656d,0x6f6c6f43,0x00000072,0x00050005,0x00000030,0x78655473,
|
||||
0x65727574,0x00000000,0x00040047,0x0000000b,0x0000001e,0x00000000,0x00050048,0x0000000d,
|
||||
0x00000000,0x00000023,0x00000044,0x00050048,0x0000000d,0x00000001,0x00000023,0x00000048,
|
||||
0x00050048,0x0000000d,0x00000002,0x00000023,0x0000004c,0x00050048,0x0000000d,0x00000003,
|
||||
0x00000023,0x00000050,0x00050048,0x0000000d,0x00000004,0x00000023,0x00000054,0x00050048,
|
||||
0x0000000d,0x00000005,0x00000023,0x00000058,0x00030047,0x0000000d,0x00000002,0x00040047,
|
||||
0x0000002c,0x0000001e,0x00000000,0x00040047,0x00000030,0x00000022,0x00000000,0x00040047,
|
||||
0x00000030,0x00000021,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,
|
||||
0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,
|
||||
0x00000008,0x00000007,0x00000007,0x00040020,0x0000000a,0x00000001,0x00000007,0x0004003b,
|
||||
0x0000000a,0x0000000b,0x00000001,0x0008001e,0x0000000d,0x00000006,0x00000006,0x00000006,
|
||||
0x00000006,0x00000006,0x00000006,0x00040020,0x0000000e,0x00000009,0x0000000d,0x0004003b,
|
||||
0x0000000e,0x0000000f,0x00000009,0x00040015,0x00000010,0x00000020,0x00000001,0x0004002b,
|
||||
0x00000010,0x00000011,0x00000002,0x00040020,0x00000012,0x00000009,0x00000006,0x0004002b,
|
||||
0x00000010,0x00000015,0x00000003,0x0004002b,0x00000010,0x0000001a,0x00000004,0x0004002b,
|
||||
0x00000010,0x0000001d,0x00000005,0x0004002b,0x00000010,0x00000022,0x00000000,0x0004002b,
|
||||
0x00000006,0x00000025,0x00000000,0x00020014,0x00000026,0x00040017,0x0000002a,0x00000006,
|
||||
0x00000004,0x00040020,0x0000002b,0x00000003,0x0000002a,0x0004003b,0x0000002b,0x0000002c,
|
||||
0x00000003,0x00090019,0x0000002d,0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,
|
||||
0x00000001,0x00000000,0x0003001b,0x0000002e,0x0000002d,0x00040020,0x0000002f,0x00000000,
|
||||
0x0000002e,0x0004003b,0x0000002f,0x00000030,0x00000000,0x00040017,0x00000034,0x00000006,
|
||||
0x00000003,0x0004002b,0x00000006,0x00000036,0x3fc00000,0x0004002b,0x00000010,0x00000038,
|
||||
0x00000001,0x0004002b,0x00000006,0x0000003d,0x3f800000,0x00050036,0x00000002,0x00000004,
|
||||
0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,0x00000009,0x00000007,
|
||||
0x0004003d,0x00000007,0x0000000c,0x0000000b,0x00050041,0x00000012,0x00000013,0x0000000f,
|
||||
0x00000011,0x0004003d,0x00000006,0x00000014,0x00000013,0x00050041,0x00000012,0x00000016,
|
||||
0x0000000f,0x00000015,0x0004003d,0x00000006,0x00000017,0x00000016,0x00050050,0x00000007,
|
||||
0x00000018,0x00000014,0x00000017,0x00050085,0x00000007,0x00000019,0x0000000c,0x00000018,
|
||||
0x00050041,0x00000012,0x0000001b,0x0000000f,0x0000001a,0x0004003d,0x00000006,0x0000001c,
|
||||
0x0000001b,0x00050041,0x00000012,0x0000001e,0x0000000f,0x0000001d,0x0004003d,0x00000006,
|
||||
0x0000001f,0x0000001e,0x00050050,0x00000007,0x00000020,0x0000001c,0x0000001f,0x00050081,
|
||||
0x00000007,0x00000021,0x00000019,0x00000020,0x0003003e,0x00000009,0x00000021,0x00050041,
|
||||
0x00000012,0x00000023,0x0000000f,0x00000022,0x0004003d,0x00000006,0x00000024,0x00000023,
|
||||
0x000500ba,0x00000026,0x00000027,0x00000024,0x00000025,0x000300f7,0x00000029,0x00000000,
|
||||
0x000400fa,0x00000027,0x00000028,0x00000042,0x000200f8,0x00000028,0x0004003d,0x0000002e,
|
||||
0x00000031,0x00000030,0x0004003d,0x00000007,0x00000032,0x00000009,0x00070058,0x0000002a,
|
||||
0x00000033,0x00000031,0x00000032,0x00000002,0x00000025,0x0008004f,0x00000034,0x00000035,
|
||||
0x00000033,0x00000033,0x00000000,0x00000001,0x00000002,0x0005008e,0x00000034,0x00000037,
|
||||
0x00000035,0x00000036,0x00050041,0x00000012,0x00000039,0x0000000f,0x00000038,0x0004003d,
|
||||
0x00000006,0x0000003a,0x00000039,0x00060050,0x00000034,0x0000003b,0x0000003a,0x0000003a,
|
||||
0x0000003a,0x0007000c,0x00000034,0x0000003c,0x00000001,0x0000001a,0x00000037,0x0000003b,
|
||||
0x00050051,0x00000006,0x0000003e,0x0000003c,0x00000000,0x00050051,0x00000006,0x0000003f,
|
||||
0x0000003c,0x00000001,0x00050051,0x00000006,0x00000040,0x0000003c,0x00000002,0x00070050,
|
||||
0x0000002a,0x00000041,0x0000003e,0x0000003f,0x00000040,0x0000003d,0x0003003e,0x0000002c,
|
||||
0x00000041,0x000200f9,0x00000029,0x000200f8,0x00000042,0x0004003d,0x0000002e,0x00000043,
|
||||
0x00000030,0x0004003d,0x00000007,0x00000044,0x00000009,0x00070058,0x0000002a,0x00000045,
|
||||
0x00000043,0x00000044,0x00000002,0x00000025,0x0003003e,0x0000002c,0x00000045,0x000200f9,
|
||||
0x00000029,0x000200f8,0x00000029,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,36 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t postprocess_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000029,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000c,0x0000001a,
|
||||
0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,
|
||||
0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,0x6e69616d,0x00000000,
|
||||
0x00050005,0x00000009,0x43786574,0x64726f6f,0x00000000,0x00060005,0x0000000c,0x565f6c67,
|
||||
0x65747265,0x646e4978,0x00007865,0x00060005,0x00000018,0x505f6c67,0x65567265,0x78657472,
|
||||
0x00000000,0x00060006,0x00000018,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,
|
||||
0x0000001a,0x00000000,0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000c,
|
||||
0x0000000b,0x0000002a,0x00050048,0x00000018,0x00000000,0x0000000b,0x00000000,0x00030047,
|
||||
0x00000018,0x00000002,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,
|
||||
0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,
|
||||
0x00000003,0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003,0x00040015,0x0000000a,
|
||||
0x00000020,0x00000001,0x00040020,0x0000000b,0x00000001,0x0000000a,0x0004003b,0x0000000b,
|
||||
0x0000000c,0x00000001,0x0004002b,0x0000000a,0x0000000e,0x00000001,0x0004002b,0x0000000a,
|
||||
0x00000010,0x00000002,0x00040017,0x00000017,0x00000006,0x00000004,0x0003001e,0x00000018,
|
||||
0x00000017,0x00040020,0x00000019,0x00000003,0x00000018,0x0004003b,0x00000019,0x0000001a,
|
||||
0x00000003,0x0004002b,0x0000000a,0x0000001b,0x00000000,0x0004002b,0x00000006,0x0000001d,
|
||||
0x40000000,0x0004002b,0x00000006,0x0000001f,0xbf800000,0x0004002b,0x00000006,0x00000022,
|
||||
0x00000000,0x0004002b,0x00000006,0x00000023,0x3f800000,0x00040020,0x00000027,0x00000003,
|
||||
0x00000017,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,
|
||||
0x0004003d,0x0000000a,0x0000000d,0x0000000c,0x000500c4,0x0000000a,0x0000000f,0x0000000d,
|
||||
0x0000000e,0x000500c7,0x0000000a,0x00000011,0x0000000f,0x00000010,0x0004006f,0x00000006,
|
||||
0x00000012,0x00000011,0x0004003d,0x0000000a,0x00000013,0x0000000c,0x000500c7,0x0000000a,
|
||||
0x00000014,0x00000013,0x00000010,0x0004006f,0x00000006,0x00000015,0x00000014,0x00050050,
|
||||
0x00000007,0x00000016,0x00000012,0x00000015,0x0003003e,0x00000009,0x00000016,0x0004003d,
|
||||
0x00000007,0x0000001c,0x00000009,0x0005008e,0x00000007,0x0000001e,0x0000001c,0x0000001d,
|
||||
0x00050050,0x00000007,0x00000020,0x0000001f,0x0000001f,0x00050081,0x00000007,0x00000021,
|
||||
0x0000001e,0x00000020,0x00050051,0x00000006,0x00000024,0x00000021,0x00000000,0x00050051,
|
||||
0x00000006,0x00000025,0x00000021,0x00000001,0x00070050,0x00000017,0x00000026,0x00000024,
|
||||
0x00000025,0x00000022,0x00000023,0x00050041,0x00000027,0x00000028,0x0000001a,0x0000001b,
|
||||
0x0003003e,0x00000028,0x00000026,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,46 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t shadows_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x0000002b,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000027,
|
||||
0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,
|
||||
0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,0x6e69616d,0x00000000,
|
||||
0x00060005,0x00000008,0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,0x00000008,
|
||||
0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,0x0000000a,0x00000000,0x00060005,
|
||||
0x0000000e,0x68737550,0x736e6f43,0x746e6174,0x00000000,0x00060006,0x0000000e,0x00000000,
|
||||
0x614d7076,0x78697274,0x00000000,0x00030005,0x00000010,0x00006370,0x00070005,0x00000014,
|
||||
0x66696e55,0x426d726f,0x65666675,0x6a624f72,0x00746365,0x00050006,0x00000014,0x00000000,
|
||||
0x65646f6d,0x0000006c,0x00030005,0x00000016,0x006f6275,0x00050005,0x0000001d,0x65566e69,
|
||||
0x78657472,0x00000000,0x00040005,0x00000027,0x6f6c6f63,0x00000072,0x00050048,0x00000008,
|
||||
0x00000000,0x0000000b,0x00000000,0x00030047,0x00000008,0x00000002,0x00040048,0x0000000e,
|
||||
0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000,0x00000023,0x00000000,0x00050048,
|
||||
0x0000000e,0x00000000,0x00000007,0x00000010,0x00030047,0x0000000e,0x00000002,0x00040048,
|
||||
0x00000014,0x00000000,0x00000005,0x00050048,0x00000014,0x00000000,0x00000023,0x00000000,
|
||||
0x00050048,0x00000014,0x00000000,0x00000007,0x00000010,0x00030047,0x00000014,0x00000002,
|
||||
0x00040047,0x00000016,0x00000022,0x00000000,0x00040047,0x00000016,0x00000021,0x00000000,
|
||||
0x00040047,0x0000001d,0x0000001e,0x00000000,0x00040047,0x00000027,0x0000001e,0x00000000,
|
||||
0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,
|
||||
0x00040017,0x00000007,0x00000006,0x00000004,0x0003001e,0x00000008,0x00000007,0x00040020,
|
||||
0x00000009,0x00000003,0x00000008,0x0004003b,0x00000009,0x0000000a,0x00000003,0x00040015,
|
||||
0x0000000b,0x00000020,0x00000001,0x0004002b,0x0000000b,0x0000000c,0x00000000,0x00040018,
|
||||
0x0000000d,0x00000007,0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,
|
||||
0x00000009,0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000009,0x00040020,0x00000011,
|
||||
0x00000009,0x0000000d,0x0003001e,0x00000014,0x0000000d,0x00040020,0x00000015,0x00000002,
|
||||
0x00000014,0x0004003b,0x00000015,0x00000016,0x00000002,0x00040020,0x00000017,0x00000002,
|
||||
0x0000000d,0x00040017,0x0000001b,0x00000006,0x00000003,0x00040020,0x0000001c,0x00000001,
|
||||
0x0000001b,0x0004003b,0x0000001c,0x0000001d,0x00000001,0x0004002b,0x00000006,0x0000001f,
|
||||
0x3f800000,0x00040020,0x00000025,0x00000003,0x00000007,0x0004003b,0x00000025,0x00000027,
|
||||
0x00000003,0x0004002b,0x00000006,0x00000028,0x00000000,0x0004002b,0x00000006,0x00000029,
|
||||
0x3f000000,0x0007002c,0x00000007,0x0000002a,0x00000028,0x00000028,0x00000028,0x00000029,
|
||||
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,
|
||||
0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,0x00000012,
|
||||
0x00050041,0x00000017,0x00000018,0x00000016,0x0000000c,0x0004003d,0x0000000d,0x00000019,
|
||||
0x00000018,0x00050092,0x0000000d,0x0000001a,0x00000013,0x00000019,0x0004003d,0x0000001b,
|
||||
0x0000001e,0x0000001d,0x00050051,0x00000006,0x00000020,0x0000001e,0x00000000,0x00050051,
|
||||
0x00000006,0x00000021,0x0000001e,0x00000001,0x00050051,0x00000006,0x00000022,0x0000001e,
|
||||
0x00000002,0x00070050,0x00000007,0x00000023,0x00000020,0x00000021,0x00000022,0x0000001f,
|
||||
0x00050091,0x00000007,0x00000024,0x0000001a,0x00000023,0x00050041,0x00000025,0x00000026,
|
||||
0x0000000a,0x0000000c,0x0003003e,0x00000026,0x00000024,0x0003003e,0x00000027,0x0000002a,
|
||||
0x000100fd,0x00010038
|
||||
};
|
|
@ -1,54 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t skybox_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000032,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029,
|
||||
0x0000002b,0x0000002d,0x00000030,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,
|
||||
0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,0x78657472,
|
||||
0x00000000,0x00060006,0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,
|
||||
0x0000000a,0x00000000,0x00060005,0x0000000e,0x68737550,0x736e6f43,0x746e6174,0x00000000,
|
||||
0x00060006,0x0000000e,0x00000000,0x614d7076,0x78697274,0x00000000,0x00030005,0x00000010,
|
||||
0x00006370,0x00070005,0x00000014,0x66696e55,0x426d726f,0x65666675,0x6a624f72,0x00746365,
|
||||
0x00050006,0x00000014,0x00000000,0x65646f6d,0x0000006c,0x00030005,0x00000016,0x006f6275,
|
||||
0x00050005,0x0000001d,0x65566e69,0x78657472,0x00000000,0x00050005,0x00000029,0x43786574,
|
||||
0x64726f6f,0x00000000,0x00050005,0x0000002b,0x65546e69,0x6f6f4378,0x00006472,0x00040005,
|
||||
0x0000002d,0x6f6c6f63,0x00000072,0x00050005,0x00000030,0x65725461,0x6c6f6873,0x00000064,
|
||||
0x00050048,0x00000008,0x00000000,0x0000000b,0x00000000,0x00030047,0x00000008,0x00000002,
|
||||
0x00040048,0x0000000e,0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000,0x00000023,
|
||||
0x00000000,0x00050048,0x0000000e,0x00000000,0x00000007,0x00000010,0x00030047,0x0000000e,
|
||||
0x00000002,0x00040048,0x00000014,0x00000000,0x00000005,0x00050048,0x00000014,0x00000000,
|
||||
0x00000023,0x00000000,0x00050048,0x00000014,0x00000000,0x00000007,0x00000010,0x00030047,
|
||||
0x00000014,0x00000002,0x00040047,0x00000016,0x00000022,0x00000001,0x00040047,0x00000016,
|
||||
0x00000021,0x00000000,0x00040047,0x0000001d,0x0000001e,0x00000000,0x00040047,0x00000029,
|
||||
0x0000001e,0x00000000,0x00040047,0x0000002b,0x0000001e,0x00000001,0x00040047,0x0000002d,
|
||||
0x0000001e,0x00000001,0x00040047,0x00000030,0x0000001e,0x00000002,0x00020013,0x00000002,
|
||||
0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,
|
||||
0x00000006,0x00000004,0x0003001e,0x00000008,0x00000007,0x00040020,0x00000009,0x00000003,
|
||||
0x00000008,0x0004003b,0x00000009,0x0000000a,0x00000003,0x00040015,0x0000000b,0x00000020,
|
||||
0x00000001,0x0004002b,0x0000000b,0x0000000c,0x00000000,0x00040018,0x0000000d,0x00000007,
|
||||
0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000009,0x0000000e,
|
||||
0x0004003b,0x0000000f,0x00000010,0x00000009,0x00040020,0x00000011,0x00000009,0x0000000d,
|
||||
0x0003001e,0x00000014,0x0000000d,0x00040020,0x00000015,0x00000002,0x00000014,0x0004003b,
|
||||
0x00000015,0x00000016,0x00000002,0x00040020,0x00000017,0x00000002,0x0000000d,0x00040017,
|
||||
0x0000001b,0x00000006,0x00000003,0x00040020,0x0000001c,0x00000001,0x0000001b,0x0004003b,
|
||||
0x0000001c,0x0000001d,0x00000001,0x0004002b,0x00000006,0x0000001f,0x3f800000,0x00040020,
|
||||
0x00000025,0x00000003,0x00000007,0x00040017,0x00000027,0x00000006,0x00000002,0x00040020,
|
||||
0x00000028,0x00000003,0x00000027,0x0004003b,0x00000028,0x00000029,0x00000003,0x00040020,
|
||||
0x0000002a,0x00000001,0x00000027,0x0004003b,0x0000002a,0x0000002b,0x00000001,0x0004003b,
|
||||
0x00000025,0x0000002d,0x00000003,0x0007002c,0x00000007,0x0000002e,0x0000001f,0x0000001f,
|
||||
0x0000001f,0x0000001f,0x00040020,0x0000002f,0x00000003,0x00000006,0x0004003b,0x0000002f,
|
||||
0x00000030,0x00000003,0x0004002b,0x00000006,0x00000031,0x00000000,0x00050036,0x00000002,
|
||||
0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,0x00000011,0x00000012,
|
||||
0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,0x00000012,0x00050041,0x00000017,
|
||||
0x00000018,0x00000016,0x0000000c,0x0004003d,0x0000000d,0x00000019,0x00000018,0x00050092,
|
||||
0x0000000d,0x0000001a,0x00000013,0x00000019,0x0004003d,0x0000001b,0x0000001e,0x0000001d,
|
||||
0x00050051,0x00000006,0x00000020,0x0000001e,0x00000000,0x00050051,0x00000006,0x00000021,
|
||||
0x0000001e,0x00000001,0x00050051,0x00000006,0x00000022,0x0000001e,0x00000002,0x00070050,
|
||||
0x00000007,0x00000023,0x00000020,0x00000021,0x00000022,0x0000001f,0x00050091,0x00000007,
|
||||
0x00000024,0x0000001a,0x00000023,0x00050041,0x00000025,0x00000026,0x0000000a,0x0000000c,
|
||||
0x0003003e,0x00000026,0x00000024,0x0004003d,0x00000027,0x0000002c,0x0000002b,0x0003003e,
|
||||
0x00000029,0x0000002c,0x0003003e,0x0000002d,0x0000002e,0x0003003e,0x00000030,0x00000031,
|
||||
0x000100fd,0x00010038
|
||||
};
|
|
@ -1,49 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t sprite_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x0000002f,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000022,
|
||||
0x00000024,0x00000026,0x0000002d,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,
|
||||
0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,
|
||||
0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265,0x78657472,
|
||||
0x00000000,0x00060006,0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005,
|
||||
0x0000000a,0x00000000,0x00060005,0x0000000e,0x68737550,0x736e6f43,0x746e6174,0x00000000,
|
||||
0x00060006,0x0000000e,0x00000000,0x4d70766d,0x69727461,0x00000078,0x00050006,0x0000000e,
|
||||
0x00000001,0x68706c61,0x00000061,0x00030005,0x00000010,0x00006370,0x00050005,0x00000016,
|
||||
0x65566e69,0x78657472,0x00000000,0x00050005,0x00000022,0x43786574,0x64726f6f,0x00000000,
|
||||
0x00050005,0x00000024,0x65546e69,0x6f6f4378,0x00006472,0x00040005,0x00000026,0x6f6c6f63,
|
||||
0x00000072,0x00050005,0x0000002d,0x65725461,0x6c6f6873,0x00000064,0x00050048,0x00000008,
|
||||
0x00000000,0x0000000b,0x00000000,0x00030047,0x00000008,0x00000002,0x00040048,0x0000000e,
|
||||
0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000,0x00000023,0x00000000,0x00050048,
|
||||
0x0000000e,0x00000000,0x00000007,0x00000010,0x00050048,0x0000000e,0x00000001,0x00000023,
|
||||
0x00000040,0x00030047,0x0000000e,0x00000002,0x00040047,0x00000016,0x0000001e,0x00000000,
|
||||
0x00040047,0x00000022,0x0000001e,0x00000000,0x00040047,0x00000024,0x0000001e,0x00000001,
|
||||
0x00040047,0x00000026,0x0000001e,0x00000001,0x00040047,0x0000002d,0x0000001e,0x00000002,
|
||||
0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,
|
||||
0x00040017,0x00000007,0x00000006,0x00000004,0x0003001e,0x00000008,0x00000007,0x00040020,
|
||||
0x00000009,0x00000003,0x00000008,0x0004003b,0x00000009,0x0000000a,0x00000003,0x00040015,
|
||||
0x0000000b,0x00000020,0x00000001,0x0004002b,0x0000000b,0x0000000c,0x00000000,0x00040018,
|
||||
0x0000000d,0x00000007,0x00000004,0x0004001e,0x0000000e,0x0000000d,0x00000006,0x00040020,
|
||||
0x0000000f,0x00000009,0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000009,0x00040020,
|
||||
0x00000011,0x00000009,0x0000000d,0x00040017,0x00000014,0x00000006,0x00000003,0x00040020,
|
||||
0x00000015,0x00000001,0x00000014,0x0004003b,0x00000015,0x00000016,0x00000001,0x0004002b,
|
||||
0x00000006,0x00000018,0x3f800000,0x00040020,0x0000001e,0x00000003,0x00000007,0x00040017,
|
||||
0x00000020,0x00000006,0x00000002,0x00040020,0x00000021,0x00000003,0x00000020,0x0004003b,
|
||||
0x00000021,0x00000022,0x00000003,0x00040020,0x00000023,0x00000001,0x00000020,0x0004003b,
|
||||
0x00000023,0x00000024,0x00000001,0x0004003b,0x0000001e,0x00000026,0x00000003,0x0004002b,
|
||||
0x0000000b,0x00000027,0x00000001,0x00040020,0x00000028,0x00000009,0x00000006,0x00040020,
|
||||
0x0000002c,0x00000003,0x00000006,0x0004003b,0x0000002c,0x0000002d,0x00000003,0x0004002b,
|
||||
0x00000006,0x0000002e,0x3d886595,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,
|
||||
0x000200f8,0x00000005,0x00050041,0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,
|
||||
0x0000000d,0x00000013,0x00000012,0x0004003d,0x00000014,0x00000017,0x00000016,0x00050051,
|
||||
0x00000006,0x00000019,0x00000017,0x00000000,0x00050051,0x00000006,0x0000001a,0x00000017,
|
||||
0x00000001,0x00050051,0x00000006,0x0000001b,0x00000017,0x00000002,0x00070050,0x00000007,
|
||||
0x0000001c,0x00000019,0x0000001a,0x0000001b,0x00000018,0x00050091,0x00000007,0x0000001d,
|
||||
0x00000013,0x0000001c,0x00050041,0x0000001e,0x0000001f,0x0000000a,0x0000000c,0x0003003e,
|
||||
0x0000001f,0x0000001d,0x0004003d,0x00000020,0x00000025,0x00000024,0x0003003e,0x00000022,
|
||||
0x00000025,0x00050041,0x00000028,0x00000029,0x00000010,0x00000027,0x0004003d,0x00000006,
|
||||
0x0000002a,0x00000029,0x00070050,0x00000007,0x0000002b,0x00000018,0x00000018,0x00000018,
|
||||
0x0000002a,0x0003003e,0x00000026,0x0000002b,0x0003003e,0x0000002d,0x0000002e,0x000100fd,
|
||||
0x00010038
|
||||
};
|
|
@ -1,154 +0,0 @@
|
|||
// 1011.0.0
|
||||
#pragma once
|
||||
const uint32_t world_warp_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x0008000a,0x000000c1,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000019,0x000000b9,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,
|
||||
0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,
|
||||
0x6e69616d,0x00000000,0x00040005,0x00000009,0x53726373,0x00657a69,0x00060005,0x0000000a,
|
||||
0x68737550,0x736e6f43,0x746e6174,0x00000000,0x00050006,0x0000000a,0x00000000,0x656d6974,
|
||||
0x00000000,0x00050006,0x0000000a,0x00000001,0x6c616373,0x00000065,0x00060006,0x0000000a,
|
||||
0x00000002,0x57726373,0x68746469,0x00000000,0x00060006,0x0000000a,0x00000003,0x48726373,
|
||||
0x68676965,0x00000074,0x00050006,0x0000000a,0x00000004,0x7366666f,0x00587465,0x00050006,
|
||||
0x0000000a,0x00000005,0x7366666f,0x00597465,0x00060006,0x0000000a,0x00000006,0x65786970,
|
||||
0x7a69536c,0x00000065,0x00050006,0x0000000a,0x00000007,0x64666572,0x00586665,0x00050006,
|
||||
0x0000000a,0x00000008,0x64666572,0x00596665,0x00060006,0x0000000a,0x00000009,0x64666572,
|
||||
0x69576665,0x00687464,0x00070006,0x0000000a,0x0000000a,0x64666572,0x65486665,0x74686769,
|
||||
0x00000000,0x00030005,0x0000000c,0x00006370,0x00050005,0x00000016,0x67617266,0x726f6f43,
|
||||
0x00000064,0x00060005,0x00000019,0x465f6c67,0x43676172,0x64726f6f,0x00000000,0x00030005,
|
||||
0x00000024,0x00007675,0x00040005,0x00000029,0x6e694d78,0x00000000,0x00040005,0x0000002d,
|
||||
0x78614d78,0x00000000,0x00040005,0x00000034,0x6e694d79,0x00000000,0x00040005,0x00000038,
|
||||
0x78614d79,0x00000000,0x00030005,0x00000066,0x00007873,0x00030005,0x00000077,0x00007973,
|
||||
0x00040005,0x00000086,0x69685378,0x00007466,0x00040005,0x00000091,0x69685379,0x00007466,
|
||||
0x00050005,0x0000009a,0x74736964,0x6974726f,0x00006e6f,0x00060005,0x000000b9,0x67617266,
|
||||
0x746e656d,0x6f6c6f43,0x00000072,0x00050005,0x000000bd,0x78655473,0x65727574,0x00000000,
|
||||
0x00050048,0x0000000a,0x00000000,0x00000023,0x00000044,0x00050048,0x0000000a,0x00000001,
|
||||
0x00000023,0x00000048,0x00050048,0x0000000a,0x00000002,0x00000023,0x0000004c,0x00050048,
|
||||
0x0000000a,0x00000003,0x00000023,0x00000050,0x00050048,0x0000000a,0x00000004,0x00000023,
|
||||
0x00000054,0x00050048,0x0000000a,0x00000005,0x00000023,0x00000058,0x00050048,0x0000000a,
|
||||
0x00000006,0x00000023,0x0000005c,0x00050048,0x0000000a,0x00000007,0x00000023,0x00000060,
|
||||
0x00050048,0x0000000a,0x00000008,0x00000023,0x00000064,0x00050048,0x0000000a,0x00000009,
|
||||
0x00000023,0x00000068,0x00050048,0x0000000a,0x0000000a,0x00000023,0x0000006c,0x00030047,
|
||||
0x0000000a,0x00000002,0x00040047,0x00000019,0x0000000b,0x0000000f,0x00040047,0x000000b9,
|
||||
0x0000001e,0x00000000,0x00040047,0x000000bd,0x00000022,0x00000000,0x00040047,0x000000bd,
|
||||
0x00000021,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,
|
||||
0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,
|
||||
0x00000007,0x00000007,0x000d001e,0x0000000a,0x00000006,0x00000006,0x00000006,0x00000006,
|
||||
0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00040020,
|
||||
0x0000000b,0x00000009,0x0000000a,0x0004003b,0x0000000b,0x0000000c,0x00000009,0x00040015,
|
||||
0x0000000d,0x00000020,0x00000001,0x0004002b,0x0000000d,0x0000000e,0x00000002,0x00040020,
|
||||
0x0000000f,0x00000009,0x00000006,0x0004002b,0x0000000d,0x00000012,0x00000003,0x00040017,
|
||||
0x00000017,0x00000006,0x00000004,0x00040020,0x00000018,0x00000001,0x00000017,0x0004003b,
|
||||
0x00000018,0x00000019,0x00000001,0x0004002b,0x0000000d,0x0000001c,0x00000004,0x0004002b,
|
||||
0x0000000d,0x0000001f,0x00000005,0x00040020,0x00000028,0x00000007,0x00000006,0x0004002b,
|
||||
0x0000000d,0x0000002a,0x00000007,0x0004002b,0x0000000d,0x00000030,0x00000009,0x0004002b,
|
||||
0x0000000d,0x00000035,0x00000008,0x0004002b,0x0000000d,0x0000003b,0x0000000a,0x00020014,
|
||||
0x0000003f,0x0004002b,0x0000000d,0x00000040,0x00000000,0x0004002b,0x00000006,0x00000043,
|
||||
0x00000000,0x00040015,0x00000047,0x00000020,0x00000000,0x0004002b,0x00000047,0x00000048,
|
||||
0x00000000,0x0004002b,0x00000047,0x00000057,0x00000001,0x0004002b,0x0000000d,0x00000067,
|
||||
0x00000001,0x0004002b,0x00000006,0x0000006c,0x40000000,0x0004002b,0x00000006,0x0000008c,
|
||||
0x40490e56,0x0004002b,0x00000006,0x0000008e,0x41200000,0x0004002b,0x00000006,0x000000a4,
|
||||
0x3bda3c21,0x0004002b,0x0000000d,0x000000a9,0x00000006,0x0005002c,0x00000007,0x000000b2,
|
||||
0x00000043,0x00000043,0x0004002b,0x00000006,0x000000b4,0x3f000000,0x0005002c,0x00000007,
|
||||
0x000000b5,0x000000b4,0x000000b4,0x00040020,0x000000b8,0x00000003,0x00000017,0x0004003b,
|
||||
0x000000b8,0x000000b9,0x00000003,0x00090019,0x000000ba,0x00000006,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x000000bb,0x000000ba,0x00040020,
|
||||
0x000000bc,0x00000000,0x000000bb,0x0004003b,0x000000bc,0x000000bd,0x00000000,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,
|
||||
0x00000009,0x00000007,0x0004003b,0x00000008,0x00000016,0x00000007,0x0004003b,0x00000008,
|
||||
0x00000024,0x00000007,0x0004003b,0x00000028,0x00000029,0x00000007,0x0004003b,0x00000028,
|
||||
0x0000002d,0x00000007,0x0004003b,0x00000028,0x00000034,0x00000007,0x0004003b,0x00000028,
|
||||
0x00000038,0x00000007,0x0004003b,0x00000028,0x00000066,0x00000007,0x0004003b,0x00000028,
|
||||
0x00000077,0x00000007,0x0004003b,0x00000028,0x00000086,0x00000007,0x0004003b,0x00000028,
|
||||
0x00000091,0x00000007,0x0004003b,0x00000008,0x0000009a,0x00000007,0x00050041,0x0000000f,
|
||||
0x00000010,0x0000000c,0x0000000e,0x0004003d,0x00000006,0x00000011,0x00000010,0x00050041,
|
||||
0x0000000f,0x00000013,0x0000000c,0x00000012,0x0004003d,0x00000006,0x00000014,0x00000013,
|
||||
0x00050050,0x00000007,0x00000015,0x00000011,0x00000014,0x0003003e,0x00000009,0x00000015,
|
||||
0x0004003d,0x00000017,0x0000001a,0x00000019,0x0007004f,0x00000007,0x0000001b,0x0000001a,
|
||||
0x0000001a,0x00000000,0x00000001,0x00050041,0x0000000f,0x0000001d,0x0000000c,0x0000001c,
|
||||
0x0004003d,0x00000006,0x0000001e,0x0000001d,0x00050041,0x0000000f,0x00000020,0x0000000c,
|
||||
0x0000001f,0x0004003d,0x00000006,0x00000021,0x00000020,0x00050050,0x00000007,0x00000022,
|
||||
0x0000001e,0x00000021,0x00050083,0x00000007,0x00000023,0x0000001b,0x00000022,0x0003003e,
|
||||
0x00000016,0x00000023,0x0004003d,0x00000007,0x00000025,0x00000016,0x0004003d,0x00000007,
|
||||
0x00000026,0x00000009,0x00050088,0x00000007,0x00000027,0x00000025,0x00000026,0x0003003e,
|
||||
0x00000024,0x00000027,0x00050041,0x0000000f,0x0000002b,0x0000000c,0x0000002a,0x0004003d,
|
||||
0x00000006,0x0000002c,0x0000002b,0x0003003e,0x00000029,0x0000002c,0x00050041,0x0000000f,
|
||||
0x0000002e,0x0000000c,0x0000002a,0x0004003d,0x00000006,0x0000002f,0x0000002e,0x00050041,
|
||||
0x0000000f,0x00000031,0x0000000c,0x00000030,0x0004003d,0x00000006,0x00000032,0x00000031,
|
||||
0x00050081,0x00000006,0x00000033,0x0000002f,0x00000032,0x0003003e,0x0000002d,0x00000033,
|
||||
0x00050041,0x0000000f,0x00000036,0x0000000c,0x00000035,0x0004003d,0x00000006,0x00000037,
|
||||
0x00000036,0x0003003e,0x00000034,0x00000037,0x00050041,0x0000000f,0x00000039,0x0000000c,
|
||||
0x00000035,0x0004003d,0x00000006,0x0000003a,0x00000039,0x00050041,0x0000000f,0x0000003c,
|
||||
0x0000000c,0x0000003b,0x0004003d,0x00000006,0x0000003d,0x0000003c,0x00050081,0x00000006,
|
||||
0x0000003e,0x0000003a,0x0000003d,0x0003003e,0x00000038,0x0000003e,0x00050041,0x0000000f,
|
||||
0x00000041,0x0000000c,0x00000040,0x0004003d,0x00000006,0x00000042,0x00000041,0x000500ba,
|
||||
0x0000003f,0x00000044,0x00000042,0x00000043,0x000300f7,0x00000046,0x00000000,0x000400fa,
|
||||
0x00000044,0x00000045,0x00000046,0x000200f8,0x00000045,0x00050041,0x00000028,0x00000049,
|
||||
0x00000016,0x00000048,0x0004003d,0x00000006,0x0000004a,0x00000049,0x0004003d,0x00000006,
|
||||
0x0000004b,0x00000029,0x000500ba,0x0000003f,0x0000004c,0x0000004a,0x0000004b,0x000200f9,
|
||||
0x00000046,0x000200f8,0x00000046,0x000700f5,0x0000003f,0x0000004d,0x00000044,0x00000005,
|
||||
0x0000004c,0x00000045,0x000300f7,0x0000004f,0x00000000,0x000400fa,0x0000004d,0x0000004e,
|
||||
0x0000004f,0x000200f8,0x0000004e,0x00050041,0x00000028,0x00000050,0x00000016,0x00000048,
|
||||
0x0004003d,0x00000006,0x00000051,0x00000050,0x0004003d,0x00000006,0x00000052,0x0000002d,
|
||||
0x000500b8,0x0000003f,0x00000053,0x00000051,0x00000052,0x000200f9,0x0000004f,0x000200f8,
|
||||
0x0000004f,0x000700f5,0x0000003f,0x00000054,0x0000004d,0x00000046,0x00000053,0x0000004e,
|
||||
0x000300f7,0x00000056,0x00000000,0x000400fa,0x00000054,0x00000055,0x00000056,0x000200f8,
|
||||
0x00000055,0x00050041,0x00000028,0x00000058,0x00000016,0x00000057,0x0004003d,0x00000006,
|
||||
0x00000059,0x00000058,0x0004003d,0x00000006,0x0000005a,0x00000034,0x000500ba,0x0000003f,
|
||||
0x0000005b,0x00000059,0x0000005a,0x000200f9,0x00000056,0x000200f8,0x00000056,0x000700f5,
|
||||
0x0000003f,0x0000005c,0x00000054,0x0000004f,0x0000005b,0x00000055,0x000300f7,0x0000005e,
|
||||
0x00000000,0x000400fa,0x0000005c,0x0000005d,0x0000005e,0x000200f8,0x0000005d,0x00050041,
|
||||
0x00000028,0x0000005f,0x00000016,0x00000057,0x0004003d,0x00000006,0x00000060,0x0000005f,
|
||||
0x0004003d,0x00000006,0x00000061,0x00000038,0x000500b8,0x0000003f,0x00000062,0x00000060,
|
||||
0x00000061,0x000200f9,0x0000005e,0x000200f8,0x0000005e,0x000700f5,0x0000003f,0x00000063,
|
||||
0x0000005c,0x00000056,0x00000062,0x0000005d,0x000300f7,0x00000065,0x00000000,0x000400fa,
|
||||
0x00000063,0x00000064,0x00000065,0x000200f8,0x00000064,0x00050041,0x0000000f,0x00000068,
|
||||
0x0000000c,0x00000067,0x0004003d,0x00000006,0x00000069,0x00000068,0x00050041,0x0000000f,
|
||||
0x0000006a,0x0000000c,0x0000000e,0x0004003d,0x00000006,0x0000006b,0x0000006a,0x00050088,
|
||||
0x00000006,0x0000006d,0x0000006b,0x0000006c,0x00050041,0x00000028,0x0000006e,0x00000016,
|
||||
0x00000048,0x0004003d,0x00000006,0x0000006f,0x0000006e,0x00050083,0x00000006,0x00000070,
|
||||
0x0000006d,0x0000006f,0x0006000c,0x00000006,0x00000071,0x00000001,0x00000004,0x00000070,
|
||||
0x00050085,0x00000006,0x00000072,0x00000071,0x0000006c,0x00050041,0x0000000f,0x00000073,
|
||||
0x0000000c,0x0000000e,0x0004003d,0x00000006,0x00000074,0x00000073,0x00050088,0x00000006,
|
||||
0x00000075,0x00000072,0x00000074,0x00050083,0x00000006,0x00000076,0x00000069,0x00000075,
|
||||
0x0003003e,0x00000066,0x00000076,0x00050041,0x0000000f,0x00000078,0x0000000c,0x00000067,
|
||||
0x0004003d,0x00000006,0x00000079,0x00000078,0x00050041,0x0000000f,0x0000007a,0x0000000c,
|
||||
0x00000012,0x0004003d,0x00000006,0x0000007b,0x0000007a,0x00050088,0x00000006,0x0000007c,
|
||||
0x0000007b,0x0000006c,0x00050041,0x00000028,0x0000007d,0x00000016,0x00000057,0x0004003d,
|
||||
0x00000006,0x0000007e,0x0000007d,0x00050083,0x00000006,0x0000007f,0x0000007c,0x0000007e,
|
||||
0x0006000c,0x00000006,0x00000080,0x00000001,0x00000004,0x0000007f,0x00050085,0x00000006,
|
||||
0x00000081,0x00000080,0x0000006c,0x00050041,0x0000000f,0x00000082,0x0000000c,0x00000012,
|
||||
0x0004003d,0x00000006,0x00000083,0x00000082,0x00050088,0x00000006,0x00000084,0x00000081,
|
||||
0x00000083,0x00050083,0x00000006,0x00000085,0x00000079,0x00000084,0x0003003e,0x00000077,
|
||||
0x00000085,0x00050041,0x0000000f,0x00000087,0x0000000c,0x00000040,0x0004003d,0x00000006,
|
||||
0x00000088,0x00000087,0x00050085,0x00000006,0x00000089,0x0000006c,0x00000088,0x00050041,
|
||||
0x00000028,0x0000008a,0x00000024,0x00000057,0x0004003d,0x00000006,0x0000008b,0x0000008a,
|
||||
0x00050085,0x00000006,0x0000008d,0x0000008b,0x0000008c,0x00050085,0x00000006,0x0000008f,
|
||||
0x0000008d,0x0000008e,0x00050081,0x00000006,0x00000090,0x00000089,0x0000008f,0x0003003e,
|
||||
0x00000086,0x00000090,0x00050041,0x0000000f,0x00000092,0x0000000c,0x00000040,0x0004003d,
|
||||
0x00000006,0x00000093,0x00000092,0x00050085,0x00000006,0x00000094,0x0000006c,0x00000093,
|
||||
0x00050041,0x00000028,0x00000095,0x00000024,0x00000048,0x0004003d,0x00000006,0x00000096,
|
||||
0x00000095,0x00050085,0x00000006,0x00000097,0x00000096,0x0000008c,0x00050085,0x00000006,
|
||||
0x00000098,0x00000097,0x0000008e,0x00050081,0x00000006,0x00000099,0x00000094,0x00000098,
|
||||
0x0003003e,0x00000091,0x00000099,0x0004003d,0x00000006,0x0000009b,0x00000086,0x0006000c,
|
||||
0x00000006,0x0000009c,0x00000001,0x0000000d,0x0000009b,0x0004003d,0x00000006,0x0000009d,
|
||||
0x00000066,0x00050085,0x00000006,0x0000009e,0x0000009c,0x0000009d,0x0004003d,0x00000006,
|
||||
0x0000009f,0x00000091,0x0006000c,0x00000006,0x000000a0,0x00000001,0x0000000d,0x0000009f,
|
||||
0x0004003d,0x00000006,0x000000a1,0x00000077,0x00050085,0x00000006,0x000000a2,0x000000a0,
|
||||
0x000000a1,0x00050050,0x00000007,0x000000a3,0x0000009e,0x000000a2,0x0005008e,0x00000007,
|
||||
0x000000a5,0x000000a3,0x000000a4,0x0003003e,0x0000009a,0x000000a5,0x0004003d,0x00000007,
|
||||
0x000000a6,0x0000009a,0x0004003d,0x00000007,0x000000a7,0x00000024,0x00050081,0x00000007,
|
||||
0x000000a8,0x000000a7,0x000000a6,0x0003003e,0x00000024,0x000000a8,0x000200f9,0x00000065,
|
||||
0x000200f8,0x00000065,0x00050041,0x0000000f,0x000000aa,0x0000000c,0x000000a9,0x0004003d,
|
||||
0x00000006,0x000000ab,0x000000aa,0x0004003d,0x00000007,0x000000ac,0x00000024,0x00050050,
|
||||
0x00000007,0x000000ad,0x000000ab,0x000000ab,0x00050088,0x00000007,0x000000ae,0x000000ac,
|
||||
0x000000ad,0x0003003e,0x00000024,0x000000ae,0x0004003d,0x00000007,0x000000af,0x00000024,
|
||||
0x0004003d,0x00000007,0x000000b0,0x00000009,0x00050085,0x00000007,0x000000b1,0x000000af,
|
||||
0x000000b0,0x0004003d,0x00000007,0x000000b3,0x00000009,0x00050083,0x00000007,0x000000b6,
|
||||
0x000000b3,0x000000b5,0x0008000c,0x00000007,0x000000b7,0x00000001,0x0000002b,0x000000b1,
|
||||
0x000000b2,0x000000b6,0x0003003e,0x00000024,0x000000b7,0x0004003d,0x000000bb,0x000000be,
|
||||
0x000000bd,0x0004003d,0x00000007,0x000000bf,0x00000024,0x00070058,0x00000017,0x000000c0,
|
||||
0x000000be,0x000000bf,0x00000002,0x00000043,0x0003003e,0x000000b9,0x000000c0,0x000100fd,
|
||||
0x00010038
|
||||
};
|
|
@ -1,33 +0,0 @@
|
|||
// 8.13.3559
|
||||
#pragma once
|
||||
const uint32_t world_warp_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080008,0x00000024,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000017,0x0000001b,0x00030003,
|
||||
0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,0x64616873,
|
||||
0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00050005,
|
||||
0x0000000c,0x69736f70,0x6e6f6974,0x00000073,0x00060005,0x00000015,0x505f6c67,0x65567265,
|
||||
0x78657472,0x00000000,0x00060006,0x00000015,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,
|
||||
0x00030005,0x00000017,0x00000000,0x00060005,0x0000001b,0x565f6c67,0x65747265,0x646e4978,
|
||||
0x00007865,0x00050048,0x00000015,0x00000000,0x0000000b,0x00000000,0x00030047,0x00000015,
|
||||
0x00000002,0x00040047,0x0000001b,0x0000000b,0x0000002a,0x00020013,0x00000002,0x00030021,
|
||||
0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,
|
||||
0x00000004,0x00040015,0x00000008,0x00000020,0x00000000,0x0004002b,0x00000008,0x00000009,
|
||||
0x00000003,0x0004001c,0x0000000a,0x00000007,0x00000009,0x00040020,0x0000000b,0x00000007,
|
||||
0x0000000a,0x0004002b,0x00000006,0x0000000d,0xbf800000,0x0004002b,0x00000006,0x0000000e,
|
||||
0x00000000,0x0004002b,0x00000006,0x0000000f,0x3f800000,0x0007002c,0x00000007,0x00000010,
|
||||
0x0000000d,0x0000000d,0x0000000e,0x0000000f,0x0004002b,0x00000006,0x00000011,0x40400000,
|
||||
0x0007002c,0x00000007,0x00000012,0x00000011,0x0000000d,0x0000000e,0x0000000f,0x0007002c,
|
||||
0x00000007,0x00000013,0x0000000d,0x00000011,0x0000000e,0x0000000f,0x0006002c,0x0000000a,
|
||||
0x00000014,0x00000010,0x00000012,0x00000013,0x0003001e,0x00000015,0x00000007,0x00040020,
|
||||
0x00000016,0x00000003,0x00000015,0x0004003b,0x00000016,0x00000017,0x00000003,0x00040015,
|
||||
0x00000018,0x00000020,0x00000001,0x0004002b,0x00000018,0x00000019,0x00000000,0x00040020,
|
||||
0x0000001a,0x00000001,0x00000018,0x0004003b,0x0000001a,0x0000001b,0x00000001,0x0004002b,
|
||||
0x00000018,0x0000001d,0x00000003,0x00040020,0x0000001f,0x00000007,0x00000007,0x00040020,
|
||||
0x00000022,0x00000003,0x00000007,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,
|
||||
0x000200f8,0x00000005,0x0004003b,0x0000000b,0x0000000c,0x00000007,0x0003003e,0x0000000c,
|
||||
0x00000014,0x0004003d,0x00000018,0x0000001c,0x0000001b,0x0005008b,0x00000018,0x0000001e,
|
||||
0x0000001c,0x0000001d,0x00050041,0x0000001f,0x00000020,0x0000000c,0x0000001e,0x0004003d,
|
||||
0x00000007,0x00000021,0x00000020,0x00050041,0x00000022,0x00000023,0x00000017,0x00000019,
|
||||
0x0003003e,0x00000023,0x00000021,0x000100fd,0x00010038
|
||||
};
|
|
@ -1,205 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
// internal helper
|
||||
static void
|
||||
copyBuffer(const VkBuffer * src, VkBuffer * dst, VkDeviceSize size)
|
||||
{
|
||||
VkCommandBuffer commandBuffer = QVk_CreateCommandBuffer(&vk_transferCommandPool,
|
||||
VK_COMMAND_BUFFER_LEVEL_PRIMARY);
|
||||
QVk_BeginCommand(&commandBuffer);
|
||||
|
||||
VkBufferCopy copyRegion = {
|
||||
.srcOffset = 0,
|
||||
.dstOffset = 0,
|
||||
.size = size
|
||||
};
|
||||
vkCmdCopyBuffer(commandBuffer, *src, *dst, 1, ©Region);
|
||||
|
||||
QVk_SubmitCommand(&commandBuffer, &vk_device.transferQueue);
|
||||
vkFreeCommandBuffers(vk_device.logical, vk_transferCommandPool, 1,
|
||||
&commandBuffer);
|
||||
}
|
||||
|
||||
// internal helper
|
||||
static void
|
||||
createStagedBuffer(const void *data, VkDeviceSize size, qvkbuffer_t * dstBuffer,
|
||||
qvkbufferopts_t bufferOpts)
|
||||
{
|
||||
qvkstagingbuffer_t *stgBuffer;
|
||||
stgBuffer = (qvkstagingbuffer_t *) malloc(sizeof(qvkstagingbuffer_t));
|
||||
VK_VERIFY(QVk_CreateStagingBuffer(size, stgBuffer,
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
|
||||
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
||||
VK_MEMORY_PROPERTY_HOST_CACHED_BIT));
|
||||
|
||||
if (data)
|
||||
{
|
||||
void *dst;
|
||||
// staging buffers in vkQuake2 are required to be host coherent,
|
||||
// so no flushing/invalidation is involved
|
||||
dst = buffer_map(&stgBuffer->resource);
|
||||
memcpy(dst, data, (size_t) size);
|
||||
buffer_unmap(&stgBuffer->resource);
|
||||
}
|
||||
|
||||
VK_VERIFY(QVk_CreateBuffer(size, dstBuffer, bufferOpts));
|
||||
copyBuffer(&stgBuffer->resource.buffer, &dstBuffer->resource.buffer, size);
|
||||
|
||||
QVk_FreeStagingBuffer(stgBuffer);
|
||||
free(stgBuffer);
|
||||
}
|
||||
|
||||
VkResult
|
||||
QVk_CreateBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer,
|
||||
const qvkbufferopts_t options)
|
||||
{
|
||||
VkBufferCreateInfo bcInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.size = size,
|
||||
.usage = options.usage,
|
||||
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
.queueFamilyIndexCount = 0,
|
||||
.pQueueFamilyIndices = NULL,
|
||||
};
|
||||
|
||||
// separate transfer queue makes sense only if the buffer is targetted
|
||||
// for being transfered to GPU, so ignore it if it's CPU-only
|
||||
uint32_t queueFamilies[] = {
|
||||
(uint32_t)vk_device.gfxFamilyIndex,
|
||||
(uint32_t)vk_device.transferFamilyIndex
|
||||
};
|
||||
|
||||
if (vk_device.gfxFamilyIndex != vk_device.transferFamilyIndex)
|
||||
{
|
||||
bcInfo.sharingMode = VK_SHARING_MODE_CONCURRENT;
|
||||
bcInfo.queueFamilyIndexCount = 2;
|
||||
bcInfo.pQueueFamilyIndices = queueFamilies;
|
||||
}
|
||||
|
||||
dstBuffer->currentOffset = 0;
|
||||
return buffer_create(&dstBuffer->resource, bcInfo,
|
||||
options.reqMemFlags, options.prefMemFlags);
|
||||
}
|
||||
|
||||
void
|
||||
QVk_FreeBuffer(qvkbuffer_t *buffer)
|
||||
{
|
||||
buffer_destroy(&buffer->resource);
|
||||
buffer->currentOffset = 0;
|
||||
}
|
||||
|
||||
void
|
||||
QVk_FreeStagingBuffer(qvkstagingbuffer_t *buffer)
|
||||
{
|
||||
buffer_destroy(&buffer->resource);
|
||||
buffer->currentOffset = 0;
|
||||
}
|
||||
|
||||
VkResult
|
||||
QVk_CreateStagingBuffer(VkDeviceSize size, qvkstagingbuffer_t *dstBuffer,
|
||||
VkMemoryPropertyFlags reqMemFlags,
|
||||
VkMemoryPropertyFlags prefMemFlags)
|
||||
{
|
||||
VkBufferCreateInfo bcInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.size = ROUNDUP(size, 1024),
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
|
||||
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
.queueFamilyIndexCount = 0,
|
||||
.pQueueFamilyIndices = NULL,
|
||||
};
|
||||
|
||||
reqMemFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
||||
|
||||
dstBuffer->currentOffset = 0;
|
||||
return buffer_create(&dstBuffer->resource, bcInfo, reqMemFlags,
|
||||
prefMemFlags);
|
||||
}
|
||||
|
||||
VkResult
|
||||
QVk_CreateUniformBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer,
|
||||
VkMemoryPropertyFlags reqMemFlags,
|
||||
VkMemoryPropertyFlags prefMemFlags)
|
||||
{
|
||||
qvkbufferopts_t dstOpts = {
|
||||
.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
|
||||
.reqMemFlags = reqMemFlags,
|
||||
.prefMemFlags = prefMemFlags,
|
||||
};
|
||||
|
||||
dstOpts.reqMemFlags |= VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
|
||||
if((vk_device.properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) ||
|
||||
(dstOpts.prefMemFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
|
||||
{
|
||||
dstOpts.prefMemFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
|
||||
}
|
||||
|
||||
return QVk_CreateBuffer(size, dstBuffer, dstOpts);
|
||||
}
|
||||
|
||||
void
|
||||
QVk_CreateVertexBuffer(const void *data, VkDeviceSize size,
|
||||
qvkbuffer_t *dstBuffer,
|
||||
VkMemoryPropertyFlags reqMemFlags,
|
||||
VkMemoryPropertyFlags prefMemFlags)
|
||||
{
|
||||
qvkbufferopts_t dstOpts = {
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT |
|
||||
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
|
||||
.reqMemFlags = reqMemFlags,
|
||||
.prefMemFlags = prefMemFlags,
|
||||
};
|
||||
|
||||
if((vk_device.properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) ||
|
||||
(dstOpts.prefMemFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
|
||||
{
|
||||
dstOpts.prefMemFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
|
||||
}
|
||||
|
||||
createStagedBuffer(data, size, dstBuffer, dstOpts);
|
||||
}
|
||||
|
||||
void
|
||||
QVk_CreateIndexBuffer(const void *data, VkDeviceSize size,
|
||||
qvkbuffer_t *dstBuffer,
|
||||
VkMemoryPropertyFlags reqMemFlags,
|
||||
VkMemoryPropertyFlags prefMemFlags)
|
||||
{
|
||||
qvkbufferopts_t dstOpts = {
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
|
||||
.reqMemFlags = reqMemFlags,
|
||||
.prefMemFlags = prefMemFlags,
|
||||
};
|
||||
|
||||
if((vk_device.properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) ||
|
||||
(dstOpts.prefMemFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) == 0)
|
||||
{
|
||||
dstOpts.prefMemFlags |= VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
|
||||
}
|
||||
|
||||
createStagedBuffer(data, size, dstBuffer, dstOpts);
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
VkResult QVk_BeginCommand(const VkCommandBuffer *commandBuffer)
|
||||
{
|
||||
VkCommandBufferBeginInfo cmdInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
|
||||
.pInheritanceInfo = NULL
|
||||
};
|
||||
|
||||
return vkBeginCommandBuffer(*commandBuffer, &cmdInfo);
|
||||
}
|
||||
|
||||
void QVk_SubmitCommand(const VkCommandBuffer *commandBuffer, const VkQueue *queue)
|
||||
{
|
||||
VK_VERIFY(vkEndCommandBuffer(*commandBuffer));
|
||||
|
||||
VkSubmitInfo submitInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
|
||||
.pNext = NULL,
|
||||
.waitSemaphoreCount = 0,
|
||||
.pWaitSemaphores = NULL,
|
||||
.pWaitDstStageMask = NULL,
|
||||
.commandBufferCount = 1,
|
||||
.pCommandBuffers = commandBuffer,
|
||||
.signalSemaphoreCount = 0,
|
||||
.pSignalSemaphores = NULL
|
||||
};
|
||||
|
||||
VkFenceCreateInfo fCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0
|
||||
};
|
||||
|
||||
VkFence queueFence;
|
||||
VK_VERIFY(vkCreateFence(vk_device.logical, &fCreateInfo, NULL, &queueFence));
|
||||
VK_VERIFY(vkQueueSubmit(*queue, 1, &submitInfo, queueFence));
|
||||
VK_VERIFY(vkWaitForFences(vk_device.logical, 1, &queueFence, VK_TRUE, UINT64_MAX));
|
||||
|
||||
vkDestroyFence(vk_device.logical, queueFence, NULL);
|
||||
}
|
||||
|
||||
VkResult QVk_CreateCommandPool(VkCommandPool *commandPool, uint32_t queueFamilyIndex)
|
||||
{
|
||||
VkCommandPoolCreateInfo cpCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
// allow the command pool to be explicitly reset without reallocating it manually during recording each frame
|
||||
.flags = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT,
|
||||
.queueFamilyIndex = queueFamilyIndex
|
||||
};
|
||||
|
||||
return vkCreateCommandPool(vk_device.logical, &cpCreateInfo, NULL, commandPool);
|
||||
}
|
||||
|
||||
VkCommandBuffer QVk_CreateCommandBuffer(const VkCommandPool *commandPool, VkCommandBufferLevel level)
|
||||
{
|
||||
VkCommandBuffer commandBuffer = VK_NULL_HANDLE;
|
||||
VkCommandBufferAllocateInfo allocInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
|
||||
.pNext = NULL,
|
||||
.commandPool = *commandPool,
|
||||
.level = level,
|
||||
.commandBufferCount = 1
|
||||
};
|
||||
|
||||
VK_VERIFY(vkAllocateCommandBuffers(vk_device.logical, &allocInfo, &commandBuffer));
|
||||
return commandBuffer;
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,365 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
// internal helper
|
||||
static qboolean deviceExtensionsSupported(const VkPhysicalDevice *physicalDevice, const char* extensionName)
|
||||
{
|
||||
uint32_t availableExtCount = 0;
|
||||
qboolean vk_extension_available = false;
|
||||
VK_VERIFY(vkEnumerateDeviceExtensionProperties(*physicalDevice, NULL, &availableExtCount, NULL));
|
||||
|
||||
if (availableExtCount > 0)
|
||||
{
|
||||
VkExtensionProperties *extensions = (VkExtensionProperties *)malloc(availableExtCount * sizeof(VkExtensionProperties));
|
||||
VK_VERIFY(vkEnumerateDeviceExtensionProperties(*physicalDevice, NULL, &availableExtCount, extensions));
|
||||
|
||||
for (uint32_t i = 0; i < availableExtCount; ++i)
|
||||
{
|
||||
vk_extension_available |= strcmp(extensions[i].extensionName, extensionName) == 0;
|
||||
}
|
||||
|
||||
free(extensions);
|
||||
}
|
||||
|
||||
// lack of extension disqualifies the device
|
||||
return vk_extension_available;
|
||||
}
|
||||
|
||||
// internal helper
|
||||
static void getBestPhysicalDevice(const VkPhysicalDevice *devices, int preferredIdx, int count)
|
||||
{
|
||||
VkPhysicalDeviceProperties deviceProperties;
|
||||
VkPhysicalDeviceFeatures deviceFeatures;
|
||||
uint32_t queueFamilyCount = 0;
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
vkGetPhysicalDeviceProperties(devices[i], &deviceProperties);
|
||||
vkGetPhysicalDeviceFeatures(devices[i], &deviceFeatures);
|
||||
vkGetPhysicalDeviceQueueFamilyProperties(devices[i], &queueFamilyCount, NULL);
|
||||
|
||||
if (queueFamilyCount == 0)
|
||||
continue;
|
||||
|
||||
// prefer discrete GPU but if it's the only one available then don't be picky
|
||||
// also - if the user specifies a preferred device, select it
|
||||
qboolean bestProperties = deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU;
|
||||
if (preferredIdx == i || (bestProperties && preferredIdx < 0) || count == 1)
|
||||
{
|
||||
uint32_t formatCount = 0;
|
||||
uint32_t presentModesCount = 0;
|
||||
|
||||
// check if requested device extensions are present
|
||||
qboolean extSupported = deviceExtensionsSupported(&devices[i], VK_KHR_SWAPCHAIN_EXTENSION_NAME);
|
||||
|
||||
// no required extensions? try next device
|
||||
if (!extSupported)
|
||||
continue;
|
||||
|
||||
// if extensions are fine, query surface formats and present modes to see if the device can be used
|
||||
VK_VERIFY(vkGetPhysicalDeviceSurfaceFormatsKHR(devices[i], vk_surface, &formatCount, NULL));
|
||||
VK_VERIFY(vkGetPhysicalDeviceSurfacePresentModesKHR(devices[i], vk_surface, &presentModesCount, NULL));
|
||||
|
||||
if (formatCount == 0 || presentModesCount == 0)
|
||||
continue;
|
||||
|
||||
VkQueueFamilyProperties *queueFamilies = (VkQueueFamilyProperties *)malloc(queueFamilyCount * sizeof(VkQueueFamilyProperties));
|
||||
vkGetPhysicalDeviceQueueFamilyProperties(devices[i], &queueFamilyCount, queueFamilies);
|
||||
|
||||
// secondary check - device is OK if there's at least on queue with VK_QUEUE_GRAPHICS_BIT set
|
||||
for (uint32_t j = 0; j < queueFamilyCount; ++j)
|
||||
{
|
||||
// check if this queue family has support for presentation
|
||||
VkBool32 presentSupported;
|
||||
VK_VERIFY(vkGetPhysicalDeviceSurfaceSupportKHR(devices[i], j, vk_surface, &presentSupported));
|
||||
|
||||
// good optimization would be to find a queue where presentIdx == gfxQueueIdx for less overhead
|
||||
if (vk_device.presentFamilyIndex < 0 && queueFamilies[j].queueCount > 0 && presentSupported)
|
||||
{
|
||||
vk_device.presentFamilyIndex = j;
|
||||
}
|
||||
|
||||
if (vk_device.gfxFamilyIndex < 0 && queueFamilies[j].queueCount > 0 && (queueFamilies[j].queueFlags & VK_QUEUE_GRAPHICS_BIT))
|
||||
{
|
||||
vk_device.gfxFamilyIndex = j;
|
||||
}
|
||||
|
||||
if (vk_device.transferFamilyIndex < 0 && queueFamilies[j].queueCount > 0 && !(queueFamilies[j].queueFlags & VK_QUEUE_GRAPHICS_BIT) && (queueFamilies[j].queueFlags & VK_QUEUE_TRANSFER_BIT))
|
||||
{
|
||||
vk_device.transferFamilyIndex = j;
|
||||
}
|
||||
}
|
||||
|
||||
free(queueFamilies);
|
||||
|
||||
// accept only device that has support for presentation and drawing
|
||||
if (vk_device.presentFamilyIndex >= 0 && vk_device.gfxFamilyIndex >= 0)
|
||||
{
|
||||
if (vk_device.transferFamilyIndex < 0)
|
||||
{
|
||||
vk_device.transferFamilyIndex = vk_device.gfxFamilyIndex;
|
||||
}
|
||||
|
||||
vk_device.physical = devices[i];
|
||||
vk_device.properties = deviceProperties;
|
||||
vk_device.features = deviceFeatures;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// internal helper
|
||||
static qboolean selectPhysicalDevice(int preferredDeviceIdx)
|
||||
{
|
||||
uint32_t physicalDeviceCount = 0;
|
||||
VK_VERIFY(vkEnumeratePhysicalDevices(vk_instance, &physicalDeviceCount, NULL));
|
||||
|
||||
if (physicalDeviceCount == 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "No Vulkan-capable devices found!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
R_Printf(PRINT_ALL, "...found %d Vulkan-capable device(s)\n", physicalDeviceCount);
|
||||
|
||||
VkPhysicalDevice *physicalDevices = (VkPhysicalDevice *)malloc(physicalDeviceCount * sizeof(VkPhysicalDevice));
|
||||
VK_VERIFY(vkEnumeratePhysicalDevices(vk_instance, &physicalDeviceCount, physicalDevices));
|
||||
|
||||
getBestPhysicalDevice(physicalDevices, preferredDeviceIdx < physicalDeviceCount ? preferredDeviceIdx : -1, physicalDeviceCount);
|
||||
free(physicalDevices);
|
||||
|
||||
if (vk_device.physical == VK_NULL_HANDLE)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "Could not find a suitable physical device!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!vk_device.features.samplerAnisotropy)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "...anisotropy filtering is unsupported.\n");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// internal helper
|
||||
static VkResult createLogicalDevice()
|
||||
{
|
||||
// at least one queue (graphics and present combined) has to be present
|
||||
uint32_t numQueues = 1;
|
||||
float queuePriority = 1.f;
|
||||
VkDeviceQueueCreateInfo queueCreateInfo[3];
|
||||
queueCreateInfo[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
|
||||
queueCreateInfo[0].pNext = NULL;
|
||||
queueCreateInfo[0].flags = 0;
|
||||
queueCreateInfo[0].queueFamilyIndex = vk_device.gfxFamilyIndex;
|
||||
queueCreateInfo[0].queueCount = 1;
|
||||
queueCreateInfo[0].pQueuePriorities = &queuePriority;
|
||||
queueCreateInfo[1].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
|
||||
queueCreateInfo[1].pNext = NULL;
|
||||
queueCreateInfo[1].flags = 0;
|
||||
queueCreateInfo[1].queueFamilyIndex = 0;
|
||||
queueCreateInfo[1].queueCount = 1;
|
||||
queueCreateInfo[1].pQueuePriorities = &queuePriority;
|
||||
queueCreateInfo[2].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
|
||||
queueCreateInfo[2].pNext = NULL;
|
||||
queueCreateInfo[2].flags = 0;
|
||||
queueCreateInfo[2].queueFamilyIndex = 0;
|
||||
queueCreateInfo[2].queueCount = 1;
|
||||
queueCreateInfo[2].pQueuePriorities = &queuePriority;
|
||||
|
||||
VkPhysicalDeviceFeatures wantedDeviceFeatures = {
|
||||
.samplerAnisotropy = vk_device.features.samplerAnisotropy,
|
||||
.fillModeNonSolid = vk_device.features.fillModeNonSolid, // for wireframe rendering
|
||||
.sampleRateShading = vk_device.features.sampleRateShading, // for sample shading
|
||||
};
|
||||
|
||||
// a graphics and present queue are different - two queues have to be created
|
||||
if (vk_device.gfxFamilyIndex != vk_device.presentFamilyIndex)
|
||||
{
|
||||
queueCreateInfo[numQueues++].queueFamilyIndex = vk_device.presentFamilyIndex;
|
||||
}
|
||||
|
||||
// a separate transfer queue exists that's different from present and graphics queue?
|
||||
if (vk_device.transferFamilyIndex != vk_device.gfxFamilyIndex && vk_device.transferFamilyIndex != vk_device.presentFamilyIndex)
|
||||
{
|
||||
queueCreateInfo[numQueues++].queueFamilyIndex = vk_device.transferFamilyIndex;
|
||||
}
|
||||
|
||||
const char *deviceExtensions[] = { VK_KHR_SWAPCHAIN_EXTENSION_NAME };
|
||||
|
||||
VkDeviceCreateInfo deviceCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
|
||||
.pEnabledFeatures = &wantedDeviceFeatures,
|
||||
.ppEnabledExtensionNames = deviceExtensions,
|
||||
.enabledExtensionCount = 1,
|
||||
.enabledLayerCount = 0,
|
||||
.ppEnabledLayerNames = NULL,
|
||||
.queueCreateInfoCount = numQueues,
|
||||
.pQueueCreateInfos = queueCreateInfo
|
||||
};
|
||||
|
||||
#if VK_HEADER_VERSION > 101
|
||||
const char *validationLayers[] = { "VK_LAYER_KHRONOS_validation" };
|
||||
#else
|
||||
const char *validationLayers[] = { "VK_LAYER_LUNARG_standard_validation" };
|
||||
#endif
|
||||
|
||||
if (vk_validation->value)
|
||||
{
|
||||
deviceCreateInfo.enabledLayerCount = sizeof(validationLayers)/sizeof(validationLayers[0]);
|
||||
deviceCreateInfo.ppEnabledLayerNames = validationLayers;
|
||||
}
|
||||
|
||||
return vkCreateDevice(vk_device.physical, &deviceCreateInfo, NULL, &vk_device.logical);
|
||||
}
|
||||
|
||||
// internal helper
|
||||
static const char *deviceTypeString(VkPhysicalDeviceType dType)
|
||||
{
|
||||
#define DEVTYPESTR(r) case VK_ ##r: return "VK_"#r
|
||||
switch (dType)
|
||||
{
|
||||
DEVTYPESTR(PHYSICAL_DEVICE_TYPE_OTHER);
|
||||
DEVTYPESTR(PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU);
|
||||
DEVTYPESTR(PHYSICAL_DEVICE_TYPE_DISCRETE_GPU);
|
||||
DEVTYPESTR(PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU);
|
||||
DEVTYPESTR(PHYSICAL_DEVICE_TYPE_CPU);
|
||||
default: return "<unknown>";
|
||||
}
|
||||
#undef DEVTYPESTR
|
||||
return "UNKNOWN DEVICE";
|
||||
}
|
||||
|
||||
// internal helper
|
||||
static const char *vendorNameString(uint32_t vendorId)
|
||||
{
|
||||
switch (vendorId)
|
||||
{
|
||||
case 0x1002: return "AMD";
|
||||
case 0x1010: return "ImgTec";
|
||||
case 0x10DE: return "NVIDIA";
|
||||
case 0x13B5: return "ARM";
|
||||
case 0x5143: return "Qualcomm";
|
||||
case 0x8086: return "Intel";
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
qboolean QVk_CreateDevice(int preferredDeviceIdx)
|
||||
{
|
||||
if (!selectPhysicalDevice(preferredDeviceIdx))
|
||||
return false;
|
||||
|
||||
vk_config.vendor_name = vendorNameString(vk_device.properties.vendorID);
|
||||
vk_config.device_type = deviceTypeString(vk_device.properties.deviceType);
|
||||
|
||||
VkResult res = createLogicalDevice();
|
||||
if (res != VK_SUCCESS)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "Could not create Vulkan logical device: %s\n", QVk_GetError(res));
|
||||
return false;
|
||||
}
|
||||
|
||||
vkGetDeviceQueue(vk_device.logical, vk_device.gfxFamilyIndex, 0, &vk_device.gfxQueue);
|
||||
vkGetDeviceQueue(vk_device.logical, vk_device.presentFamilyIndex, 0, &vk_device.presentQueue);
|
||||
vkGetDeviceQueue(vk_device.logical, vk_device.transferFamilyIndex, 0, &vk_device.transferQueue);
|
||||
vkGetPhysicalDeviceMemoryProperties(vk_device.physical, &vk_device.mem_properties);
|
||||
// init our memory management
|
||||
vulkan_memory_init();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// debug label related functions
|
||||
void QVk_DebugSetObjectName(uint64_t obj, VkObjectType objType, const char *objName)
|
||||
{
|
||||
if (qvkSetDebugUtilsObjectNameEXT)
|
||||
{
|
||||
VkDebugUtilsObjectNameInfoEXT oNameInf = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT,
|
||||
.pNext = NULL,
|
||||
.objectType = objType,
|
||||
.objectHandle = obj,
|
||||
.pObjectName = objName
|
||||
};
|
||||
|
||||
qvkSetDebugUtilsObjectNameEXT(vk_device.logical, &oNameInf);
|
||||
}
|
||||
}
|
||||
|
||||
void QVk_DebugSetObjectTag(uint64_t obj, VkObjectType objType, uint64_t tagName,
|
||||
size_t tagSize, const void *tagData)
|
||||
{
|
||||
if (qvkSetDebugUtilsObjectTagEXT)
|
||||
{
|
||||
VkDebugUtilsObjectTagInfoEXT oTagInf = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_OBJECT_TAG_INFO_EXT,
|
||||
.pNext = NULL,
|
||||
.objectType = objType,
|
||||
.objectHandle = obj,
|
||||
.tagName = tagName,
|
||||
.tagSize = tagSize,
|
||||
.pTag = tagData
|
||||
};
|
||||
|
||||
qvkSetDebugUtilsObjectTagEXT(vk_device.logical, &oTagInf);
|
||||
}
|
||||
}
|
||||
|
||||
void QVk_DebugLabelBegin(const VkCommandBuffer *cmdBuffer, const char *labelName, const float r, const float g, const float b)
|
||||
{
|
||||
if (qvkCmdBeginDebugUtilsLabelEXT)
|
||||
{
|
||||
VkDebugUtilsLabelEXT labelInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
|
||||
.pNext = NULL,
|
||||
.pLabelName = labelName,
|
||||
.color = { r, g, b, 1.f }
|
||||
};
|
||||
|
||||
qvkCmdBeginDebugUtilsLabelEXT(*cmdBuffer, &labelInfo);
|
||||
}
|
||||
}
|
||||
|
||||
void QVk_DebugLabelEnd(const VkCommandBuffer *cmdBuffer)
|
||||
{
|
||||
if (qvkCmdEndDebugUtilsLabelEXT)
|
||||
{
|
||||
qvkCmdEndDebugUtilsLabelEXT(*cmdBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
void QVk_DebugLabelInsert(const VkCommandBuffer *cmdBuffer, const char *labelName, const float r, const float g, const float b)
|
||||
{
|
||||
if (qvkInsertDebugUtilsLabelEXT)
|
||||
{
|
||||
VkDebugUtilsLabelEXT labelInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
|
||||
.pNext = NULL,
|
||||
.pLabelName = labelName,
|
||||
.color = { r, g, b, 1.f }
|
||||
};
|
||||
|
||||
qvkInsertDebugUtilsLabelEXT(*cmdBuffer, &labelInfo);
|
||||
}
|
||||
}
|
|
@ -1,371 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
// vk_draw.c
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
static image_t *draw_chars;
|
||||
|
||||
/*
|
||||
===============
|
||||
Draw_InitLocal
|
||||
===============
|
||||
*/
|
||||
void Draw_InitLocal (void)
|
||||
{
|
||||
draw_chars = Vk_FindImage("pics/conchars.pcx", it_pic);
|
||||
if (!draw_chars)
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: Couldn't load pics/conchars.pcx", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
RE_Draw_CharScaled
|
||||
|
||||
Draws one 8*8 graphics character with 0 being transparent.
|
||||
It can be clipped to the top of the screen to allow the console to be
|
||||
smoothly scrolled off.
|
||||
================
|
||||
*/
|
||||
void RE_Draw_CharScaled (int x, int y, int num, float scale)
|
||||
{
|
||||
int row, col;
|
||||
float frow, fcol, size;
|
||||
|
||||
if (!vk_frameStarted)
|
||||
return;
|
||||
|
||||
num &= 255;
|
||||
|
||||
if ((num & 127) == 32)
|
||||
return; // space
|
||||
|
||||
if (y <= -8)
|
||||
return; // totally off screen
|
||||
|
||||
row = num >> 4;
|
||||
col = num & 15;
|
||||
|
||||
frow = row * 0.0625;
|
||||
fcol = col * 0.0625;
|
||||
size = 0.0625;
|
||||
|
||||
float imgTransform[] = { (float)x / vid.width, (float)y / vid.height,
|
||||
8.f * scale / vid.width, 8.f * scale / vid.height,
|
||||
fcol, frow, size, size };
|
||||
QVk_DrawTexRect(imgTransform, sizeof(imgTransform), &draw_chars->vk_texture);
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
RE_Draw_FindPic
|
||||
=============
|
||||
*/
|
||||
image_t *RE_Draw_FindPic (char *name)
|
||||
{
|
||||
image_t *vk;
|
||||
|
||||
if (name[0] != '/' && name[0] != '\\')
|
||||
{
|
||||
char fullname[MAX_QPATH];
|
||||
|
||||
Com_sprintf(fullname, sizeof(fullname), "pics/%s.pcx", name);
|
||||
vk = Vk_FindImage(fullname, it_pic);
|
||||
}
|
||||
else
|
||||
vk = Vk_FindImage(name + 1, it_pic);
|
||||
|
||||
return vk;
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
RE_Draw_GetPicSize
|
||||
=============
|
||||
*/
|
||||
void RE_Draw_GetPicSize (int *w, int *h, char *name)
|
||||
{
|
||||
image_t *vk;
|
||||
|
||||
vk = RE_Draw_FindPic(name);
|
||||
if (!vk)
|
||||
{
|
||||
*w = *h = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
*w = vk->width;
|
||||
*h = vk->height;
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
RE_Draw_StretchPic
|
||||
=============
|
||||
*/
|
||||
void RE_Draw_StretchPic (int x, int y, int w, int h, char *name)
|
||||
{
|
||||
image_t *vk;
|
||||
|
||||
if (!vk_frameStarted)
|
||||
return;
|
||||
|
||||
vk = RE_Draw_FindPic(name);
|
||||
if (!vk)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s(): Can't find pic: %s\n", __func__, name);
|
||||
return;
|
||||
}
|
||||
|
||||
float imgTransform[] = { (float)x / vid.width, (float)y / vid.height,
|
||||
(float)w / vid.width, (float)h / vid.height,
|
||||
0, 0, 1, 1 };
|
||||
QVk_DrawTexRect(imgTransform, sizeof(imgTransform), &vk->vk_texture);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
RE_Draw_PicScaled
|
||||
=============
|
||||
*/
|
||||
void RE_Draw_PicScaled (int x, int y, char *name, float scale)
|
||||
{
|
||||
image_t *vk;
|
||||
|
||||
vk = RE_Draw_FindPic(name);
|
||||
if (!vk)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s(): Can't find pic: %s\n", __func__, name);
|
||||
return;
|
||||
}
|
||||
|
||||
RE_Draw_StretchPic(x, y, vk->width*scale, vk->height*scale, name);
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
RE_Draw_TileClear
|
||||
|
||||
This repeats a 64*64 tile graphic to fill the screen around a sized down
|
||||
refresh window.
|
||||
=============
|
||||
*/
|
||||
void RE_Draw_TileClear (int x, int y, int w, int h, char *name)
|
||||
{
|
||||
image_t *image;
|
||||
|
||||
if (!vk_frameStarted)
|
||||
return;
|
||||
|
||||
image = RE_Draw_FindPic(name);
|
||||
if (!image)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s(): Can't find pic: %s\n", __func__, name);
|
||||
return;
|
||||
}
|
||||
|
||||
// Change viewport and scissor to draw in the top left corner as the world view.
|
||||
VkViewport tileViewport = vk_viewport;
|
||||
VkRect2D tileScissor = vk_scissor;
|
||||
|
||||
tileViewport.x = 0.f;
|
||||
tileViewport.y = 0.f;
|
||||
tileScissor.offset.x = 0;
|
||||
tileScissor.offset.y = 0;
|
||||
|
||||
vkCmdSetViewport(vk_activeCmdbuffer, 0u, 1u, &tileViewport);
|
||||
vkCmdSetScissor(vk_activeCmdbuffer, 0u, 1u, &tileScissor);
|
||||
|
||||
const float divisor = (vk_pixel_size->value < 1.0f ? 1.0f : vk_pixel_size->value);
|
||||
float imgTransform[] = { (float)x / (vid.width * divisor), (float)y / (vid.height * divisor),
|
||||
(float)w / (vid.width * divisor), (float)h / (vid.height * divisor),
|
||||
(float)x / (64.0 * divisor), (float)y / (64.0 * divisor),
|
||||
(float)w / (64.0 * divisor), (float)h / (64.0 * divisor) };
|
||||
QVk_DrawTexRect(imgTransform, sizeof(imgTransform), &image->vk_texture);
|
||||
|
||||
// Restore viewport and scissor.
|
||||
vkCmdSetViewport(vk_activeCmdbuffer, 0u, 1u, &vk_viewport);
|
||||
vkCmdSetScissor(vk_activeCmdbuffer, 0u, 1u, &vk_scissor);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
RE_Draw_Fill
|
||||
|
||||
Fills a box of pixels with a single color
|
||||
=============
|
||||
*/
|
||||
void RE_Draw_Fill (int x, int y, int w, int h, int c)
|
||||
{
|
||||
union
|
||||
{
|
||||
unsigned c;
|
||||
byte v[4];
|
||||
} color;
|
||||
|
||||
if (!vk_frameStarted)
|
||||
return;
|
||||
|
||||
if ((unsigned)c > 255)
|
||||
ri.Sys_Error(ERR_FATAL, "%s: bad color", __func__);
|
||||
|
||||
color.c = d_8to24table[c];
|
||||
|
||||
float imgTransform[] = { (float)x / vid.width, (float)y / vid.height,
|
||||
(float)w / vid.width, (float)h / vid.height,
|
||||
color.v[0] / 255.f, color.v[1] / 255.f, color.v[2] / 255.f, 1.f };
|
||||
QVk_DrawColorRect(imgTransform, sizeof(imgTransform), RP_UI);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
/*
|
||||
================
|
||||
RE_Draw_FadeScreen
|
||||
|
||||
================
|
||||
*/
|
||||
void RE_Draw_FadeScreen (void)
|
||||
{
|
||||
float imgTransform[] = { 0.f, 0.f, vid.width, vid.height, 0.f, 0.f, 0.f, .8f };
|
||||
|
||||
if (!vk_frameStarted)
|
||||
return;
|
||||
|
||||
QVk_DrawColorRect(imgTransform, sizeof(imgTransform), RP_UI);
|
||||
}
|
||||
|
||||
|
||||
//====================================================================
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
RE_Draw_StretchRaw
|
||||
=============
|
||||
*/
|
||||
extern unsigned r_rawpalette[256];
|
||||
extern qvktexture_t vk_rawTexture;
|
||||
static int scaled_size = 512;
|
||||
|
||||
void RE_Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data)
|
||||
{
|
||||
|
||||
int i, j;
|
||||
int hscale, vscale;
|
||||
unsigned *dest;
|
||||
byte *source;
|
||||
byte *image_scaled;
|
||||
unsigned *raw_image32;
|
||||
|
||||
if (!vk_frameStarted)
|
||||
return;
|
||||
|
||||
if (vk_retexturing->value)
|
||||
{
|
||||
// triple scaling
|
||||
if (cols < (vid.width / 3) || rows < (vid.height / 3))
|
||||
{
|
||||
image_scaled = malloc(cols * rows * 9);
|
||||
|
||||
scale3x(data, image_scaled, cols, rows);
|
||||
|
||||
cols = cols * 3;
|
||||
rows = rows * 3;
|
||||
}
|
||||
else
|
||||
// double scaling
|
||||
{
|
||||
image_scaled = malloc(cols * rows * 4);
|
||||
|
||||
scale2x(data, image_scaled, cols, rows);
|
||||
|
||||
cols = cols * 2;
|
||||
rows = rows * 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
image_scaled = data;
|
||||
}
|
||||
|
||||
if (vk_rawTexture.resource.image == VK_NULL_HANDLE)
|
||||
{
|
||||
// get power of two image size,
|
||||
// could be updated only size only after recreate texture
|
||||
for (scaled_size = 512; scaled_size < cols && scaled_size < rows; scaled_size <<= 1)
|
||||
;
|
||||
}
|
||||
|
||||
raw_image32 = malloc(scaled_size * scaled_size * sizeof(unsigned));
|
||||
|
||||
hscale = cols * 0x10000 / scaled_size;
|
||||
vscale = rows * 0x10000 / scaled_size;
|
||||
|
||||
source = image_scaled;
|
||||
dest = raw_image32;
|
||||
for (i = 0; i < scaled_size; i++)
|
||||
{
|
||||
for (j = 0; j < scaled_size; j++)
|
||||
{
|
||||
*dest = r_rawpalette[*(source + ((j * hscale) >> 16))];
|
||||
dest ++;
|
||||
}
|
||||
source = image_scaled + (((i * vscale) >> 16) * cols);
|
||||
}
|
||||
|
||||
if (vk_retexturing->value)
|
||||
{
|
||||
free(image_scaled);
|
||||
SmoothColorImage(raw_image32, scaled_size * scaled_size, scaled_size >> 7);
|
||||
}
|
||||
|
||||
if (vk_rawTexture.resource.image != VK_NULL_HANDLE)
|
||||
{
|
||||
QVk_UpdateTextureData(&vk_rawTexture, (unsigned char*)raw_image32, 0, 0, scaled_size, scaled_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
QVVKTEXTURE_CLEAR(vk_rawTexture);
|
||||
QVk_CreateTexture(&vk_rawTexture, (unsigned char*)raw_image32, scaled_size, scaled_size,
|
||||
vk_current_sampler, false);
|
||||
QVk_DebugSetObjectName((uint64_t)vk_rawTexture.resource.image,
|
||||
VK_OBJECT_TYPE_IMAGE, "Image: raw texture");
|
||||
QVk_DebugSetObjectName((uint64_t)vk_rawTexture.imageView,
|
||||
VK_OBJECT_TYPE_IMAGE_VIEW, "Image View: raw texture");
|
||||
QVk_DebugSetObjectName((uint64_t)vk_rawTexture.descriptorSet,
|
||||
VK_OBJECT_TYPE_DESCRIPTOR_SET, "Descriptor Set: raw texture");
|
||||
QVk_DebugSetObjectName((uint64_t)vk_rawTexture.resource.memory,
|
||||
VK_OBJECT_TYPE_DEVICE_MEMORY, "Memory: raw texture");
|
||||
}
|
||||
free(raw_image32);
|
||||
|
||||
float imgTransform[] = { (float)x / vid.width, (float)y / vid.height,
|
||||
(float)w / vid.width, (float)h / vid.height,
|
||||
0.f, 0.f, 1.f, 1.0f };
|
||||
QVk_DrawTexRect(imgTransform, sizeof(imgTransform), &vk_rawTexture);
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,626 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// vk_light.c
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
static int r_dlightframecount;
|
||||
|
||||
#define DLIGHT_CUTOFF 64
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
DYNAMIC LIGHTS BLEND RENDERING
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
void R_RenderDlight (dlight_t *light)
|
||||
{
|
||||
int i, j;
|
||||
float rad;
|
||||
|
||||
rad = light->intensity * 0.35;
|
||||
|
||||
struct {
|
||||
vec3_t verts;
|
||||
float color[3];
|
||||
} lightVerts[18];
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
lightVerts[0].verts[i] = light->origin[i] - vpn[i] * rad;
|
||||
|
||||
lightVerts[0].color[0] = light->color[0] * 0.2;
|
||||
lightVerts[0].color[1] = light->color[1] * 0.2;
|
||||
lightVerts[0].color[2] = light->color[2] * 0.2;
|
||||
|
||||
for (i = 16; i >= 0; i--)
|
||||
{
|
||||
float a;
|
||||
|
||||
a = i / 16.0 * M_PI * 2;
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
lightVerts[i+1].verts[j] = light->origin[j] + vright[j] * cos(a)*rad
|
||||
+ vup[j] * sin(a)*rad;
|
||||
lightVerts[i+1].color[j] = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
QVk_BindPipeline(&vk_drawDLightPipeline);
|
||||
|
||||
VkBuffer vbo;
|
||||
VkDeviceSize vboOffset;
|
||||
uint32_t uboOffset;
|
||||
VkDescriptorSet uboDescriptorSet;
|
||||
uint8_t *vertData = QVk_GetVertexBuffer(sizeof(lightVerts), &vbo, &vboOffset);
|
||||
uint8_t *uboData = QVk_GetUniformBuffer(sizeof(r_viewproj_matrix), &uboOffset, &uboDescriptorSet);
|
||||
memcpy(vertData, lightVerts, sizeof(lightVerts));
|
||||
memcpy(uboData, r_viewproj_matrix, sizeof(r_viewproj_matrix));
|
||||
|
||||
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
|
||||
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawDLightPipeline.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset);
|
||||
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo(48), 0, VK_INDEX_TYPE_UINT16);
|
||||
vkCmdDrawIndexed(vk_activeCmdbuffer, 48, 1, 0, 0, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
R_RenderDlights
|
||||
=============
|
||||
*/
|
||||
void R_RenderDlights (void)
|
||||
{
|
||||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
if (!vk_flashblend->value)
|
||||
return;
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
// advanced yet for this frame
|
||||
l = r_newrefdef.dlights;
|
||||
for (i=0 ; i<r_newrefdef.num_dlights ; i++, l++)
|
||||
R_RenderDlight (l);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
DYNAMIC LIGHTS
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
=============
|
||||
R_MarkLights
|
||||
=============
|
||||
*/
|
||||
void R_MarkLights (dlight_t *light, int bit, mnode_t *node)
|
||||
{
|
||||
cplane_t *splitplane;
|
||||
float dist;
|
||||
msurface_t *surf;
|
||||
int i;
|
||||
|
||||
if (node->contents != -1)
|
||||
return;
|
||||
|
||||
splitplane = node->plane;
|
||||
dist = DotProduct (light->origin, splitplane->normal) - splitplane->dist;
|
||||
|
||||
if (dist > light->intensity-DLIGHT_CUTOFF)
|
||||
{
|
||||
R_MarkLights (light, bit, node->children[0]);
|
||||
return;
|
||||
}
|
||||
if (dist < -light->intensity+DLIGHT_CUTOFF)
|
||||
{
|
||||
R_MarkLights (light, bit, node->children[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
// mark the polygons
|
||||
surf = r_worldmodel->surfaces + node->firstsurface;
|
||||
for (i=0 ; i<node->numsurfaces ; i++, surf++)
|
||||
{
|
||||
if (surf->dlightframe != r_dlightframecount)
|
||||
{
|
||||
surf->dlightbits = 0;
|
||||
surf->dlightframe = r_dlightframecount;
|
||||
}
|
||||
surf->dlightbits |= bit;
|
||||
}
|
||||
|
||||
R_MarkLights (light, bit, node->children[0]);
|
||||
R_MarkLights (light, bit, node->children[1]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_PushDlights
|
||||
=============
|
||||
*/
|
||||
void R_PushDlights (void)
|
||||
{
|
||||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
if (vk_flashblend->value)
|
||||
return;
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
// advanced yet for this frame
|
||||
l = r_newrefdef.dlights;
|
||||
for (i=0 ; i<r_newrefdef.num_dlights ; i++, l++)
|
||||
R_MarkLights ( l, 1<<i, r_worldmodel->nodes );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
LIGHT SAMPLING
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
vec3_t pointcolor;
|
||||
cplane_t *lightplane; // used as shadow plane
|
||||
vec3_t lightspot;
|
||||
|
||||
static int RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
||||
{
|
||||
float front, back, frac;
|
||||
int side;
|
||||
cplane_t *plane;
|
||||
vec3_t mid;
|
||||
msurface_t *surf;
|
||||
int s, t, ds, dt;
|
||||
int i;
|
||||
mtexinfo_t *tex;
|
||||
byte *lightmap;
|
||||
int maps;
|
||||
int r;
|
||||
|
||||
if (node->contents != -1)
|
||||
return -1; // didn't hit anything
|
||||
|
||||
// calculate mid point
|
||||
|
||||
// FIXME: optimize for axial
|
||||
plane = node->plane;
|
||||
front = DotProduct (start, plane->normal) - plane->dist;
|
||||
back = DotProduct (end, plane->normal) - plane->dist;
|
||||
side = front < 0;
|
||||
|
||||
if ( (back < 0) == side)
|
||||
return RecursiveLightPoint (node->children[side], start, end);
|
||||
|
||||
frac = front / (front-back);
|
||||
mid[0] = start[0] + (end[0] - start[0])*frac;
|
||||
mid[1] = start[1] + (end[1] - start[1])*frac;
|
||||
mid[2] = start[2] + (end[2] - start[2])*frac;
|
||||
|
||||
// go down front side
|
||||
r = RecursiveLightPoint (node->children[side], start, mid);
|
||||
if (r >= 0)
|
||||
return r; // hit something
|
||||
|
||||
// check for impact on this node
|
||||
VectorCopy (mid, lightspot);
|
||||
lightplane = plane;
|
||||
|
||||
surf = r_worldmodel->surfaces + node->firstsurface;
|
||||
for (i=0 ; i<node->numsurfaces ; i++, surf++)
|
||||
{
|
||||
vec3_t scale;
|
||||
|
||||
if (surf->flags&(SURF_DRAWTURB|SURF_DRAWSKY))
|
||||
continue; // no lightmaps
|
||||
|
||||
tex = surf->texinfo;
|
||||
|
||||
s = DotProduct (mid, tex->vecs[0]) + tex->vecs[0][3];
|
||||
t = DotProduct (mid, tex->vecs[1]) + tex->vecs[1][3];;
|
||||
|
||||
if (s < surf->texturemins[0] ||
|
||||
t < surf->texturemins[1])
|
||||
continue;
|
||||
|
||||
ds = s - surf->texturemins[0];
|
||||
dt = t - surf->texturemins[1];
|
||||
|
||||
if ( ds > surf->extents[0] || dt > surf->extents[1] )
|
||||
continue;
|
||||
|
||||
if (!surf->samples)
|
||||
return 0;
|
||||
|
||||
ds >>= 4;
|
||||
dt >>= 4;
|
||||
|
||||
lightmap = surf->samples;
|
||||
VectorCopy (vec3_origin, pointcolor);
|
||||
|
||||
lightmap += 3*(dt * ((surf->extents[0]>>4)+1) + ds);
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
for (int j=0 ; j<3 ; j++)
|
||||
scale[j] = r_modulate->value*r_newrefdef.lightstyles[surf->styles[maps]].rgb[j];
|
||||
|
||||
pointcolor[0] += lightmap[0] * scale[0] * (1.0/255);
|
||||
pointcolor[1] += lightmap[1] * scale[1] * (1.0/255);
|
||||
pointcolor[2] += lightmap[2] * scale[2] * (1.0/255);
|
||||
lightmap += 3*((surf->extents[0]>>4)+1) *
|
||||
((surf->extents[1]>>4)+1);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// go down back side
|
||||
return RecursiveLightPoint (node->children[!side], mid, end);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
R_LightPoint
|
||||
===============
|
||||
*/
|
||||
void R_LightPoint (vec3_t p, vec3_t color, entity_t *currententity)
|
||||
{
|
||||
vec3_t end;
|
||||
float r;
|
||||
int lnum;
|
||||
dlight_t *dl;
|
||||
vec3_t dist;
|
||||
|
||||
if (!r_worldmodel->lightdata || !currententity)
|
||||
{
|
||||
color[0] = color[1] = color[2] = 1.0;
|
||||
return;
|
||||
}
|
||||
|
||||
end[0] = p[0];
|
||||
end[1] = p[1];
|
||||
end[2] = p[2] - 2048;
|
||||
|
||||
r = RecursiveLightPoint (r_worldmodel->nodes, p, end);
|
||||
|
||||
if (r == -1)
|
||||
{
|
||||
VectorCopy (vec3_origin, color);
|
||||
}
|
||||
else
|
||||
{
|
||||
VectorCopy (pointcolor, color);
|
||||
}
|
||||
|
||||
//
|
||||
// add dynamic lights
|
||||
//
|
||||
dl = r_newrefdef.dlights;
|
||||
for (lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++, dl++)
|
||||
{
|
||||
float add;
|
||||
|
||||
VectorSubtract (currententity->origin,
|
||||
dl->origin,
|
||||
dist);
|
||||
add = dl->intensity - VectorLength(dist);
|
||||
add *= (1.0/256);
|
||||
if (add > 0)
|
||||
{
|
||||
VectorMA (color, add, dl->color, color);
|
||||
}
|
||||
}
|
||||
|
||||
VectorScale (color, r_modulate->value, color);
|
||||
}
|
||||
|
||||
|
||||
//===================================================================
|
||||
|
||||
static float s_blocklights[34*34*3];
|
||||
/*
|
||||
===============
|
||||
R_AddDynamicLights
|
||||
===============
|
||||
*/
|
||||
static void R_AddDynamicLights (msurface_t *surf)
|
||||
{
|
||||
int lnum;
|
||||
int sd, td;
|
||||
float fdist, frad, fminlight;
|
||||
vec3_t impact, local;
|
||||
int s, t;
|
||||
int i;
|
||||
int smax, tmax;
|
||||
mtexinfo_t *tex;
|
||||
dlight_t *dl;
|
||||
float *pfBL;
|
||||
float fsacc, ftacc;
|
||||
|
||||
smax = (surf->extents[0]>>4)+1;
|
||||
tmax = (surf->extents[1]>>4)+1;
|
||||
tex = surf->texinfo;
|
||||
|
||||
for (lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++)
|
||||
{
|
||||
if ( !(surf->dlightbits & (1<<lnum) ) )
|
||||
continue; // not lit by this light
|
||||
|
||||
dl = &r_newrefdef.dlights[lnum];
|
||||
frad = dl->intensity;
|
||||
fdist = DotProduct (dl->origin, surf->plane->normal) -
|
||||
surf->plane->dist;
|
||||
frad -= fabs(fdist);
|
||||
// rad is now the highest intensity on the plane
|
||||
|
||||
fminlight = DLIGHT_CUTOFF; // FIXME: make configurable?
|
||||
if (frad < fminlight)
|
||||
continue;
|
||||
fminlight = frad - fminlight;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
impact[i] = dl->origin[i] -
|
||||
surf->plane->normal[i]*fdist;
|
||||
}
|
||||
|
||||
local[0] = DotProduct (impact, tex->vecs[0]) + tex->vecs[0][3] - surf->texturemins[0];
|
||||
local[1] = DotProduct (impact, tex->vecs[1]) + tex->vecs[1][3] - surf->texturemins[1];
|
||||
|
||||
pfBL = s_blocklights;
|
||||
for (t = 0, ftacc = 0 ; t<tmax ; t++, ftacc += 16)
|
||||
{
|
||||
td = local[1] - ftacc;
|
||||
if ( td < 0 )
|
||||
td = -td;
|
||||
|
||||
for ( s=0, fsacc = 0 ; s<smax ; s++, fsacc += 16, pfBL += 3)
|
||||
{
|
||||
sd = Q_ftol( local[0] - fsacc );
|
||||
|
||||
if ( sd < 0 )
|
||||
sd = -sd;
|
||||
|
||||
if (sd > td)
|
||||
fdist = sd + (td>>1);
|
||||
else
|
||||
fdist = td + (sd>>1);
|
||||
|
||||
if ( fdist < fminlight )
|
||||
{
|
||||
pfBL[0] += ( frad - fdist ) * dl->color[0];
|
||||
pfBL[1] += ( frad - fdist ) * dl->color[1];
|
||||
pfBL[2] += ( frad - fdist ) * dl->color[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** R_SetCacheState
|
||||
*/
|
||||
void R_SetCacheState( msurface_t *surf )
|
||||
{
|
||||
int maps;
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
surf->cached_light[maps] = r_newrefdef.lightstyles[surf->styles[maps]].white;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
R_BuildLightMap
|
||||
|
||||
Combine and scale multiple lightmaps into the floating format in blocklights
|
||||
===============
|
||||
*/
|
||||
void R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
|
||||
{
|
||||
int smax, tmax;
|
||||
int r, g, b, a, max;
|
||||
int i, j, size;
|
||||
byte *lightmap;
|
||||
float scale[4];
|
||||
int nummaps;
|
||||
float *bl;
|
||||
|
||||
if ( surf->texinfo->flags & (SURF_SKY|SURF_TRANS33|SURF_TRANS66|SURF_WARP) )
|
||||
ri.Sys_Error (ERR_DROP, "R_BuildLightMap called for non-lit surface");
|
||||
|
||||
smax = (surf->extents[0]>>4)+1;
|
||||
tmax = (surf->extents[1]>>4)+1;
|
||||
size = smax*tmax;
|
||||
if (size > (sizeof(s_blocklights)>>4) )
|
||||
ri.Sys_Error (ERR_DROP, "Bad s_blocklights size");
|
||||
|
||||
// set to full bright if no light data
|
||||
if (!surf->samples)
|
||||
{
|
||||
for (i=0 ; i<size*3 ; i++)
|
||||
s_blocklights[i] = 255;
|
||||
goto store;
|
||||
}
|
||||
|
||||
// count the # of maps
|
||||
for ( nummaps = 0 ; nummaps < MAXLIGHTMAPS && surf->styles[nummaps] != 255 ;
|
||||
nummaps++)
|
||||
;
|
||||
|
||||
lightmap = surf->samples;
|
||||
|
||||
// add all the lightmaps
|
||||
if ( nummaps == 1 )
|
||||
{
|
||||
int maps;
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
bl = s_blocklights;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
scale[i] = r_modulate->value*r_newrefdef.lightstyles[surf->styles[maps]].rgb[i];
|
||||
|
||||
if ( scale[0] == 1.0F &&
|
||||
scale[1] == 1.0F &&
|
||||
scale[2] == 1.0F )
|
||||
{
|
||||
for (i=0 ; i<size ; i++, bl+=3)
|
||||
{
|
||||
bl[0] = lightmap[i*3+0];
|
||||
bl[1] = lightmap[i*3+1];
|
||||
bl[2] = lightmap[i*3+2];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0 ; i<size ; i++, bl+=3)
|
||||
{
|
||||
bl[0] = lightmap[i*3+0] * scale[0];
|
||||
bl[1] = lightmap[i*3+1] * scale[1];
|
||||
bl[2] = lightmap[i*3+2] * scale[2];
|
||||
}
|
||||
}
|
||||
lightmap += size*3; // skip to next lightmap
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int maps;
|
||||
|
||||
memset( s_blocklights, 0, sizeof( s_blocklights[0] ) * size * 3 );
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
bl = s_blocklights;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
scale[i] = r_modulate->value*r_newrefdef.lightstyles[surf->styles[maps]].rgb[i];
|
||||
|
||||
if ( scale[0] == 1.0F &&
|
||||
scale[1] == 1.0F &&
|
||||
scale[2] == 1.0F )
|
||||
{
|
||||
for (i=0 ; i<size ; i++, bl+=3 )
|
||||
{
|
||||
bl[0] += lightmap[i*3+0];
|
||||
bl[1] += lightmap[i*3+1];
|
||||
bl[2] += lightmap[i*3+2];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0 ; i<size ; i++, bl+=3)
|
||||
{
|
||||
bl[0] += lightmap[i*3+0] * scale[0];
|
||||
bl[1] += lightmap[i*3+1] * scale[1];
|
||||
bl[2] += lightmap[i*3+2] * scale[2];
|
||||
}
|
||||
}
|
||||
lightmap += size*3; // skip to next lightmap
|
||||
}
|
||||
}
|
||||
|
||||
// add all the dynamic lights
|
||||
if (surf->dlightframe == r_framecount)
|
||||
R_AddDynamicLights (surf);
|
||||
|
||||
store:
|
||||
// put into texture format
|
||||
stride -= (smax<<2);
|
||||
bl = s_blocklights;
|
||||
|
||||
for (i = 0; i < tmax; i++, dest += stride)
|
||||
{
|
||||
for (j = 0; j < smax; j++)
|
||||
{
|
||||
|
||||
r = Q_ftol(bl[0]);
|
||||
g = Q_ftol(bl[1]);
|
||||
b = Q_ftol(bl[2]);
|
||||
|
||||
// catch negative lights
|
||||
if (r < 0)
|
||||
r = 0;
|
||||
if (g < 0)
|
||||
g = 0;
|
||||
if (b < 0)
|
||||
b = 0;
|
||||
|
||||
/*
|
||||
** determine the brightest of the three color components
|
||||
*/
|
||||
if (r > g)
|
||||
max = r;
|
||||
else
|
||||
max = g;
|
||||
if (b > max)
|
||||
max = b;
|
||||
|
||||
/*
|
||||
** alpha is ONLY used for the mono lightmap case. For this reason
|
||||
** we set it to the brightest of the color components so that
|
||||
** things don't get too dim.
|
||||
*/
|
||||
a = max;
|
||||
|
||||
/*
|
||||
** rescale all the color components if the intensity of the greatest
|
||||
** channel exceeds 1.0
|
||||
*/
|
||||
if (max > 255)
|
||||
{
|
||||
float t = 255.0F / max;
|
||||
|
||||
r = r * t;
|
||||
g = g * t;
|
||||
b = b * t;
|
||||
a = a * t;
|
||||
}
|
||||
|
||||
dest[0] = r;
|
||||
dest[1] = g;
|
||||
dest[2] = b;
|
||||
dest[3] = a;
|
||||
|
||||
bl += 3;
|
||||
dest += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,999 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// vk_mesh.c: triangle model functions
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
/*
|
||||
=============================================================
|
||||
|
||||
ALIAS MODELS
|
||||
|
||||
=============================================================
|
||||
*/
|
||||
|
||||
#define NUMVERTEXNORMALS 162
|
||||
|
||||
static float r_avertexnormals[NUMVERTEXNORMALS][3] = {
|
||||
#include "../constants/anorms.h"
|
||||
};
|
||||
|
||||
typedef float vec4_t[4];
|
||||
|
||||
enum {
|
||||
TRIANGLE_STRIP = 0,
|
||||
TRIANGLE_FAN = 1
|
||||
} pipelineIdx;
|
||||
|
||||
typedef struct {
|
||||
vec3_t vertex;
|
||||
float color[4];
|
||||
float texCoord[2];
|
||||
} modelvert;
|
||||
|
||||
typedef struct {
|
||||
int vertexCount;
|
||||
int firstVertex;
|
||||
} drawinfo_t;
|
||||
|
||||
polyvert_t *verts_buffer = NULL;
|
||||
lmappolyvert_t *lmappolyverts_buffer = NULL;
|
||||
static drawinfo_t *drawInfo[2] = {NULL, NULL};
|
||||
static modelvert *vertList[2] = {NULL, NULL};
|
||||
static vec4_t *s_lerped = NULL;
|
||||
static vec3_t *shadowverts = NULL;
|
||||
static int verts_count = 0;
|
||||
|
||||
vec3_t shadevector;
|
||||
float shadelight[3];
|
||||
|
||||
// precalculated dot products for quantized angles
|
||||
#define SHADEDOT_QUANT 16
|
||||
static float r_avertexnormal_dots[SHADEDOT_QUANT][256] = {
|
||||
#include "../constants/anormtab.h"
|
||||
};
|
||||
|
||||
float *shadedots = r_avertexnormal_dots[0];
|
||||
|
||||
extern float r_view_matrix[16];
|
||||
extern float r_projection_matrix[16];
|
||||
extern float r_viewproj_matrix[16];
|
||||
|
||||
// correction matrix with "hacked depth" for models with RF_DEPTHHACK flag set
|
||||
static float r_vulkan_correction_dh[16] = {
|
||||
1.f, 0.f, 0.f, 0.f,
|
||||
0.f, -1.f, 0.f, 0.f,
|
||||
0.f, 0.f, .3f, 0.f,
|
||||
0.f, 0.f, .3f, 1.f
|
||||
};
|
||||
|
||||
int
|
||||
Mesh_VertsRealloc(int count)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
if (verts_count > count)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
verts_count = ROUNDUP(count * 2, 256);
|
||||
|
||||
ptr = realloc(s_lerped, verts_count * sizeof(vec4_t));
|
||||
if (!ptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
s_lerped = ptr;
|
||||
|
||||
ptr = realloc(shadowverts, verts_count * sizeof(vec3_t));
|
||||
if (!ptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
shadowverts = ptr;
|
||||
|
||||
ptr = realloc(verts_buffer, verts_count * sizeof(polyvert_t));
|
||||
if (!ptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
verts_buffer = ptr;
|
||||
|
||||
ptr = realloc(lmappolyverts_buffer, verts_count * sizeof(polyvert_t));
|
||||
if (!ptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
lmappolyverts_buffer = ptr;
|
||||
|
||||
ptr = realloc(vertList[0], verts_count * sizeof(modelvert));
|
||||
if (!ptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
vertList[0] = ptr;
|
||||
|
||||
ptr = realloc(vertList[1], verts_count * sizeof(modelvert));
|
||||
if (!ptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
vertList[1] = ptr;
|
||||
|
||||
ptr = realloc(drawInfo[0], verts_count * sizeof(drawinfo_t));
|
||||
if (!ptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
drawInfo[0] = ptr;
|
||||
|
||||
ptr = realloc(drawInfo[1], verts_count * sizeof(drawinfo_t));
|
||||
if (!ptr)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
drawInfo[1] = ptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
Mesh_Init
|
||||
===============
|
||||
*/
|
||||
void Mesh_Init (void)
|
||||
{
|
||||
s_lerped = NULL;
|
||||
shadowverts = NULL;
|
||||
verts_buffer = NULL;
|
||||
lmappolyverts_buffer = NULL;
|
||||
vertList[0] = NULL;
|
||||
vertList[1] = NULL;
|
||||
drawInfo[0] = NULL;
|
||||
drawInfo[1] = NULL;
|
||||
|
||||
verts_count = 0;
|
||||
|
||||
if (Mesh_VertsRealloc(MAX_VERTS))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Mesh_Free
|
||||
================
|
||||
*/
|
||||
void Mesh_Free (void)
|
||||
{
|
||||
if (vk_validation->value > 1)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Deallocated %d mesh verts\n",
|
||||
__func__, verts_count);
|
||||
}
|
||||
verts_count = 0;
|
||||
|
||||
if (shadowverts)
|
||||
{
|
||||
free(shadowverts);
|
||||
}
|
||||
shadowverts = NULL;
|
||||
|
||||
if (s_lerped)
|
||||
{
|
||||
free(s_lerped);
|
||||
}
|
||||
s_lerped = NULL;
|
||||
|
||||
if (verts_buffer)
|
||||
{
|
||||
free(verts_buffer);
|
||||
}
|
||||
verts_buffer = NULL;
|
||||
|
||||
if (lmappolyverts_buffer)
|
||||
{
|
||||
free(lmappolyverts_buffer);
|
||||
}
|
||||
lmappolyverts_buffer = NULL;
|
||||
|
||||
if (vertList[0])
|
||||
{
|
||||
free(vertList[0]);
|
||||
}
|
||||
if (vertList[1])
|
||||
{
|
||||
free(vertList[1]);
|
||||
}
|
||||
vertList[0] = NULL;
|
||||
vertList[1] = NULL;
|
||||
|
||||
if (drawInfo[0])
|
||||
{
|
||||
free(drawInfo[0]);
|
||||
}
|
||||
if (drawInfo[1])
|
||||
{
|
||||
free(drawInfo[1]);
|
||||
}
|
||||
drawInfo[0] = NULL;
|
||||
drawInfo[1] = NULL;
|
||||
}
|
||||
|
||||
|
||||
static void Vk_LerpVerts( int nverts, dtrivertx_t *v, dtrivertx_t *ov, dtrivertx_t *verts, float *lerp, float move[3], float frontv[3], float backv[3], entity_t *currententity )
|
||||
{
|
||||
int i;
|
||||
|
||||
//PMM -- added RF_SHELL_DOUBLE, RF_SHELL_HALF_DAM
|
||||
if ( currententity->flags & ( RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE | RF_SHELL_DOUBLE | RF_SHELL_HALF_DAM) )
|
||||
{
|
||||
for (i=0 ; i < nverts; i++, v++, ov++, lerp+=4 )
|
||||
{
|
||||
float *normal = r_avertexnormals[verts[i].lightnormalindex];
|
||||
|
||||
lerp[0] = move[0] + ov->v[0]*backv[0] + v->v[0]*frontv[0] + normal[0] * POWERSUIT_SCALE;
|
||||
lerp[1] = move[1] + ov->v[1]*backv[1] + v->v[1]*frontv[1] + normal[1] * POWERSUIT_SCALE;
|
||||
lerp[2] = move[2] + ov->v[2]*backv[2] + v->v[2]*frontv[2] + normal[2] * POWERSUIT_SCALE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0 ; i < nverts; i++, v++, ov++, lerp+=4)
|
||||
{
|
||||
lerp[0] = move[0] + ov->v[0]*backv[0] + v->v[0]*frontv[0];
|
||||
lerp[1] = move[1] + ov->v[1]*backv[1] + v->v[1]*frontv[1];
|
||||
lerp[2] = move[2] + ov->v[2]*backv[2] + v->v[2]*frontv[2];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Vk_DrawAliasFrameLerp
|
||||
|
||||
interpolates between two frames and origins
|
||||
FIXME: batch lerp all vertexes
|
||||
=============
|
||||
*/
|
||||
static void Vk_DrawAliasFrameLerp (dmdl_t *paliashdr, float backlerp, image_t *skin, float *modelMatrix, int leftHandOffset, int translucentIdx, entity_t *currententity)
|
||||
{
|
||||
daliasframe_t *frame, *oldframe;
|
||||
dtrivertx_t *v, *ov, *verts;
|
||||
int *order;
|
||||
float frontlerp;
|
||||
float alpha;
|
||||
vec3_t move, delta, vectors[3];
|
||||
vec3_t frontv, backv;
|
||||
int i;
|
||||
float *lerp;
|
||||
|
||||
frame = (daliasframe_t *)((byte *)paliashdr + paliashdr->ofs_frames
|
||||
+ currententity->frame * paliashdr->framesize);
|
||||
verts = v = frame->verts;
|
||||
|
||||
oldframe = (daliasframe_t *)((byte *)paliashdr + paliashdr->ofs_frames
|
||||
+ currententity->oldframe * paliashdr->framesize);
|
||||
ov = oldframe->verts;
|
||||
|
||||
order = (int *)((byte *)paliashdr + paliashdr->ofs_glcmds);
|
||||
|
||||
if (currententity->flags & RF_TRANSLUCENT)
|
||||
alpha = currententity->alpha;
|
||||
else
|
||||
alpha = 1.0;
|
||||
|
||||
frontlerp = 1.0 - backlerp;
|
||||
|
||||
// move should be the delta back to the previous frame * backlerp
|
||||
VectorSubtract (currententity->oldorigin, currententity->origin, delta);
|
||||
AngleVectors (currententity->angles, vectors[0], vectors[1], vectors[2]);
|
||||
|
||||
move[0] = DotProduct (delta, vectors[0]); // forward
|
||||
move[1] = -DotProduct (delta, vectors[1]); // left
|
||||
move[2] = DotProduct (delta, vectors[2]); // up
|
||||
|
||||
VectorAdd (move, oldframe->translate, move);
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
move[i] = backlerp*move[i] + frontlerp*frame->translate[i];
|
||||
}
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
frontv[i] = frontlerp*frame->scale[i];
|
||||
backv[i] = backlerp*oldframe->scale[i];
|
||||
}
|
||||
|
||||
if (Mesh_VertsRealloc(paliashdr->num_xyz))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
|
||||
lerp = s_lerped[0];
|
||||
|
||||
Vk_LerpVerts( paliashdr->num_xyz, v, ov, verts, lerp, move, frontv, backv, currententity );
|
||||
|
||||
int vertCounts[2] = { 0, 0 };
|
||||
int pipeCounters[2] = { 0, 0 };
|
||||
VkDeviceSize maxTriangleFanIdxCnt = 0;
|
||||
|
||||
if (Mesh_VertsRealloc(1))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
|
||||
drawInfo[0][0].firstVertex = 0;
|
||||
drawInfo[1][0].firstVertex = 0;
|
||||
|
||||
struct {
|
||||
float model[16];
|
||||
int textured;
|
||||
} meshUbo;
|
||||
|
||||
while (1)
|
||||
{
|
||||
int count;
|
||||
|
||||
// get the vertex count and primitive type
|
||||
count = *order++;
|
||||
if (!count)
|
||||
break; // done
|
||||
if (count < 0)
|
||||
{
|
||||
count = -count;
|
||||
pipelineIdx = TRIANGLE_FAN;
|
||||
}
|
||||
else
|
||||
{
|
||||
pipelineIdx = TRIANGLE_STRIP;
|
||||
}
|
||||
|
||||
if (Mesh_VertsRealloc(pipeCounters[pipelineIdx]))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
|
||||
drawInfo[pipelineIdx][pipeCounters[pipelineIdx]].vertexCount = count;
|
||||
maxTriangleFanIdxCnt = max(maxTriangleFanIdxCnt, ((count - 2) * 3));
|
||||
|
||||
if (currententity->flags & (RF_SHELL_RED | RF_SHELL_GREEN | RF_SHELL_BLUE))
|
||||
{
|
||||
meshUbo.textured = 0;
|
||||
do
|
||||
{
|
||||
int vertIdx = vertCounts[pipelineIdx];
|
||||
int index_xyz = order[2];
|
||||
|
||||
if (Mesh_VertsRealloc(vertIdx))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
|
||||
// unused in this case, since texturing is disabled
|
||||
vertList[pipelineIdx][vertIdx].texCoord[0] = 0.f;
|
||||
vertList[pipelineIdx][vertIdx].texCoord[1] = 0.f;
|
||||
|
||||
vertList[pipelineIdx][vertIdx].color[0] = shadelight[0];
|
||||
vertList[pipelineIdx][vertIdx].color[1] = shadelight[1];
|
||||
vertList[pipelineIdx][vertIdx].color[2] = shadelight[2];
|
||||
vertList[pipelineIdx][vertIdx].color[3] = alpha;
|
||||
|
||||
if (verts_count < index_xyz)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Model has issues with lerped index\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
vertList[pipelineIdx][vertIdx].vertex[0] = s_lerped[index_xyz][0];
|
||||
vertList[pipelineIdx][vertIdx].vertex[1] = s_lerped[index_xyz][1];
|
||||
vertList[pipelineIdx][vertIdx].vertex[2] = s_lerped[index_xyz][2];
|
||||
vertCounts[pipelineIdx]++;
|
||||
order += 3;
|
||||
} while (--count);
|
||||
}
|
||||
else
|
||||
{
|
||||
meshUbo.textured = 1;
|
||||
do
|
||||
{
|
||||
int vertIdx = vertCounts[pipelineIdx];
|
||||
int index_xyz = order[2];
|
||||
float l;
|
||||
|
||||
if (Mesh_VertsRealloc(vertIdx))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
|
||||
// texture coordinates come from the draw list
|
||||
vertList[pipelineIdx][vertIdx].texCoord[0] = ((float *)order)[0];
|
||||
vertList[pipelineIdx][vertIdx].texCoord[1] = ((float *)order)[1];
|
||||
|
||||
// normals and vertexes come from the frame list
|
||||
l = shadedots[verts[index_xyz].lightnormalindex];
|
||||
|
||||
vertList[pipelineIdx][vertIdx].color[0] = l * shadelight[0];
|
||||
vertList[pipelineIdx][vertIdx].color[1] = l * shadelight[1];
|
||||
vertList[pipelineIdx][vertIdx].color[2] = l * shadelight[2];
|
||||
vertList[pipelineIdx][vertIdx].color[3] = alpha;
|
||||
|
||||
if (verts_count < index_xyz)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Model has issues with lerped index\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
vertList[pipelineIdx][vertIdx].vertex[0] = s_lerped[index_xyz][0];
|
||||
vertList[pipelineIdx][vertIdx].vertex[1] = s_lerped[index_xyz][1];
|
||||
vertList[pipelineIdx][vertIdx].vertex[2] = s_lerped[index_xyz][2];
|
||||
vertCounts[pipelineIdx]++;
|
||||
order += 3;
|
||||
} while (--count);
|
||||
}
|
||||
|
||||
if (Mesh_VertsRealloc(pipeCounters[pipelineIdx] + 1))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
|
||||
pipeCounters[pipelineIdx]++;
|
||||
drawInfo[pipelineIdx][pipeCounters[pipelineIdx]].firstVertex = vertCounts[pipelineIdx];
|
||||
}
|
||||
|
||||
uint32_t uboOffset;
|
||||
VkDescriptorSet uboDescriptorSet;
|
||||
uint8_t *uboData = QVk_GetUniformBuffer(sizeof(meshUbo), &uboOffset, &uboDescriptorSet);
|
||||
memcpy(meshUbo.model, modelMatrix, sizeof(float) * 16);
|
||||
memcpy(uboData, &meshUbo, sizeof(meshUbo));
|
||||
|
||||
// player configuration screen model is using the UI renderpass
|
||||
int pidx = (r_newrefdef.rdflags & RDF_NOWORLDMODEL) ? RP_UI : RP_WORLD;
|
||||
// non-depth write alias models don't occur with RF_WEAPONMODEL set, so no need for additional left-handed pipelines
|
||||
qvkpipeline_t pipelines[2][2] = {
|
||||
{ vk_drawModelPipelineFan[pidx], vk_drawLefthandModelPipelineFan },
|
||||
{ vk_drawNoDepthModelPipelineFan, vk_drawLefthandModelPipelineFan } };
|
||||
for (int p = 0; p < 2; p++)
|
||||
{
|
||||
VkDeviceSize vaoSize = sizeof(modelvert) * vertCounts[p];
|
||||
VkBuffer vbo;
|
||||
VkDeviceSize vboOffset;
|
||||
uint8_t *vertData = QVk_GetVertexBuffer(vaoSize, &vbo, &vboOffset);
|
||||
memcpy(vertData, vertList[p], vaoSize);
|
||||
|
||||
QVk_BindPipeline(&pipelines[translucentIdx][leftHandOffset]);
|
||||
VkDescriptorSet descriptorSets[] = { skin->vk_texture.descriptorSet, uboDescriptorSet };
|
||||
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines[translucentIdx][leftHandOffset].layout, 0, 2, descriptorSets, 1, &uboOffset);
|
||||
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
|
||||
|
||||
if (p == TRIANGLE_STRIP)
|
||||
{
|
||||
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleStripIbo(maxTriangleFanIdxCnt), 0, VK_INDEX_TYPE_UINT16);
|
||||
|
||||
for (i = 0; i < pipeCounters[p]; i++)
|
||||
{
|
||||
vkCmdDrawIndexed(vk_activeCmdbuffer, (drawInfo[p][i].vertexCount - 2) * 3, 1, 0, drawInfo[p][i].firstVertex, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo(maxTriangleFanIdxCnt), 0, VK_INDEX_TYPE_UINT16);
|
||||
|
||||
for (i = 0; i < pipeCounters[p]; i++)
|
||||
{
|
||||
vkCmdDrawIndexed(vk_activeCmdbuffer, (drawInfo[p][i].vertexCount - 2) * 3, 1, 0, drawInfo[p][i].firstVertex, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Vk_DrawAliasShadow
|
||||
=============
|
||||
*/
|
||||
extern vec3_t lightspot;
|
||||
|
||||
static void Vk_DrawAliasShadow (dmdl_t *paliashdr, int posenum, float *modelMatrix, entity_t *currententity)
|
||||
{
|
||||
int *order;
|
||||
vec3_t point;
|
||||
float height, lheight;
|
||||
|
||||
lheight = currententity->origin[2] - lightspot[2];
|
||||
|
||||
height = 0;
|
||||
|
||||
order = (int *)((byte *)paliashdr + paliashdr->ofs_glcmds);
|
||||
|
||||
height = -lheight + 1.0;
|
||||
|
||||
uint32_t uboOffset;
|
||||
VkDescriptorSet uboDescriptorSet;
|
||||
uint8_t *uboData = QVk_GetUniformBuffer(sizeof(float) * 16, &uboOffset, &uboDescriptorSet);
|
||||
memcpy(uboData, modelMatrix, sizeof(float) * 16);
|
||||
|
||||
while (1)
|
||||
{
|
||||
int i;
|
||||
int count;
|
||||
|
||||
i = 0;
|
||||
// get the vertex count and primitive type
|
||||
count = *order++;
|
||||
if (!count)
|
||||
break; // done
|
||||
if (count < 0)
|
||||
{
|
||||
count = -count;
|
||||
pipelineIdx = TRIANGLE_FAN;
|
||||
}
|
||||
else
|
||||
{
|
||||
pipelineIdx = TRIANGLE_STRIP;
|
||||
}
|
||||
|
||||
if (Mesh_VertsRealloc(count))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if (Mesh_VertsRealloc(order[2]))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
|
||||
// normals and vertexes come from the frame list
|
||||
memcpy( point, s_lerped[order[2]], sizeof( point ) );
|
||||
|
||||
point[0] -= shadevector[0]*(point[2]+lheight);
|
||||
point[1] -= shadevector[1]*(point[2]+lheight);
|
||||
point[2] = height;
|
||||
|
||||
shadowverts[i][0] = point[0];
|
||||
shadowverts[i][1] = point[1];
|
||||
shadowverts[i][2] = point[2];
|
||||
|
||||
order += 3;
|
||||
i++;
|
||||
} while (--count);
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
VkDeviceSize vaoSize = sizeof(vec3_t) * i;
|
||||
VkBuffer vbo;
|
||||
VkDeviceSize vboOffset;
|
||||
uint8_t *vertData = QVk_GetVertexBuffer(vaoSize, &vbo, &vboOffset);
|
||||
memcpy(vertData, shadowverts, vaoSize);
|
||||
|
||||
QVk_BindPipeline(&vk_shadowsPipelineFan);
|
||||
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_shadowsPipelineFan.layout, 0, 1, &uboDescriptorSet, 1, &uboOffset);
|
||||
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
|
||||
|
||||
if (pipelineIdx == TRIANGLE_STRIP)
|
||||
{
|
||||
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleStripIbo((i - 2) * 3), 0, VK_INDEX_TYPE_UINT16);
|
||||
vkCmdDrawIndexed(vk_activeCmdbuffer, (i - 2) * 3, 1, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo((i - 2) * 3), 0, VK_INDEX_TYPE_UINT16);
|
||||
vkCmdDrawIndexed(vk_activeCmdbuffer, (i - 2) * 3, 1, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** R_CullAliasModel
|
||||
*/
|
||||
static qboolean R_CullAliasModel( vec3_t bbox[8], entity_t *e, model_t *currentmodel )
|
||||
{
|
||||
int i;
|
||||
vec3_t mins, maxs;
|
||||
dmdl_t *paliashdr;
|
||||
vec3_t vectors[3];
|
||||
vec3_t thismins, oldmins, thismaxs, oldmaxs;
|
||||
daliasframe_t *pframe, *poldframe;
|
||||
vec3_t angles;
|
||||
|
||||
paliashdr = (dmdl_t *)currentmodel->extradata;
|
||||
|
||||
if ( ( e->frame >= paliashdr->num_frames ) || ( e->frame < 0 ) )
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s %s: no such frame %d\n",
|
||||
__func__, currentmodel->name, e->frame);
|
||||
e->frame = 0;
|
||||
}
|
||||
if ( ( e->oldframe >= paliashdr->num_frames ) || ( e->oldframe < 0 ) )
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s %s: no such oldframe %d\n",
|
||||
__func__, currentmodel->name, e->oldframe);
|
||||
e->oldframe = 0;
|
||||
}
|
||||
|
||||
pframe = ( daliasframe_t * ) ( ( byte * ) paliashdr +
|
||||
paliashdr->ofs_frames +
|
||||
e->frame * paliashdr->framesize);
|
||||
|
||||
poldframe = ( daliasframe_t * ) ( ( byte * ) paliashdr +
|
||||
paliashdr->ofs_frames +
|
||||
e->oldframe * paliashdr->framesize);
|
||||
|
||||
/*
|
||||
** compute axially aligned mins and maxs
|
||||
*/
|
||||
if ( pframe == poldframe )
|
||||
{
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
mins[i] = pframe->translate[i];
|
||||
maxs[i] = mins[i] + pframe->scale[i]*255;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( i = 0; i < 3; i++ )
|
||||
{
|
||||
thismins[i] = pframe->translate[i];
|
||||
thismaxs[i] = thismins[i] + pframe->scale[i]*255;
|
||||
|
||||
oldmins[i] = poldframe->translate[i];
|
||||
oldmaxs[i] = oldmins[i] + poldframe->scale[i]*255;
|
||||
|
||||
if ( thismins[i] < oldmins[i] )
|
||||
mins[i] = thismins[i];
|
||||
else
|
||||
mins[i] = oldmins[i];
|
||||
|
||||
if ( thismaxs[i] > oldmaxs[i] )
|
||||
maxs[i] = thismaxs[i];
|
||||
else
|
||||
maxs[i] = oldmaxs[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** compute a full bounding box
|
||||
*/
|
||||
for ( i = 0; i < 8; i++ )
|
||||
{
|
||||
vec3_t tmp;
|
||||
|
||||
if ( i & 1 )
|
||||
tmp[0] = mins[0];
|
||||
else
|
||||
tmp[0] = maxs[0];
|
||||
|
||||
if ( i & 2 )
|
||||
tmp[1] = mins[1];
|
||||
else
|
||||
tmp[1] = maxs[1];
|
||||
|
||||
if ( i & 4 )
|
||||
tmp[2] = mins[2];
|
||||
else
|
||||
tmp[2] = maxs[2];
|
||||
|
||||
VectorCopy( tmp, bbox[i] );
|
||||
}
|
||||
|
||||
/*
|
||||
** rotate the bounding box
|
||||
*/
|
||||
VectorCopy( e->angles, angles );
|
||||
angles[YAW] = -angles[YAW];
|
||||
AngleVectors( angles, vectors[0], vectors[1], vectors[2] );
|
||||
|
||||
for ( i = 0; i < 8; i++ )
|
||||
{
|
||||
vec3_t tmp;
|
||||
|
||||
VectorCopy( bbox[i], tmp );
|
||||
|
||||
bbox[i][0] = DotProduct( vectors[0], tmp );
|
||||
bbox[i][1] = -DotProduct( vectors[1], tmp );
|
||||
bbox[i][2] = DotProduct( vectors[2], tmp );
|
||||
|
||||
VectorAdd( e->origin, bbox[i], bbox[i] );
|
||||
}
|
||||
|
||||
{
|
||||
int p, f, aggregatemask = ~0;
|
||||
|
||||
for ( p = 0; p < 8; p++ )
|
||||
{
|
||||
int mask = 0;
|
||||
|
||||
for ( f = 0; f < 4; f++ )
|
||||
{
|
||||
float dp = DotProduct( frustum[f].normal, bbox[p] );
|
||||
|
||||
if ( ( dp - frustum[f].dist ) < 0 )
|
||||
{
|
||||
mask |= ( 1 << f );
|
||||
}
|
||||
}
|
||||
|
||||
aggregatemask &= mask;
|
||||
}
|
||||
|
||||
if ( aggregatemask )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_DrawAliasModel
|
||||
|
||||
=================
|
||||
*/
|
||||
void R_DrawAliasModel (entity_t *currententity, model_t *currentmodel)
|
||||
{
|
||||
int i;
|
||||
int leftHandOffset = 0;
|
||||
dmdl_t *paliashdr;
|
||||
float an;
|
||||
vec3_t bbox[8];
|
||||
float prev_viewproj[16];
|
||||
|
||||
if ( !( currententity->flags & RF_WEAPONMODEL ) )
|
||||
{
|
||||
if ( R_CullAliasModel( bbox, currententity, currentmodel ) )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( currententity->flags & RF_WEAPONMODEL )
|
||||
{
|
||||
if ( r_lefthand->value == 2 )
|
||||
return;
|
||||
}
|
||||
|
||||
paliashdr = (dmdl_t *)currentmodel->extradata;
|
||||
|
||||
//
|
||||
// get lighting information
|
||||
//
|
||||
// PMM - rewrote, reordered to handle new shells & mixing
|
||||
// PMM - 3.20 code .. replaced with original way of doing it to keep mod authors happy
|
||||
//
|
||||
if ( currententity->flags & ( RF_SHELL_HALF_DAM | RF_SHELL_GREEN | RF_SHELL_RED | RF_SHELL_BLUE | RF_SHELL_DOUBLE ) )
|
||||
{
|
||||
VectorClear (shadelight);
|
||||
if (currententity->flags & RF_SHELL_HALF_DAM)
|
||||
{
|
||||
shadelight[0] = 0.56;
|
||||
shadelight[1] = 0.59;
|
||||
shadelight[2] = 0.45;
|
||||
}
|
||||
if ( currententity->flags & RF_SHELL_DOUBLE )
|
||||
{
|
||||
shadelight[0] = 0.9;
|
||||
shadelight[1] = 0.7;
|
||||
}
|
||||
if ( currententity->flags & RF_SHELL_RED )
|
||||
shadelight[0] = 1.0;
|
||||
if ( currententity->flags & RF_SHELL_GREEN )
|
||||
shadelight[1] = 1.0;
|
||||
if ( currententity->flags & RF_SHELL_BLUE )
|
||||
shadelight[2] = 1.0;
|
||||
}
|
||||
else if ( currententity->flags & RF_FULLBRIGHT )
|
||||
{
|
||||
for (i=0 ; i<3 ; i++)
|
||||
shadelight[i] = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
R_LightPoint (currententity->origin, shadelight, currententity);
|
||||
|
||||
// player lighting hack for communication back to server
|
||||
// big hack!
|
||||
if ( currententity->flags & RF_WEAPONMODEL )
|
||||
{
|
||||
// pick the greatest component, which should be the same
|
||||
// as the mono value returned by software
|
||||
if (shadelight[0] > shadelight[1])
|
||||
{
|
||||
if (shadelight[0] > shadelight[2])
|
||||
r_lightlevel->value = 150*shadelight[0];
|
||||
else
|
||||
r_lightlevel->value = 150*shadelight[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shadelight[1] > shadelight[2])
|
||||
r_lightlevel->value = 150*shadelight[1];
|
||||
else
|
||||
r_lightlevel->value = 150*shadelight[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( currententity->flags & RF_MINLIGHT )
|
||||
{
|
||||
for (i=0 ; i<3 ; i++)
|
||||
if (shadelight[i] > 0.1)
|
||||
break;
|
||||
if (i == 3)
|
||||
{
|
||||
shadelight[0] = 0.1;
|
||||
shadelight[1] = 0.1;
|
||||
shadelight[2] = 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( currententity->flags & RF_GLOW )
|
||||
{ // bonus items will pulse with time
|
||||
float scale;
|
||||
|
||||
scale = 0.1 * sin(r_newrefdef.time*7);
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
float min;
|
||||
|
||||
min = shadelight[i] * 0.8;
|
||||
shadelight[i] += scale;
|
||||
if (shadelight[i] < min)
|
||||
shadelight[i] = min;
|
||||
}
|
||||
}
|
||||
|
||||
// =================
|
||||
// PGM ir goggles color override
|
||||
if ( r_newrefdef.rdflags & RDF_IRGOGGLES && currententity->flags & RF_IR_VISIBLE)
|
||||
{
|
||||
shadelight[0] = 1.0;
|
||||
shadelight[1] = 0.0;
|
||||
shadelight[2] = 0.0;
|
||||
}
|
||||
// PGM
|
||||
// =================
|
||||
|
||||
shadedots = r_avertexnormal_dots[((int)(currententity->angles[1] * (SHADEDOT_QUANT / 360.0))) & (SHADEDOT_QUANT - 1)];
|
||||
|
||||
an = currententity->angles[1]/180*M_PI;
|
||||
shadevector[0] = cos(-an);
|
||||
shadevector[1] = sin(-an);
|
||||
shadevector[2] = 1;
|
||||
VectorNormalize (shadevector);
|
||||
|
||||
//
|
||||
// locate the proper data
|
||||
//
|
||||
|
||||
c_alias_polys += paliashdr->num_tris;
|
||||
|
||||
//
|
||||
// draw all the triangles
|
||||
//
|
||||
if (currententity->flags & RF_DEPTHHACK || r_newrefdef.rdflags & RDF_NOWORLDMODEL) { // hack the depth range to prevent view model from poking into walls
|
||||
float r_proj_aspect = (float)r_newrefdef.width / r_newrefdef.height;
|
||||
float r_proj_fovy = r_newrefdef.fov_y;
|
||||
float dist = (r_farsee->value == 0) ? 4096.0f : 8192.0f;
|
||||
// use different range for player setup screen so it doesn't collide with the viewmodel
|
||||
r_vulkan_correction_dh[10] = 0.3f - (r_newrefdef.rdflags & RDF_NOWORLDMODEL) * 0.1f;
|
||||
r_vulkan_correction_dh[14] = 0.3f - (r_newrefdef.rdflags & RDF_NOWORLDMODEL) * 0.1f;
|
||||
|
||||
memcpy(prev_viewproj, r_viewproj_matrix, sizeof(r_viewproj_matrix));
|
||||
if (currententity->flags & RF_WEAPONMODEL && r_gunfov->value < 0)
|
||||
{
|
||||
Mat_Perspective(r_projection_matrix, r_vulkan_correction_dh, r_proj_fovy, r_proj_aspect, 4, dist);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mat_Perspective(r_projection_matrix, r_vulkan_correction_dh, r_gunfov->value, r_proj_aspect, 4, dist);
|
||||
}
|
||||
Mat_Mul(r_view_matrix, r_projection_matrix, r_viewproj_matrix);
|
||||
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTexQuadPipeline[vk_state.current_renderpass].layout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(r_viewproj_matrix), r_viewproj_matrix);
|
||||
}
|
||||
|
||||
if ( ( currententity->flags & RF_WEAPONMODEL ) && ( r_lefthand->value == 1.0F ) )
|
||||
{
|
||||
Mat_Scale(r_viewproj_matrix, -1.f, 1.f, 1.f);
|
||||
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTexQuadPipeline[vk_state.current_renderpass].layout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(r_viewproj_matrix), r_viewproj_matrix);
|
||||
leftHandOffset = 1;
|
||||
}
|
||||
|
||||
currententity->angles[PITCH] = -currententity->angles[PITCH]; // sigh.
|
||||
{
|
||||
float model[16];
|
||||
image_t *skin;
|
||||
Mat_Identity(model);
|
||||
R_RotateForEntity (currententity, model);
|
||||
|
||||
currententity->angles[PITCH] = -currententity->angles[PITCH]; // sigh.
|
||||
|
||||
// select skin
|
||||
if (currententity->skin)
|
||||
skin = currententity->skin; // custom player skin
|
||||
else
|
||||
{
|
||||
if (currententity->skinnum >= MAX_MD2SKINS)
|
||||
skin = currentmodel->skins[0];
|
||||
else
|
||||
{
|
||||
skin = currentmodel->skins[currententity->skinnum];
|
||||
if (!skin)
|
||||
skin = currentmodel->skins[0];
|
||||
}
|
||||
}
|
||||
if (!skin)
|
||||
skin = r_notexture; // fallback...
|
||||
|
||||
// draw it
|
||||
if ( (currententity->frame >= paliashdr->num_frames)
|
||||
|| (currententity->frame < 0) )
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s %s: no such frame %d\n",
|
||||
__func__, currentmodel->name, currententity->frame);
|
||||
currententity->frame = 0;
|
||||
currententity->oldframe = 0;
|
||||
}
|
||||
|
||||
if ( (currententity->oldframe >= paliashdr->num_frames)
|
||||
|| (currententity->oldframe < 0))
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s %s: no such oldframe %d\n",
|
||||
__func__, currentmodel->name, currententity->oldframe);
|
||||
currententity->frame = 0;
|
||||
currententity->oldframe = 0;
|
||||
}
|
||||
|
||||
if ( !r_lerpmodels->value )
|
||||
currententity->backlerp = 0;
|
||||
Vk_DrawAliasFrameLerp (paliashdr, currententity->backlerp, skin, model, leftHandOffset, (currententity->flags & RF_TRANSLUCENT) ? 1 : 0, currententity);
|
||||
}
|
||||
|
||||
if ( ( currententity->flags & RF_WEAPONMODEL ) && ( r_lefthand->value == 1.0F ) )
|
||||
{
|
||||
Mat_Scale(r_viewproj_matrix, -1.f, 1.f, 1.f);
|
||||
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTexQuadPipeline[vk_state.current_renderpass].layout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(r_viewproj_matrix), r_viewproj_matrix);
|
||||
}
|
||||
|
||||
if (currententity->flags & RF_DEPTHHACK || r_newrefdef.rdflags & RDF_NOWORLDMODEL)
|
||||
{
|
||||
memcpy(r_viewproj_matrix, prev_viewproj, sizeof(prev_viewproj));
|
||||
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTexQuadPipeline[vk_state.current_renderpass].layout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(r_viewproj_matrix), r_viewproj_matrix);
|
||||
}
|
||||
|
||||
if (vk_shadows->value && !(currententity->flags & (RF_TRANSLUCENT | RF_WEAPONMODEL)))
|
||||
{
|
||||
float model[16];
|
||||
Mat_Identity(model);
|
||||
R_RotateForEntity(currententity, model);
|
||||
Vk_DrawAliasShadow (paliashdr, currententity->frame, model, currententity);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,222 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
qvkshader_t QVk_CreateShader(const uint32_t *shaderSrc, size_t shaderCodeSize, VkShaderStageFlagBits shaderStage)
|
||||
{
|
||||
qvkshader_t shader;
|
||||
VkShaderModuleCreateInfo smCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.codeSize = shaderCodeSize,
|
||||
.pCode = shaderSrc
|
||||
};
|
||||
|
||||
VK_VERIFY(vkCreateShaderModule(vk_device.logical, &smCreateInfo, NULL, &shader.module));
|
||||
|
||||
VkPipelineShaderStageCreateInfo vssCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.stage = shaderStage,
|
||||
.module = shader.module,
|
||||
.pName = "main",
|
||||
.pSpecializationInfo = NULL
|
||||
};
|
||||
|
||||
shader.createInfo = vssCreateInfo;
|
||||
|
||||
return shader;
|
||||
}
|
||||
|
||||
void QVk_CreatePipeline(const VkDescriptorSetLayout *descriptorLayout, const uint32_t descLayoutCount, const VkPipelineVertexInputStateCreateInfo *vertexInputInfo,
|
||||
qvkpipeline_t *pipeline, const qvkrenderpass_t *renderpass, const qvkshader_t *shaders, uint32_t shaderCount)
|
||||
{
|
||||
VkPipelineShaderStageCreateInfo *ssCreateInfos = (VkPipelineShaderStageCreateInfo *)malloc(shaderCount * sizeof(VkPipelineShaderStageCreateInfo));
|
||||
for (int i = 0; i < shaderCount; i++)
|
||||
{
|
||||
ssCreateInfos[i] = shaders[i].createInfo;
|
||||
}
|
||||
|
||||
VkPipelineInputAssemblyStateCreateInfo iaCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.topology = pipeline->topology,
|
||||
.primitiveRestartEnable = VK_FALSE
|
||||
};
|
||||
|
||||
VkViewport viewport = {
|
||||
.x = 0.f,
|
||||
.y = 0.f,
|
||||
.width = (float)vid.width,
|
||||
.height = (float)vid.height,
|
||||
.minDepth = 0.f,
|
||||
.maxDepth = 1.f,
|
||||
};
|
||||
|
||||
VkRect2D scissor = {
|
||||
.offset.x = 0,
|
||||
.offset.y = 0,
|
||||
.extent = vk_swapchain.extent
|
||||
};
|
||||
|
||||
VkPipelineViewportStateCreateInfo vpCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.viewportCount = 1,
|
||||
.pViewports = &viewport,
|
||||
.scissorCount = 1,
|
||||
.pScissors = &scissor
|
||||
};
|
||||
|
||||
VkPipelineRasterizationStateCreateInfo rCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.depthClampEnable = VK_FALSE,
|
||||
.rasterizerDiscardEnable = VK_FALSE,
|
||||
.polygonMode = VK_POLYGON_MODE_FILL,
|
||||
.cullMode = pipeline->cullMode,
|
||||
.frontFace = VK_FRONT_FACE_CLOCKWISE,
|
||||
.depthBiasEnable = VK_FALSE,
|
||||
.depthBiasConstantFactor = 0.f,
|
||||
.depthBiasClamp = 0.f,
|
||||
.depthBiasSlopeFactor = 0.f,
|
||||
.lineWidth = 1.f
|
||||
};
|
||||
|
||||
VkPipelineMultisampleStateCreateInfo msCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.rasterizationSamples = renderpass->sampleCount,
|
||||
.sampleShadingEnable = (vk_sampleshading->value > 0 && vk_device.features.sampleRateShading) ? VK_TRUE : VK_FALSE,
|
||||
.minSampleShading = (vk_sampleshading->value > 0 && vk_device.features.sampleRateShading) ? 1.f : 0.f,
|
||||
.pSampleMask = NULL,
|
||||
.alphaToCoverageEnable = VK_FALSE,
|
||||
.alphaToOneEnable = VK_FALSE
|
||||
};
|
||||
|
||||
VkPipelineDepthStencilStateCreateInfo dCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.depthTestEnable = pipeline->depthTestEnable,
|
||||
.depthWriteEnable = pipeline->depthTestEnable == VK_TRUE ? pipeline->depthWriteEnable : VK_FALSE, // there should be NO depth writes if depthTestEnable is false but Intel seems to not follow the specs fully...
|
||||
.depthCompareOp = VK_COMPARE_OP_LESS,
|
||||
.depthBoundsTestEnable = VK_FALSE,
|
||||
.stencilTestEnable = VK_FALSE,
|
||||
.front = { VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_COMPARE_OP_NEVER, 0, 0, 0 },
|
||||
.back = { VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_STENCIL_OP_KEEP, VK_COMPARE_OP_NEVER, 0, 0, 0 },
|
||||
.minDepthBounds = 0.f,
|
||||
.maxDepthBounds = 1.f
|
||||
};
|
||||
|
||||
VkPipelineColorBlendStateCreateInfo cbsCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.logicOpEnable = VK_FALSE,
|
||||
.logicOp = VK_LOGIC_OP_COPY,
|
||||
.attachmentCount = 1,
|
||||
.pAttachments = &pipeline->blendOpts,
|
||||
.blendConstants[0] = 0.f,
|
||||
.blendConstants[1] = 0.f,
|
||||
.blendConstants[2] = 0.f,
|
||||
.blendConstants[3] = 0.f
|
||||
};
|
||||
|
||||
VkDynamicState dynamicStates[] = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR };
|
||||
VkPipelineDynamicStateCreateInfo dsCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.dynamicStateCount = 2,
|
||||
.pDynamicStates = dynamicStates
|
||||
};
|
||||
|
||||
// push constant sizes accomodate for maximum number of uploaded elements (should probably be checked against the hardware's maximum supported value)
|
||||
VkPushConstantRange pushConstantRange[] = {
|
||||
{
|
||||
.stageFlags = VK_SHADER_STAGE_VERTEX_BIT,
|
||||
.offset = 0,
|
||||
.size = 17 * sizeof(float)
|
||||
},
|
||||
{
|
||||
.stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,
|
||||
.offset = 17 * sizeof(float),
|
||||
.size = 11 * sizeof(float)
|
||||
}};
|
||||
|
||||
VkPipelineLayoutCreateInfo plCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.setLayoutCount = descLayoutCount,
|
||||
.pSetLayouts = descriptorLayout,
|
||||
// for simplicity assume only two push constant range is passed,
|
||||
// so it's not the most flexible approach
|
||||
.pushConstantRangeCount = 2,
|
||||
.pPushConstantRanges = pushConstantRange
|
||||
};
|
||||
|
||||
VK_VERIFY(vkCreatePipelineLayout(vk_device.logical, &plCreateInfo, NULL, &pipeline->layout));
|
||||
|
||||
// create THE pipeline
|
||||
VkGraphicsPipelineCreateInfo pCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = pipeline->flags,
|
||||
.stageCount = shaderCount,
|
||||
.pStages = ssCreateInfos,
|
||||
.pVertexInputState = vertexInputInfo,
|
||||
.pInputAssemblyState = &iaCreateInfo,
|
||||
.pTessellationState = NULL,
|
||||
.pViewportState = &vpCreateInfo,
|
||||
.pRasterizationState = &rCreateInfo,
|
||||
.pMultisampleState = &msCreateInfo,
|
||||
.pDepthStencilState = &dCreateInfo,
|
||||
.pColorBlendState = &cbsCreateInfo,
|
||||
.pDynamicState = &dsCreateInfo,
|
||||
.layout = pipeline->layout,
|
||||
.renderPass = renderpass->rp,
|
||||
.subpass = 0,
|
||||
.basePipelineHandle = VK_NULL_HANDLE,
|
||||
.basePipelineIndex = -1
|
||||
};
|
||||
|
||||
VK_VERIFY(vkCreateGraphicsPipelines(vk_device.logical, VK_NULL_HANDLE, 1, &pCreateInfo, NULL, &pipeline->pl));
|
||||
free(ssCreateInfos);
|
||||
}
|
||||
|
||||
void QVk_DestroyPipeline(qvkpipeline_t *pipeline)
|
||||
{
|
||||
if (pipeline->layout != VK_NULL_HANDLE)
|
||||
vkDestroyPipelineLayout(vk_device.logical, pipeline->layout, NULL);
|
||||
if (pipeline->pl != VK_NULL_HANDLE)
|
||||
vkDestroyPipeline(vk_device.logical, pipeline->pl, NULL);
|
||||
|
||||
pipeline->layout = VK_NULL_HANDLE;
|
||||
pipeline->pl = VK_NULL_HANDLE;
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,325 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
// vk_misc.c
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
/*
|
||||
==================
|
||||
RE_InitParticleTexture
|
||||
==================
|
||||
*/
|
||||
static byte dottexture[8][8] =
|
||||
{
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,1,1,0,0,0,0},
|
||||
{0,1,1,1,1,0,0,0},
|
||||
{0,1,1,1,1,0,0,0},
|
||||
{0,0,1,1,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
};
|
||||
|
||||
void RE_InitParticleTexture (void)
|
||||
{
|
||||
int x,y,i;
|
||||
byte data[8][8][4];
|
||||
|
||||
//
|
||||
// particle texture
|
||||
//
|
||||
for (x=0 ; x<8 ; x++)
|
||||
{
|
||||
for (y=0 ; y<8 ; y++)
|
||||
{
|
||||
data[y][x][0] = 255;
|
||||
data[y][x][1] = 255;
|
||||
data[y][x][2] = 255;
|
||||
data[y][x][3] = dottexture[x][y]*255;
|
||||
}
|
||||
}
|
||||
r_particletexture = Vk_LoadPic("***particle***", (byte *)data,
|
||||
8, 8, 8, 8, it_sprite, 32);
|
||||
|
||||
//
|
||||
// particle texture
|
||||
//
|
||||
for (x=0 ; x<8 ; x++)
|
||||
{
|
||||
for (y=0 ; y<8 ; y++)
|
||||
{
|
||||
for (i=0 ; i<4 ; i++)
|
||||
{
|
||||
data[y][x][i] = ((y < 4) && (x < 4)) ? 255 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
r_squaretexture = Vk_LoadPic("***square***", (byte *)data,
|
||||
8, 8, 8, 8, it_sprite, 32);
|
||||
|
||||
//
|
||||
// also use this for bad textures, but without alpha
|
||||
//
|
||||
for (x=0 ; x<8 ; x++)
|
||||
{
|
||||
for (y=0 ; y<8 ; y++)
|
||||
{
|
||||
data[y][x][0] = dottexture[x&3][y&3]*255;
|
||||
data[y][x][1] = 0;
|
||||
data[y][x][2] = 0;
|
||||
data[y][x][3] = 255;
|
||||
}
|
||||
}
|
||||
r_notexture = Vk_LoadPic("***r_notexture***", (byte *)data,
|
||||
8, 8, 8, 8, it_wall, 32);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
==================
|
||||
Vk_ScreenShot_f
|
||||
==================
|
||||
*/
|
||||
void Vk_ScreenShot_f (void)
|
||||
{
|
||||
byte *buffer;
|
||||
int i;
|
||||
size_t buffSize = vid.width * vid.height * 4;
|
||||
|
||||
if (!vk_device.screenshotSupported)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s: Screenshots are not supported by this GPU.\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
buffer = malloc(buffSize);
|
||||
|
||||
VkExtent2D extent = {
|
||||
.width = (uint32_t)(vid.width),
|
||||
.height = (uint32_t)(vid.height),
|
||||
};
|
||||
VkOffset2D offset = {
|
||||
.x = (int32_t)((vk_swapchain.extent.width - extent.width) / 2u),
|
||||
.y = (int32_t)((vk_swapchain.extent.height - extent.height) / 2u),
|
||||
};
|
||||
|
||||
QVk_ReadPixels(buffer, &offset, &extent);
|
||||
|
||||
// swap rgb to bgr
|
||||
if (vk_swapchain.format == VK_FORMAT_R8G8B8A8_UNORM ||
|
||||
vk_swapchain.format == VK_FORMAT_R8G8B8A8_SRGB)
|
||||
{
|
||||
for (i = 0; i < buffSize; i += 4)
|
||||
{
|
||||
buffer[i + 3] = 255;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < buffSize; i += 4)
|
||||
{
|
||||
int temp;
|
||||
|
||||
temp = buffer[i];
|
||||
buffer[i] = buffer[i + 2];
|
||||
buffer[i + 2] = temp;
|
||||
buffer[i + 3] = 255; // alpha component
|
||||
}
|
||||
}
|
||||
|
||||
ri.Vid_WriteScreenshot(vid.width, vid.height, 4, buffer);
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
** Vk_Strings_f
|
||||
*/
|
||||
void Vk_Strings_f(void)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
uint32_t numDevices = 0;
|
||||
int usedDevice = 0;
|
||||
VkPhysicalDevice *physicalDevices;
|
||||
VkPhysicalDeviceProperties deviceProperties;
|
||||
int preferredDevice = (int)vk_device_idx->value;
|
||||
int msaa = (int)vk_msaa->value;
|
||||
uint32_t driverMajor = VK_VERSION_MAJOR(vk_device.properties.driverVersion);
|
||||
uint32_t driverMinor = VK_VERSION_MINOR(vk_device.properties.driverVersion);
|
||||
uint32_t driverPatch = VK_VERSION_PATCH(vk_device.properties.driverVersion);
|
||||
|
||||
// NVIDIA driver version decoding scheme
|
||||
if (vk_device.properties.vendorID == 0x10DE)
|
||||
{
|
||||
driverMajor = ((uint32_t)(vk_device.properties.driverVersion) >> 22) & 0x3ff;
|
||||
driverMinor = ((uint32_t)(vk_device.properties.driverVersion) >> 14) & 0x0ff;
|
||||
|
||||
uint32_t secondary = ((uint32_t)(vk_device.properties.driverVersion) >> 6) & 0x0ff;
|
||||
uint32_t tertiary = vk_device.properties.driverVersion & 0x03f;
|
||||
|
||||
driverPatch = (secondary << 8) | tertiary;
|
||||
}
|
||||
|
||||
VK_VERIFY(vkEnumeratePhysicalDevices(vk_instance, &numDevices, NULL));
|
||||
if (!numDevices)
|
||||
{
|
||||
return;
|
||||
}
|
||||
physicalDevices = malloc(sizeof(VkPhysicalDevice) * numDevices);
|
||||
if (!physicalDevices)
|
||||
{
|
||||
return;
|
||||
}
|
||||
VK_VERIFY(vkEnumeratePhysicalDevices(vk_instance, &numDevices, physicalDevices));
|
||||
|
||||
if (preferredDevice >= numDevices)
|
||||
{
|
||||
preferredDevice = -1;
|
||||
}
|
||||
|
||||
R_Printf(PRINT_ALL, "------------------------------------\n");
|
||||
R_Printf(PRINT_ALL, "Vulkan API: %d.%d\n", VK_VERSION_MAJOR(vk_config.vk_version),
|
||||
VK_VERSION_MINOR(vk_config.vk_version));
|
||||
R_Printf(PRINT_ALL, "Header version: %d\n", VK_HEADER_VERSION);
|
||||
R_Printf(PRINT_ALL, "Devices found:\n");
|
||||
for (i = 0; i < numDevices; ++i)
|
||||
{
|
||||
qboolean isPreferred = false;
|
||||
|
||||
vkGetPhysicalDeviceProperties(physicalDevices[i], &deviceProperties);
|
||||
isPreferred = (preferredDevice == i) || (
|
||||
preferredDevice < 0 &&
|
||||
deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
|
||||
);
|
||||
if (isPreferred) {
|
||||
usedDevice = i;
|
||||
}
|
||||
R_Printf(PRINT_ALL, "%s#%d: %s\n",
|
||||
isPreferred && numDevices > 1 ? "* " : " ",
|
||||
i, deviceProperties.deviceName);
|
||||
}
|
||||
free(physicalDevices);
|
||||
|
||||
R_Printf(PRINT_ALL, "Using device #%d:\n", usedDevice);
|
||||
R_Printf(PRINT_ALL, " deviceName: %s\n", vk_device.properties.deviceName);
|
||||
R_Printf(PRINT_ALL, " resolution: %dx%d", vid.width, vid.height);
|
||||
if (msaa > 0)
|
||||
{
|
||||
R_Printf(PRINT_ALL, " (MSAAx%d)\n", msaa);
|
||||
}
|
||||
else
|
||||
{
|
||||
R_Printf(PRINT_ALL, "\n");
|
||||
}
|
||||
#ifndef __linux__
|
||||
// Intel on Windows and MacOS (Linux uses semver for Mesa drivers)
|
||||
if (vk_device.properties.vendorID == 0x8086)
|
||||
{
|
||||
R_Printf(PRINT_ALL, " driverVersion: %d (0x%X)\n",
|
||||
vk_device.properties.driverVersion,
|
||||
vk_device.properties.driverVersion);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
R_Printf(PRINT_ALL, " driverVersion: %d.%d.%d (0x%X)\n",
|
||||
driverMajor, driverMinor, driverPatch,
|
||||
vk_device.properties.driverVersion);
|
||||
}
|
||||
|
||||
R_Printf(PRINT_ALL, " apiVersion: %d.%d.%d\n",
|
||||
VK_VERSION_MAJOR(vk_device.properties.apiVersion),
|
||||
VK_VERSION_MINOR(vk_device.properties.apiVersion),
|
||||
VK_VERSION_PATCH(vk_device.properties.apiVersion));
|
||||
R_Printf(PRINT_ALL, " deviceID: %d\n", vk_device.properties.deviceID);
|
||||
R_Printf(PRINT_ALL, " vendorID: 0x%X (%s)\n",
|
||||
vk_device.properties.vendorID, vk_config.vendor_name);
|
||||
R_Printf(PRINT_ALL, " deviceType: %s\n", vk_config.device_type);
|
||||
R_Printf(PRINT_ALL, " gfx/present/transfer: %d/%d/%d\n",
|
||||
vk_device.gfxFamilyIndex,
|
||||
vk_device.presentFamilyIndex,
|
||||
vk_device.transferFamilyIndex);
|
||||
R_Printf(PRINT_ALL, "Present mode: %s\n", vk_config.present_mode);
|
||||
R_Printf(PRINT_ALL, "Swapchain image format: %d\n", vk_swapchain.format);
|
||||
|
||||
R_Printf(PRINT_ALL, "Supported present modes: ");
|
||||
i = 0;
|
||||
while(vk_config.supported_present_modes[i])
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s ", vk_config.supported_present_modes[i++]);
|
||||
}
|
||||
R_Printf(PRINT_ALL, "\n");
|
||||
|
||||
R_Printf(PRINT_ALL, "Enabled extensions: ");
|
||||
i = 0;
|
||||
while(vk_config.extensions[i])
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s ", vk_config.extensions[i++]);
|
||||
}
|
||||
R_Printf(PRINT_ALL, "\n");
|
||||
|
||||
R_Printf(PRINT_ALL, "Enabled layers: ");
|
||||
i = 0;
|
||||
while(vk_config.layers[i])
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s ", vk_config.layers[i++]);
|
||||
}
|
||||
R_Printf(PRINT_ALL, "\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** Vk_Mem_f
|
||||
*/
|
||||
void Vk_Mem_f(void)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "\nDynamic buffer stats: \n");
|
||||
R_Printf(PRINT_ALL, "Vertex : %u/%ukB (%.1f%% max: %ukB)\n",
|
||||
vk_config.vertex_buffer_usage / 1024,
|
||||
vk_config.vertex_buffer_size / 1024,
|
||||
100.f * vk_config.vertex_buffer_usage / vk_config.vertex_buffer_size,
|
||||
vk_config.vertex_buffer_max_usage / 1024);
|
||||
|
||||
R_Printf(PRINT_ALL, "Index : %u/%uB (%.1f%% max: %uB)\n",
|
||||
vk_config.index_buffer_usage,
|
||||
vk_config.index_buffer_size,
|
||||
100.f * vk_config.index_buffer_usage / vk_config.index_buffer_size,
|
||||
vk_config.index_buffer_max_usage);
|
||||
R_Printf(PRINT_ALL, "Uniform: %u/%ukB (%.1f%% max: %ukB)\n",
|
||||
vk_config.uniform_buffer_usage / 1024,
|
||||
vk_config.uniform_buffer_size / 1024,
|
||||
100.f * vk_config.uniform_buffer_usage / vk_config.uniform_buffer_size,
|
||||
vk_config.uniform_buffer_max_usage / 1024);
|
||||
R_Printf(PRINT_ALL, "Triangle index: %u/%u (%.1f%% max: %u)\n",
|
||||
vk_config.triangle_index_usage,
|
||||
vk_config.triangle_index_count,
|
||||
100.f * vk_config.triangle_index_usage / vk_config.triangle_index_count,
|
||||
vk_config.triangle_index_max_usage);
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "header/shaders.h"
|
||||
|
||||
// ingame shaders stored as uint32_t arrays (autogenerated by glslangValidator)
|
||||
#include "spirv/basic_vert.c"
|
||||
#include "spirv/basic_frag.c"
|
||||
#include "spirv/basic_color_quad_vert.c"
|
||||
#include "spirv/basic_color_quad_frag.c"
|
||||
#include "spirv/model_vert.c"
|
||||
#include "spirv/model_frag.c"
|
||||
#include "spirv/nullmodel_vert.c"
|
||||
#include "spirv/particle_vert.c"
|
||||
#include "spirv/point_particle_vert.c"
|
||||
#include "spirv/point_particle_frag.c"
|
||||
#include "spirv/sprite_vert.c"
|
||||
#include "spirv/beam_vert.c"
|
||||
#include "spirv/skybox_vert.c"
|
||||
#include "spirv/d_light_vert.c"
|
||||
#include "spirv/polygon_vert.c"
|
||||
#include "spirv/polygon_lmap_vert.c"
|
||||
#include "spirv/polygon_lmap_frag.c"
|
||||
#include "spirv/polygon_warp_vert.c"
|
||||
#include "spirv/shadows_vert.c"
|
||||
#include "spirv/postprocess_vert.c"
|
||||
#include "spirv/postprocess_frag.c"
|
||||
#include "spirv/world_warp_vert.c"
|
||||
#include "spirv/world_warp_frag.c"
|
||||
|
||||
const size_t basic_vert_size = sizeof(basic_vert_spv);
|
||||
const size_t basic_frag_size = sizeof(basic_frag_spv);
|
||||
|
||||
const size_t basic_color_quad_vert_size = sizeof(basic_color_quad_vert_spv);
|
||||
const size_t basic_color_quad_frag_size = sizeof(basic_color_quad_frag_spv);
|
||||
|
||||
const size_t model_vert_size = sizeof(model_vert_spv);
|
||||
const size_t model_frag_size = sizeof(model_frag_spv);
|
||||
|
||||
const size_t nullmodel_vert_size = sizeof(nullmodel_vert_spv);
|
||||
|
||||
const size_t particle_vert_size = sizeof(particle_vert_spv);
|
||||
|
||||
const size_t point_particle_vert_size = sizeof(point_particle_vert_spv);
|
||||
const size_t point_particle_frag_size = sizeof(point_particle_frag_spv);
|
||||
|
||||
const size_t sprite_vert_size = sizeof(sprite_vert_spv);
|
||||
|
||||
const size_t beam_vert_size = sizeof(beam_vert_spv);
|
||||
|
||||
const size_t skybox_vert_size = sizeof(skybox_vert_spv);
|
||||
|
||||
const size_t d_light_vert_size = sizeof(d_light_vert_spv);
|
||||
|
||||
const size_t polygon_vert_size = sizeof(polygon_vert_spv);
|
||||
|
||||
const size_t polygon_lmap_vert_size = sizeof(polygon_lmap_vert_spv);
|
||||
const size_t polygon_lmap_frag_size = sizeof(polygon_lmap_frag_spv);
|
||||
|
||||
const size_t polygon_warp_vert_size = sizeof(polygon_warp_vert_spv);
|
||||
|
||||
const size_t shadows_vert_size = sizeof(shadows_vert_spv);
|
||||
|
||||
const size_t postprocess_vert_size = sizeof(postprocess_vert_spv);
|
||||
const size_t postprocess_frag_size = sizeof(postprocess_frag_spv);
|
||||
|
||||
const size_t world_warp_vert_size = sizeof(world_warp_vert_spv);
|
||||
const size_t world_warp_frag_size = sizeof(world_warp_frag_spv);
|
|
@ -1,250 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
// internal helper
|
||||
static const char *presentModeString(VkPresentModeKHR presentMode)
|
||||
{
|
||||
#define PMSTR(r) case VK_ ##r: return "VK_"#r
|
||||
switch (presentMode)
|
||||
{
|
||||
PMSTR(PRESENT_MODE_IMMEDIATE_KHR);
|
||||
PMSTR(PRESENT_MODE_MAILBOX_KHR);
|
||||
PMSTR(PRESENT_MODE_FIFO_KHR);
|
||||
PMSTR(PRESENT_MODE_FIFO_RELAXED_KHR);
|
||||
default: return "<unknown>";
|
||||
}
|
||||
#undef PMSTR
|
||||
return "UNKNOWN PRESENT MODE";
|
||||
}
|
||||
|
||||
// internal helper
|
||||
static VkSurfaceFormatKHR getSwapSurfaceFormat(const VkSurfaceFormatKHR *surfaceFormats, uint32_t formatCount)
|
||||
{
|
||||
VkSurfaceFormatKHR swapSurfaceFormat;
|
||||
memset(&swapSurfaceFormat, 0, sizeof(swapSurfaceFormat));
|
||||
if (!surfaceFormats || !formatCount)
|
||||
{
|
||||
return swapSurfaceFormat;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < formatCount; ++i)
|
||||
{
|
||||
if (surfaceFormats[i].colorSpace == VK_COLOR_SPACE_SRGB_NONLINEAR_KHR &&
|
||||
surfaceFormats[i].format == VK_FORMAT_B8G8R8A8_UNORM)
|
||||
{
|
||||
swapSurfaceFormat.colorSpace = surfaceFormats[i].colorSpace;
|
||||
swapSurfaceFormat.format = surfaceFormats[i].format;
|
||||
return swapSurfaceFormat;
|
||||
}
|
||||
}
|
||||
// no preferred format, so get the first one from list
|
||||
swapSurfaceFormat.colorSpace = surfaceFormats[0].colorSpace;
|
||||
swapSurfaceFormat.format = surfaceFormats[0].format;
|
||||
|
||||
return swapSurfaceFormat;
|
||||
}
|
||||
|
||||
// internal helper
|
||||
// look to https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPresentModeKHR.html for more information
|
||||
static VkPresentModeKHR getSwapPresentMode(const VkPresentModeKHR *presentModes, uint32_t presentModesCount, VkPresentModeKHR desiredMode)
|
||||
{
|
||||
// PRESENT_MODE_FIFO_KHR is guaranteed to exist due to spec requirements
|
||||
VkPresentModeKHR usedPresentMode = VK_PRESENT_MODE_FIFO_KHR;
|
||||
|
||||
if (!presentModes)
|
||||
{
|
||||
return usedPresentMode;
|
||||
}
|
||||
|
||||
// check if the desired present mode is supported
|
||||
for (uint32_t i = 0; i < presentModesCount; ++i)
|
||||
{
|
||||
// mode supported, nothing to do here
|
||||
if (presentModes[i] == desiredMode)
|
||||
{
|
||||
vk_config.present_mode = presentModeString(desiredMode);
|
||||
R_Printf(PRINT_ALL, "...using present mode: %s\n", vk_config.present_mode);
|
||||
return desiredMode;
|
||||
}
|
||||
}
|
||||
|
||||
// preferred present mode not found - choose the next best thing
|
||||
for (uint32_t i = 0; i < presentModesCount; ++i)
|
||||
{
|
||||
// always prefer mailbox for triple buffering with whole image replace
|
||||
if (presentModes[i] == VK_PRESENT_MODE_MAILBOX_KHR)
|
||||
{
|
||||
usedPresentMode = presentModes[i];
|
||||
break;
|
||||
}
|
||||
// prefer immediate update with tearing
|
||||
else if (presentModes[i] == VK_PRESENT_MODE_IMMEDIATE_KHR)
|
||||
{
|
||||
usedPresentMode = presentModes[i];
|
||||
}
|
||||
}
|
||||
|
||||
vk_config.present_mode = presentModeString(usedPresentMode);
|
||||
R_Printf(PRINT_ALL, "...present mode %s not supported, using present mode: %s\n", presentModeString(desiredMode), vk_config.present_mode);
|
||||
return usedPresentMode;
|
||||
}
|
||||
|
||||
// internal helper
|
||||
static VkCompositeAlphaFlagBitsKHR getSupportedCompositeAlpha(VkCompositeAlphaFlagsKHR supportedFlags)
|
||||
{
|
||||
VkCompositeAlphaFlagBitsKHR compositeAlphaFlags[] = {
|
||||
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
|
||||
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR,
|
||||
VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR,
|
||||
VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR
|
||||
};
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
if (supportedFlags & compositeAlphaFlags[i])
|
||||
return compositeAlphaFlags[i];
|
||||
}
|
||||
|
||||
return VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR;
|
||||
}
|
||||
|
||||
qboolean QVk_CheckExtent(void)
|
||||
{
|
||||
VkSurfaceCapabilitiesKHR surfaceCaps;
|
||||
VK_VERIFY(vkGetPhysicalDeviceSurfaceCapabilitiesKHR(vk_device.physical, vk_surface, &surfaceCaps));
|
||||
|
||||
if (surfaceCaps.currentExtent.width == 0 || surfaceCaps.currentExtent.height == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
VkResult QVk_CreateSwapchain()
|
||||
{
|
||||
VkSurfaceCapabilitiesKHR surfaceCaps;
|
||||
VkSurfaceFormatKHR *surfaceFormats = NULL;
|
||||
VkPresentModeKHR *presentModes = NULL;
|
||||
uint32_t formatCount, presentModesCount;
|
||||
VK_VERIFY(vkGetPhysicalDeviceSurfaceCapabilitiesKHR(vk_device.physical, vk_surface, &surfaceCaps));
|
||||
VK_VERIFY(vkGetPhysicalDeviceSurfaceFormatsKHR(vk_device.physical, vk_surface, &formatCount, NULL));
|
||||
VK_VERIFY(vkGetPhysicalDeviceSurfacePresentModesKHR(vk_device.physical, vk_surface, &presentModesCount, NULL));
|
||||
|
||||
if (formatCount > 0)
|
||||
{
|
||||
surfaceFormats = (VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR));
|
||||
VK_VERIFY(vkGetPhysicalDeviceSurfaceFormatsKHR(vk_device.physical, vk_surface, &formatCount, surfaceFormats));
|
||||
}
|
||||
|
||||
if (presentModesCount > 0)
|
||||
{
|
||||
presentModes = (VkPresentModeKHR *)malloc(presentModesCount * sizeof(VkPresentModeKHR));
|
||||
VK_VERIFY(vkGetPhysicalDeviceSurfacePresentModesKHR(vk_device.physical, vk_surface, &presentModesCount, presentModes));
|
||||
|
||||
R_Printf(PRINT_ALL, "Supported present modes: ");
|
||||
for (int i = 0; i < presentModesCount; i++)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s ", presentModeString(presentModes[i]));
|
||||
vk_config.supported_present_modes[i] = presentModeString(presentModes[i]);
|
||||
}
|
||||
R_Printf(PRINT_ALL, "\n");
|
||||
}
|
||||
|
||||
VkSurfaceFormatKHR swapSurfaceFormat = getSwapSurfaceFormat(surfaceFormats, formatCount);
|
||||
VkPresentModeKHR swapPresentMode = getSwapPresentMode(presentModes, presentModesCount, r_vsync->value > 0 ? VK_PRESENT_MODE_FIFO_KHR : VK_PRESENT_MODE_MAILBOX_KHR);
|
||||
free(surfaceFormats);
|
||||
free(presentModes);
|
||||
|
||||
VkExtent2D extent = surfaceCaps.currentExtent;
|
||||
if(extent.width == UINT32_MAX || extent.height == UINT32_MAX)
|
||||
{
|
||||
extent.width = max(surfaceCaps.minImageExtent.width, min(surfaceCaps.maxImageExtent.width, vid.width));
|
||||
extent.height = max(surfaceCaps.minImageExtent.height, min(surfaceCaps.maxImageExtent.height, vid.height));
|
||||
}
|
||||
|
||||
// request at least 2 images - this fixes fullscreen crashes on AMD when launching the game in fullscreen
|
||||
uint32_t imageCount = max(2, surfaceCaps.minImageCount);
|
||||
if (swapPresentMode != VK_PRESENT_MODE_FIFO_KHR)
|
||||
imageCount = max(3, surfaceCaps.minImageCount);
|
||||
|
||||
if (surfaceCaps.maxImageCount > 0)
|
||||
imageCount = min(imageCount, surfaceCaps.maxImageCount);
|
||||
|
||||
VkImageUsageFlags imgUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
|
||||
// TRANSFER_SRC_BIT is required for taking screenshots
|
||||
if (surfaceCaps.supportedUsageFlags & VK_IMAGE_USAGE_TRANSFER_SRC_BIT)
|
||||
{
|
||||
imgUsage |= VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
|
||||
vk_device.screenshotSupported = true;
|
||||
}
|
||||
|
||||
VkSwapchainKHR oldSwapchain = vk_swapchain.sc;
|
||||
VkSwapchainCreateInfoKHR scCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.surface = vk_surface,
|
||||
.minImageCount = imageCount,
|
||||
.imageFormat = swapSurfaceFormat.format,
|
||||
.imageColorSpace = swapSurfaceFormat.colorSpace,
|
||||
.imageExtent = extent,
|
||||
.imageArrayLayers = 1,
|
||||
.imageUsage = imgUsage,
|
||||
.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
.queueFamilyIndexCount = 0,
|
||||
.pQueueFamilyIndices = NULL,
|
||||
.preTransform = (surfaceCaps.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) ? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : surfaceCaps.currentTransform,
|
||||
.compositeAlpha = getSupportedCompositeAlpha(surfaceCaps.supportedCompositeAlpha),
|
||||
.presentMode = swapPresentMode,
|
||||
.clipped = VK_TRUE,
|
||||
.oldSwapchain = oldSwapchain
|
||||
};
|
||||
|
||||
uint32_t queueFamilyIndices[] = { (uint32_t)vk_device.gfxFamilyIndex, (uint32_t)vk_device.presentFamilyIndex };
|
||||
if (vk_device.presentFamilyIndex != vk_device.gfxFamilyIndex)
|
||||
{
|
||||
scCreateInfo.imageSharingMode = VK_SHARING_MODE_CONCURRENT;
|
||||
scCreateInfo.queueFamilyIndexCount = 2;
|
||||
scCreateInfo.pQueueFamilyIndices = queueFamilyIndices;
|
||||
}
|
||||
|
||||
vk_swapchain.format = swapSurfaceFormat.format;
|
||||
vk_swapchain.extent = extent;
|
||||
R_Printf(PRINT_ALL, "...trying swapchain extent: %dx%d\n", vk_swapchain.extent.width, vk_swapchain.extent.height);
|
||||
R_Printf(PRINT_ALL, "...trying swapchain image format: %d\n", vk_swapchain.format);
|
||||
|
||||
VkResult res = vkCreateSwapchainKHR(vk_device.logical, &scCreateInfo, NULL, &vk_swapchain.sc);
|
||||
if (res != VK_SUCCESS)
|
||||
return res;
|
||||
|
||||
VK_VERIFY(vkGetSwapchainImagesKHR(vk_device.logical, vk_swapchain.sc, &imageCount, NULL));
|
||||
vk_swapchain.images = (VkImage *)malloc(imageCount * sizeof(VkImage));
|
||||
vk_swapchain.imageCount = imageCount;
|
||||
res = vkGetSwapchainImagesKHR(vk_device.logical, vk_swapchain.sc, &imageCount, vk_swapchain.images);
|
||||
|
||||
if (oldSwapchain != VK_NULL_HANDLE)
|
||||
vkDestroySwapchainKHR(vk_device.logical, oldSwapchain, NULL);
|
||||
|
||||
return res;
|
||||
}
|
|
@ -1,620 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018 Christoph Schied
|
||||
Copyright (C) 2020 Denis Pauk
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "header/util.h"
|
||||
#include "header/local.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
static uint32_t
|
||||
get_memory_type(uint32_t mem_req_type_bits, VkMemoryPropertyFlags mem_prop)
|
||||
{
|
||||
for(uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; i++) {
|
||||
if(mem_req_type_bits & (1 << i)) {
|
||||
if((vk_device.mem_properties.memoryTypes[i].propertyFlags & mem_prop) == mem_prop)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
typedef struct MemoryResource_s {
|
||||
// type of memory
|
||||
uint32_t memory_type;
|
||||
// offset step
|
||||
VkDeviceSize alignment;
|
||||
// id memory used
|
||||
VkBool32 used;
|
||||
// suballocate
|
||||
VkBool32 suballocate;
|
||||
// shared memory used for image
|
||||
VkDeviceMemory memory;
|
||||
// image size
|
||||
VkDeviceSize size;
|
||||
// posision in shared memory
|
||||
VkDeviceSize offset;
|
||||
} MemoryResource_t;
|
||||
|
||||
// 1MB buffers / 512 x 512 * RGBA
|
||||
#define MEMORY_THRESHOLD (512 * 512 * 4)
|
||||
|
||||
static VkDeviceSize memory_block_threshold;
|
||||
static MemoryResource_t *used_memory;
|
||||
static VkDeviceSize used_memory_size;
|
||||
|
||||
void
|
||||
vulkan_memory_init(void)
|
||||
{
|
||||
memory_block_threshold = MEMORY_THRESHOLD;
|
||||
used_memory_size = 1024; // Size of buffers history
|
||||
used_memory = malloc(used_memory_size * sizeof(MemoryResource_t));
|
||||
memset(used_memory, 0, used_memory_size * sizeof(MemoryResource_t));
|
||||
}
|
||||
|
||||
static void
|
||||
memory_type_print(VkMemoryPropertyFlags mem_prop)
|
||||
{
|
||||
#define MPSTR(r, prop) \
|
||||
if((prop & VK_ ##r) != 0) \
|
||||
{ R_Printf(PRINT_ALL, " %s", "VK_"#r); };
|
||||
|
||||
MPSTR(MEMORY_PROPERTY_DEVICE_LOCAL_BIT, mem_prop);
|
||||
MPSTR(MEMORY_PROPERTY_HOST_VISIBLE_BIT, mem_prop);
|
||||
MPSTR(MEMORY_PROPERTY_HOST_COHERENT_BIT, mem_prop);
|
||||
MPSTR(MEMORY_PROPERTY_HOST_CACHED_BIT, mem_prop);
|
||||
MPSTR(MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT, mem_prop);
|
||||
MPSTR(MEMORY_PROPERTY_PROTECTED_BIT, mem_prop);
|
||||
MPSTR(MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD, mem_prop);
|
||||
MPSTR(MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD, mem_prop);
|
||||
|
||||
#undef PMSTR
|
||||
}
|
||||
|
||||
void
|
||||
vulkan_memory_types_show(void)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "\nMemory blocks:");
|
||||
|
||||
for(uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; i++)
|
||||
{
|
||||
if (vk_device.mem_properties.memoryTypes[i].propertyFlags)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "\n #%d:", i);
|
||||
memory_type_print(vk_device.mem_properties.memoryTypes[i].propertyFlags);
|
||||
}
|
||||
}
|
||||
R_Printf(PRINT_ALL, "\n");
|
||||
}
|
||||
|
||||
static VkBool32
|
||||
vulkan_memory_is_used(int start_pos, int end_pos, VkDeviceMemory memory)
|
||||
{
|
||||
int pos;
|
||||
|
||||
for (pos = start_pos; pos < end_pos; pos++)
|
||||
{
|
||||
if (used_memory[pos].memory == memory && used_memory[pos].used)
|
||||
return VK_TRUE;
|
||||
}
|
||||
|
||||
return VK_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
vulkan_memory_free_unused(void)
|
||||
{
|
||||
int pos_global;
|
||||
|
||||
for (pos_global = 0; pos_global < used_memory_size; pos_global ++)
|
||||
{
|
||||
VkDeviceMemory memory = used_memory[pos_global].memory;
|
||||
if (memory != VK_NULL_HANDLE && !used_memory[pos_global].used)
|
||||
{
|
||||
int pos_local;
|
||||
|
||||
// is used somewhere else after
|
||||
if (vulkan_memory_is_used(pos_global, used_memory_size, memory))
|
||||
continue;
|
||||
|
||||
// is used somewhere else before
|
||||
if (vulkan_memory_is_used(0, pos_global, memory))
|
||||
continue;
|
||||
|
||||
// free current memory block
|
||||
vkFreeMemory(vk_device.logical, memory, NULL);
|
||||
memset(&used_memory[pos_global], 0, sizeof(MemoryResource_t));
|
||||
|
||||
// cleanup same block
|
||||
for (pos_local = pos_global + 1; pos_local < used_memory_size; pos_local++)
|
||||
{
|
||||
if (used_memory[pos_local].memory == memory)
|
||||
{
|
||||
memset(&used_memory[pos_local], 0, sizeof(MemoryResource_t));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
vulkan_memory_delete(void)
|
||||
{
|
||||
int pos_global;
|
||||
for (pos_global = 0; pos_global < used_memory_size; pos_global ++)
|
||||
{
|
||||
VkDeviceMemory memory = used_memory[pos_global].memory;
|
||||
if (memory != VK_NULL_HANDLE)
|
||||
{
|
||||
int pos_local;
|
||||
|
||||
// free current memory block
|
||||
vkFreeMemory(vk_device.logical, memory, NULL);
|
||||
memset(&used_memory[pos_global], 0, sizeof(MemoryResource_t));
|
||||
|
||||
// cleanup same block
|
||||
for (pos_local = pos_global + 1; pos_local < used_memory_size; pos_local++)
|
||||
{
|
||||
if (used_memory[pos_local].memory == memory)
|
||||
{
|
||||
memset(&used_memory[pos_local], 0, sizeof(MemoryResource_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
free(used_memory);
|
||||
}
|
||||
|
||||
static VkResult
|
||||
memory_block_min(VkDeviceSize size,
|
||||
uint32_t memory_type,
|
||||
VkDeviceSize alignment,
|
||||
VkBool32 suballocate,
|
||||
int* block_pos)
|
||||
{
|
||||
int pos;
|
||||
VkDeviceSize min_size = memory_block_threshold;
|
||||
VkResult result = VK_ERROR_OUT_OF_DEVICE_MEMORY;
|
||||
|
||||
// update max_size
|
||||
if (min_size < size)
|
||||
{
|
||||
*block_pos = -1;
|
||||
return result;
|
||||
}
|
||||
|
||||
// search minimal posible size
|
||||
for (pos = 0; pos < used_memory_size; pos ++)
|
||||
{
|
||||
if (used_memory[pos].memory_type == memory_type &&
|
||||
used_memory[pos].suballocate == suballocate &&
|
||||
used_memory[pos].alignment == alignment &&
|
||||
used_memory[pos].memory != VK_NULL_HANDLE &&
|
||||
used_memory[pos].used == VK_FALSE &&
|
||||
used_memory[pos].size < min_size &&
|
||||
used_memory[pos].size >= size)
|
||||
{
|
||||
// save minimal size
|
||||
min_size = used_memory[pos].size;
|
||||
*block_pos = pos;
|
||||
result = VK_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
memory_block_empty(int *block_pos)
|
||||
{
|
||||
int pos;
|
||||
MemoryResource_t *memory;
|
||||
|
||||
// search empty memory
|
||||
for (pos = *block_pos; pos < used_memory_size; pos ++)
|
||||
{
|
||||
if (used_memory[pos].memory == VK_NULL_HANDLE)
|
||||
{
|
||||
*block_pos = pos;
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
memory = realloc(used_memory, (used_memory_size * 2) * sizeof(MemoryResource_t));
|
||||
if (!memory)
|
||||
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
|
||||
|
||||
// use previous end
|
||||
*block_pos = used_memory_size;
|
||||
|
||||
// update old struct
|
||||
memset(memory + used_memory_size, 0, used_memory_size * sizeof(MemoryResource_t));
|
||||
used_memory_size *= 2;
|
||||
used_memory = memory;
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
memory_block_allocate(VkDeviceSize size,
|
||||
uint32_t memory_type,
|
||||
VkDeviceSize alignment,
|
||||
VkBool32 suballocate,
|
||||
int *block_pos)
|
||||
{
|
||||
int pos = 0;
|
||||
if (memory_block_empty(&pos) == VK_SUCCESS)
|
||||
{
|
||||
VkResult result;
|
||||
VkDeviceMemory memory;
|
||||
|
||||
if (size < MEMORY_THRESHOLD)
|
||||
size = MEMORY_THRESHOLD;
|
||||
|
||||
// allocate only aligned
|
||||
size = ROUNDUP(size, alignment);
|
||||
|
||||
// Need to split only buffers with suballocate support
|
||||
if (suballocate)
|
||||
{
|
||||
// requested bigger then usual
|
||||
if (size > memory_block_threshold)
|
||||
{
|
||||
size *= 2;
|
||||
// up threshold for next allocations
|
||||
memory_block_threshold = size;
|
||||
}
|
||||
// allcate bigger memory for reuse
|
||||
else if (size < memory_block_threshold)
|
||||
{
|
||||
size = memory_block_threshold;
|
||||
}
|
||||
}
|
||||
|
||||
VkMemoryAllocateInfo mem_alloc_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
|
||||
.allocationSize = size,
|
||||
.memoryTypeIndex = memory_type
|
||||
};
|
||||
|
||||
result = vkAllocateMemory(vk_device.logical, &mem_alloc_info, NULL, &memory);
|
||||
if (result == VK_SUCCESS)
|
||||
{
|
||||
used_memory[pos].memory = memory;
|
||||
used_memory[pos].memory_type = memory_type;
|
||||
used_memory[pos].alignment = alignment;
|
||||
used_memory[pos].offset = 0;
|
||||
used_memory[pos].size = size;
|
||||
used_memory[pos].suballocate = suballocate;
|
||||
used_memory[pos].used = VK_FALSE;
|
||||
*block_pos = pos;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
memory_create(VkDeviceSize size,
|
||||
uint32_t memory_type,
|
||||
VkBool32 suballocate,
|
||||
VkDeviceSize alignment,
|
||||
VkDeviceMemory *memory,
|
||||
VkDeviceSize *offset)
|
||||
{
|
||||
int pos = -1;
|
||||
VkResult result;
|
||||
result = memory_block_min(size, memory_type, alignment, suballocate, &pos);
|
||||
|
||||
if (result != VK_SUCCESS)
|
||||
{
|
||||
result = memory_block_allocate(size, memory_type, alignment, suballocate, &pos);
|
||||
}
|
||||
if (result == VK_SUCCESS)
|
||||
{
|
||||
// check size of block,
|
||||
// new block should be at least same size as current
|
||||
// and beger than double minimal offset
|
||||
// and marked as not for mmap
|
||||
if (used_memory[pos].size > (size * 2) &&
|
||||
(used_memory[pos].size > (used_memory[pos].alignment * 2)) &&
|
||||
used_memory[pos].suballocate)
|
||||
{
|
||||
// search from next slot
|
||||
int new_pos = pos + 1;
|
||||
result = memory_block_empty(&new_pos);
|
||||
if (result == VK_SUCCESS)
|
||||
{
|
||||
VkDeviceSize new_size = ROUNDUP(size, used_memory[pos].alignment);
|
||||
|
||||
// split to several blocks
|
||||
memcpy(&used_memory[new_pos], &used_memory[pos], sizeof(MemoryResource_t));
|
||||
used_memory[new_pos].offset = used_memory[pos].offset + new_size;
|
||||
used_memory[new_pos].size = used_memory[pos].size - new_size;
|
||||
|
||||
// save new size to block, it can be bigger than required
|
||||
used_memory[pos].size = used_memory[new_pos].offset - used_memory[pos].offset;
|
||||
assert(used_memory[pos].size > 0);
|
||||
}
|
||||
}
|
||||
|
||||
used_memory[pos].used = VK_TRUE;
|
||||
*offset = used_memory[pos].offset;
|
||||
*memory = used_memory[pos].memory;
|
||||
return result;
|
||||
}
|
||||
|
||||
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
|
||||
}
|
||||
|
||||
static void
|
||||
memory_destroy(VkDeviceMemory memory, VkDeviceSize offset)
|
||||
{
|
||||
int pos;
|
||||
for (pos = 0; pos < used_memory_size; pos ++)
|
||||
{
|
||||
if (used_memory[pos].memory == memory && used_memory[pos].offset == offset)
|
||||
{
|
||||
used_memory[pos].used = VK_FALSE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// looks as no such memory registered
|
||||
vkFreeMemory(vk_device.logical, memory, NULL);
|
||||
}
|
||||
|
||||
static VkResult
|
||||
memory_create_by_property(VkMemoryRequirements* mem_reqs,
|
||||
VkMemoryPropertyFlags mem_properties,
|
||||
VkMemoryPropertyFlags mem_preferences,
|
||||
VkDeviceMemory *memory,
|
||||
VkDeviceSize *offset)
|
||||
{
|
||||
uint32_t memory_index;
|
||||
VkMemoryPropertyFlags host_visible;
|
||||
|
||||
memory_index = get_memory_type(mem_reqs->memoryTypeBits,
|
||||
mem_properties | mem_preferences);
|
||||
// prefered memory allocation
|
||||
if (memory_index == -1)
|
||||
{
|
||||
memory_index = get_memory_type(mem_reqs->memoryTypeBits,
|
||||
mem_properties);
|
||||
}
|
||||
// strictly required
|
||||
if (memory_index == -1)
|
||||
{
|
||||
R_Printf(PRINT_ALL, "%s:%d: Have not found required memory type.\n",
|
||||
__func__, __LINE__);
|
||||
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
|
||||
}
|
||||
|
||||
host_visible = mem_properties & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
|
||||
|
||||
return memory_create(mem_reqs->size, memory_index,
|
||||
// suballocate allowed
|
||||
host_visible != VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
|
||||
mem_reqs->alignment, memory, offset);
|
||||
}
|
||||
|
||||
VkResult
|
||||
buffer_create(BufferResource_t *buf,
|
||||
VkBufferCreateInfo buf_create_info,
|
||||
VkMemoryPropertyFlags mem_properties,
|
||||
VkMemoryPropertyFlags mem_preferences)
|
||||
{
|
||||
assert(buf_create_info.size > 0);
|
||||
assert(buf);
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
buf->size = buf_create_info.size;
|
||||
buf->is_mapped = VK_FALSE;
|
||||
|
||||
result = vkCreateBuffer(vk_device.logical, &buf_create_info, NULL, &buf->buffer);
|
||||
if(result != VK_SUCCESS) {
|
||||
R_Printf(PRINT_ALL, "%s:%d: VkResult verification: %s\n",
|
||||
__func__, __LINE__, QVk_GetError(result));
|
||||
goto fail_buffer;
|
||||
}
|
||||
assert(buf->buffer != VK_NULL_HANDLE);
|
||||
|
||||
VkMemoryRequirements mem_reqs;
|
||||
vkGetBufferMemoryRequirements(vk_device.logical, buf->buffer, &mem_reqs);
|
||||
|
||||
result = memory_create_by_property(&mem_reqs, mem_properties, mem_preferences,
|
||||
&buf->memory, &buf->offset);
|
||||
if(result != VK_SUCCESS) {
|
||||
R_Printf(PRINT_ALL, "%s:%d: VkResult verification: %s\n",
|
||||
__func__, __LINE__, QVk_GetError(result));
|
||||
goto fail_mem_alloc;
|
||||
}
|
||||
|
||||
assert(buf->memory != VK_NULL_HANDLE);
|
||||
|
||||
result = vkBindBufferMemory(vk_device.logical, buf->buffer, buf->memory, buf->offset);
|
||||
if(result != VK_SUCCESS) {
|
||||
R_Printf(PRINT_ALL, "%s:%d: VkResult verification: %s\n",
|
||||
__func__, __LINE__, QVk_GetError(result));
|
||||
goto fail_bind_buf_memory;
|
||||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
||||
fail_bind_buf_memory:
|
||||
memory_destroy(buf->memory, buf->offset);
|
||||
fail_mem_alloc:
|
||||
vkDestroyBuffer(vk_device.logical, buf->buffer, NULL);
|
||||
fail_buffer:
|
||||
buf->buffer = VK_NULL_HANDLE;
|
||||
buf->memory = VK_NULL_HANDLE;
|
||||
buf->size = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
VkResult
|
||||
image_create(ImageResource_t *img,
|
||||
VkImageCreateInfo img_create_info,
|
||||
VkMemoryPropertyFlags mem_properties,
|
||||
VkMemoryPropertyFlags mem_preferences)
|
||||
{
|
||||
assert(img);
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
result = vkCreateImage(vk_device.logical, &img_create_info, NULL, &img->image);
|
||||
if(result != VK_SUCCESS) {
|
||||
R_Printf(PRINT_ALL, "%s:%d: VkResult verification: %s\n",
|
||||
__func__, __LINE__, QVk_GetError(result));
|
||||
goto fail_buffer;
|
||||
}
|
||||
assert(img->image != VK_NULL_HANDLE);
|
||||
|
||||
VkMemoryRequirements mem_reqs;
|
||||
vkGetImageMemoryRequirements(vk_device.logical, img->image, &mem_reqs);
|
||||
img->size = mem_reqs.size;
|
||||
|
||||
result = memory_create_by_property(&mem_reqs, mem_properties, mem_preferences,
|
||||
&img->memory, &img->offset);
|
||||
if(result != VK_SUCCESS) {
|
||||
R_Printf(PRINT_ALL, "%s:%d: VkResult verification: %s\n",
|
||||
__func__, __LINE__, QVk_GetError(result));
|
||||
goto fail_mem_alloc;
|
||||
}
|
||||
|
||||
assert(img->memory != VK_NULL_HANDLE);
|
||||
|
||||
result = vkBindImageMemory(vk_device.logical, img->image, img->memory, img->offset);
|
||||
if(result != VK_SUCCESS) {
|
||||
R_Printf(PRINT_ALL, "%s:%d: VkResult verification: %s\n",
|
||||
__func__, __LINE__, QVk_GetError(result));
|
||||
goto fail_bind_buf_memory;
|
||||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
||||
fail_bind_buf_memory:
|
||||
memory_destroy(img->memory, img->offset);
|
||||
fail_mem_alloc:
|
||||
vkDestroyImage(vk_device.logical, img->image, NULL);
|
||||
fail_buffer:
|
||||
img->image = VK_NULL_HANDLE;
|
||||
img->memory = VK_NULL_HANDLE;
|
||||
img->size = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
VkResult
|
||||
buffer_destroy(BufferResource_t *buf)
|
||||
{
|
||||
assert(!buf->is_mapped);
|
||||
|
||||
// buffer should be destroed before bound memory
|
||||
if(buf->buffer != VK_NULL_HANDLE)
|
||||
{
|
||||
vkDestroyBuffer(vk_device.logical, buf->buffer, NULL);
|
||||
buf->buffer = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
// buffer desroed, we can free up memory
|
||||
if(buf->memory != VK_NULL_HANDLE)
|
||||
{
|
||||
memory_destroy(buf->memory, buf->offset);
|
||||
buf->memory = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
memset(buf, 0, sizeof(BufferResource_t));
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult
|
||||
image_destroy(ImageResource_t *img)
|
||||
{
|
||||
// image should be destroed before bound memory
|
||||
if(img->image != VK_NULL_HANDLE)
|
||||
{
|
||||
vkDestroyImage(vk_device.logical, img->image, NULL);
|
||||
img->image = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
// image destroed, we can free up memory
|
||||
if(img->memory != VK_NULL_HANDLE)
|
||||
{
|
||||
memory_destroy(img->memory, img->offset);
|
||||
img->memory = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
memset(img, 0, sizeof(ImageResource_t));
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult
|
||||
buffer_flush(BufferResource_t *buf)
|
||||
{
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
VkMappedMemoryRange ranges[1] = {{
|
||||
.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
|
||||
.memory = buf->memory,
|
||||
.offset = buf->offset,
|
||||
.size = buf->size
|
||||
}};
|
||||
result = vkFlushMappedMemoryRanges(vk_device.logical, 1, ranges);
|
||||
return result;
|
||||
}
|
||||
|
||||
VkResult
|
||||
buffer_invalidate(BufferResource_t *buf)
|
||||
{
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
VkMappedMemoryRange ranges[1] = {{
|
||||
.sType = VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE,
|
||||
.memory = buf->memory,
|
||||
.offset = buf->offset,
|
||||
.size = buf->size
|
||||
}};
|
||||
result = vkInvalidateMappedMemoryRanges(vk_device.logical, 1, ranges);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
void *
|
||||
buffer_map(BufferResource_t *buf)
|
||||
{
|
||||
assert(buf->memory);
|
||||
assert(!buf->is_mapped);
|
||||
buf->is_mapped = VK_TRUE;
|
||||
void *ret = NULL;
|
||||
assert(buf->memory != VK_NULL_HANDLE);
|
||||
assert(buf->size > 0);
|
||||
VK_VERIFY(vkMapMemory(vk_device.logical, buf->memory,
|
||||
buf->offset/*offset*/, buf->size, 0 /*flags*/, &ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
buffer_unmap(BufferResource_t *buf)
|
||||
{
|
||||
assert(buf->memory);
|
||||
assert(buf->is_mapped);
|
||||
buf->is_mapped = VK_FALSE;
|
||||
vkUnmapMemory(vk_device.logical, buf->memory);
|
||||
}
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "header/local.h"
|
||||
|
||||
static VkDebugUtilsMessengerEXT validationMessenger = VK_NULL_HANDLE;
|
||||
|
||||
// layer message to string
|
||||
static const char* msgToString(VkDebugUtilsMessageTypeFlagsEXT type)
|
||||
{
|
||||
int g = (type & VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT) != 0 ? 1 : 0;
|
||||
int p = (type & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT) != 0 ? 1 : 0;
|
||||
int v = (type & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT) != 0 ? 1 : 0;
|
||||
|
||||
if (g) return "";
|
||||
if (p && !v) return "(performance)";
|
||||
if (p && v) return "(performance and validation)";
|
||||
if (v) return "(validation)";
|
||||
|
||||
return "?";
|
||||
}
|
||||
|
||||
// validation layer callback function (VK_EXT_debug_utils)
|
||||
static VKAPI_ATTR VkBool32 VKAPI_CALL debugUtilsCallback(VkDebugUtilsMessageSeverityFlagBitsEXT msgSeverity,
|
||||
VkDebugUtilsMessageTypeFlagsEXT msgType,
|
||||
const VkDebugUtilsMessengerCallbackDataEXT *callbackData,
|
||||
void* userData)
|
||||
{
|
||||
switch (msgSeverity)
|
||||
{
|
||||
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT:
|
||||
R_Printf(PRINT_ALL, "VK_INFO: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
break;
|
||||
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
|
||||
R_Printf(PRINT_ALL, "VK_VERBOSE: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
break;
|
||||
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
|
||||
R_Printf(PRINT_ALL, "VK_WARNING: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
break;
|
||||
default:
|
||||
R_Printf(PRINT_ALL, "VK_ERROR: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
assert(!"Vulkan error occured!");
|
||||
}
|
||||
return VK_FALSE;
|
||||
}
|
||||
|
||||
void QVk_CreateValidationLayers()
|
||||
{
|
||||
VkDebugUtilsMessengerCreateInfoEXT callbackInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT |
|
||||
VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT,
|
||||
.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT |
|
||||
VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT |
|
||||
VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT,
|
||||
.pfnUserCallback = debugUtilsCallback,
|
||||
.pUserData = NULL
|
||||
};
|
||||
|
||||
if(vk_validation->value)
|
||||
{
|
||||
callbackInfo.messageSeverity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT |
|
||||
VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT;
|
||||
}
|
||||
|
||||
if (qvkCreateDebugUtilsMessengerEXT)
|
||||
{
|
||||
VK_VERIFY(qvkCreateDebugUtilsMessengerEXT(vk_instance, &callbackInfo, NULL, &validationMessenger));
|
||||
R_Printf(PRINT_ALL, "...Vulkan validation layers enabled\n");
|
||||
}
|
||||
}
|
||||
|
||||
void QVk_DestroyValidationLayers()
|
||||
{
|
||||
if( validationMessenger != VK_NULL_HANDLE && qvkDestroyDebugUtilsMessengerEXT)
|
||||
{
|
||||
qvkDestroyDebugUtilsMessengerEXT( vk_instance, validationMessenger, NULL );
|
||||
validationMessenger = VK_NULL_HANDLE;
|
||||
}
|
||||
}
|
|
@ -1,732 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
Copyright (C) 2018-2019 Krzysztof Kondrak
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// vk_warp.c -- sky and water polygons
|
||||
#include "header/local.h"
|
||||
|
||||
static char skyname[MAX_QPATH];
|
||||
static float skyrotate;
|
||||
static vec3_t skyaxis;
|
||||
static image_t *sky_images[6];
|
||||
|
||||
static msurface_t *warpface;
|
||||
|
||||
#define SUBDIVIDE_SIZE 64
|
||||
|
||||
static void BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
int i, j;
|
||||
float *v;
|
||||
|
||||
mins[0] = mins[1] = mins[2] = 9999;
|
||||
maxs[0] = maxs[1] = maxs[2] = -9999;
|
||||
v = verts;
|
||||
for (i=0 ; i<numverts ; i++)
|
||||
for (j=0 ; j<3 ; j++, v++)
|
||||
{
|
||||
if (*v < mins[j])
|
||||
mins[j] = *v;
|
||||
if (*v > maxs[j])
|
||||
maxs[j] = *v;
|
||||
}
|
||||
}
|
||||
|
||||
static void SubdividePolygon (int numverts, float *verts)
|
||||
{
|
||||
int i, j, k;
|
||||
vec3_t mins, maxs;
|
||||
float *v;
|
||||
vec3_t front[64], back[64];
|
||||
int f, b;
|
||||
float dist[64];
|
||||
float frac;
|
||||
vkpoly_t *poly;
|
||||
vec3_t total;
|
||||
float total_s, total_t;
|
||||
|
||||
if (numverts > 60)
|
||||
ri.Sys_Error (ERR_DROP, "%s: numverts = %i", __func__, numverts);
|
||||
|
||||
BoundPoly (numverts, verts, mins, maxs);
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
float m;
|
||||
|
||||
m = (mins[i] + maxs[i]) * 0.5;
|
||||
m = SUBDIVIDE_SIZE * floor (m/SUBDIVIDE_SIZE + 0.5);
|
||||
if (maxs[i] - m < 8)
|
||||
continue;
|
||||
if (m - mins[i] < 8)
|
||||
continue;
|
||||
|
||||
// cut it
|
||||
v = verts + i;
|
||||
for (j=0 ; j<numverts ; j++, v+= 3)
|
||||
dist[j] = *v - m;
|
||||
|
||||
// wrap cases
|
||||
dist[j] = dist[0];
|
||||
v-=i;
|
||||
VectorCopy (verts, v);
|
||||
|
||||
f = b = 0;
|
||||
v = verts;
|
||||
for (j=0 ; j<numverts ; j++, v+= 3)
|
||||
{
|
||||
if (dist[j] >= 0)
|
||||
{
|
||||
VectorCopy (v, front[f]);
|
||||
f++;
|
||||
}
|
||||
if (dist[j] <= 0)
|
||||
{
|
||||
VectorCopy (v, back[b]);
|
||||
b++;
|
||||
}
|
||||
if (dist[j] == 0 || dist[j+1] == 0)
|
||||
continue;
|
||||
if ( (dist[j] > 0) != (dist[j+1] > 0) )
|
||||
{
|
||||
// clip point
|
||||
frac = dist[j] / (dist[j] - dist[j+1]);
|
||||
for (k=0 ; k<3 ; k++)
|
||||
front[f][k] = back[b][k] = v[k] + frac*(v[3+k] - v[k]);
|
||||
f++;
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
SubdividePolygon (f, front[0]);
|
||||
SubdividePolygon (b, back[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
// add a point in the center to help keep warp valid
|
||||
poly = Hunk_Alloc (sizeof(vkpoly_t) + ((numverts-4)+2) * VERTEXSIZE*sizeof(float));
|
||||
poly->next = warpface->polys;
|
||||
warpface->polys = poly;
|
||||
poly->numverts = numverts+2;
|
||||
VectorClear (total);
|
||||
total_s = 0;
|
||||
total_t = 0;
|
||||
for (i=0 ; i<numverts ; i++, verts+= 3)
|
||||
{
|
||||
float s, t;
|
||||
|
||||
VectorCopy (verts, poly->verts[i+1]);
|
||||
s = DotProduct (verts, warpface->texinfo->vecs[0]);
|
||||
t = DotProduct (verts, warpface->texinfo->vecs[1]);
|
||||
|
||||
total_s += s;
|
||||
total_t += t;
|
||||
VectorAdd (total, verts, total);
|
||||
|
||||
poly->verts[i+1][3] = s;
|
||||
poly->verts[i+1][4] = t;
|
||||
}
|
||||
|
||||
VectorScale (total, (1.0/numverts), poly->verts[0]);
|
||||
poly->verts[0][3] = total_s/numverts;
|
||||
poly->verts[0][4] = total_t/numverts;
|
||||
|
||||
// copy first vertex to last
|
||||
memcpy (poly->verts[i+1], poly->verts[1], sizeof(poly->verts[0]));
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Vk_SubdivideSurface
|
||||
|
||||
Breaks a polygon up along axial 64 unit
|
||||
boundaries so that turbulent and sky warps
|
||||
can be done reasonably.
|
||||
================
|
||||
*/
|
||||
void Vk_SubdivideSurface (msurface_t *fa, model_t *loadmodel)
|
||||
{
|
||||
vec3_t verts[64];
|
||||
int numverts;
|
||||
int i;
|
||||
float *vec;
|
||||
|
||||
warpface = fa;
|
||||
|
||||
//
|
||||
// convert edges back to a normal polygon
|
||||
//
|
||||
numverts = 0;
|
||||
for (i=0 ; i<fa->numedges ; i++)
|
||||
{
|
||||
int lindex;
|
||||
|
||||
lindex = loadmodel->surfedges[fa->firstedge + i];
|
||||
|
||||
if (lindex > 0)
|
||||
vec = loadmodel->vertexes[loadmodel->edges[lindex].v[0]].position;
|
||||
else
|
||||
vec = loadmodel->vertexes[loadmodel->edges[-lindex].v[1]].position;
|
||||
VectorCopy (vec, verts[numverts]);
|
||||
numverts++;
|
||||
}
|
||||
|
||||
SubdividePolygon (numverts, verts[0]);
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
|
||||
/*
|
||||
=============
|
||||
EmitWaterPolys
|
||||
|
||||
Does a water warp on the pre-fragmented vkpoly_t chain
|
||||
=============
|
||||
*/
|
||||
void
|
||||
EmitWaterPolys (msurface_t *fa, image_t *texture, float *modelMatrix,
|
||||
float *color, qboolean solid_surface)
|
||||
{
|
||||
vkpoly_t *p, *bp;
|
||||
float *v;
|
||||
int i;
|
||||
|
||||
struct {
|
||||
float model[16];
|
||||
float color[4];
|
||||
float time;
|
||||
float scroll;
|
||||
} polyUbo;
|
||||
|
||||
polyUbo.color[0] = color[0];
|
||||
polyUbo.color[1] = color[1];
|
||||
polyUbo.color[2] = color[2];
|
||||
polyUbo.color[3] = color[3];
|
||||
polyUbo.time = r_newrefdef.time;
|
||||
|
||||
if (fa->texinfo->flags & SURF_FLOWING)
|
||||
polyUbo.scroll = (-64 * ((r_newrefdef.time*0.5) - (int)(r_newrefdef.time*0.5))) / 64.f;
|
||||
else
|
||||
polyUbo.scroll = 0;
|
||||
|
||||
if (modelMatrix)
|
||||
{
|
||||
memcpy(polyUbo.model, modelMatrix, sizeof(float) * 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
Mat_Identity(polyUbo.model);
|
||||
}
|
||||
|
||||
if (solid_surface)
|
||||
{
|
||||
// Solid surface
|
||||
QVk_BindPipeline(&vk_drawPolySolidWarpPipeline);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Blend surface
|
||||
QVk_BindPipeline(&vk_drawPolyWarpPipeline);
|
||||
}
|
||||
|
||||
uint32_t uboOffset;
|
||||
VkDescriptorSet uboDescriptorSet;
|
||||
uint8_t *uboData = QVk_GetUniformBuffer(sizeof(polyUbo), &uboOffset, &uboDescriptorSet);
|
||||
memcpy(uboData, &polyUbo, sizeof(polyUbo));
|
||||
|
||||
VkBuffer vbo;
|
||||
VkDeviceSize vboOffset;
|
||||
VkDescriptorSet descriptorSets[] = { texture->vk_texture.descriptorSet, uboDescriptorSet };
|
||||
|
||||
float gamma = 2.1F - vid_gamma->value;
|
||||
|
||||
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTexQuadPipeline[vk_state.current_renderpass].layout,
|
||||
VK_SHADER_STAGE_FRAGMENT_BIT, 17 * sizeof(float), sizeof(gamma), &gamma);
|
||||
|
||||
if (solid_surface)
|
||||
{
|
||||
// Solid surface
|
||||
vkCmdBindDescriptorSets(
|
||||
vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
vk_drawPolySolidWarpPipeline.layout, 0, 2,
|
||||
descriptorSets, 1, &uboOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Blend surface
|
||||
vkCmdBindDescriptorSets(
|
||||
vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
vk_drawPolyWarpPipeline.layout, 0, 2,
|
||||
descriptorSets, 1, &uboOffset);
|
||||
}
|
||||
|
||||
for (bp = fa->polys; bp; bp = bp->next)
|
||||
{
|
||||
p = bp;
|
||||
|
||||
if (Mesh_VertsRealloc(p->numverts))
|
||||
{
|
||||
ri.Sys_Error(ERR_FATAL, "%s: can't allocate memory", __func__);
|
||||
}
|
||||
|
||||
for (i = 0, v = p->verts[0]; i < p->numverts; i++, v += VERTEXSIZE)
|
||||
{
|
||||
verts_buffer[i].vertex[0] = v[0];
|
||||
verts_buffer[i].vertex[1] = v[1];
|
||||
verts_buffer[i].vertex[2] = v[2];
|
||||
verts_buffer[i].texCoord[0] = v[3] / 64.f;
|
||||
verts_buffer[i].texCoord[1] = v[4] / 64.f;
|
||||
}
|
||||
|
||||
uint8_t *vertData = QVk_GetVertexBuffer(sizeof(polyvert_t) * p->numverts, &vbo, &vboOffset);
|
||||
memcpy(vertData, verts_buffer, sizeof(polyvert_t) * p->numverts);
|
||||
|
||||
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
|
||||
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo((p->numverts - 2) * 3), 0, VK_INDEX_TYPE_UINT16);
|
||||
vkCmdDrawIndexed(vk_activeCmdbuffer, (p->numverts - 2) * 3, 1, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===================================================================
|
||||
|
||||
|
||||
static vec3_t skyclip[6] = {
|
||||
{1,1,0},
|
||||
{1,-1,0},
|
||||
{0,-1,1},
|
||||
{0,1,1},
|
||||
{1,0,1},
|
||||
{-1,0,1}
|
||||
};
|
||||
|
||||
// 1 = s, 2 = t, 3 = 2048
|
||||
static int st_to_vec[6][3] =
|
||||
{
|
||||
{3,-1,2},
|
||||
{-3,1,2},
|
||||
|
||||
{1,3,2},
|
||||
{-1,-3,2},
|
||||
|
||||
{-2,-1,3}, // 0 degrees yaw, look straight up
|
||||
{2,-1,-3} // look straight down
|
||||
|
||||
// {-1,2,3},
|
||||
// {1,2,-3}
|
||||
};
|
||||
|
||||
// s = [0]/[2], t = [1]/[2]
|
||||
static int vec_to_st[6][3] =
|
||||
{
|
||||
{-2,3,1},
|
||||
{2,3,-1},
|
||||
|
||||
{1,3,2},
|
||||
{-1,3,-2},
|
||||
|
||||
{-2,-1,3},
|
||||
{-2,1,-3}
|
||||
|
||||
// {-1,2,3},
|
||||
// {1,2,-3}
|
||||
};
|
||||
|
||||
static float skymins[2][6], skymaxs[2][6];
|
||||
static float sky_min, sky_max;
|
||||
|
||||
static void DrawSkyPolygon (int nump, vec3_t vecs)
|
||||
{
|
||||
int i;
|
||||
vec3_t v, av;
|
||||
float s, t, dv;
|
||||
int axis;
|
||||
float *vp;
|
||||
|
||||
// decide which face it maps to
|
||||
VectorCopy (vec3_origin, v);
|
||||
for (i=0, vp=vecs ; i<nump ; i++, vp+=3)
|
||||
{
|
||||
VectorAdd (vp, v, v);
|
||||
}
|
||||
av[0] = fabs(v[0]);
|
||||
av[1] = fabs(v[1]);
|
||||
av[2] = fabs(v[2]);
|
||||
if (av[0] > av[1] && av[0] > av[2])
|
||||
{
|
||||
if (v[0] < 0)
|
||||
axis = 1;
|
||||
else
|
||||
axis = 0;
|
||||
}
|
||||
else if (av[1] > av[2] && av[1] > av[0])
|
||||
{
|
||||
if (v[1] < 0)
|
||||
axis = 3;
|
||||
else
|
||||
axis = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (v[2] < 0)
|
||||
axis = 5;
|
||||
else
|
||||
axis = 4;
|
||||
}
|
||||
|
||||
// project new texture coords
|
||||
for (i=0 ; i<nump ; i++, vecs+=3)
|
||||
{
|
||||
int j;
|
||||
|
||||
j = vec_to_st[axis][2];
|
||||
if (j > 0)
|
||||
dv = vecs[j - 1];
|
||||
else
|
||||
dv = -vecs[-j - 1];
|
||||
if (dv < 0.001)
|
||||
continue; // don't divide by zero
|
||||
j = vec_to_st[axis][0];
|
||||
if (j < 0)
|
||||
s = -vecs[-j -1] / dv;
|
||||
else
|
||||
s = vecs[j-1] / dv;
|
||||
j = vec_to_st[axis][1];
|
||||
if (j < 0)
|
||||
t = -vecs[-j -1] / dv;
|
||||
else
|
||||
t = vecs[j-1] / dv;
|
||||
|
||||
if (s < skymins[0][axis])
|
||||
skymins[0][axis] = s;
|
||||
if (t < skymins[1][axis])
|
||||
skymins[1][axis] = t;
|
||||
if (s > skymaxs[0][axis])
|
||||
skymaxs[0][axis] = s;
|
||||
if (t > skymaxs[1][axis])
|
||||
skymaxs[1][axis] = t;
|
||||
}
|
||||
}
|
||||
|
||||
#define ON_EPSILON 0.1 // point on plane side epsilon
|
||||
#define MAX_CLIP_VERTS 64
|
||||
static void ClipSkyPolygon (int nump, vec3_t vecs, int stage)
|
||||
{
|
||||
float *norm;
|
||||
float *v;
|
||||
qboolean front, back;
|
||||
float d, e;
|
||||
float dists[MAX_CLIP_VERTS];
|
||||
int sides[MAX_CLIP_VERTS];
|
||||
vec3_t newv[2][MAX_CLIP_VERTS];
|
||||
int newc[2];
|
||||
int i, j;
|
||||
|
||||
if (nump > MAX_CLIP_VERTS-2)
|
||||
ri.Sys_Error (ERR_DROP, "%s: MAX_CLIP_VERTS", __func__);
|
||||
if (stage == 6)
|
||||
{ // fully clipped, so draw it
|
||||
DrawSkyPolygon (nump, vecs);
|
||||
return;
|
||||
}
|
||||
|
||||
front = back = false;
|
||||
norm = skyclip[stage];
|
||||
for (i=0, v = vecs ; i<nump ; i++, v+=3)
|
||||
{
|
||||
d = DotProduct (v, norm);
|
||||
if (d > ON_EPSILON)
|
||||
{
|
||||
front = true;
|
||||
sides[i] = SIDE_FRONT;
|
||||
}
|
||||
else if (d < -ON_EPSILON)
|
||||
{
|
||||
back = true;
|
||||
sides[i] = SIDE_BACK;
|
||||
}
|
||||
else
|
||||
sides[i] = SIDE_ON;
|
||||
dists[i] = d;
|
||||
}
|
||||
|
||||
if (!front || !back)
|
||||
{ // not clipped
|
||||
ClipSkyPolygon (nump, vecs, stage+1);
|
||||
return;
|
||||
}
|
||||
|
||||
// clip it
|
||||
sides[i] = sides[0];
|
||||
dists[i] = dists[0];
|
||||
VectorCopy (vecs, (vecs+(i*3)) );
|
||||
newc[0] = newc[1] = 0;
|
||||
|
||||
for (i=0, v = vecs ; i<nump ; i++, v+=3)
|
||||
{
|
||||
switch (sides[i])
|
||||
{
|
||||
case SIDE_FRONT:
|
||||
VectorCopy (v, newv[0][newc[0]]);
|
||||
newc[0]++;
|
||||
break;
|
||||
case SIDE_BACK:
|
||||
VectorCopy (v, newv[1][newc[1]]);
|
||||
newc[1]++;
|
||||
break;
|
||||
case SIDE_ON:
|
||||
VectorCopy (v, newv[0][newc[0]]);
|
||||
newc[0]++;
|
||||
VectorCopy (v, newv[1][newc[1]]);
|
||||
newc[1]++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (sides[i] == SIDE_ON || sides[i+1] == SIDE_ON || sides[i+1] == sides[i])
|
||||
continue;
|
||||
|
||||
d = dists[i] / (dists[i] - dists[i+1]);
|
||||
for (j=0 ; j<3 ; j++)
|
||||
{
|
||||
e = v[j] + d*(v[j+3] - v[j]);
|
||||
newv[0][newc[0]][j] = e;
|
||||
newv[1][newc[1]][j] = e;
|
||||
}
|
||||
newc[0]++;
|
||||
newc[1]++;
|
||||
}
|
||||
|
||||
// continue
|
||||
ClipSkyPolygon (newc[0], newv[0][0], stage+1);
|
||||
ClipSkyPolygon (newc[1], newv[1][0], stage+1);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_AddSkySurface
|
||||
=================
|
||||
*/
|
||||
void R_AddSkySurface (msurface_t *fa)
|
||||
{
|
||||
int i;
|
||||
vec3_t verts[MAX_CLIP_VERTS];
|
||||
vkpoly_t *p;
|
||||
|
||||
// calculate vertex values for sky box
|
||||
for (p=fa->polys ; p ; p=p->next)
|
||||
{
|
||||
for (i=0 ; i<p->numverts ; i++)
|
||||
{
|
||||
VectorSubtract (p->verts[i], r_origin, verts[i]);
|
||||
}
|
||||
ClipSkyPolygon (p->numverts, verts[0], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
R_ClearSkyBox
|
||||
==============
|
||||
*/
|
||||
void R_ClearSkyBox (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i<6 ; i++)
|
||||
{
|
||||
skymins[0][i] = skymins[1][i] = 9999;
|
||||
skymaxs[0][i] = skymaxs[1][i] = -9999;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MakeSkyVec (float s, float t, int axis, float *vertexData)
|
||||
{
|
||||
vec3_t v, b;
|
||||
int j;
|
||||
|
||||
float dist = (r_farsee->value == 0) ? 2300.0f : 4096.0f;
|
||||
|
||||
b[0] = s * dist;
|
||||
b[1] = t * dist;
|
||||
b[2] = dist;
|
||||
|
||||
for (j = 0; j<3; j++)
|
||||
{
|
||||
int k;
|
||||
|
||||
k = st_to_vec[axis][j];
|
||||
if (k < 0)
|
||||
v[j] = -b[-k - 1];
|
||||
else
|
||||
v[j] = b[k - 1];
|
||||
}
|
||||
|
||||
// avoid bilerp seam
|
||||
s = (s + 1)*0.5;
|
||||
t = (t + 1)*0.5;
|
||||
|
||||
if (s < sky_min)
|
||||
s = sky_min;
|
||||
else if (s > sky_max)
|
||||
s = sky_max;
|
||||
if (t < sky_min)
|
||||
t = sky_min;
|
||||
else if (t > sky_max)
|
||||
t = sky_max;
|
||||
|
||||
t = 1.0 - t;
|
||||
|
||||
vertexData[0] = v[0];
|
||||
vertexData[1] = v[1];
|
||||
vertexData[2] = v[2];
|
||||
vertexData[3] = s;
|
||||
vertexData[4] = t;
|
||||
}
|
||||
|
||||
/*
|
||||
==============
|
||||
R_DrawSkyBox
|
||||
==============
|
||||
*/
|
||||
static int skytexorder[6] = {0,2,1,3,4,5};
|
||||
void R_DrawSkyBox (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (skyrotate)
|
||||
{ // check for no sky at all
|
||||
for (i = 0; i<6; i++)
|
||||
if (skymins[0][i] < skymaxs[0][i]
|
||||
&& skymins[1][i] < skymaxs[1][i])
|
||||
break;
|
||||
if (i == 6)
|
||||
return; // nothing visible
|
||||
}
|
||||
|
||||
float model[16];
|
||||
Mat_Identity(model);
|
||||
Mat_Rotate(model, r_newrefdef.time * skyrotate, skyaxis[0], skyaxis[1], skyaxis[2]);
|
||||
Mat_Translate(model, r_origin[0], r_origin[1], r_origin[2]);
|
||||
|
||||
struct {
|
||||
float data[5];
|
||||
} skyVerts[4];
|
||||
|
||||
QVk_BindPipeline(&vk_drawSkyboxPipeline);
|
||||
uint32_t uboOffset;
|
||||
VkDescriptorSet uboDescriptorSet;
|
||||
uint8_t *uboData = QVk_GetUniformBuffer(sizeof(model), &uboOffset, &uboDescriptorSet);
|
||||
memcpy(uboData, model, sizeof(model));
|
||||
|
||||
for (i = 0; i<6; i++)
|
||||
{
|
||||
if (skyrotate)
|
||||
{ // hack, forces full sky to draw when rotating
|
||||
skymins[0][i] = -1;
|
||||
skymins[1][i] = -1;
|
||||
skymaxs[0][i] = 1;
|
||||
skymaxs[1][i] = 1;
|
||||
}
|
||||
|
||||
if (skymins[0][i] >= skymaxs[0][i]
|
||||
|| skymins[1][i] >= skymaxs[1][i])
|
||||
continue;
|
||||
|
||||
MakeSkyVec(skymins[0][i], skymins[1][i], i, skyVerts[0].data);
|
||||
MakeSkyVec(skymins[0][i], skymaxs[1][i], i, skyVerts[1].data);
|
||||
MakeSkyVec(skymaxs[0][i], skymaxs[1][i], i, skyVerts[2].data);
|
||||
MakeSkyVec(skymaxs[0][i], skymins[1][i], i, skyVerts[3].data);
|
||||
|
||||
float verts[] = {
|
||||
skyVerts[0].data[0], skyVerts[0].data[1], skyVerts[0].data[2], skyVerts[0].data[3], skyVerts[0].data[4],
|
||||
skyVerts[1].data[0], skyVerts[1].data[1], skyVerts[1].data[2], skyVerts[1].data[3], skyVerts[1].data[4],
|
||||
skyVerts[2].data[0], skyVerts[2].data[1], skyVerts[2].data[2], skyVerts[2].data[3], skyVerts[2].data[4],
|
||||
skyVerts[0].data[0], skyVerts[0].data[1], skyVerts[0].data[2], skyVerts[0].data[3], skyVerts[0].data[4],
|
||||
skyVerts[2].data[0], skyVerts[2].data[1], skyVerts[2].data[2], skyVerts[2].data[3], skyVerts[2].data[4],
|
||||
skyVerts[3].data[0], skyVerts[3].data[1], skyVerts[3].data[2], skyVerts[3].data[3], skyVerts[3].data[4]
|
||||
};
|
||||
|
||||
VkBuffer vbo;
|
||||
VkDeviceSize vboOffset;
|
||||
uint8_t *vertData = QVk_GetVertexBuffer(sizeof(verts), &vbo, &vboOffset);
|
||||
memcpy(vertData, verts, sizeof(verts));
|
||||
|
||||
VkDescriptorSet descriptorSets[] = { sky_images[skytexorder[i]]->vk_texture.descriptorSet, uboDescriptorSet };
|
||||
|
||||
float gamma = 2.1F - vid_gamma->value;
|
||||
|
||||
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTexQuadPipeline[vk_state.current_renderpass].layout,
|
||||
VK_SHADER_STAGE_FRAGMENT_BIT, 17 * sizeof(float), sizeof(gamma), &gamma);
|
||||
|
||||
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
vk_drawSkyboxPipeline.layout, 0, 2, descriptorSets, 1, &uboOffset);
|
||||
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
|
||||
vkCmdDraw(vk_activeCmdbuffer, 6, 1, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
RE_SetSky
|
||||
============
|
||||
*/
|
||||
// 3dstudio environment map names
|
||||
static char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"};
|
||||
void RE_SetSky (char *name, float rotate, vec3_t axis)
|
||||
{
|
||||
int i;
|
||||
char pathname[MAX_QPATH];
|
||||
|
||||
strncpy(skyname, name, sizeof(skyname) - 1);
|
||||
skyrotate = rotate;
|
||||
VectorCopy(axis, skyaxis);
|
||||
|
||||
for (i = 0; i<6; i++)
|
||||
{
|
||||
// chop down rotating skies for less memory
|
||||
if (vk_skymip->value || skyrotate)
|
||||
vk_picmip->value++;
|
||||
|
||||
Com_sprintf(pathname, sizeof(pathname), "env/%s%s.tga", skyname, suf[i]);
|
||||
|
||||
sky_images[i] = Vk_FindImage(pathname, it_sky);
|
||||
if (!sky_images[i]) {
|
||||
Com_sprintf(pathname, sizeof(pathname), "pics/Skies/%s%s.m8", skyname, suf[i]);
|
||||
sky_images[i] = Vk_FindImage(pathname, it_sky);
|
||||
}
|
||||
|
||||
if (!sky_images[i])
|
||||
sky_images[i] = r_notexture;
|
||||
|
||||
if (vk_skymip->value || skyrotate)
|
||||
{ // take less memory
|
||||
vk_picmip->value--;
|
||||
sky_min = 1.0 / 256;
|
||||
sky_max = 255.0 / 256;
|
||||
}
|
||||
else
|
||||
{
|
||||
sky_min = 1.0 / 512;
|
||||
sky_max = 511.0 / 512;
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,25 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
glslangValidator --variable-name basic_vert_spv -V shaders/basic.vert -o ../src/client/refresh/vk/spirv/basic_vert.c
|
||||
glslangValidator --variable-name basic_frag_spv -V shaders/basic.frag -o ../src/client/refresh/vk/spirv/basic_frag.c
|
||||
glslangValidator --variable-name basic_color_quad_vert_spv -V shaders/basic_color_quad.vert -o ../src/client/refresh/vk/spirv/basic_color_quad_vert.c
|
||||
glslangValidator --variable-name basic_color_quad_frag_spv -V shaders/basic_color_quad.frag -o ../src/client/refresh/vk/spirv/basic_color_quad_frag.c
|
||||
glslangValidator --variable-name model_vert_spv -V shaders/model.vert -o ../src/client/refresh/vk/spirv/model_vert.c
|
||||
glslangValidator --variable-name model_frag_spv -V shaders/model.frag -o ../src/client/refresh/vk/spirv/model_frag.c
|
||||
glslangValidator --variable-name nullmodel_vert_spv -V shaders/nullmodel.vert -o ../src/client/refresh/vk/spirv/nullmodel_vert.c
|
||||
glslangValidator --variable-name particle_vert_spv -V shaders/particle.vert -o ../src/client/refresh/vk/spirv/particle_vert.c
|
||||
glslangValidator --variable-name point_particle_vert_spv -V shaders/point_particle.vert -o ../src/client/refresh/vk/spirv/point_particle_vert.c
|
||||
glslangValidator --variable-name point_particle_frag_spv -V shaders/point_particle.frag -o ../src/client/refresh/vk/spirv/point_particle_frag.c
|
||||
glslangValidator --variable-name sprite_vert_spv -V shaders/sprite.vert -o ../src/client/refresh/vk/spirv/sprite_vert.c
|
||||
glslangValidator --variable-name beam_vert_spv -V shaders/beam.vert -o ../src/client/refresh/vk/spirv/beam_vert.c
|
||||
glslangValidator --variable-name skybox_vert_spv -V shaders/skybox.vert -o ../src/client/refresh/vk/spirv/skybox_vert.c
|
||||
glslangValidator --variable-name d_light_vert_spv -V shaders/d_light.vert -o ../src/client/refresh/vk/spirv/d_light_vert.c
|
||||
glslangValidator --variable-name polygon_vert_spv -V shaders/polygon.vert -o ../src/client/refresh/vk/spirv/polygon_vert.c
|
||||
glslangValidator --variable-name polygon_lmap_vert_spv -V shaders/polygon_lmap.vert -o ../src/client/refresh/vk/spirv/polygon_lmap_vert.c
|
||||
glslangValidator --variable-name polygon_lmap_frag_spv -V shaders/polygon_lmap.frag -o ../src/client/refresh/vk/spirv/polygon_lmap_frag.c
|
||||
glslangValidator --variable-name polygon_warp_vert_spv -V shaders/polygon_warp.vert -o ../src/client/refresh/vk/spirv/polygon_warp_vert.c
|
||||
glslangValidator --variable-name shadows_vert_spv -V shaders/shadows.vert -o ../src/client/refresh/vk/spirv/shadows_vert.c
|
||||
glslangValidator --variable-name postprocess_vert_spv -V shaders/postprocess.vert -o ../src/client/refresh/vk/spirv/postprocess_vert.c
|
||||
glslangValidator --variable-name postprocess_frag_spv -V shaders/postprocess.frag -o ../src/client/refresh/vk/spirv/postprocess_frag.c
|
||||
glslangValidator --variable-name world_warp_vert_spv -V shaders/world_warp.vert -o ../src/client/refresh/vk/spirv/world_warp_vert.c
|
||||
glslangValidator --variable-name world_warp_frag_spv -V shaders/world_warp.frag -o ../src/client/refresh/vk/spirv/world_warp_frag.c
|
|
@ -1,24 +0,0 @@
|
|||
#version 450
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
// vertex shader has 'mat4 vpMatrix;' at begin.
|
||||
layout(offset = 68) float gamma;
|
||||
} pc;
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D sTexture;
|
||||
|
||||
layout(location = 0) in vec2 texCoord;
|
||||
layout(location = 1) in vec4 color;
|
||||
layout(location = 2) in float aTreshold;
|
||||
|
||||
layout(location = 0) out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
fragmentColor = texture(sTexture, texCoord) * color;
|
||||
if(fragmentColor.a < aTreshold)
|
||||
discard;
|
||||
|
||||
fragmentColor = vec4(pow(fragmentColor.rgb, vec3(pc.gamma)), fragmentColor.a);
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
// normalized offset and scale
|
||||
layout(set = 1, binding = 0) uniform imageTransform
|
||||
{
|
||||
vec2 offset;
|
||||
vec2 scale;
|
||||
vec2 uvOffset;
|
||||
vec2 uvScale;
|
||||
} it;
|
||||
|
||||
layout(location = 0) in vec2 inVertex;
|
||||
layout(location = 1) in vec2 inTexCoord;
|
||||
|
||||
layout(location = 0) out vec2 texCoord;
|
||||
layout(location = 1) out vec4 color;
|
||||
layout(location = 2) out float aTreshold;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
vec2 vPos = inVertex.xy * it.scale - (vec2(1.0) - it.scale);
|
||||
gl_Position = vec4(vPos + it.offset * 2.0, 0.0, 1.0);
|
||||
texCoord = inTexCoord.xy * it.uvScale + it.uvOffset;
|
||||
color = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
aTreshold = 0.666;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
#version 450
|
||||
|
||||
layout(location = 0) in vec4 color;
|
||||
|
||||
layout(location = 0) out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
fragmentColor = color;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
// normalized offset and scale
|
||||
layout(set = 0, binding = 0) uniform imageTransform
|
||||
{
|
||||
vec2 offset;
|
||||
vec2 scale;
|
||||
vec4 color;
|
||||
} it;
|
||||
|
||||
layout(location = 0) in vec2 inVertex;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
vec2 vPos = inVertex.xy * it.scale - (vec2(1.0) - it.scale);
|
||||
gl_Position = vec4(vPos + it.offset * 2.0, 0.0, 1.0);
|
||||
color = it.color;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 mvpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
vec4 color;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.mvpMatrix * vec4(inVertex, 1.0);
|
||||
color = ubo.color;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec3 inColor;
|
||||
|
||||
layout(binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
mat4 mvpMatrix;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = ubo.mvpMatrix * vec4(inVertex, 1.0);
|
||||
color = vec4(inColor, 1.0);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#version 450
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D sTexture;
|
||||
|
||||
layout(location = 0) in vec4 color;
|
||||
layout(location = 1) in vec2 texCoord;
|
||||
layout(location = 2) in flat int textured;
|
||||
|
||||
layout(location = 0) out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
if(textured != 0)
|
||||
fragmentColor = texture(sTexture, texCoord) * clamp(color, 0.0, 1.0);
|
||||
else
|
||||
fragmentColor = color;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec4 inColor;
|
||||
layout(location = 2) in vec2 inTexCoord;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 vpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(set = 1, binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
mat4 model;
|
||||
int textured;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
layout(location = 1) out vec2 texCoord;
|
||||
layout(location = 2) out int textured;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.vpMatrix * ubo.model * vec4(inVertex, 1.0);
|
||||
color = inColor;
|
||||
texCoord = inTexCoord;
|
||||
textured = ubo.textured;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec3 inColor;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 vpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
mat4 model;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.vpMatrix * ubo.model * vec4(inVertex, 1.0);
|
||||
color = vec4(inColor, 1.0);
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec4 inColor;
|
||||
layout(location = 2) in vec2 inTexCoord;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 mvpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(location = 0) out vec2 texCoord;
|
||||
layout(location = 1) out vec4 color;
|
||||
layout(location = 2) out float aTreshold;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.mvpMatrix * vec4(inVertex, 1.0);
|
||||
texCoord = inTexCoord;
|
||||
color = inColor;
|
||||
aTreshold = 0.5;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
#version 450
|
||||
|
||||
layout(location = 0) in vec4 color;
|
||||
|
||||
layout(location = 0) out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 cxy = 2.0 * gl_PointCoord - 1.0;
|
||||
if(dot(cxy, cxy) > 1.0)
|
||||
discard;
|
||||
|
||||
fragmentColor = color;
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec4 inColor;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 mvpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
float pointSize;
|
||||
float pointScale;
|
||||
float minPointSize;
|
||||
float maxPointSize;
|
||||
float att_a;
|
||||
float att_b;
|
||||
float att_c;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
float gl_PointSize;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.mvpMatrix * vec4(inVertex, 1.0);
|
||||
|
||||
float dist_atten = ubo.pointScale / (ubo.att_a + ubo.att_b * gl_Position.w + ubo.att_c * gl_Position.w * gl_Position.w);
|
||||
gl_PointSize = clamp(ubo.pointScale * ubo.pointSize * sqrt(dist_atten), ubo.minPointSize, ubo.maxPointSize);
|
||||
|
||||
color = inColor;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec2 inTexCoord;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 mvpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(set = 1, binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
vec4 color;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) out vec2 texCoord;
|
||||
layout(location = 1) out vec4 color;
|
||||
layout(location = 2) out float aTreshold;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.mvpMatrix * vec4(inVertex, 1.0);
|
||||
texCoord = inTexCoord;
|
||||
color = ubo.color;
|
||||
aTreshold = 0.0;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#version 450
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D sTexture;
|
||||
layout(set = 2, binding = 0) uniform sampler2D sLightmap;
|
||||
|
||||
layout(location = 0) in vec2 texCoord;
|
||||
layout(location = 1) in vec2 texCoordLmap;
|
||||
layout(location = 2) in float viewLightmaps;
|
||||
|
||||
layout(location = 0) out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 color = texture(sTexture, texCoord);
|
||||
vec4 light = texture(sLightmap, texCoordLmap);
|
||||
fragmentColor = (1.0 - viewLightmaps) * color * light + viewLightmaps * light;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec2 inTexCoord;
|
||||
layout(location = 2) in vec2 inTexCoordLmap;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 vpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(set = 1, binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
mat4 model;
|
||||
float viewLightmaps;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) out vec2 texCoord;
|
||||
layout(location = 1) out vec2 texCoordLmap;
|
||||
layout(location = 2) out float viewLightmaps;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.vpMatrix * ubo.model * vec4(inVertex, 1.0);
|
||||
texCoord = inTexCoord;
|
||||
texCoordLmap = inTexCoordLmap;
|
||||
viewLightmaps = ubo.viewLightmaps;
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec2 inTexCoord;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 vpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(set = 1, binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
mat4 model;
|
||||
vec4 color;
|
||||
float time;
|
||||
float scroll;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) out vec2 texCoord;
|
||||
layout(location = 1) out vec4 color;
|
||||
layout(location = 2) out float aTreshold;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.vpMatrix * ubo.model * vec4(inVertex, 1.0);
|
||||
texCoord = inTexCoord + vec2(sin(2.0 * ubo.time + inTexCoord.y * 3.28), sin(2.0 * ubo.time + inTexCoord.x * 3.28)) * 0.05;
|
||||
texCoord.x += ubo.scroll;
|
||||
color = ubo.color;
|
||||
aTreshold = 0.0;
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
layout(offset = 68) float postprocess;
|
||||
layout(offset = 72) float gamma;
|
||||
layout(offset = 76) float scrWidth;
|
||||
layout(offset = 80) float scrHeight;
|
||||
layout(offset = 84) float offsetX;
|
||||
layout(offset = 88) float offsetY;
|
||||
} pc;
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D sTexture;
|
||||
|
||||
layout(location = 0) in vec2 texCoord;
|
||||
layout(location = 0) out vec4 fragmentColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 unnormTexCoord = texCoord * vec2(pc.scrWidth, pc.scrHeight) + vec2(pc.offsetX, pc.offsetY);
|
||||
|
||||
// apply any additional world-only postprocessing effects here (if enabled)
|
||||
if (pc.postprocess > 0.0)
|
||||
{
|
||||
//gamma + color intensity bump
|
||||
fragmentColor = vec4(pow(textureLod(sTexture, unnormTexCoord, 0.0).rgb * 1.5, vec3(pc.gamma)), 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
fragmentColor = textureLod(sTexture, unnormTexCoord, 0.0);
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
// rendering a fullscreen quad (which is actually just a huge triangle)
|
||||
// source: https://www.saschawillems.de/blog/2016/08/13/vulkan-tutorial-on-rendering-a-fullscreen-quad-without-buffers/
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
layout(location = 0) out vec2 texCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
texCoord = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
|
||||
gl_Position = vec4(texCoord * 2.0f + -1.0f, 0.0f, 1.0f);
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 vpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
mat4 model;
|
||||
} ubo;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.vpMatrix * ubo.model * vec4(inVertex, 1.0);
|
||||
color = vec4(0.0, 0.0, 0.0, 0.5);
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec2 inTexCoord;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 vpMatrix;
|
||||
} pc;
|
||||
|
||||
layout(set = 1, binding = 0) uniform UniformBufferObject
|
||||
{
|
||||
mat4 model;
|
||||
} ubo;
|
||||
|
||||
layout(location = 0) out vec2 texCoord;
|
||||
layout(location = 1) out vec4 color;
|
||||
layout(location = 2) out float aTreshold;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.vpMatrix * ubo.model * vec4(inVertex, 1.0);
|
||||
texCoord = inTexCoord;
|
||||
color = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
aTreshold = 0.0;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec3 inVertex;
|
||||
layout(location = 1) in vec2 inTexCoord;
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
mat4 mvpMatrix;
|
||||
float alpha;
|
||||
} pc;
|
||||
|
||||
layout(location = 0) out vec2 texCoord;
|
||||
layout(location = 1) out vec4 color;
|
||||
layout(location = 2) out float aTreshold;
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main() {
|
||||
gl_Position = pc.mvpMatrix * vec4(inVertex, 1.0);
|
||||
texCoord = inTexCoord;
|
||||
color = vec4(1.0, 1.0, 1.0, pc.alpha);
|
||||
aTreshold = 0.0666;
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
// Underwater screen warp effect similar to what software renderer provides.
|
||||
// Pixel size to simulate lower screen resolutions is used to restore world to full screen size.
|
||||
|
||||
layout(push_constant) uniform PushConstant
|
||||
{
|
||||
layout(offset = 68) float time;
|
||||
layout(offset = 72) float scale;
|
||||
layout(offset = 76) float scrWidth;
|
||||
layout(offset = 80) float scrHeight;
|
||||
layout(offset = 84) float offsetX;
|
||||
layout(offset = 88) float offsetY;
|
||||
layout(offset = 92) float pixelSize;
|
||||
layout(offset = 96) float refdefX;
|
||||
layout(offset = 100) float refdefY;
|
||||
layout(offset = 104) float refdefWidth;
|
||||
layout(offset = 108) float refdefHeight;
|
||||
} pc;
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler2D sTexture;
|
||||
|
||||
layout(location = 0) out vec4 fragmentColor;
|
||||
|
||||
#define PI 3.1415
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 scrSize = vec2(pc.scrWidth, pc.scrHeight);
|
||||
vec2 fragCoord = (gl_FragCoord.xy - vec2(pc.offsetX, pc.offsetY));
|
||||
vec2 uv = fragCoord / scrSize;
|
||||
|
||||
float xMin = pc.refdefX;
|
||||
float xMax = pc.refdefX + pc.refdefWidth;
|
||||
float yMin = pc.refdefY;
|
||||
float yMax = pc.refdefY + pc.refdefHeight;
|
||||
|
||||
if (pc.time > 0 && fragCoord.x > xMin && fragCoord.x < xMax && fragCoord.y > yMin && fragCoord.y < yMax)
|
||||
{
|
||||
float sx = pc.scale - abs(pc.scrWidth / 2.0 - fragCoord.x) * 2.0 / pc.scrWidth;
|
||||
float sy = pc.scale - abs(pc.scrHeight / 2.0 - fragCoord.y) * 2.0 / pc.scrHeight;
|
||||
float xShift = 2.0 * pc.time + uv.y * PI * 10;
|
||||
float yShift = 2.0 * pc.time + uv.x * PI * 10;
|
||||
vec2 distortion = vec2(sin(xShift) * sx, sin(yShift) * sy) * 0.00666;
|
||||
|
||||
uv += distortion;
|
||||
}
|
||||
|
||||
uv /= pc.pixelSize;
|
||||
|
||||
uv = clamp(uv * scrSize, vec2(0.0, 0.0), scrSize - vec2(0.5, 0.5));
|
||||
|
||||
fragmentColor = textureLod(sTexture, uv, 0.0);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
out gl_PerVertex {
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 positions[3] = {
|
||||
vec4(-1.0f, -1.0f, 0.0f, 1.0f),
|
||||
vec4(3.0f, -1.0f, 0.0f, 1.0f),
|
||||
vec4(-1.0f, 3.0f, 0.0f, 1.0f)
|
||||
};
|
||||
|
||||
gl_Position = positions[gl_VertexIndex % 3];
|
||||
}
|
Loading…
Reference in a new issue