mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-23 13:02:07 +00:00
vkQuake2 1.4.3
Vulkan render from https://github.com/kondrak/vkQuake2.git@9c85ad15a73320be6641c840697644d27e851fd4
This commit is contained in:
parent
bd4f7bed65
commit
4c3853ca56
48 changed files with 31578 additions and 0 deletions
181
src/client/refresh/vk/anorms.h
Normal file
181
src/client/refresh/vk/anorms.h
Normal file
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
{-0.525731, 0.000000, 0.850651},
|
||||
{-0.442863, 0.238856, 0.864188},
|
||||
{-0.295242, 0.000000, 0.955423},
|
||||
{-0.309017, 0.500000, 0.809017},
|
||||
{-0.162460, 0.262866, 0.951056},
|
||||
{0.000000, 0.000000, 1.000000},
|
||||
{0.000000, 0.850651, 0.525731},
|
||||
{-0.147621, 0.716567, 0.681718},
|
||||
{0.147621, 0.716567, 0.681718},
|
||||
{0.000000, 0.525731, 0.850651},
|
||||
{0.309017, 0.500000, 0.809017},
|
||||
{0.525731, 0.000000, 0.850651},
|
||||
{0.295242, 0.000000, 0.955423},
|
||||
{0.442863, 0.238856, 0.864188},
|
||||
{0.162460, 0.262866, 0.951056},
|
||||
{-0.681718, 0.147621, 0.716567},
|
||||
{-0.809017, 0.309017, 0.500000},
|
||||
{-0.587785, 0.425325, 0.688191},
|
||||
{-0.850651, 0.525731, 0.000000},
|
||||
{-0.864188, 0.442863, 0.238856},
|
||||
{-0.716567, 0.681718, 0.147621},
|
||||
{-0.688191, 0.587785, 0.425325},
|
||||
{-0.500000, 0.809017, 0.309017},
|
||||
{-0.238856, 0.864188, 0.442863},
|
||||
{-0.425325, 0.688191, 0.587785},
|
||||
{-0.716567, 0.681718, -0.147621},
|
||||
{-0.500000, 0.809017, -0.309017},
|
||||
{-0.525731, 0.850651, 0.000000},
|
||||
{0.000000, 0.850651, -0.525731},
|
||||
{-0.238856, 0.864188, -0.442863},
|
||||
{0.000000, 0.955423, -0.295242},
|
||||
{-0.262866, 0.951056, -0.162460},
|
||||
{0.000000, 1.000000, 0.000000},
|
||||
{0.000000, 0.955423, 0.295242},
|
||||
{-0.262866, 0.951056, 0.162460},
|
||||
{0.238856, 0.864188, 0.442863},
|
||||
{0.262866, 0.951056, 0.162460},
|
||||
{0.500000, 0.809017, 0.309017},
|
||||
{0.238856, 0.864188, -0.442863},
|
||||
{0.262866, 0.951056, -0.162460},
|
||||
{0.500000, 0.809017, -0.309017},
|
||||
{0.850651, 0.525731, 0.000000},
|
||||
{0.716567, 0.681718, 0.147621},
|
||||
{0.716567, 0.681718, -0.147621},
|
||||
{0.525731, 0.850651, 0.000000},
|
||||
{0.425325, 0.688191, 0.587785},
|
||||
{0.864188, 0.442863, 0.238856},
|
||||
{0.688191, 0.587785, 0.425325},
|
||||
{0.809017, 0.309017, 0.500000},
|
||||
{0.681718, 0.147621, 0.716567},
|
||||
{0.587785, 0.425325, 0.688191},
|
||||
{0.955423, 0.295242, 0.000000},
|
||||
{1.000000, 0.000000, 0.000000},
|
||||
{0.951056, 0.162460, 0.262866},
|
||||
{0.850651, -0.525731, 0.000000},
|
||||
{0.955423, -0.295242, 0.000000},
|
||||
{0.864188, -0.442863, 0.238856},
|
||||
{0.951056, -0.162460, 0.262866},
|
||||
{0.809017, -0.309017, 0.500000},
|
||||
{0.681718, -0.147621, 0.716567},
|
||||
{0.850651, 0.000000, 0.525731},
|
||||
{0.864188, 0.442863, -0.238856},
|
||||
{0.809017, 0.309017, -0.500000},
|
||||
{0.951056, 0.162460, -0.262866},
|
||||
{0.525731, 0.000000, -0.850651},
|
||||
{0.681718, 0.147621, -0.716567},
|
||||
{0.681718, -0.147621, -0.716567},
|
||||
{0.850651, 0.000000, -0.525731},
|
||||
{0.809017, -0.309017, -0.500000},
|
||||
{0.864188, -0.442863, -0.238856},
|
||||
{0.951056, -0.162460, -0.262866},
|
||||
{0.147621, 0.716567, -0.681718},
|
||||
{0.309017, 0.500000, -0.809017},
|
||||
{0.425325, 0.688191, -0.587785},
|
||||
{0.442863, 0.238856, -0.864188},
|
||||
{0.587785, 0.425325, -0.688191},
|
||||
{0.688191, 0.587785, -0.425325},
|
||||
{-0.147621, 0.716567, -0.681718},
|
||||
{-0.309017, 0.500000, -0.809017},
|
||||
{0.000000, 0.525731, -0.850651},
|
||||
{-0.525731, 0.000000, -0.850651},
|
||||
{-0.442863, 0.238856, -0.864188},
|
||||
{-0.295242, 0.000000, -0.955423},
|
||||
{-0.162460, 0.262866, -0.951056},
|
||||
{0.000000, 0.000000, -1.000000},
|
||||
{0.295242, 0.000000, -0.955423},
|
||||
{0.162460, 0.262866, -0.951056},
|
||||
{-0.442863, -0.238856, -0.864188},
|
||||
{-0.309017, -0.500000, -0.809017},
|
||||
{-0.162460, -0.262866, -0.951056},
|
||||
{0.000000, -0.850651, -0.525731},
|
||||
{-0.147621, -0.716567, -0.681718},
|
||||
{0.147621, -0.716567, -0.681718},
|
||||
{0.000000, -0.525731, -0.850651},
|
||||
{0.309017, -0.500000, -0.809017},
|
||||
{0.442863, -0.238856, -0.864188},
|
||||
{0.162460, -0.262866, -0.951056},
|
||||
{0.238856, -0.864188, -0.442863},
|
||||
{0.500000, -0.809017, -0.309017},
|
||||
{0.425325, -0.688191, -0.587785},
|
||||
{0.716567, -0.681718, -0.147621},
|
||||
{0.688191, -0.587785, -0.425325},
|
||||
{0.587785, -0.425325, -0.688191},
|
||||
{0.000000, -0.955423, -0.295242},
|
||||
{0.000000, -1.000000, 0.000000},
|
||||
{0.262866, -0.951056, -0.162460},
|
||||
{0.000000, -0.850651, 0.525731},
|
||||
{0.000000, -0.955423, 0.295242},
|
||||
{0.238856, -0.864188, 0.442863},
|
||||
{0.262866, -0.951056, 0.162460},
|
||||
{0.500000, -0.809017, 0.309017},
|
||||
{0.716567, -0.681718, 0.147621},
|
||||
{0.525731, -0.850651, 0.000000},
|
||||
{-0.238856, -0.864188, -0.442863},
|
||||
{-0.500000, -0.809017, -0.309017},
|
||||
{-0.262866, -0.951056, -0.162460},
|
||||
{-0.850651, -0.525731, 0.000000},
|
||||
{-0.716567, -0.681718, -0.147621},
|
||||
{-0.716567, -0.681718, 0.147621},
|
||||
{-0.525731, -0.850651, 0.000000},
|
||||
{-0.500000, -0.809017, 0.309017},
|
||||
{-0.238856, -0.864188, 0.442863},
|
||||
{-0.262866, -0.951056, 0.162460},
|
||||
{-0.864188, -0.442863, 0.238856},
|
||||
{-0.809017, -0.309017, 0.500000},
|
||||
{-0.688191, -0.587785, 0.425325},
|
||||
{-0.681718, -0.147621, 0.716567},
|
||||
{-0.442863, -0.238856, 0.864188},
|
||||
{-0.587785, -0.425325, 0.688191},
|
||||
{-0.309017, -0.500000, 0.809017},
|
||||
{-0.147621, -0.716567, 0.681718},
|
||||
{-0.425325, -0.688191, 0.587785},
|
||||
{-0.162460, -0.262866, 0.951056},
|
||||
{0.442863, -0.238856, 0.864188},
|
||||
{0.162460, -0.262866, 0.951056},
|
||||
{0.309017, -0.500000, 0.809017},
|
||||
{0.147621, -0.716567, 0.681718},
|
||||
{0.000000, -0.525731, 0.850651},
|
||||
{0.425325, -0.688191, 0.587785},
|
||||
{0.587785, -0.425325, 0.688191},
|
||||
{0.688191, -0.587785, 0.425325},
|
||||
{-0.955423, 0.295242, 0.000000},
|
||||
{-0.951056, 0.162460, 0.262866},
|
||||
{-1.000000, 0.000000, 0.000000},
|
||||
{-0.850651, 0.000000, 0.525731},
|
||||
{-0.955423, -0.295242, 0.000000},
|
||||
{-0.951056, -0.162460, 0.262866},
|
||||
{-0.864188, 0.442863, -0.238856},
|
||||
{-0.951056, 0.162460, -0.262866},
|
||||
{-0.809017, 0.309017, -0.500000},
|
||||
{-0.864188, -0.442863, -0.238856},
|
||||
{-0.951056, -0.162460, -0.262866},
|
||||
{-0.809017, -0.309017, -0.500000},
|
||||
{-0.681718, 0.147621, -0.716567},
|
||||
{-0.681718, -0.147621, -0.716567},
|
||||
{-0.850651, 0.000000, -0.525731},
|
||||
{-0.688191, 0.587785, -0.425325},
|
||||
{-0.587785, 0.425325, -0.688191},
|
||||
{-0.425325, 0.688191, -0.587785},
|
||||
{-0.425325, -0.688191, -0.587785},
|
||||
{-0.587785, -0.425325, -0.688191},
|
||||
{-0.688191, -0.587785, -0.425325},
|
37
src/client/refresh/vk/anormtab.h
Normal file
37
src/client/refresh/vk/anormtab.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright (C) 1997-2001 Id Software, Inc.
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
{
|
||||
{1.23,1.30,1.47,1.35,1.56,1.71,1.37,1.38,1.59,1.60,1.79,1.97,1.88,1.92,1.79,1.02,0.93,1.07,0.82,0.87,0.88,0.94,0.96,1.14,1.11,0.82,0.83,0.89,0.89,0.86,0.94,0.91,1.00,1.21,0.98,1.48,1.30,1.57,0.96,1.07,1.14,1.60,1.61,1.40,1.37,1.72,1.78,1.79,1.93,1.99,1.90,1.68,1.71,1.86,1.60,1.68,1.78,1.86,1.93,1.99,1.97,1.44,1.22,1.49,0.93,0.99,0.99,1.23,1.22,1.44,1.49,0.89,0.89,0.97,0.91,0.98,1.19,0.82,0.76,0.82,0.71,0.72,0.73,0.76,0.79,0.86,0.83,0.72,0.76,0.76,0.89,0.82,0.89,0.82,0.89,0.91,0.83,0.96,1.14,0.97,1.40,1.19,0.98,0.94,1.00,1.07,1.37,1.21,1.48,1.30,1.57,1.61,1.37,0.86,0.83,0.91,0.82,0.82,0.88,0.89,0.96,1.14,0.98,0.87,0.93,0.94,1.02,1.30,1.07,1.35,1.38,1.11,1.56,1.92,1.79,1.79,1.59,1.60,1.72,1.90,1.79,0.80,0.85,0.79,0.93,0.80,0.85,0.77,0.74,0.72,0.77,0.74,0.72,0.70,0.70,0.71,0.76,0.73,0.79,0.79,0.73,0.76,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.26,1.26,1.48,1.23,1.50,1.71,1.14,1.19,1.38,1.46,1.64,1.94,1.87,1.84,1.71,1.02,0.92,1.00,0.79,0.85,0.84,0.91,0.90,0.98,0.99,0.77,0.77,0.83,0.82,0.79,0.86,0.84,0.92,0.99,0.91,1.24,1.03,1.33,0.88,0.94,0.97,1.41,1.39,1.18,1.11,1.51,1.61,1.59,1.80,1.91,1.76,1.54,1.65,1.76,1.70,1.70,1.85,1.85,1.97,1.99,1.93,1.28,1.09,1.39,0.92,0.97,0.99,1.18,1.26,1.52,1.48,0.83,0.85,0.90,0.88,0.93,1.00,0.77,0.73,0.78,0.72,0.71,0.74,0.75,0.79,0.86,0.81,0.75,0.81,0.79,0.96,0.88,0.94,0.86,0.93,0.92,0.85,1.08,1.33,1.05,1.55,1.31,1.01,1.05,1.27,1.31,1.60,1.47,1.70,1.54,1.76,1.76,1.57,0.93,0.90,0.99,0.88,0.88,0.95,0.97,1.11,1.39,1.20,0.92,0.97,1.01,1.10,1.39,1.22,1.51,1.58,1.32,1.64,1.97,1.85,1.91,1.77,1.74,1.88,1.99,1.91,0.79,0.86,0.80,0.94,0.84,0.88,0.74,0.74,0.71,0.82,0.77,0.76,0.70,0.73,0.72,0.73,0.70,0.74,0.85,0.77,0.82,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.34,1.27,1.53,1.17,1.46,1.71,0.98,1.05,1.20,1.34,1.48,1.86,1.82,1.71,1.62,1.09,0.94,0.99,0.79,0.85,0.82,0.90,0.87,0.93,0.96,0.76,0.74,0.79,0.76,0.74,0.79,0.78,0.85,0.92,0.85,1.00,0.93,1.06,0.81,0.86,0.89,1.16,1.12,0.97,0.95,1.28,1.38,1.35,1.60,1.77,1.57,1.33,1.50,1.58,1.69,1.63,1.82,1.74,1.91,1.92,1.80,1.04,0.97,1.21,0.90,0.93,0.97,1.05,1.21,1.48,1.37,0.77,0.80,0.84,0.85,0.88,0.92,0.73,0.71,0.74,0.74,0.71,0.75,0.73,0.79,0.84,0.78,0.79,0.86,0.81,1.05,0.94,0.99,0.90,0.95,0.92,0.86,1.24,1.44,1.14,1.59,1.34,1.02,1.27,1.50,1.49,1.80,1.69,1.86,1.72,1.87,1.80,1.69,1.00,0.98,1.23,0.95,0.96,1.09,1.16,1.37,1.63,1.46,0.99,1.10,1.25,1.24,1.51,1.41,1.67,1.77,1.55,1.72,1.95,1.89,1.98,1.91,1.86,1.97,1.99,1.94,0.81,0.89,0.85,0.98,0.90,0.94,0.75,0.78,0.73,0.89,0.83,0.82,0.72,0.77,0.76,0.72,0.70,0.71,0.91,0.83,0.89,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.46,1.34,1.60,1.16,1.46,1.71,0.94,0.99,1.05,1.26,1.33,1.74,1.76,1.57,1.54,1.23,0.98,1.05,0.83,0.89,0.84,0.92,0.87,0.91,0.96,0.78,0.74,0.79,0.72,0.72,0.75,0.76,0.80,0.88,0.83,0.94,0.87,0.95,0.76,0.80,0.82,0.97,0.96,0.89,0.88,1.08,1.11,1.10,1.37,1.59,1.37,1.07,1.27,1.34,1.57,1.45,1.69,1.55,1.77,1.79,1.60,0.93,0.90,0.99,0.86,0.87,0.93,0.96,1.07,1.35,1.18,0.73,0.76,0.77,0.81,0.82,0.85,0.70,0.71,0.72,0.78,0.73,0.77,0.73,0.79,0.82,0.76,0.83,0.90,0.84,1.18,0.98,1.03,0.92,0.95,0.90,0.86,1.32,1.45,1.15,1.53,1.27,0.99,1.42,1.65,1.58,1.93,1.83,1.94,1.81,1.88,1.74,1.70,1.19,1.17,1.44,1.11,1.15,1.36,1.41,1.61,1.81,1.67,1.22,1.34,1.50,1.42,1.65,1.61,1.82,1.91,1.75,1.80,1.89,1.89,1.98,1.99,1.94,1.98,1.92,1.87,0.86,0.95,0.92,1.14,0.98,1.03,0.79,0.84,0.77,0.97,0.90,0.89,0.76,0.82,0.82,0.74,0.72,0.71,0.98,0.89,0.97,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.60,1.44,1.68,1.22,1.49,1.71,0.93,0.99,0.99,1.23,1.22,1.60,1.68,1.44,1.49,1.40,1.14,1.19,0.89,0.96,0.89,0.97,0.89,0.91,0.98,0.82,0.76,0.82,0.71,0.72,0.73,0.76,0.79,0.86,0.83,0.91,0.83,0.89,0.72,0.76,0.76,0.89,0.89,0.82,0.82,0.98,0.96,0.97,1.14,1.40,1.19,0.94,1.00,1.07,1.37,1.21,1.48,1.30,1.57,1.61,1.37,0.86,0.83,0.91,0.82,0.82,0.88,0.89,0.96,1.14,0.98,0.70,0.72,0.73,0.77,0.76,0.79,0.70,0.72,0.71,0.82,0.77,0.80,0.74,0.79,0.80,0.74,0.87,0.93,0.85,1.23,1.02,1.02,0.93,0.93,0.87,0.85,1.30,1.35,1.07,1.38,1.11,0.94,1.47,1.71,1.56,1.97,1.88,1.92,1.79,1.79,1.59,1.60,1.30,1.35,1.56,1.37,1.38,1.59,1.60,1.79,1.92,1.79,1.48,1.57,1.72,1.61,1.78,1.79,1.93,1.99,1.90,1.86,1.78,1.86,1.93,1.99,1.97,1.90,1.79,1.72,0.94,1.07,1.00,1.37,1.21,1.30,0.86,0.91,0.83,1.14,0.98,0.96,0.82,0.88,0.89,0.79,0.76,0.73,1.07,0.94,1.11,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.74,1.57,1.76,1.33,1.54,1.71,0.94,1.05,0.99,1.26,1.16,1.46,1.60,1.34,1.46,1.59,1.37,1.37,0.97,1.11,0.96,1.10,0.95,0.94,1.08,0.89,0.82,0.88,0.72,0.76,0.75,0.80,0.80,0.88,0.87,0.91,0.83,0.87,0.72,0.76,0.74,0.83,0.84,0.78,0.79,0.96,0.89,0.92,0.98,1.23,1.05,0.86,0.92,0.95,1.11,0.98,1.22,1.03,1.34,1.42,1.14,0.79,0.77,0.84,0.78,0.76,0.82,0.82,0.89,0.97,0.90,0.70,0.71,0.71,0.73,0.72,0.74,0.73,0.76,0.72,0.86,0.81,0.82,0.76,0.79,0.77,0.73,0.90,0.95,0.86,1.18,1.03,0.98,0.92,0.90,0.83,0.84,1.19,1.17,0.98,1.15,0.97,0.89,1.42,1.65,1.44,1.93,1.83,1.81,1.67,1.61,1.36,1.41,1.32,1.45,1.58,1.57,1.53,1.74,1.70,1.88,1.94,1.81,1.69,1.77,1.87,1.79,1.89,1.92,1.98,1.99,1.98,1.89,1.65,1.80,1.82,1.91,1.94,1.75,1.61,1.50,1.07,1.34,1.27,1.60,1.45,1.55,0.93,0.99,0.90,1.35,1.18,1.07,0.87,0.93,0.96,0.85,0.82,0.77,1.15,0.99,1.27,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.86,1.71,1.82,1.48,1.62,1.71,0.98,1.20,1.05,1.34,1.17,1.34,1.53,1.27,1.46,1.77,1.60,1.57,1.16,1.38,1.12,1.35,1.06,1.00,1.28,0.97,0.89,0.95,0.76,0.81,0.79,0.86,0.85,0.92,0.93,0.93,0.85,0.87,0.74,0.78,0.74,0.79,0.82,0.76,0.79,0.96,0.85,0.90,0.94,1.09,0.99,0.81,0.85,0.89,0.95,0.90,0.99,0.94,1.10,1.24,0.98,0.75,0.73,0.78,0.74,0.72,0.77,0.76,0.82,0.89,0.83,0.73,0.71,0.71,0.71,0.70,0.72,0.77,0.80,0.74,0.90,0.85,0.84,0.78,0.79,0.75,0.73,0.92,0.95,0.86,1.05,0.99,0.94,0.90,0.86,0.79,0.81,1.00,0.98,0.91,0.96,0.89,0.83,1.27,1.50,1.23,1.80,1.69,1.63,1.46,1.37,1.09,1.16,1.24,1.44,1.49,1.69,1.59,1.80,1.69,1.87,1.86,1.72,1.82,1.91,1.94,1.92,1.95,1.99,1.98,1.91,1.97,1.89,1.51,1.72,1.67,1.77,1.86,1.55,1.41,1.25,1.33,1.58,1.50,1.80,1.63,1.74,1.04,1.21,0.97,1.48,1.37,1.21,0.93,0.97,1.05,0.92,0.88,0.84,1.14,1.02,1.34,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.94,1.84,1.87,1.64,1.71,1.71,1.14,1.38,1.19,1.46,1.23,1.26,1.48,1.26,1.50,1.91,1.80,1.76,1.41,1.61,1.39,1.59,1.33,1.24,1.51,1.18,0.97,1.11,0.82,0.88,0.86,0.94,0.92,0.99,1.03,0.98,0.91,0.90,0.79,0.84,0.77,0.79,0.84,0.77,0.83,0.99,0.85,0.91,0.92,1.02,1.00,0.79,0.80,0.86,0.88,0.84,0.92,0.88,0.97,1.10,0.94,0.74,0.71,0.74,0.72,0.70,0.73,0.72,0.76,0.82,0.77,0.77,0.73,0.74,0.71,0.70,0.73,0.83,0.85,0.78,0.92,0.88,0.86,0.81,0.79,0.74,0.75,0.92,0.93,0.85,0.96,0.94,0.88,0.86,0.81,0.75,0.79,0.93,0.90,0.85,0.88,0.82,0.77,1.05,1.27,0.99,1.60,1.47,1.39,1.20,1.11,0.95,0.97,1.08,1.33,1.31,1.70,1.55,1.76,1.57,1.76,1.70,1.54,1.85,1.97,1.91,1.99,1.97,1.99,1.91,1.77,1.88,1.85,1.39,1.64,1.51,1.58,1.74,1.32,1.22,1.01,1.54,1.76,1.65,1.93,1.70,1.85,1.28,1.39,1.09,1.52,1.48,1.26,0.97,0.99,1.18,1.00,0.93,0.90,1.05,1.01,1.31,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.97,1.92,1.88,1.79,1.79,1.71,1.37,1.59,1.38,1.60,1.35,1.23,1.47,1.30,1.56,1.99,1.93,1.90,1.60,1.78,1.61,1.79,1.57,1.48,1.72,1.40,1.14,1.37,0.89,0.96,0.94,1.07,1.00,1.21,1.30,1.14,0.98,0.96,0.86,0.91,0.83,0.82,0.88,0.82,0.89,1.11,0.87,0.94,0.93,1.02,1.07,0.80,0.79,0.85,0.82,0.80,0.87,0.85,0.93,1.02,0.93,0.77,0.72,0.74,0.71,0.70,0.70,0.71,0.72,0.77,0.74,0.82,0.76,0.79,0.72,0.73,0.76,0.89,0.89,0.82,0.93,0.91,0.86,0.83,0.79,0.73,0.76,0.91,0.89,0.83,0.89,0.89,0.82,0.82,0.76,0.72,0.76,0.86,0.83,0.79,0.82,0.76,0.73,0.94,1.00,0.91,1.37,1.21,1.14,0.98,0.96,0.88,0.89,0.96,1.14,1.07,1.60,1.40,1.61,1.37,1.57,1.48,1.30,1.78,1.93,1.79,1.99,1.92,1.90,1.79,1.59,1.72,1.79,1.30,1.56,1.35,1.38,1.60,1.11,1.07,0.94,1.68,1.86,1.71,1.97,1.68,1.86,1.44,1.49,1.22,1.44,1.49,1.22,0.99,0.99,1.23,1.19,0.98,0.97,0.97,0.98,1.19,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.94,1.97,1.87,1.91,1.85,1.71,1.60,1.77,1.58,1.74,1.51,1.26,1.48,1.39,1.64,1.99,1.97,1.99,1.70,1.85,1.76,1.91,1.76,1.70,1.88,1.55,1.33,1.57,0.96,1.08,1.05,1.31,1.27,1.47,1.54,1.39,1.20,1.11,0.93,0.99,0.90,0.88,0.95,0.88,0.97,1.32,0.92,1.01,0.97,1.10,1.22,0.84,0.80,0.88,0.79,0.79,0.85,0.86,0.92,1.02,0.94,0.82,0.76,0.77,0.72,0.73,0.70,0.72,0.71,0.74,0.74,0.88,0.81,0.85,0.75,0.77,0.82,0.94,0.93,0.86,0.92,0.92,0.86,0.85,0.79,0.74,0.79,0.88,0.85,0.81,0.82,0.83,0.77,0.78,0.73,0.71,0.75,0.79,0.77,0.74,0.77,0.73,0.70,0.86,0.92,0.84,1.14,0.99,0.98,0.91,0.90,0.84,0.83,0.88,0.97,0.94,1.41,1.18,1.39,1.11,1.33,1.24,1.03,1.61,1.80,1.59,1.91,1.84,1.76,1.64,1.38,1.51,1.71,1.26,1.50,1.23,1.19,1.46,0.99,1.00,0.91,1.70,1.85,1.65,1.93,1.54,1.76,1.52,1.48,1.26,1.28,1.39,1.09,0.99,0.97,1.18,1.31,1.01,1.05,0.90,0.93,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.86,1.95,1.82,1.98,1.89,1.71,1.80,1.91,1.77,1.86,1.67,1.34,1.53,1.51,1.72,1.92,1.91,1.99,1.69,1.82,1.80,1.94,1.87,1.86,1.97,1.59,1.44,1.69,1.05,1.24,1.27,1.49,1.50,1.69,1.72,1.63,1.46,1.37,1.00,1.23,0.98,0.95,1.09,0.96,1.16,1.55,0.99,1.25,1.10,1.24,1.41,0.90,0.85,0.94,0.79,0.81,0.85,0.89,0.94,1.09,0.98,0.89,0.82,0.83,0.74,0.77,0.72,0.76,0.73,0.75,0.78,0.94,0.86,0.91,0.79,0.83,0.89,0.99,0.95,0.90,0.90,0.92,0.84,0.86,0.79,0.75,0.81,0.85,0.80,0.78,0.76,0.77,0.73,0.74,0.71,0.71,0.73,0.74,0.74,0.71,0.76,0.72,0.70,0.79,0.85,0.78,0.98,0.92,0.93,0.85,0.87,0.82,0.79,0.81,0.89,0.86,1.16,0.97,1.12,0.95,1.06,1.00,0.93,1.38,1.60,1.35,1.77,1.71,1.57,1.48,1.20,1.28,1.62,1.27,1.46,1.17,1.05,1.34,0.96,0.99,0.90,1.63,1.74,1.50,1.80,1.33,1.58,1.48,1.37,1.21,1.04,1.21,0.97,0.97,0.93,1.05,1.34,1.02,1.14,0.84,0.88,0.92,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.74,1.89,1.76,1.98,1.89,1.71,1.93,1.99,1.91,1.94,1.82,1.46,1.60,1.65,1.80,1.79,1.77,1.92,1.57,1.69,1.74,1.87,1.88,1.94,1.98,1.53,1.45,1.70,1.18,1.32,1.42,1.58,1.65,1.83,1.81,1.81,1.67,1.61,1.19,1.44,1.17,1.11,1.36,1.15,1.41,1.75,1.22,1.50,1.34,1.42,1.61,0.98,0.92,1.03,0.83,0.86,0.89,0.95,0.98,1.23,1.14,0.97,0.89,0.90,0.78,0.82,0.76,0.82,0.77,0.79,0.84,0.98,0.90,0.98,0.83,0.89,0.97,1.03,0.95,0.92,0.86,0.90,0.82,0.86,0.79,0.77,0.84,0.81,0.76,0.76,0.72,0.73,0.70,0.72,0.71,0.73,0.73,0.72,0.74,0.71,0.78,0.74,0.72,0.75,0.80,0.76,0.94,0.88,0.91,0.83,0.87,0.84,0.79,0.76,0.82,0.80,0.97,0.89,0.96,0.88,0.95,0.94,0.87,1.11,1.37,1.10,1.59,1.57,1.37,1.33,1.05,1.08,1.54,1.34,1.46,1.16,0.99,1.26,0.96,1.05,0.92,1.45,1.55,1.27,1.60,1.07,1.34,1.35,1.18,1.07,0.93,0.99,0.90,0.93,0.87,0.96,1.27,0.99,1.15,0.77,0.82,0.85,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.60,1.78,1.68,1.93,1.86,1.71,1.97,1.99,1.99,1.97,1.93,1.60,1.68,1.78,1.86,1.61,1.57,1.79,1.37,1.48,1.59,1.72,1.79,1.92,1.90,1.38,1.35,1.60,1.23,1.30,1.47,1.56,1.71,1.88,1.79,1.92,1.79,1.79,1.30,1.56,1.35,1.37,1.59,1.38,1.60,1.90,1.48,1.72,1.57,1.61,1.79,1.21,1.00,1.30,0.89,0.94,0.96,1.07,1.14,1.40,1.37,1.14,0.96,0.98,0.82,0.88,0.82,0.89,0.83,0.86,0.91,1.02,0.93,1.07,0.87,0.94,1.11,1.02,0.93,0.93,0.82,0.87,0.80,0.85,0.79,0.80,0.85,0.77,0.72,0.74,0.71,0.70,0.70,0.71,0.72,0.77,0.74,0.72,0.76,0.73,0.82,0.79,0.76,0.73,0.79,0.76,0.93,0.86,0.91,0.83,0.89,0.89,0.82,0.72,0.76,0.76,0.89,0.82,0.89,0.82,0.89,0.91,0.83,0.96,1.14,0.97,1.40,1.44,1.19,1.22,0.99,0.98,1.49,1.44,1.49,1.22,0.99,1.23,0.98,1.19,0.97,1.21,1.30,1.00,1.37,0.94,1.07,1.14,0.98,0.96,0.86,0.91,0.83,0.88,0.82,0.89,1.11,0.94,1.07,0.73,0.76,0.79,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.46,1.65,1.60,1.82,1.80,1.71,1.93,1.91,1.99,1.94,1.98,1.74,1.76,1.89,1.89,1.42,1.34,1.61,1.11,1.22,1.36,1.50,1.61,1.81,1.75,1.15,1.17,1.41,1.18,1.19,1.42,1.44,1.65,1.83,1.67,1.94,1.81,1.88,1.32,1.58,1.45,1.57,1.74,1.53,1.70,1.98,1.69,1.87,1.77,1.79,1.92,1.45,1.27,1.55,0.97,1.07,1.11,1.34,1.37,1.59,1.60,1.35,1.07,1.18,0.86,0.93,0.87,0.96,0.90,0.93,0.99,1.03,0.95,1.15,0.90,0.99,1.27,0.98,0.90,0.92,0.78,0.83,0.77,0.84,0.79,0.82,0.86,0.73,0.71,0.73,0.72,0.70,0.73,0.72,0.76,0.81,0.76,0.76,0.82,0.77,0.89,0.85,0.82,0.75,0.80,0.80,0.94,0.88,0.94,0.87,0.95,0.96,0.88,0.72,0.74,0.76,0.83,0.78,0.84,0.79,0.87,0.91,0.83,0.89,0.98,0.92,1.23,1.34,1.05,1.16,0.99,0.96,1.46,1.57,1.54,1.33,1.05,1.26,1.08,1.37,1.10,0.98,1.03,0.92,1.14,0.86,0.95,0.97,0.90,0.89,0.79,0.84,0.77,0.82,0.76,0.82,0.97,0.89,0.98,0.71,0.72,0.74,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.34,1.51,1.53,1.67,1.72,1.71,1.80,1.77,1.91,1.86,1.98,1.86,1.82,1.95,1.89,1.24,1.10,1.41,0.95,0.99,1.09,1.25,1.37,1.63,1.55,0.96,0.98,1.16,1.05,1.00,1.27,1.23,1.50,1.69,1.46,1.86,1.72,1.87,1.24,1.49,1.44,1.69,1.80,1.59,1.69,1.97,1.82,1.94,1.91,1.92,1.99,1.63,1.50,1.74,1.16,1.33,1.38,1.58,1.60,1.77,1.80,1.48,1.21,1.37,0.90,0.97,0.93,1.05,0.97,1.04,1.21,0.99,0.95,1.14,0.92,1.02,1.34,0.94,0.86,0.90,0.74,0.79,0.75,0.81,0.79,0.84,0.86,0.71,0.71,0.73,0.76,0.73,0.77,0.74,0.80,0.85,0.78,0.81,0.89,0.84,0.97,0.92,0.88,0.79,0.85,0.86,0.98,0.92,1.00,0.93,1.06,1.12,0.95,0.74,0.74,0.78,0.79,0.76,0.82,0.79,0.87,0.93,0.85,0.85,0.94,0.90,1.09,1.27,0.99,1.17,1.05,0.96,1.46,1.71,1.62,1.48,1.20,1.34,1.28,1.57,1.35,0.90,0.94,0.85,0.98,0.81,0.89,0.89,0.83,0.82,0.75,0.78,0.73,0.77,0.72,0.76,0.89,0.83,0.91,0.71,0.70,0.72,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00},
|
||||
{1.26,1.39,1.48,1.51,1.64,1.71,1.60,1.58,1.77,1.74,1.91,1.94,1.87,1.97,1.85,1.10,0.97,1.22,0.88,0.92,0.95,1.01,1.11,1.39,1.32,0.88,0.90,0.97,0.96,0.93,1.05,0.99,1.27,1.47,1.20,1.70,1.54,1.76,1.08,1.31,1.33,1.70,1.76,1.55,1.57,1.88,1.85,1.91,1.97,1.99,1.99,1.70,1.65,1.85,1.41,1.54,1.61,1.76,1.80,1.91,1.93,1.52,1.26,1.48,0.92,0.99,0.97,1.18,1.09,1.28,1.39,0.94,0.93,1.05,0.92,1.01,1.31,0.88,0.81,0.86,0.72,0.75,0.74,0.79,0.79,0.86,0.85,0.71,0.73,0.75,0.82,0.77,0.83,0.78,0.85,0.88,0.81,0.88,0.97,0.90,1.18,1.00,0.93,0.86,0.92,0.94,1.14,0.99,1.24,1.03,1.33,1.39,1.11,0.79,0.77,0.84,0.79,0.77,0.84,0.83,0.90,0.98,0.91,0.85,0.92,0.91,1.02,1.26,1.00,1.23,1.19,0.99,1.50,1.84,1.71,1.64,1.38,1.46,1.51,1.76,1.59,0.84,0.88,0.80,0.94,0.79,0.86,0.82,0.77,0.76,0.74,0.74,0.71,0.73,0.70,0.72,0.82,0.77,0.85,0.74,0.70,0.73,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00}
|
||||
}
|
323
src/client/refresh/vk/qvk.h
Normal file
323
src/client/refresh/vk/qvk.h
Normal file
|
@ -0,0 +1,323 @@
|
|||
/*
|
||||
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 <vulkan/vulkan.h>
|
||||
#include "vk_mem_alloc.h"
|
||||
#include "vk_shaders.h"
|
||||
|
||||
// Vulkan device
|
||||
typedef struct
|
||||
{
|
||||
VkPhysicalDevice physical;
|
||||
VkDevice logical;
|
||||
VkPhysicalDeviceProperties properties;
|
||||
VkPhysicalDeviceFeatures features;
|
||||
VkQueue gfxQueue;
|
||||
VkQueue presentQueue;
|
||||
VkQueue transferQueue;
|
||||
int gfxFamilyIndex;
|
||||
int presentFamilyIndex;
|
||||
int transferFamilyIndex;
|
||||
} 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_ANISO_NEAREST = 4,
|
||||
S_ANISO_LINEAR = 5,
|
||||
S_ANISO_MIPMAP_NEAREST = 6,
|
||||
S_ANISO_MIPMAP_LINEAR = 7,
|
||||
S_SAMPLER_CNT = 8
|
||||
} qvksampler_t;
|
||||
|
||||
// texture object
|
||||
typedef struct
|
||||
{
|
||||
VkImage image;
|
||||
VmaAllocation allocation;
|
||||
VmaAllocationInfo allocInfo;
|
||||
VmaAllocationCreateFlags vmaFlags;
|
||||
VkImageView imageView;
|
||||
VkSharingMode sharingMode;
|
||||
VkSampleCountFlagBits sampleCount;
|
||||
VkFormat format;
|
||||
VkDescriptorSet descriptorSet;
|
||||
uint32_t mipLevels;
|
||||
} qvktexture_t;
|
||||
|
||||
#define QVVKTEXTURE_INIT { \
|
||||
.image = VK_NULL_HANDLE, \
|
||||
.allocation = VK_NULL_HANDLE, \
|
||||
.allocInfo = VK_NULL_HANDLE, \
|
||||
.vmaFlags = 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).image = VK_NULL_HANDLE; \
|
||||
(i).allocation = VK_NULL_HANDLE; \
|
||||
(i).vmaFlags = 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
|
||||
{
|
||||
VkBuffer buffer;
|
||||
VmaAllocation allocation;
|
||||
VmaAllocationInfo allocInfo;
|
||||
VkDeviceSize currentOffset;
|
||||
} qvkbuffer_t;
|
||||
|
||||
// Vulkan staging buffer
|
||||
typedef struct
|
||||
{
|
||||
qvkbuffer_t buffer;
|
||||
VkCommandBuffer cmdBuffer;
|
||||
VkFence fence;
|
||||
qboolean submitted;
|
||||
} qvkstagingbuffer_t;
|
||||
|
||||
// Vulkan buffer options
|
||||
typedef struct
|
||||
{
|
||||
VkBufferUsageFlags usage;
|
||||
VkMemoryPropertyFlags reqMemFlags;
|
||||
VkMemoryPropertyFlags prefMemFlags;
|
||||
VmaMemoryUsage vmaUsage;
|
||||
VmaAllocationCreateFlags vmaFlags;
|
||||
} qvkbufferopts_t;
|
||||
|
||||
// Vulkan pipeline
|
||||
typedef struct
|
||||
{
|
||||
VkPipelineLayout layout;
|
||||
VkPipeline pl;
|
||||
VkPipelineCreateFlags flags;
|
||||
VkPolygonMode mode;
|
||||
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, \
|
||||
.mode = VK_POLYGON_MODE_FILL, \
|
||||
.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 instance
|
||||
extern VkInstance vk_instance;
|
||||
// Vulkan surface
|
||||
extern VkSurfaceKHR vk_surface;
|
||||
// Vulkan device
|
||||
extern qvkdevice_t vk_device;
|
||||
// Vulkan memory allocator
|
||||
extern VmaAllocator vk_malloc;
|
||||
// Vulkan swapchain
|
||||
extern qvkswapchain_t vk_swapchain;
|
||||
// Vulkan command buffer currently in use
|
||||
extern VkCommandBuffer vk_activeCmdbuffer;
|
||||
// Vulkan command pools
|
||||
extern VkCommandPool vk_commandPool;
|
||||
extern VkCommandPool vk_transferCommandPool;
|
||||
// Vulkan descriptor pool
|
||||
extern VkDescriptorPool vk_descriptorPool;
|
||||
|
||||
// Vulkan descriptor sets
|
||||
extern VkDescriptorSetLayout vk_uboDescSetLayout;
|
||||
extern VkDescriptorSetLayout vk_samplerDescSetLayout;
|
||||
|
||||
// *** pipelines ***
|
||||
extern qvkpipeline_t vk_drawTexQuadPipeline;
|
||||
extern qvkpipeline_t vk_drawColorQuadPipeline[2];
|
||||
extern qvkpipeline_t vk_drawModelPipelineStrip[2];
|
||||
extern qvkpipeline_t vk_drawModelPipelineFan[2];
|
||||
extern qvkpipeline_t vk_drawNoDepthModelPipelineStrip;
|
||||
extern qvkpipeline_t vk_drawNoDepthModelPipelineFan;
|
||||
extern qvkpipeline_t vk_drawLefthandModelPipelineStrip;
|
||||
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_drawBeamPipeline;
|
||||
extern qvkpipeline_t vk_drawSkyboxPipeline;
|
||||
extern qvkpipeline_t vk_drawDLightPipeline;
|
||||
extern qvkpipeline_t vk_showTrisPipeline;
|
||||
extern qvkpipeline_t vk_shadowsPipelineStrip;
|
||||
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;
|
||||
|
||||
// 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)
|
||||
qboolean QVk_Init(void);
|
||||
void QVk_Shutdown(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, VmaMemoryUsage memUsage, 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);
|
||||
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);
|
||||
void QVk_ReleaseTexture(qvktexture_t *texture);
|
||||
void QVk_ReadPixels(uint8_t *dstBuffer, uint32_t width, uint32_t height);
|
||||
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(void);
|
||||
VkResult QVk_EndFrame(qboolean force);
|
||||
void QVk_BeginRenderpass(qvkrenderpasstype_t rpType);
|
||||
void QVk_RecreateSwapchain(void);
|
||||
VkResult QVk_CreateBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer, const qvkbufferopts_t options);
|
||||
void QVk_FreeBuffer(qvkbuffer_t *buffer);
|
||||
VkResult QVk_CreateStagingBuffer(VkDeviceSize size, qvkbuffer_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, qvkbuffer_t *stagingBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
||||
void QVk_CreateIndexBuffer(const void *data, VkDeviceSize size, qvkbuffer_t *dstBuffer, qvkbuffer_t *stagingBuffer, 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 desLayoutCount, const VkPipelineVertexInputStateCreateInfo *vertexInputInfo, qvkpipeline_t *pipeline, const qvkrenderpass_t *renderpass, const qvkshader_t *shaders, uint32_t shaderCount, VkPushConstantRange *pcRange);
|
||||
void QVk_DestroyPipeline(qvkpipeline_t *pipeline);
|
||||
uint8_t* QVk_GetVertexBuffer(VkDeviceSize size, VkBuffer *dstBuffer, VkDeviceSize *dstOffset);
|
||||
uint8_t* QVk_GetIndexBuffer(VkDeviceSize size, 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);
|
||||
void QVk_DrawColorRect(float *ubo, VkDeviceSize uboSize, qvkrenderpasstype_t rpType);
|
||||
void QVk_DrawTexRect(float *ubo, VkDeviceSize uboSize, qvktexture_t *texture);
|
||||
void QVk_BindPipeline(qvkpipeline_t *pipeline);
|
||||
void QVk_SubmitStagingBuffers(void);
|
||||
// debug label related functions
|
||||
#if defined(_DEBUG) || defined(ENABLE_DEBUG_LABELS)
|
||||
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);
|
||||
#else
|
||||
#define QVk_DebugSetObjectName(a, b, c)
|
||||
#define QVk_DebugSetObjectTag(a, b, c, d, e)
|
||||
#define QVk_DebugLabelBegin(a, b, c, d, e)
|
||||
#define QVk_DebugLabelEnd(a)
|
||||
#define QVk_DebugLabelInsert(a, b, c, d, e)
|
||||
#endif
|
||||
#endif
|
16
src/client/refresh/vk/spirv/basic_color_quad_frag.c
Normal file
16
src/client/refresh/vk/spirv/basic_color_quad_frag.c
Normal file
|
@ -0,0 +1,16 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t basic_color_quad_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
48
src/client/refresh/vk/spirv/basic_color_quad_vert.c
Normal file
48
src/client/refresh/vk/spirv/basic_color_quad_vert.c
Normal file
|
@ -0,0 +1,48 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t basic_color_quad_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
33
src/client/refresh/vk/spirv/basic_frag.c
Normal file
33
src/client/refresh/vk/spirv/basic_frag.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t basic_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,0x00000025,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,0x00040047,0x00000009,0x0000001e,0x00000000,
|
||||
0x00040047,0x0000000d,0x00000022,0x00000000,0x00040047,0x0000000d,0x00000021,0x00000000,
|
||||
0x00040047,0x00000011,0x0000001e,0x00000000,0x00040047,0x00000015,0x0000001e,0x00000001,
|
||||
0x00040047,0x0000001e,0x0000001e,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,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,0x000100fd,0x00010038
|
||||
};
|
61
src/client/refresh/vk/spirv/basic_vert.c
Normal file
61
src/client/refresh/vk/spirv/basic_vert.c
Normal file
|
@ -0,0 +1,61 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t basic_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
42
src/client/refresh/vk/spirv/beam_vert.c
Normal file
42
src/client/refresh/vk/spirv/beam_vert.c
Normal file
|
@ -0,0 +1,42 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t beam_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
41
src/client/refresh/vk/spirv/d_light_vert.c
Normal file
41
src/client/refresh/vk/spirv/d_light_vert.c
Normal file
|
@ -0,0 +1,41 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t d_light_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
37
src/client/refresh/vk/spirv/model_frag.c
Normal file
37
src/client/refresh/vk/spirv/model_frag.c
Normal file
|
@ -0,0 +1,37 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t model_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
59
src/client/refresh/vk/spirv/model_vert.c
Normal file
59
src/client/refresh/vk/spirv/model_vert.c
Normal file
|
@ -0,0 +1,59 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t model_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
49
src/client/refresh/vk/spirv/nullmodel_vert.c
Normal file
49
src/client/refresh/vk/spirv/nullmodel_vert.c
Normal file
|
@ -0,0 +1,49 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t nullmodel_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
47
src/client/refresh/vk/spirv/particle_vert.c
Normal file
47
src/client/refresh/vk/spirv/particle_vert.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t particle_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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,
|
||||
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,0x0004003d,
|
||||
0x00000007,0x00000029,0x00000028,0x0003003e,0x00000026,0x00000029,0x0003003e,0x0000002b,
|
||||
0x0000002c,0x000100fd,0x00010038
|
||||
};
|
28
src/client/refresh/vk/spirv/point_particle_frag.c
Normal file
28
src/client/refresh/vk/spirv/point_particle_frag.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t point_particle_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
82
src/client/refresh/vk/spirv/point_particle_vert.c
Normal file
82
src/client/refresh/vk/spirv/point_particle_vert.c
Normal file
|
@ -0,0 +1,82 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t point_particle_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
40
src/client/refresh/vk/spirv/polygon_lmap_frag.c
Normal file
40
src/client/refresh/vk/spirv/polygon_lmap_frag.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t polygon_lmap_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
59
src/client/refresh/vk/spirv/polygon_lmap_vert.c
Normal file
59
src/client/refresh/vk/spirv/polygon_lmap_vert.c
Normal file
|
@ -0,0 +1,59 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t polygon_lmap_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
51
src/client/refresh/vk/spirv/polygon_vert.c
Normal file
51
src/client/refresh/vk/spirv/polygon_vert.c
Normal file
|
@ -0,0 +1,51 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t polygon_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
80
src/client/refresh/vk/spirv/polygon_warp_vert.c
Normal file
80
src/client/refresh/vk/spirv/polygon_warp_vert.c
Normal file
|
@ -0,0 +1,80 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t polygon_warp_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
46
src/client/refresh/vk/spirv/postprocess_frag.c
Normal file
46
src/client/refresh/vk/spirv/postprocess_frag.c
Normal file
|
@ -0,0 +1,46 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t postprocess_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,0x00000033,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000016,0x0000001e,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,
|
||||
0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,
|
||||
0x6e69616d,0x00000000,0x00060005,0x00000007,0x68737550,0x736e6f43,0x746e6174,0x00000000,
|
||||
0x00060006,0x00000007,0x00000000,0x74736f70,0x636f7270,0x00737365,0x00050006,0x00000007,
|
||||
0x00000001,0x6d6d6167,0x00000061,0x00030005,0x00000009,0x00006370,0x00060005,0x00000016,
|
||||
0x67617266,0x746e656d,0x6f6c6f43,0x00000072,0x00050005,0x0000001a,0x78655473,0x65727574,
|
||||
0x00000000,0x00050005,0x0000001e,0x43786574,0x64726f6f,0x00000000,0x00050048,0x00000007,
|
||||
0x00000000,0x00000023,0x00000000,0x00050048,0x00000007,0x00000001,0x00000023,0x00000004,
|
||||
0x00030047,0x00000007,0x00000002,0x00040047,0x00000016,0x0000001e,0x00000000,0x00040047,
|
||||
0x0000001a,0x00000022,0x00000000,0x00040047,0x0000001a,0x00000021,0x00000000,0x00040047,
|
||||
0x0000001e,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,
|
||||
0x00030016,0x00000006,0x00000020,0x0004001e,0x00000007,0x00000006,0x00000006,0x00040020,
|
||||
0x00000008,0x00000009,0x00000007,0x0004003b,0x00000008,0x00000009,0x00000009,0x00040015,
|
||||
0x0000000a,0x00000020,0x00000001,0x0004002b,0x0000000a,0x0000000b,0x00000000,0x00040020,
|
||||
0x0000000c,0x00000009,0x00000006,0x0004002b,0x00000006,0x0000000f,0x00000000,0x00020014,
|
||||
0x00000010,0x00040017,0x00000014,0x00000006,0x00000004,0x00040020,0x00000015,0x00000003,
|
||||
0x00000014,0x0004003b,0x00000015,0x00000016,0x00000003,0x00090019,0x00000017,0x00000006,
|
||||
0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x00000018,
|
||||
0x00000017,0x00040020,0x00000019,0x00000000,0x00000018,0x0004003b,0x00000019,0x0000001a,
|
||||
0x00000000,0x00040017,0x0000001c,0x00000006,0x00000002,0x00040020,0x0000001d,0x00000001,
|
||||
0x0000001c,0x0004003b,0x0000001d,0x0000001e,0x00000001,0x00040017,0x00000021,0x00000006,
|
||||
0x00000003,0x0004002b,0x00000006,0x00000023,0x3fc00000,0x0004002b,0x0000000a,0x00000025,
|
||||
0x00000001,0x0004002b,0x00000006,0x0000002a,0x3f800000,0x00050036,0x00000002,0x00000004,
|
||||
0x00000000,0x00000003,0x000200f8,0x00000005,0x00050041,0x0000000c,0x0000000d,0x00000009,
|
||||
0x0000000b,0x0004003d,0x00000006,0x0000000e,0x0000000d,0x000500ba,0x00000010,0x00000011,
|
||||
0x0000000e,0x0000000f,0x000300f7,0x00000013,0x00000000,0x000400fa,0x00000011,0x00000012,
|
||||
0x0000002f,0x000200f8,0x00000012,0x0004003d,0x00000018,0x0000001b,0x0000001a,0x0004003d,
|
||||
0x0000001c,0x0000001f,0x0000001e,0x00050057,0x00000014,0x00000020,0x0000001b,0x0000001f,
|
||||
0x0008004f,0x00000021,0x00000022,0x00000020,0x00000020,0x00000000,0x00000001,0x00000002,
|
||||
0x0005008e,0x00000021,0x00000024,0x00000022,0x00000023,0x00050041,0x0000000c,0x00000026,
|
||||
0x00000009,0x00000025,0x0004003d,0x00000006,0x00000027,0x00000026,0x00060050,0x00000021,
|
||||
0x00000028,0x00000027,0x00000027,0x00000027,0x0007000c,0x00000021,0x00000029,0x00000001,
|
||||
0x0000001a,0x00000024,0x00000028,0x00050051,0x00000006,0x0000002b,0x00000029,0x00000000,
|
||||
0x00050051,0x00000006,0x0000002c,0x00000029,0x00000001,0x00050051,0x00000006,0x0000002d,
|
||||
0x00000029,0x00000002,0x00070050,0x00000014,0x0000002e,0x0000002b,0x0000002c,0x0000002d,
|
||||
0x0000002a,0x0003003e,0x00000016,0x0000002e,0x000200f9,0x00000013,0x000200f8,0x0000002f,
|
||||
0x0004003d,0x00000018,0x00000030,0x0000001a,0x0004003d,0x0000001c,0x00000031,0x0000001e,
|
||||
0x00050057,0x00000014,0x00000032,0x00000030,0x00000031,0x0003003e,0x00000016,0x00000032,
|
||||
0x000200f9,0x00000013,0x000200f8,0x00000013,0x000100fd,0x00010038
|
||||
};
|
36
src/client/refresh/vk/spirv/postprocess_vert.c
Normal file
36
src/client/refresh/vk/spirv/postprocess_vert.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t postprocess_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
46
src/client/refresh/vk/spirv/shadows_vert.c
Normal file
46
src/client/refresh/vk/spirv/shadows_vert.c
Normal file
|
@ -0,0 +1,46 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t shadows_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
54
src/client/refresh/vk/spirv/skybox_vert.c
Normal file
54
src/client/refresh/vk/spirv/skybox_vert.c
Normal file
|
@ -0,0 +1,54 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t skybox_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
49
src/client/refresh/vk/spirv/sprite_vert.c
Normal file
49
src/client/refresh/vk/spirv/sprite_vert.c
Normal file
|
@ -0,0 +1,49 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t sprite_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
93
src/client/refresh/vk/spirv/world_warp_frag.c
Normal file
93
src/client/refresh/vk/spirv/world_warp_frag.c
Normal file
|
@ -0,0 +1,93 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t world_warp_frag_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,0x00000078,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000c,0x00000070,0x00030010,
|
||||
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,
|
||||
0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00040005,0x00000004,
|
||||
0x6e69616d,0x00000000,0x00030005,0x00000009,0x00007675,0x00060005,0x0000000c,0x465f6c67,
|
||||
0x43676172,0x64726f6f,0x00000000,0x00060005,0x00000012,0x68737550,0x736e6f43,0x746e6174,
|
||||
0x00000000,0x00050006,0x00000012,0x00000000,0x656d6974,0x00000000,0x00050006,0x00000012,
|
||||
0x00000001,0x6c616373,0x00000065,0x00060006,0x00000012,0x00000002,0x57726373,0x68746469,
|
||||
0x00000000,0x00060006,0x00000012,0x00000003,0x48726373,0x68676965,0x00000074,0x00030005,
|
||||
0x00000014,0x00006370,0x00030005,0x0000002c,0x00007873,0x00030005,0x0000003d,0x00007973,
|
||||
0x00040005,0x0000004c,0x69685378,0x00007466,0x00040005,0x00000057,0x69685379,0x00007466,
|
||||
0x00050005,0x00000060,0x74736964,0x6974726f,0x00006e6f,0x00060005,0x00000070,0x67617266,
|
||||
0x746e656d,0x6f6c6f43,0x00000072,0x00050005,0x00000074,0x78655473,0x65727574,0x00000000,
|
||||
0x00040047,0x0000000c,0x0000000b,0x0000000f,0x00050048,0x00000012,0x00000000,0x00000023,
|
||||
0x00000000,0x00050048,0x00000012,0x00000001,0x00000023,0x00000004,0x00050048,0x00000012,
|
||||
0x00000002,0x00000023,0x00000008,0x00050048,0x00000012,0x00000003,0x00000023,0x0000000c,
|
||||
0x00030047,0x00000012,0x00000002,0x00040047,0x00000070,0x0000001e,0x00000000,0x00040047,
|
||||
0x00000074,0x00000022,0x00000000,0x00040047,0x00000074,0x00000021,0x00000000,0x00020013,
|
||||
0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,
|
||||
0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000007,0x00000007,0x00040017,
|
||||
0x0000000a,0x00000006,0x00000004,0x00040020,0x0000000b,0x00000001,0x0000000a,0x0004003b,
|
||||
0x0000000b,0x0000000c,0x00000001,0x00040015,0x0000000d,0x00000020,0x00000000,0x0004002b,
|
||||
0x0000000d,0x0000000e,0x00000000,0x00040020,0x0000000f,0x00000001,0x00000006,0x0006001e,
|
||||
0x00000012,0x00000006,0x00000006,0x00000006,0x00000006,0x00040020,0x00000013,0x00000009,
|
||||
0x00000012,0x0004003b,0x00000013,0x00000014,0x00000009,0x00040015,0x00000015,0x00000020,
|
||||
0x00000001,0x0004002b,0x00000015,0x00000016,0x00000002,0x00040020,0x00000017,0x00000009,
|
||||
0x00000006,0x0004002b,0x0000000d,0x0000001b,0x00000001,0x0004002b,0x00000015,0x0000001e,
|
||||
0x00000003,0x0004002b,0x00000015,0x00000023,0x00000000,0x0004002b,0x00000006,0x00000026,
|
||||
0x00000000,0x00020014,0x00000027,0x00040020,0x0000002b,0x00000007,0x00000006,0x0004002b,
|
||||
0x00000015,0x0000002d,0x00000001,0x0004002b,0x00000006,0x00000032,0x40000000,0x0004002b,
|
||||
0x00000006,0x00000052,0x40490e56,0x0004002b,0x00000006,0x00000054,0x41200000,0x0004002b,
|
||||
0x00000006,0x0000006a,0x3bda3c21,0x00040020,0x0000006f,0x00000003,0x0000000a,0x0004003b,
|
||||
0x0000006f,0x00000070,0x00000003,0x00090019,0x00000071,0x00000006,0x00000001,0x00000000,
|
||||
0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x00000072,0x00000071,0x00040020,
|
||||
0x00000073,0x00000000,0x00000072,0x0004003b,0x00000073,0x00000074,0x00000000,0x00050036,
|
||||
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000008,
|
||||
0x00000009,0x00000007,0x0004003b,0x0000002b,0x0000002c,0x00000007,0x0004003b,0x0000002b,
|
||||
0x0000003d,0x00000007,0x0004003b,0x0000002b,0x0000004c,0x00000007,0x0004003b,0x0000002b,
|
||||
0x00000057,0x00000007,0x0004003b,0x00000008,0x00000060,0x00000007,0x00050041,0x0000000f,
|
||||
0x00000010,0x0000000c,0x0000000e,0x0004003d,0x00000006,0x00000011,0x00000010,0x00050041,
|
||||
0x00000017,0x00000018,0x00000014,0x00000016,0x0004003d,0x00000006,0x00000019,0x00000018,
|
||||
0x00050088,0x00000006,0x0000001a,0x00000011,0x00000019,0x00050041,0x0000000f,0x0000001c,
|
||||
0x0000000c,0x0000001b,0x0004003d,0x00000006,0x0000001d,0x0000001c,0x00050041,0x00000017,
|
||||
0x0000001f,0x00000014,0x0000001e,0x0004003d,0x00000006,0x00000020,0x0000001f,0x00050088,
|
||||
0x00000006,0x00000021,0x0000001d,0x00000020,0x00050050,0x00000007,0x00000022,0x0000001a,
|
||||
0x00000021,0x0003003e,0x00000009,0x00000022,0x00050041,0x00000017,0x00000024,0x00000014,
|
||||
0x00000023,0x0004003d,0x00000006,0x00000025,0x00000024,0x000500ba,0x00000027,0x00000028,
|
||||
0x00000025,0x00000026,0x000300f7,0x0000002a,0x00000000,0x000400fa,0x00000028,0x00000029,
|
||||
0x0000002a,0x000200f8,0x00000029,0x00050041,0x00000017,0x0000002e,0x00000014,0x0000002d,
|
||||
0x0004003d,0x00000006,0x0000002f,0x0000002e,0x00050041,0x00000017,0x00000030,0x00000014,
|
||||
0x00000016,0x0004003d,0x00000006,0x00000031,0x00000030,0x00050088,0x00000006,0x00000033,
|
||||
0x00000031,0x00000032,0x00050041,0x0000000f,0x00000034,0x0000000c,0x0000000e,0x0004003d,
|
||||
0x00000006,0x00000035,0x00000034,0x00050083,0x00000006,0x00000036,0x00000033,0x00000035,
|
||||
0x0006000c,0x00000006,0x00000037,0x00000001,0x00000004,0x00000036,0x00050085,0x00000006,
|
||||
0x00000038,0x00000037,0x00000032,0x00050041,0x00000017,0x00000039,0x00000014,0x00000016,
|
||||
0x0004003d,0x00000006,0x0000003a,0x00000039,0x00050088,0x00000006,0x0000003b,0x00000038,
|
||||
0x0000003a,0x00050083,0x00000006,0x0000003c,0x0000002f,0x0000003b,0x0003003e,0x0000002c,
|
||||
0x0000003c,0x00050041,0x00000017,0x0000003e,0x00000014,0x0000002d,0x0004003d,0x00000006,
|
||||
0x0000003f,0x0000003e,0x00050041,0x00000017,0x00000040,0x00000014,0x0000001e,0x0004003d,
|
||||
0x00000006,0x00000041,0x00000040,0x00050088,0x00000006,0x00000042,0x00000041,0x00000032,
|
||||
0x00050041,0x0000000f,0x00000043,0x0000000c,0x0000001b,0x0004003d,0x00000006,0x00000044,
|
||||
0x00000043,0x00050083,0x00000006,0x00000045,0x00000042,0x00000044,0x0006000c,0x00000006,
|
||||
0x00000046,0x00000001,0x00000004,0x00000045,0x00050085,0x00000006,0x00000047,0x00000046,
|
||||
0x00000032,0x00050041,0x00000017,0x00000048,0x00000014,0x0000001e,0x0004003d,0x00000006,
|
||||
0x00000049,0x00000048,0x00050088,0x00000006,0x0000004a,0x00000047,0x00000049,0x00050083,
|
||||
0x00000006,0x0000004b,0x0000003f,0x0000004a,0x0003003e,0x0000003d,0x0000004b,0x00050041,
|
||||
0x00000017,0x0000004d,0x00000014,0x00000023,0x0004003d,0x00000006,0x0000004e,0x0000004d,
|
||||
0x00050085,0x00000006,0x0000004f,0x00000032,0x0000004e,0x00050041,0x0000002b,0x00000050,
|
||||
0x00000009,0x0000001b,0x0004003d,0x00000006,0x00000051,0x00000050,0x00050085,0x00000006,
|
||||
0x00000053,0x00000051,0x00000052,0x00050085,0x00000006,0x00000055,0x00000053,0x00000054,
|
||||
0x00050081,0x00000006,0x00000056,0x0000004f,0x00000055,0x0003003e,0x0000004c,0x00000056,
|
||||
0x00050041,0x00000017,0x00000058,0x00000014,0x00000023,0x0004003d,0x00000006,0x00000059,
|
||||
0x00000058,0x00050085,0x00000006,0x0000005a,0x00000032,0x00000059,0x00050041,0x0000002b,
|
||||
0x0000005b,0x00000009,0x0000000e,0x0004003d,0x00000006,0x0000005c,0x0000005b,0x00050085,
|
||||
0x00000006,0x0000005d,0x0000005c,0x00000052,0x00050085,0x00000006,0x0000005e,0x0000005d,
|
||||
0x00000054,0x00050081,0x00000006,0x0000005f,0x0000005a,0x0000005e,0x0003003e,0x00000057,
|
||||
0x0000005f,0x0004003d,0x00000006,0x00000061,0x0000004c,0x0006000c,0x00000006,0x00000062,
|
||||
0x00000001,0x0000000d,0x00000061,0x0004003d,0x00000006,0x00000063,0x0000002c,0x00050085,
|
||||
0x00000006,0x00000064,0x00000062,0x00000063,0x0004003d,0x00000006,0x00000065,0x00000057,
|
||||
0x0006000c,0x00000006,0x00000066,0x00000001,0x0000000d,0x00000065,0x0004003d,0x00000006,
|
||||
0x00000067,0x0000003d,0x00050085,0x00000006,0x00000068,0x00000066,0x00000067,0x00050050,
|
||||
0x00000007,0x00000069,0x00000064,0x00000068,0x0005008e,0x00000007,0x0000006b,0x00000069,
|
||||
0x0000006a,0x0003003e,0x00000060,0x0000006b,0x0004003d,0x00000007,0x0000006c,0x00000060,
|
||||
0x0004003d,0x00000007,0x0000006d,0x00000009,0x00050081,0x00000007,0x0000006e,0x0000006d,
|
||||
0x0000006c,0x0003003e,0x00000009,0x0000006e,0x000200f9,0x0000002a,0x000200f8,0x0000002a,
|
||||
0x0004003d,0x00000072,0x00000075,0x00000074,0x0004003d,0x00000007,0x00000076,0x00000009,
|
||||
0x00050057,0x0000000a,0x00000077,0x00000075,0x00000076,0x0003003e,0x00000070,0x00000077,
|
||||
0x000100fd,0x00010038
|
||||
};
|
33
src/client/refresh/vk/spirv/world_warp_vert.c
Normal file
33
src/client/refresh/vk/spirv/world_warp_vert.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
// 7.12.3294
|
||||
#pragma once
|
||||
const uint32_t world_warp_vert_spv[] = {
|
||||
0x07230203,0x00010000,0x00080007,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
|
||||
};
|
169
src/client/refresh/vk/vk_buffer.c
Normal file
169
src/client/refresh/vk/vk_buffer.c
Normal file
|
@ -0,0 +1,169 @@
|
|||
/*
|
||||
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 "vk_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, qvkbuffer_t *stagingBuffer)
|
||||
{
|
||||
qvkbuffer_t *stgBuffer = stagingBuffer;
|
||||
// create/release internal staging buffer if NULL has been passed
|
||||
if (!stagingBuffer)
|
||||
{
|
||||
stgBuffer = (qvkbuffer_t *)malloc(sizeof(qvkbuffer_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
|
||||
VK_VERIFY(vmaMapMemory(vk_malloc, stgBuffer->allocation, &dst));
|
||||
memcpy(dst, data, (size_t)size);
|
||||
vmaUnmapMemory(vk_malloc, stgBuffer->allocation);
|
||||
}
|
||||
|
||||
VK_VERIFY(QVk_CreateBuffer(size, dstBuffer, bufferOpts));
|
||||
copyBuffer(&stgBuffer->buffer, &dstBuffer->buffer, size);
|
||||
|
||||
if (!stagingBuffer)
|
||||
{
|
||||
QVk_FreeBuffer(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 (options.vmaUsage != VMA_MEMORY_USAGE_CPU_ONLY && vk_device.gfxFamilyIndex != vk_device.transferFamilyIndex)
|
||||
{
|
||||
bcInfo.sharingMode = VK_SHARING_MODE_CONCURRENT;
|
||||
bcInfo.queueFamilyIndexCount = 2;
|
||||
bcInfo.pQueueFamilyIndices = queueFamilies;
|
||||
}
|
||||
|
||||
VmaAllocationCreateInfo vmallocInfo = {
|
||||
.flags = options.vmaFlags,
|
||||
.usage = options.vmaUsage,
|
||||
.requiredFlags = options.reqMemFlags,
|
||||
.preferredFlags = options.prefMemFlags,
|
||||
.memoryTypeBits = 0,
|
||||
.pool = VK_NULL_HANDLE,
|
||||
.pUserData = NULL
|
||||
};
|
||||
|
||||
dstBuffer->currentOffset = 0;
|
||||
return vmaCreateBuffer(vk_malloc, &bcInfo, &vmallocInfo, &dstBuffer->buffer, &dstBuffer->allocation, &dstBuffer->allocInfo);
|
||||
}
|
||||
|
||||
void QVk_FreeBuffer(qvkbuffer_t *buffer)
|
||||
{
|
||||
vmaDestroyBuffer(vk_malloc, buffer->buffer, buffer->allocation);
|
||||
buffer->buffer = VK_NULL_HANDLE;
|
||||
buffer->allocation = VK_NULL_HANDLE;
|
||||
buffer->currentOffset = 0;
|
||||
}
|
||||
|
||||
VkResult QVk_CreateStagingBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags)
|
||||
{
|
||||
qvkbufferopts_t stagingOpts = {
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
|
||||
.reqMemFlags = reqMemFlags,
|
||||
.prefMemFlags = prefMemFlags,
|
||||
.vmaUsage = VMA_MEMORY_USAGE_CPU_ONLY,
|
||||
.vmaFlags = 0
|
||||
};
|
||||
|
||||
return QVk_CreateBuffer(size, dstBuffer, stagingOpts);
|
||||
}
|
||||
|
||||
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,
|
||||
.vmaUsage = VMA_MEMORY_USAGE_CPU_TO_GPU,
|
||||
// When resizing dynamic uniform buffers on Intel, the Linux driver may throw a warning:
|
||||
// "Mapping an image with layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used."
|
||||
// Minor annoyance but we don't want any validation warnings, so we create dedicated allocation for uniform buffer.
|
||||
// more details: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/34
|
||||
// Note that this is a false positive which in other cases could be ignored: https://gpuopen-librariesandsdks.github.io/VulkanMemoryAllocator/html/general_considerations.html#general_considerations_validation_layer_warnings
|
||||
.vmaFlags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
|
||||
};
|
||||
|
||||
return QVk_CreateBuffer(size, dstBuffer, dstOpts);
|
||||
}
|
||||
|
||||
void QVk_CreateVertexBuffer(const void *data, VkDeviceSize size, qvkbuffer_t *dstBuffer, qvkbuffer_t *stagingBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags)
|
||||
{
|
||||
qvkbufferopts_t dstOpts = {
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
|
||||
.reqMemFlags = reqMemFlags,
|
||||
.prefMemFlags = prefMemFlags,
|
||||
.vmaUsage = VMA_MEMORY_USAGE_GPU_ONLY,
|
||||
.vmaFlags = 0
|
||||
};
|
||||
|
||||
createStagedBuffer(data, size, dstBuffer, dstOpts, stagingBuffer);
|
||||
}
|
||||
|
||||
void QVk_CreateIndexBuffer(const void *data, VkDeviceSize size, qvkbuffer_t *dstBuffer, qvkbuffer_t *stagingBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags)
|
||||
{
|
||||
qvkbufferopts_t dstOpts = {
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_INDEX_BUFFER_BIT,
|
||||
.reqMemFlags = reqMemFlags,
|
||||
.prefMemFlags = prefMemFlags,
|
||||
.vmaUsage = VMA_MEMORY_USAGE_GPU_ONLY,
|
||||
.vmaFlags = 0
|
||||
};
|
||||
|
||||
createStagedBuffer(data, size, dstBuffer, dstOpts, stagingBuffer);
|
||||
}
|
91
src/client/refresh/vk/vk_cmd.c
Normal file
91
src/client/refresh/vk/vk_cmd.c
Normal file
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
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 "vk_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 | VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_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;
|
||||
}
|
2359
src/client/refresh/vk/vk_common.c
Normal file
2359
src/client/refresh/vk/vk_common.c
Normal file
File diff suppressed because it is too large
Load diff
346
src/client/refresh/vk/vk_device.c
Normal file
346
src/client/refresh/vk/vk_device.c
Normal file
|
@ -0,0 +1,346 @@
|
|||
/*
|
||||
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 "vk_local.h"
|
||||
|
||||
// internal helper
|
||||
static qboolean deviceExtensionsSupported(const VkPhysicalDevice *physicalDevice)
|
||||
{
|
||||
uint32_t availableExtCount = 0;
|
||||
qboolean vk_khr_swapchain_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_khr_swapchain_extension_available |= strcmp(extensions[i].extensionName, VK_KHR_SWAPCHAIN_EXTENSION_NAME) == 0;
|
||||
}
|
||||
|
||||
free(extensions);
|
||||
}
|
||||
|
||||
// lack of swapchain extension disqualifies the device
|
||||
return vk_khr_swapchain_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]);
|
||||
|
||||
// no required extensions? try next device
|
||||
if (!extSupported || !deviceFeatures.samplerAnisotropy || !deviceFeatures.fillModeNonSolid)
|
||||
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)
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "No Vulkan-capable devices found!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
ri.Con_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)
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "Could not find a suitable physical device!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
ri.Con_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);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// debug label related functions
|
||||
#if defined(_DEBUG) || defined(ENABLE_DEBUG_LABELS)
|
||||
|
||||
void QVk_DebugSetObjectName(uint64_t obj, VkObjectType objType, const char *objName)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
qvkCmdEndDebugUtilsLabelEXT(*cmdBuffer);
|
||||
}
|
||||
|
||||
void QVk_DebugLabelInsert(const VkCommandBuffer *cmdBuffer, const char *labelName, const float r, const float g, const float b)
|
||||
{
|
||||
VkDebugUtilsLabelEXT labelInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT,
|
||||
.pNext = NULL,
|
||||
.pLabelName = labelName,
|
||||
.color = { r, g, b, 1.f }
|
||||
};
|
||||
|
||||
qvkInsertDebugUtilsLabelEXT(*cmdBuffer, &labelInfo);
|
||||
}
|
||||
|
||||
#endif
|
303
src/client/refresh/vk/vk_draw.c
Normal file
303
src/client/refresh/vk/vk_draw.c
Normal file
|
@ -0,0 +1,303 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
// draw.c
|
||||
|
||||
#include "vk_local.h"
|
||||
|
||||
image_t *draw_chars;
|
||||
|
||||
/*
|
||||
===============
|
||||
Draw_InitLocal
|
||||
===============
|
||||
*/
|
||||
void Draw_InitLocal (void)
|
||||
{
|
||||
// load console characters (don't bilerp characters)
|
||||
qvksampler_t samplerType = S_NEAREST;
|
||||
draw_chars = Vk_FindImage("pics/conchars.pcx", it_pic, &samplerType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Draw_Char
|
||||
|
||||
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 Draw_Char (int x, int y, int num)
|
||||
{
|
||||
int row, col;
|
||||
float frow, fcol, size;
|
||||
|
||||
num &= 255;
|
||||
|
||||
if ((num & 127) == 32)
|
||||
return; // space
|
||||
|
||||
if (y <= -8)
|
||||
return; // totally off screen
|
||||
|
||||
cvar_t *scale = ri.Cvar_Get("hudscale", "1", 0);
|
||||
|
||||
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->value / vid.width, 8.f * scale->value / vid.height,
|
||||
fcol, frow, size, size };
|
||||
QVk_DrawTexRect(imgTransform, sizeof(imgTransform), &draw_chars->vk_texture);
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_FindPic
|
||||
=============
|
||||
*/
|
||||
image_t *Draw_FindPic (char *name)
|
||||
{
|
||||
image_t *vk;
|
||||
char fullname[MAX_QPATH];
|
||||
|
||||
if (name[0] != '/' && name[0] != '\\')
|
||||
{
|
||||
Com_sprintf(fullname, sizeof(fullname), "pics/%s.pcx", name);
|
||||
vk = Vk_FindImage(fullname, it_pic, NULL);
|
||||
}
|
||||
else
|
||||
vk = Vk_FindImage(name + 1, it_pic, NULL);
|
||||
|
||||
return vk;
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_GetPicSize
|
||||
=============
|
||||
*/
|
||||
void Draw_GetPicSize (int *w, int *h, char *pic)
|
||||
{
|
||||
image_t *vk;
|
||||
|
||||
vk = Draw_FindPic(pic);
|
||||
if (!vk)
|
||||
{
|
||||
*w = *h = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
cvar_t *scale = ri.Cvar_Get("hudscale", "1", 0);
|
||||
|
||||
*w = vk->width * scale->value;
|
||||
*h = vk->height * scale->value;
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_StretchPic
|
||||
=============
|
||||
*/
|
||||
void Draw_StretchPic (int x, int y, int w, int h, char *pic)
|
||||
{
|
||||
image_t *vk;
|
||||
|
||||
vk = Draw_FindPic(pic);
|
||||
if (!vk)
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
|
||||
return;
|
||||
}
|
||||
|
||||
float imgTransform[] = { (float)x / vid.width, (float)y / vid.height,
|
||||
(float)w / vid.width, (float)h / vid.height,
|
||||
vk->sl, vk->tl,
|
||||
vk->sh - vk->sl, vk->th - vk->tl };
|
||||
QVk_DrawTexRect(imgTransform, sizeof(imgTransform), &vk->vk_texture);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_Pic
|
||||
=============
|
||||
*/
|
||||
void Draw_Pic (int x, int y, char *pic)
|
||||
{
|
||||
image_t *vk;
|
||||
cvar_t *scale = ri.Cvar_Get("hudscale", "1", 0);
|
||||
|
||||
vk = Draw_FindPic(pic);
|
||||
if (!vk)
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
|
||||
return;
|
||||
}
|
||||
|
||||
Draw_StretchPic(x, y, vk->width*scale->value, vk->height*scale->value, pic);
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_TileClear
|
||||
|
||||
This repeats a 64*64 tile graphic to fill the screen around a sized down
|
||||
refresh window.
|
||||
=============
|
||||
*/
|
||||
void Draw_TileClear (int x, int y, int w, int h, char *pic)
|
||||
{
|
||||
image_t *image;
|
||||
|
||||
image = Draw_FindPic(pic);
|
||||
if (!image)
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "Can't find pic: %s\n", pic);
|
||||
return;
|
||||
}
|
||||
|
||||
float imgTransform[] = { (float)x / vid.width, (float)y / vid.height,
|
||||
(float)w / vid.width, (float)h / vid.height,
|
||||
(float)x / 64.0, (float)y / 64.0,
|
||||
(float)w / 64.0, (float)h / 64.0 };
|
||||
QVk_DrawTexRect(imgTransform, sizeof(imgTransform), &image->vk_texture);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_Fill
|
||||
|
||||
Fills a box of pixels with a single color
|
||||
=============
|
||||
*/
|
||||
void Draw_Fill (int x, int y, int w, int h, int c)
|
||||
{
|
||||
union
|
||||
{
|
||||
unsigned c;
|
||||
byte v[4];
|
||||
} color;
|
||||
|
||||
if ((unsigned)c > 255)
|
||||
ri.Sys_Error(ERR_FATAL, "Draw_Fill: bad color");
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
/*
|
||||
================
|
||||
Draw_FadeScreen
|
||||
|
||||
================
|
||||
*/
|
||||
void Draw_FadeScreen (void)
|
||||
{
|
||||
float imgTransform[] = { 0.f, 0.f, vid.width, vid.height, 0.f, 0.f, 0.f, .8f };
|
||||
QVk_DrawColorRect(imgTransform, sizeof(imgTransform), RP_UI);
|
||||
}
|
||||
|
||||
|
||||
//====================================================================
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
Draw_StretchRaw
|
||||
=============
|
||||
*/
|
||||
extern unsigned r_rawpalette[256];
|
||||
extern qvktexture_t vk_rawTexture;
|
||||
|
||||
void Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data)
|
||||
{
|
||||
unsigned image32[256 * 256];
|
||||
int i, j, trows;
|
||||
byte *source;
|
||||
int frac, fracstep;
|
||||
float hscale;
|
||||
int row;
|
||||
float t;
|
||||
|
||||
if (rows <= 256)
|
||||
{
|
||||
hscale = 1;
|
||||
trows = rows;
|
||||
}
|
||||
else
|
||||
{
|
||||
hscale = rows / 256.0;
|
||||
trows = 256;
|
||||
}
|
||||
t = rows * hscale / 256;
|
||||
|
||||
unsigned *dest;
|
||||
|
||||
for (i = 0; i < trows; i++)
|
||||
{
|
||||
row = (int)(i*hscale);
|
||||
if (row > rows)
|
||||
break;
|
||||
source = data + cols * row;
|
||||
dest = &image32[i * 256];
|
||||
fracstep = cols * 0x10000 / 256;
|
||||
frac = fracstep >> 1;
|
||||
for (j = 0; j < 256; j++)
|
||||
{
|
||||
dest[j] = r_rawpalette[source[frac >> 16]];
|
||||
frac += fracstep;
|
||||
}
|
||||
}
|
||||
|
||||
if (vk_rawTexture.image != VK_NULL_HANDLE)
|
||||
{
|
||||
QVk_UpdateTextureData(&vk_rawTexture, (unsigned char*)&image32, 0, 0, 256, 256);
|
||||
}
|
||||
else
|
||||
{
|
||||
QVVKTEXTURE_CLEAR(vk_rawTexture);
|
||||
QVk_CreateTexture(&vk_rawTexture, (unsigned char*)&image32, 256, 256, vk_current_sampler);
|
||||
QVk_DebugSetObjectName((uint64_t)vk_rawTexture.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.allocInfo.deviceMemory, VK_OBJECT_TYPE_DEVICE_MEMORY, "Memory: raw texture");
|
||||
}
|
||||
|
||||
float imgTransform[] = { (float)x / vid.width, (float)y / vid.height,
|
||||
(float)w / vid.width, (float)h / vid.height,
|
||||
0.f, 0.f, 1.f, t };
|
||||
QVk_DrawTexRect(imgTransform, sizeof(imgTransform), &vk_rawTexture);
|
||||
}
|
1727
src/client/refresh/vk/vk_image.c
Normal file
1727
src/client/refresh/vk/vk_image.c
Normal file
File diff suppressed because it is too large
Load diff
637
src/client/refresh/vk/vk_light.c
Normal file
637
src/client/refresh/vk/vk_light.c
Normal file
|
@ -0,0 +1,637 @@
|
|||
/*
|
||||
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 "vk_local.h"
|
||||
|
||||
int r_dlightframecount;
|
||||
|
||||
#define DLIGHT_CUTOFF 64
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
DYNAMIC LIGHTS BLEND RENDERING
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
void R_RenderDlight (dlight_t *light)
|
||||
{
|
||||
int i, j;
|
||||
float a;
|
||||
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--)
|
||||
{
|
||||
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;
|
||||
|
||||
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
|
||||
|
||||
if ( (back < 0) == side )
|
||||
return -1; // didn't hit anuthing
|
||||
|
||||
// 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++)
|
||||
{
|
||||
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);
|
||||
if (lightmap)
|
||||
{
|
||||
vec3_t scale;
|
||||
|
||||
lightmap += 3*(dt * ((surf->extents[0]>>4)+1) + ds);
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
for (i=0 ; i<3 ; i++)
|
||||
scale[i] = vk_modulate->value*r_newrefdef.lightstyles[surf->styles[maps]].rgb[i];
|
||||
|
||||
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)
|
||||
{
|
||||
vec3_t end;
|
||||
float r;
|
||||
int lnum;
|
||||
dlight_t *dl;
|
||||
vec3_t dist;
|
||||
float add;
|
||||
|
||||
if (!r_worldmodel->lightdata)
|
||||
{
|
||||
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++)
|
||||
{
|
||||
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, vk_modulate->value, color);
|
||||
}
|
||||
|
||||
|
||||
//===================================================================
|
||||
|
||||
static float s_blocklights[34*34*3];
|
||||
/*
|
||||
===============
|
||||
R_AddDynamicLights
|
||||
===============
|
||||
*/
|
||||
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;
|
||||
lightstyle_t *style;
|
||||
|
||||
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)
|
||||
{
|
||||
int maps;
|
||||
|
||||
for (i=0 ; i<size*3 ; i++)
|
||||
s_blocklights[i] = 255;
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
style = &r_newrefdef.lightstyles[surf->styles[maps]];
|
||||
}
|
||||
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] = vk_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] = vk_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);
|
||||
|
||||
// put into texture format
|
||||
store:
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
383
src/client/refresh/vk/vk_local.h
Normal file
383
src/client/refresh/vk/vk_local.h
Normal file
|
@ -0,0 +1,383 @@
|
|||
/*
|
||||
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__
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
# define VK_USE_PLATFORM_WIN32_KHR
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
# define VK_USE_PLATFORM_XLIB_KHR
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
# define VK_USE_PLATFORM_MACOS_MVK
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "../client/ref.h"
|
||||
|
||||
#include "qvk.h"
|
||||
|
||||
#define REF_VERSION "Vulkan (vkQuake2 v"VKQUAKE2_VERSION")"
|
||||
#define VKQUAKE2_VERSION "1.4.3"
|
||||
|
||||
// verify if VkResult is VK_SUCCESS
|
||||
#ifdef _DEBUG
|
||||
#define VK_VERIFY(x) { \
|
||||
VkResult res = (x); \
|
||||
if(res != VK_SUCCESS) { \
|
||||
ri.Con_Printf(PRINT_ALL, "VkResult verification failed: %s in %s:%d\n", QVk_GetError(res), __FILE__, __LINE__); \
|
||||
assert(res == VK_SUCCESS && "VkResult verification failed!"); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
# define VK_VERIFY(x) (void)(x)
|
||||
#endif
|
||||
|
||||
// up / down
|
||||
#define PITCH 0
|
||||
|
||||
// left / right
|
||||
#define YAW 1
|
||||
|
||||
// fall over
|
||||
#define ROLL 2
|
||||
|
||||
#ifndef min
|
||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef max
|
||||
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned width, height; // coordinates from main game
|
||||
} viddef_t;
|
||||
|
||||
extern viddef_t vid;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
skins will be outline flood filled and mip mapped
|
||||
pics and sprites with alpha will be outline flood filled
|
||||
pic won't be mip mapped
|
||||
|
||||
model skin
|
||||
sprite frame
|
||||
wall texture
|
||||
pic
|
||||
|
||||
*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
it_skin,
|
||||
it_sprite,
|
||||
it_wall,
|
||||
it_pic,
|
||||
it_sky
|
||||
} imagetype_t;
|
||||
|
||||
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
|
||||
float sl, tl, sh, th; // 0,0 - 1,1 unless part of the scrap
|
||||
qboolean scrap;
|
||||
|
||||
} image_t;
|
||||
|
||||
#define MAX_VKTEXTURES 1024
|
||||
|
||||
//===================================================================
|
||||
|
||||
typedef enum
|
||||
{
|
||||
rserr_ok,
|
||||
|
||||
rserr_invalid_fullscreen,
|
||||
rserr_invalid_mode,
|
||||
|
||||
rserr_unknown
|
||||
} rserr_t;
|
||||
|
||||
#include "vk_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 entity_t *currententity;
|
||||
extern model_t *currentmodel;
|
||||
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_norefresh;
|
||||
extern cvar_t *r_lefthand;
|
||||
extern cvar_t *r_drawentities;
|
||||
extern cvar_t *r_drawworld;
|
||||
extern cvar_t *r_speeds;
|
||||
extern cvar_t *r_fullbright;
|
||||
extern cvar_t *r_novis;
|
||||
extern cvar_t *r_nocull;
|
||||
extern cvar_t *r_lerpmodels;
|
||||
|
||||
extern cvar_t *r_lightlevel; // FIXME: This is a HACK to get the client's light level
|
||||
|
||||
extern cvar_t *vk_validation;
|
||||
extern cvar_t *vk_mode;
|
||||
extern cvar_t *vk_bitdepth;
|
||||
extern cvar_t *vk_log;
|
||||
extern cvar_t *vk_picmip;
|
||||
extern cvar_t *vk_skymip;
|
||||
extern cvar_t *vk_round_down;
|
||||
extern cvar_t *vk_flashblend;
|
||||
extern cvar_t *vk_finish;
|
||||
extern cvar_t *vk_clear;
|
||||
extern cvar_t *vk_lockpvs;
|
||||
extern cvar_t *vk_polyblend;
|
||||
extern cvar_t *vk_modulate;
|
||||
extern cvar_t *vk_shadows;
|
||||
extern cvar_t *vk_particle_size;
|
||||
extern cvar_t *vk_particle_att_a;
|
||||
extern cvar_t *vk_particle_att_b;
|
||||
extern cvar_t *vk_particle_att_c;
|
||||
extern cvar_t *vk_particle_min_size;
|
||||
extern cvar_t *vk_particle_max_size;
|
||||
extern cvar_t *vk_point_particles;
|
||||
extern cvar_t *vk_dynamic;
|
||||
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_vsync;
|
||||
extern cvar_t *vk_device_idx;
|
||||
|
||||
extern cvar_t *vid_fullscreen;
|
||||
extern cvar_t *vid_gamma;
|
||||
|
||||
extern cvar_t *intensity;
|
||||
|
||||
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);
|
||||
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;
|
||||
|
||||
qboolean R_Init( void *hinstance, void *hWnd );
|
||||
void R_Shutdown( void );
|
||||
|
||||
void R_RenderView (refdef_t *fd);
|
||||
void Vk_ScreenShot_f (void);
|
||||
void R_DrawAliasModel (entity_t *e);
|
||||
void R_DrawBrushModel (entity_t *e);
|
||||
void R_DrawSpriteModel (entity_t *e);
|
||||
void R_DrawBeam( entity_t *e );
|
||||
void R_DrawWorld (void);
|
||||
void R_RenderDlights (void);
|
||||
void R_DrawAlphaSurfaces (void);
|
||||
void R_RenderBrushPoly (msurface_t *fa, float *modelMatrix, float alpha);
|
||||
void R_InitParticleTexture (void);
|
||||
void Draw_InitLocal (void);
|
||||
void Vk_SubdivideSurface (msurface_t *fa);
|
||||
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);
|
||||
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);
|
||||
|
||||
void COM_StripExtension (char *in, char *out);
|
||||
|
||||
void Draw_GetPicSize (int *w, int *h, char *name);
|
||||
void Draw_Pic (int x, int y, char *name);
|
||||
void Draw_StretchPic (int x, int y, int w, int h, char *name);
|
||||
void Draw_Char (int x, int y, int c);
|
||||
void Draw_TileClear (int x, int y, int w, int h, char *name);
|
||||
void Draw_Fill (int x, int y, int w, int h, int c);
|
||||
void Draw_FadeScreen (void);
|
||||
void Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data);
|
||||
|
||||
void R_BeginFrame( float camera_separation );
|
||||
void R_EndFrame( void );
|
||||
void R_SetPalette ( const unsigned char *palette);
|
||||
|
||||
int Draw_GetPalette (void);
|
||||
|
||||
void Vk_ResampleTexture (unsigned *in, int inwidth, int inheight, unsigned *out, int outwidth, int outheight);
|
||||
|
||||
struct image_s *R_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 height, imagetype_t type, int bits, qvksampler_t *samplerType);
|
||||
image_t *Vk_FindImage (char *name, imagetype_t type, qvksampler_t *samplerType);
|
||||
void Vk_TextureMode( char *string );
|
||||
void Vk_LmapTextureMode( char *string );
|
||||
void Vk_ImageList_f (void);
|
||||
|
||||
void Vk_InitImages (void);
|
||||
void Vk_ShutdownImages (void);
|
||||
void Vk_FreeUnusedImages (void);
|
||||
void Vk_DrawParticles( int n, const particle_t particles[], const unsigned colortable[768] );
|
||||
|
||||
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_fan_index_usage;
|
||||
uint32_t triangle_fan_index_max_usage;
|
||||
uint32_t triangle_fan_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;
|
||||
} vkstate_t;
|
||||
|
||||
extern vkconfig_t vk_config;
|
||||
extern vkstate_t vk_state;
|
||||
|
||||
/*
|
||||
====================================================================
|
||||
|
||||
IMPORTED FUNCTIONS
|
||||
|
||||
====================================================================
|
||||
*/
|
||||
|
||||
extern refimport_t ri;
|
||||
|
||||
|
||||
/*
|
||||
====================================================================
|
||||
|
||||
IMPLEMENTATION SPECIFIC FUNCTIONS
|
||||
|
||||
====================================================================
|
||||
*/
|
||||
|
||||
void Vkimp_BeginFrame( float camera_separation );
|
||||
void Vkimp_EndFrame( void );
|
||||
int Vkimp_Init( void *hinstance, void *hWnd );
|
||||
void Vkimp_Shutdown( void );
|
||||
int Vkimp_SetMode( int *pwidth, int *pheight, int mode, qboolean fullscreen );
|
||||
void Vkimp_AppActivate( qboolean active );
|
||||
void Vkimp_EnableLogging( qboolean enable );
|
||||
void Vkimp_LogNewFrame( void );
|
||||
void Vkimp_GetSurfaceExtensions(char **extensions, uint32_t *extCount);
|
||||
VkResult Vkimp_CreateSurface(void);
|
||||
|
||||
#endif
|
23
src/client/refresh/vk/vk_mem_alloc.cpp
Normal file
23
src/client/refresh/vk/vk_mem_alloc.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#define VMA_IMPLEMENTATION
|
||||
#include <vulkan/vulkan.h>
|
||||
#include "vk_mem_alloc.h"
|
17087
src/client/refresh/vk/vk_mem_alloc.h
Normal file
17087
src/client/refresh/vk/vk_mem_alloc.h
Normal file
File diff suppressed because it is too large
Load diff
777
src/client/refresh/vk/vk_mesh.c
Normal file
777
src/client/refresh/vk/vk_mesh.c
Normal file
|
@ -0,0 +1,777 @@
|
|||
/*
|
||||
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 "vk_local.h"
|
||||
|
||||
/*
|
||||
=============================================================
|
||||
|
||||
ALIAS MODELS
|
||||
|
||||
=============================================================
|
||||
*/
|
||||
|
||||
#define NUMVERTEXNORMALS 162
|
||||
|
||||
float r_avertexnormals[NUMVERTEXNORMALS][3] = {
|
||||
#include "anorms.h"
|
||||
};
|
||||
|
||||
typedef float vec4_t[4];
|
||||
|
||||
static vec4_t s_lerped[MAX_VERTS];
|
||||
|
||||
vec3_t shadevector;
|
||||
float shadelight[3];
|
||||
|
||||
// precalculated dot products for quantized angles
|
||||
#define SHADEDOT_QUANT 16
|
||||
float r_avertexnormal_dots[SHADEDOT_QUANT][256] =
|
||||
#include "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
|
||||
};
|
||||
|
||||
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] )
|
||||
{
|
||||
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
|
||||
=============
|
||||
*/
|
||||
void Vk_DrawAliasFrameLerp (dmdl_t *paliashdr, float backlerp, image_t *skin, float *modelMatrix, int leftHandOffset, int translucentIdx)
|
||||
{
|
||||
float l;
|
||||
daliasframe_t *frame, *oldframe;
|
||||
dtrivertx_t *v, *ov, *verts;
|
||||
int *order;
|
||||
int count;
|
||||
float frontlerp;
|
||||
float alpha;
|
||||
vec3_t move, delta, vectors[3];
|
||||
vec3_t frontv, backv;
|
||||
int i;
|
||||
int index_xyz;
|
||||
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];
|
||||
}
|
||||
|
||||
lerp = s_lerped[0];
|
||||
|
||||
Vk_LerpVerts( paliashdr->num_xyz, v, ov, verts, lerp, move, frontv, backv );
|
||||
|
||||
enum {
|
||||
TRIANGLE_STRIP = 0,
|
||||
TRIANGLE_FAN = 1
|
||||
} pipelineIdx;
|
||||
|
||||
typedef struct {
|
||||
float vertex[3];
|
||||
float color[4];
|
||||
float texCoord[2];
|
||||
} modelvert;
|
||||
|
||||
int vertCounts[2] = { 0, 0 };
|
||||
static modelvert vertList[2][MAX_VERTS];
|
||||
int pipeCounters[2] = { 0, 0 };
|
||||
VkDeviceSize maxTriangleFanIdxCnt = 0;
|
||||
|
||||
static struct {
|
||||
int vertexCount;
|
||||
int firstVertex;
|
||||
} drawInfo[2][MAX_VERTS];
|
||||
|
||||
drawInfo[0][0].firstVertex = 0;
|
||||
drawInfo[1][0].firstVertex = 0;
|
||||
|
||||
struct {
|
||||
float model[16];
|
||||
int textured;
|
||||
} meshUbo;
|
||||
|
||||
while (1)
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
|
||||
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];
|
||||
// unused in this case, since texturing is disabled
|
||||
vertList[pipelineIdx][vertIdx].texCoord[0] = 0.f;
|
||||
vertList[pipelineIdx][vertIdx].texCoord[1] = 0.f;
|
||||
index_xyz = order[2];
|
||||
order += 3;
|
||||
|
||||
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;
|
||||
|
||||
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]++;
|
||||
} while (--count);
|
||||
}
|
||||
else
|
||||
{
|
||||
meshUbo.textured = 1;
|
||||
do
|
||||
{
|
||||
int vertIdx = vertCounts[pipelineIdx];
|
||||
// texture coordinates come from the draw list
|
||||
vertList[pipelineIdx][vertIdx].texCoord[0] = ((float *)order)[0];
|
||||
vertList[pipelineIdx][vertIdx].texCoord[1] = ((float *)order)[1];
|
||||
index_xyz = order[2];
|
||||
order += 3;
|
||||
|
||||
// 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;
|
||||
|
||||
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]++;
|
||||
} while (--count);
|
||||
}
|
||||
|
||||
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][4] = { { vk_drawModelPipelineStrip[pidx], vk_drawModelPipelineFan[pidx], vk_drawLefthandModelPipelineStrip, vk_drawLefthandModelPipelineFan },
|
||||
{ vk_drawNoDepthModelPipelineStrip, vk_drawNoDepthModelPipelineFan, vk_drawLefthandModelPipelineStrip, 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][p + leftHandOffset]);
|
||||
VkDescriptorSet descriptorSets[] = { skin->vk_texture.descriptorSet, uboDescriptorSet };
|
||||
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines[translucentIdx][p + leftHandOffset].layout, 0, 2, descriptorSets, 1, &uboOffset);
|
||||
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
|
||||
|
||||
if (p == TRIANGLE_STRIP)
|
||||
{
|
||||
for (i = 0; i < pipeCounters[p]; i++)
|
||||
{
|
||||
vkCmdDraw(vk_activeCmdbuffer, drawInfo[p][i].vertexCount, 1, 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;
|
||||
|
||||
void Vk_DrawAliasShadow (dmdl_t *paliashdr, int posenum, float *modelMatrix)
|
||||
{
|
||||
dtrivertx_t *verts;
|
||||
int *order;
|
||||
vec3_t point;
|
||||
float height, lheight;
|
||||
int count;
|
||||
int i;
|
||||
daliasframe_t *frame;
|
||||
qvkpipeline_t pipelines[2] = { vk_shadowsPipelineStrip, vk_shadowsPipelineFan };
|
||||
|
||||
enum {
|
||||
TRIANGLE_STRIP = 0,
|
||||
TRIANGLE_FAN = 1
|
||||
} pipelineIdx;
|
||||
|
||||
lheight = currententity->origin[2] - lightspot[2];
|
||||
|
||||
frame = (daliasframe_t *)((byte *)paliashdr + paliashdr->ofs_frames
|
||||
+ currententity->frame * paliashdr->framesize);
|
||||
verts = frame->verts;
|
||||
|
||||
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);
|
||||
|
||||
static vec3_t shadowverts[MAX_VERTS];
|
||||
while (1)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
// 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(&pipelines[pipelineIdx]);
|
||||
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines[pipelineIdx].layout, 0, 1, &uboDescriptorSet, 1, &uboOffset);
|
||||
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
|
||||
|
||||
if (pipelineIdx == TRIANGLE_STRIP)
|
||||
{
|
||||
vkCmdDraw(vk_activeCmdbuffer, i, 1, 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 )
|
||||
{
|
||||
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 ) )
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "R_CullAliasModel %s: no such frame %d\n",
|
||||
currentmodel->name, e->frame);
|
||||
e->frame = 0;
|
||||
}
|
||||
if ( ( e->oldframe >= paliashdr->num_frames ) || ( e->oldframe < 0 ) )
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "R_CullAliasModel %s: no such oldframe %d\n",
|
||||
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 *e)
|
||||
{
|
||||
int i;
|
||||
int leftHandOffset = 0;
|
||||
dmdl_t *paliashdr;
|
||||
float an;
|
||||
vec3_t bbox[8];
|
||||
image_t *skin;
|
||||
float prev_viewproj[16];
|
||||
|
||||
if ( !( e->flags & RF_WEAPONMODEL ) )
|
||||
{
|
||||
if ( R_CullAliasModel( bbox, e ) )
|
||||
return;
|
||||
}
|
||||
|
||||
if ( e->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);
|
||||
|
||||
// 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;
|
||||
float min;
|
||||
|
||||
scale = 0.1 * sin(r_newrefdef.time*7);
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
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
|
||||
extern float r_proj_aspect, r_proj_fovy;
|
||||
// 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));
|
||||
Mat_Perspective(r_projection_matrix, r_vulkan_correction_dh, r_proj_fovy, r_proj_aspect, 4, 4096);
|
||||
Mat_Mul(r_view_matrix, r_projection_matrix, r_viewproj_matrix);
|
||||
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTexQuadPipeline.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.layout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(r_viewproj_matrix), r_viewproj_matrix);
|
||||
leftHandOffset = 2;
|
||||
}
|
||||
|
||||
e->angles[PITCH] = -e->angles[PITCH]; // sigh.
|
||||
float model[16];
|
||||
Mat_Identity(model);
|
||||
R_RotateForEntity (e, model);
|
||||
e->angles[PITCH] = -e->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) )
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "R_DrawAliasModel %s: no such frame %d\n",
|
||||
currentmodel->name, currententity->frame);
|
||||
currententity->frame = 0;
|
||||
currententity->oldframe = 0;
|
||||
}
|
||||
|
||||
if ( (currententity->oldframe >= paliashdr->num_frames)
|
||||
|| (currententity->oldframe < 0))
|
||||
{
|
||||
ri.Con_Printf (PRINT_ALL, "R_DrawAliasModel %s: no such oldframe %d\n",
|
||||
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);
|
||||
|
||||
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.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.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(e, model);
|
||||
Vk_DrawAliasShadow (paliashdr, currententity->frame, model);
|
||||
}
|
||||
}
|
1223
src/client/refresh/vk/vk_model.c
Normal file
1223
src/client/refresh/vk/vk_model.c
Normal file
File diff suppressed because it is too large
Load diff
261
src/client/refresh/vk/vk_model.h
Normal file
261
src/client/refresh/vk/vk_model.h
Normal file
|
@ -0,0 +1,261 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
d*_t structures are on-disk representations
|
||||
m*_t structures are in-memory
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
BRUSH MODELS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// in memory representation
|
||||
//
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
vec3_t position;
|
||||
} mvertex_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t mins, maxs;
|
||||
vec3_t origin; // for sounds or lights
|
||||
float radius;
|
||||
int headnode;
|
||||
int visleafs; // not including the solid leaf 0
|
||||
int firstface, numfaces;
|
||||
} mmodel_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
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
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 enum {mod_bad, mod_brush, mod_sprite, mod_alias } modtype_t;
|
||||
|
||||
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;
|
||||
mmodel_t *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;
|
||||
} model_t;
|
||||
|
||||
//============================================================================
|
||||
|
||||
void Mod_Init (void);
|
||||
model_t *Mod_ForName (char *name, qboolean crash);
|
||||
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_Free (model_t *mod);
|
207
src/client/refresh/vk/vk_pipeline.c
Normal file
207
src/client/refresh/vk/vk_pipeline.c
Normal file
|
@ -0,0 +1,207 @@
|
|||
/*
|
||||
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 "vk_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, VkPushConstantRange *pcRange)
|
||||
{
|
||||
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 = pipeline->mode,
|
||||
.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
|
||||
};
|
||||
|
||||
VkPipelineLayoutCreateInfo plCreateInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
|
||||
.pNext = NULL,
|
||||
.flags = 0,
|
||||
.setLayoutCount = descLayoutCount,
|
||||
.pSetLayouts = descriptorLayout,
|
||||
.pushConstantRangeCount = pcRange ? 1 : 0, // for simplicity assume only one push constant range is passed, so it's not the most flexible approach
|
||||
.pPushConstantRanges = pcRange
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
1509
src/client/refresh/vk/vk_rmain.c
Normal file
1509
src/client/refresh/vk/vk_rmain.c
Normal file
File diff suppressed because it is too large
Load diff
297
src/client/refresh/vk/vk_rmisc.c
Normal file
297
src/client/refresh/vk/vk_rmisc.c
Normal file
|
@ -0,0 +1,297 @@
|
|||
/*
|
||||
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.
|
||||
|
||||
*/
|
||||
// r_misc.c
|
||||
|
||||
#include "vk_local.h"
|
||||
|
||||
/*
|
||||
==================
|
||||
R_InitParticleTexture
|
||||
==================
|
||||
*/
|
||||
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 R_InitParticleTexture (void)
|
||||
{
|
||||
int x,y;
|
||||
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, it_sprite, 32, NULL);
|
||||
|
||||
//
|
||||
// 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, it_wall, 32, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
typedef struct _TargaHeader {
|
||||
unsigned char id_length, colormap_type, image_type;
|
||||
unsigned short colormap_index, colormap_length;
|
||||
unsigned char colormap_size;
|
||||
unsigned short x_origin, y_origin, width, height;
|
||||
unsigned char pixel_size, attributes;
|
||||
} TargaHeader;
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
Vk_ScreenShot_f
|
||||
==================
|
||||
*/
|
||||
void Vk_ScreenShot_f (void)
|
||||
{
|
||||
byte *buffer;
|
||||
char picname[80];
|
||||
char checkname[MAX_OSPATH];
|
||||
int i, temp;
|
||||
FILE *f;
|
||||
size_t buffSize = vid.width * vid.height * 4 + 18;
|
||||
|
||||
// create the scrnshots directory if it doesn't exist
|
||||
Com_sprintf(checkname, sizeof(checkname), "%s/scrnshot", ri.FS_Gamedir());
|
||||
Sys_Mkdir(checkname);
|
||||
|
||||
//
|
||||
// find a file name to save it to
|
||||
//
|
||||
strcpy(picname, "quake00.tga");
|
||||
|
||||
for (i = 0; i <= 99; i++)
|
||||
{
|
||||
picname[5] = i / 10 + '0';
|
||||
picname[6] = i % 10 + '0';
|
||||
Com_sprintf(checkname, sizeof(checkname), "%s/scrnshot/%s", ri.FS_Gamedir(), picname);
|
||||
f = fopen(checkname, "rb");
|
||||
if (!f)
|
||||
break; // file doesn't exist
|
||||
fclose(f);
|
||||
}
|
||||
if (i == 100)
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "SCR_ScreenShot_f: Couldn't create a file\n");
|
||||
return;
|
||||
}
|
||||
|
||||
buffer = malloc(buffSize);
|
||||
memset(buffer, 0, 18);
|
||||
buffer[2] = 2; // uncompressed type
|
||||
buffer[12] = vid.width & 255;
|
||||
buffer[13] = vid.width >> 8;
|
||||
buffer[14] = vid.height & 255;
|
||||
buffer[15] = vid.height >> 8;
|
||||
buffer[16] = 32; // pixel size
|
||||
buffer[17] = 0x20; // image is upside-down
|
||||
|
||||
QVk_ReadPixels(buffer + 18, vid.width, vid.height);
|
||||
|
||||
// swap rgb to bgr
|
||||
if (vk_swapchain.format == VK_FORMAT_R8G8B8A8_UNORM || vk_swapchain.format == VK_FORMAT_R8G8B8A8_SRGB)
|
||||
{
|
||||
for (i = 18; i < buffSize; i += 4)
|
||||
{
|
||||
temp = buffer[i];
|
||||
buffer[i] = buffer[i + 2];
|
||||
buffer[i + 2] = temp;
|
||||
buffer[i + 3] = 255; // alpha component
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 18; i < buffSize; i += 4)
|
||||
{
|
||||
buffer[i + 3] = 255;
|
||||
}
|
||||
}
|
||||
|
||||
f = fopen(checkname, "wb");
|
||||
fwrite(buffer, 1, buffSize, f);
|
||||
fclose(f);
|
||||
|
||||
free(buffer);
|
||||
ri.Con_Printf(PRINT_ALL, "Wrote %s\n", picname);
|
||||
}
|
||||
|
||||
/*
|
||||
** Vk_Strings_f
|
||||
*/
|
||||
void Vk_Strings_f(void)
|
||||
{
|
||||
int i = 0;
|
||||
char ver[] = { "vkQuake2 v"VKQUAKE2_VERSION };
|
||||
for (i = 0; i < strlen(ver); i++)
|
||||
ver[i] += 128;
|
||||
|
||||
uint32_t numDevices = 0;
|
||||
int usedDevice = 0;
|
||||
VkPhysicalDevice physicalDevices[32]; // make an assumption that nobody has more than 32 GPUs :-)
|
||||
VkPhysicalDeviceProperties deviceProperties;
|
||||
qboolean isPreferred = false;
|
||||
int preferredDevice = (int)vk_device_idx->value;
|
||||
int msaa = (int)ri.Cvar_Get("vk_msaa", "0", CVAR_ARCHIVE)->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));
|
||||
VK_VERIFY(vkEnumeratePhysicalDevices(vk_instance, &numDevices, physicalDevices));
|
||||
|
||||
if (preferredDevice >= numDevices) preferredDevice = -1;
|
||||
|
||||
ri.Con_Printf(PRINT_ALL, "\n%s\n", ver);
|
||||
ri.Con_Printf(PRINT_ALL, "------------------------------------\n");
|
||||
ri.Con_Printf(PRINT_ALL, "Vulkan API: %d.%d\n", VK_VERSION_MAJOR(vk_config.vk_version),
|
||||
VK_VERSION_MINOR(vk_config.vk_version));
|
||||
ri.Con_Printf(PRINT_ALL, "Header version: %d\n", VK_HEADER_VERSION);
|
||||
ri.Con_Printf(PRINT_ALL, "Devices found:\n");
|
||||
for (i = 0; i < numDevices; ++i)
|
||||
{
|
||||
vkGetPhysicalDeviceProperties(physicalDevices[i], &deviceProperties);
|
||||
isPreferred = (preferredDevice == i) || (preferredDevice < 0 && deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU);
|
||||
if (isPreferred) usedDevice = i;
|
||||
ri.Con_Printf(PRINT_ALL, "%s#%d: %s\n", isPreferred && numDevices > 1 ? "* " : " ", i, deviceProperties.deviceName);
|
||||
}
|
||||
ri.Con_Printf(PRINT_ALL, "Using device #%d:\n", usedDevice);
|
||||
ri.Con_Printf(PRINT_ALL, " deviceName: %s\n", vk_device.properties.deviceName);
|
||||
ri.Con_Printf(PRINT_ALL, " resolution: %dx%d", vid.width, vid.height);
|
||||
if (msaa > 0)
|
||||
ri.Con_Printf(PRINT_ALL, " (MSAAx%d)\n", 2 << (msaa - 1));
|
||||
else
|
||||
ri.Con_Printf(PRINT_ALL, "\n");
|
||||
#ifndef __linux__
|
||||
// Intel on Windows and MacOS (Linux uses semver for Mesa drivers)
|
||||
if (vk_device.properties.vendorID == 0x8086)
|
||||
ri.Con_Printf(PRINT_ALL, " driverVersion: %d (0x%X)\n", vk_device.properties.driverVersion, vk_device.properties.driverVersion);
|
||||
else
|
||||
#endif
|
||||
ri.Con_Printf(PRINT_ALL, " driverVersion: %d.%d.%d (0x%X)\n", driverMajor, driverMinor, driverPatch, vk_device.properties.driverVersion);
|
||||
|
||||
ri.Con_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));
|
||||
ri.Con_Printf(PRINT_ALL, " deviceID: %d\n", vk_device.properties.deviceID);
|
||||
ri.Con_Printf(PRINT_ALL, " vendorID: 0x%X (%s)\n", vk_device.properties.vendorID, vk_config.vendor_name);
|
||||
ri.Con_Printf(PRINT_ALL, " deviceType: %s\n", vk_config.device_type);
|
||||
ri.Con_Printf(PRINT_ALL, " gfx/present/transfer: %d/%d/%d\n", vk_device.gfxFamilyIndex,
|
||||
vk_device.presentFamilyIndex,
|
||||
vk_device.transferFamilyIndex);
|
||||
ri.Con_Printf(PRINT_ALL, "Present mode: %s\n", vk_config.present_mode);
|
||||
ri.Con_Printf(PRINT_ALL, "Swapchain image format: %d\n", vk_swapchain.format);
|
||||
ri.Con_Printf(PRINT_ALL, "Supported present modes: ");
|
||||
|
||||
i = 0;
|
||||
while(vk_config.supported_present_modes[i])
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "%s ", vk_config.supported_present_modes[i++]);
|
||||
}
|
||||
ri.Con_Printf(PRINT_ALL, "\nEnabled extensions: ");
|
||||
|
||||
i = 0;
|
||||
while(vk_config.extensions[i])
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "%s ", vk_config.extensions[i++]);
|
||||
}
|
||||
ri.Con_Printf(PRINT_ALL, "\nEnabled layers: ");
|
||||
|
||||
i = 0;
|
||||
while(vk_config.layers[i])
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "%s ", vk_config.layers[i++]);
|
||||
}
|
||||
ri.Con_Printf(PRINT_ALL, "\n");
|
||||
}
|
||||
|
||||
/*
|
||||
** Vk_Mem_f
|
||||
*/
|
||||
void Vk_Mem_f(void)
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "\nDynamic buffer stats: \n");
|
||||
ri.Con_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);
|
||||
ri.Con_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);
|
||||
ri.Con_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);
|
||||
ri.Con_Printf(PRINT_ALL, "Tri fan: %u/%u (%.1f%% max: %u)\n", vk_config.triangle_fan_index_usage,
|
||||
vk_config.triangle_fan_index_count,
|
||||
100.f * vk_config.triangle_fan_index_usage / vk_config.triangle_fan_index_count,
|
||||
vk_config.triangle_fan_index_max_usage);
|
||||
}
|
1300
src/client/refresh/vk/vk_rsurf.c
Normal file
1300
src/client/refresh/vk/vk_rsurf.c
Normal file
File diff suppressed because it is too large
Load diff
85
src/client/refresh/vk/vk_shaders.c
Normal file
85
src/client/refresh/vk/vk_shaders.c
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
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 "vk_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);
|
115
src/client/refresh/vk/vk_shaders.h
Normal file
115
src/client/refresh/vk/vk_shaders.h
Normal file
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
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
|
215
src/client/refresh/vk/vk_swapchain.c
Normal file
215
src/client/refresh/vk/vk_swapchain.c
Normal file
|
@ -0,0 +1,215 @@
|
|||
/*
|
||||
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 "vk_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;
|
||||
|
||||
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
|
||||
static VkPresentModeKHR getSwapPresentMode(const VkPresentModeKHR *presentModes, uint32_t presentModesCount, VkPresentModeKHR desiredMode)
|
||||
{
|
||||
// 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);
|
||||
ri.Con_Printf(PRINT_ALL, "...using present mode: %s\n", vk_config.present_mode);
|
||||
return desiredMode;
|
||||
}
|
||||
}
|
||||
|
||||
// PRESENT_MODE_FIFO_KHR is guaranteed to exist due to spec requirements
|
||||
VkPresentModeKHR usedPresentMode = VK_PRESENT_MODE_FIFO_KHR;
|
||||
// preferred present mode not found - choose the next best thing
|
||||
for (uint32_t i = 0; i < presentModesCount; ++i)
|
||||
{
|
||||
// always prefer mailbox for triple buffering
|
||||
if (presentModes[i] == VK_PRESENT_MODE_MAILBOX_KHR)
|
||||
{
|
||||
usedPresentMode = presentModes[i];
|
||||
break;
|
||||
}
|
||||
else if (presentModes[i] == VK_PRESENT_MODE_IMMEDIATE_KHR)
|
||||
{
|
||||
usedPresentMode = presentModes[i];
|
||||
}
|
||||
}
|
||||
|
||||
vk_config.present_mode = presentModeString(usedPresentMode);
|
||||
ri.Con_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;
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
ri.Con_Printf(PRINT_ALL, "Supported present modes: ");
|
||||
for (int i = 0; i < presentModesCount; i++)
|
||||
{
|
||||
ri.Con_Printf(PRINT_ALL, "%s ", presentModeString(presentModes[i]));
|
||||
vk_config.supported_present_modes[i] = presentModeString(presentModes[i]);
|
||||
}
|
||||
ri.Con_Printf(PRINT_ALL, "\n");
|
||||
}
|
||||
|
||||
VkSurfaceFormatKHR swapSurfaceFormat = getSwapSurfaceFormat(surfaceFormats, formatCount);
|
||||
VkPresentModeKHR swapPresentMode = getSwapPresentMode(presentModes, presentModesCount, vk_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_MAILBOX_KHR)
|
||||
imageCount = max(3, surfaceCaps.minImageCount);
|
||||
|
||||
if (surfaceCaps.maxImageCount > 0)
|
||||
imageCount = min(imageCount, surfaceCaps.maxImageCount);
|
||||
|
||||
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 = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT, // TRANSFER_SRC_BIT is required for taking screenshots
|
||||
.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;
|
||||
ri.Con_Printf(PRINT_ALL, "...trying swapchain extent: %dx%d\n", vk_swapchain.extent.width, vk_swapchain.extent.height);
|
||||
ri.Con_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;
|
||||
}
|
106
src/client/refresh/vk/vk_validation.c
Normal file
106
src/client/refresh/vk/vk_validation.c
Normal file
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
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 "vk_local.h"
|
||||
|
||||
static VkDebugUtilsMessengerEXT validationMessenger = VK_NULL_HANDLE;
|
||||
extern FILE *vk_logfp;
|
||||
|
||||
#define VK_FILELOG(msg, ...) if(vk_log->value && vk_logfp) { \
|
||||
fprintf(vk_logfp, msg, __VA_ARGS__); \
|
||||
}
|
||||
|
||||
// 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:
|
||||
ri.Con_Printf(PRINT_ALL, "VK_INFO: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
VK_FILELOG("VK_INFO: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
break;
|
||||
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
|
||||
ri.Con_Printf(PRINT_ALL, "VK_VERBOSE: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
VK_FILELOG("VK_VERBOSE: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
break;
|
||||
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT:
|
||||
ri.Con_Printf(PRINT_ALL, "VK_WARNING: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
VK_FILELOG("VK_WARNING: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
assert(!"Vulkan warning occured!");
|
||||
break;
|
||||
default:
|
||||
ri.Con_Printf(PRINT_ALL, "VK_ERROR: %s %s\n", callbackData->pMessage, msgToString(msgType));
|
||||
VK_FILELOG("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 > 1 )
|
||||
{
|
||||
callbackInfo.messageSeverity |= VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT |
|
||||
VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT;
|
||||
}
|
||||
|
||||
VK_VERIFY(qvkCreateDebugUtilsMessengerEXT(vk_instance, &callbackInfo, NULL, &validationMessenger));
|
||||
ri.Con_Printf(PRINT_ALL, "...Vulkan validation layers enabled\n");
|
||||
}
|
||||
|
||||
void QVk_DestroyValidationLayers()
|
||||
{
|
||||
if( validationMessenger != VK_NULL_HANDLE )
|
||||
{
|
||||
qvkDestroyDebugUtilsMessengerEXT( vk_instance, validationMessenger, NULL );
|
||||
validationMessenger = VK_NULL_HANDLE;
|
||||
}
|
||||
}
|
687
src/client/refresh/vk/vk_warp.c
Normal file
687
src/client/refresh/vk/vk_warp.c
Normal file
|
@ -0,0 +1,687 @@
|
|||
/*
|
||||
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 "vk_local.h"
|
||||
|
||||
extern model_t *loadmodel;
|
||||
|
||||
char skyname[MAX_QPATH];
|
||||
float skyrotate;
|
||||
vec3_t skyaxis;
|
||||
image_t *sky_images[6];
|
||||
|
||||
msurface_t *warpface;
|
||||
|
||||
#define SUBDIVIDE_SIZE 64
|
||||
//#define SUBDIVIDE_SIZE 1024
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void SubdividePolygon (int numverts, float *verts)
|
||||
{
|
||||
int i, j, k;
|
||||
vec3_t mins, maxs;
|
||||
float m;
|
||||
float *v;
|
||||
vec3_t front[64], back[64];
|
||||
int f, b;
|
||||
float dist[64];
|
||||
float frac;
|
||||
vkpoly_t *poly;
|
||||
float s, t;
|
||||
vec3_t total;
|
||||
float total_s, total_t;
|
||||
|
||||
if (numverts > 60)
|
||||
ri.Sys_Error (ERR_DROP, "numverts = %i", numverts);
|
||||
|
||||
BoundPoly (numverts, verts, mins, maxs);
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
vec3_t verts[64];
|
||||
int numverts;
|
||||
int i;
|
||||
int lindex;
|
||||
float *vec;
|
||||
|
||||
warpface = fa;
|
||||
|
||||
//
|
||||
// convert edges back to a normal polygon
|
||||
//
|
||||
numverts = 0;
|
||||
for (i=0 ; i<fa->numedges ; i++)
|
||||
{
|
||||
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 glpoly_t chain
|
||||
=============
|
||||
*/
|
||||
void EmitWaterPolys (msurface_t *fa, image_t *texture, float *modelMatrix, float *color)
|
||||
{
|
||||
vkpoly_t *p, *bp;
|
||||
float *v;
|
||||
int i;
|
||||
|
||||
typedef struct {
|
||||
float vertex[3];
|
||||
float texCoord[2];
|
||||
} polyvert;
|
||||
|
||||
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;
|
||||
|
||||
static polyvert verts[MAX_VERTS];
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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 };
|
||||
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;
|
||||
|
||||
for (i = 0, v = p->verts[0]; i < p->numverts; i++, v += VERTEXSIZE)
|
||||
{
|
||||
verts[i].vertex[0] = v[0];
|
||||
verts[i].vertex[1] = v[1];
|
||||
verts[i].vertex[2] = v[2];
|
||||
verts[i].texCoord[0] = v[3] / 64.f;
|
||||
verts[i].texCoord[1] = v[4] / 64.f;
|
||||
}
|
||||
|
||||
uint8_t *vertData = QVk_GetVertexBuffer(sizeof(polyvert) * p->numverts, &vbo, &vboOffset);
|
||||
memcpy(vertData, verts, sizeof(polyvert) * 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===================================================================
|
||||
|
||||
|
||||
vec3_t skyclip[6] = {
|
||||
{1,1,0},
|
||||
{1,-1,0},
|
||||
{0,-1,1},
|
||||
{0,1,1},
|
||||
{1,0,1},
|
||||
{-1,0,1}
|
||||
};
|
||||
int c_sky;
|
||||
|
||||
// 1 = s, 2 = t, 3 = 2048
|
||||
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]
|
||||
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}
|
||||
};
|
||||
|
||||
float skymins[2][6], skymaxs[2][6];
|
||||
float sky_min, sky_max;
|
||||
|
||||
void DrawSkyPolygon (int nump, vec3_t vecs)
|
||||
{
|
||||
int i,j;
|
||||
vec3_t v, av;
|
||||
float s, t, dv;
|
||||
int axis;
|
||||
float *vp;
|
||||
|
||||
c_sky++;
|
||||
|
||||
// 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)
|
||||
{
|
||||
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
|
||||
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, "ClipSkyPolygon: MAX_CLIP_VERTS");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MakeSkyVec (float s, float t, int axis, float *vertexData)
|
||||
{
|
||||
vec3_t v, b;
|
||||
int j, k;
|
||||
|
||||
b[0] = s * 2300;
|
||||
b[1] = t * 2300;
|
||||
b[2] = 2300;
|
||||
|
||||
for (j = 0; j<3; j++)
|
||||
{
|
||||
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
|
||||
==============
|
||||
*/
|
||||
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 };
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
R_SetSky
|
||||
============
|
||||
*/
|
||||
// 3dstudio environment map names
|
||||
char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"};
|
||||
void R_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, NULL);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue