vk:Reuse internal vertex format in lightmap shaders

This commit is contained in:
Denis Pauk 2023-10-13 00:25:40 +03:00
parent 7084e8d7cd
commit 8694aebb20
30 changed files with 172 additions and 190 deletions

View file

@ -355,14 +355,8 @@ typedef struct {
float texCoord[2]; float texCoord[2];
} polyvert_t; } polyvert_t;
typedef struct {
float vertex[3];
float texCoord[2];
float lmTexCoord[2];
} lmappolyvert_t;
extern polyvert_t *verts_buffer; extern polyvert_t *verts_buffer;
extern lmappolyvert_t *lmappolyverts_buffer; extern mvtx_t *lmappolyverts_buffer;
void Mesh_Init (void); void Mesh_Init (void);
void Mesh_Free (void); void Mesh_Free (void);

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t basic_color_quad_frag_spv[] = { const uint32_t basic_color_quad_frag_spv[] = {
0x07230203,0x00010000,0x00080008,0x0000000d,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x0000000d,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000b,0x00030010, 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000b,0x00030010,
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d, 0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,0x6e69616d,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t basic_color_quad_vert_spv[] = { const uint32_t basic_color_quad_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000032,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000032,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000001f,0x0000002d, 0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000001f,0x0000002d,
0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461, 0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t basic_frag_spv[] = { const uint32_t basic_frag_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000038,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000038,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000011,0x00000015, 0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000011,0x00000015,
0x0000001e,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005, 0x0000001e,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t basic_vert_spv[] = { const uint32_t basic_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x0000003e,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x0000003e,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000001f,0x0000002e, 0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000001f,0x0000002e,
0x0000002f,0x00000039,0x0000003c,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47, 0x0000002f,0x00000039,0x0000003c,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t beam_vert_spv[] = { const uint32_t beam_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000027,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000027,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000020, 0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000020,
0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461, 0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t d_light_vert_spv[] = { const uint32_t d_light_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000027,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000027,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000020, 0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000020,
0x00000021,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065, 0x00000021,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t model_frag_spv[] = { const uint32_t model_frag_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000028,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000028,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000008,0x00000012,0x0000001a, 0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000008,0x00000012,0x0000001a,
0x0000001e,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005, 0x0000001e,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t model_vert_spv[] = { const uint32_t model_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000037,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000037,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000027, 0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000027,
0x00000029,0x0000002d,0x0000002f,0x00000032,0x00030003,0x00000002,0x000001c2,0x00090004, 0x00000029,0x0000002d,0x0000002f,0x00000032,0x00030003,0x00000002,0x000001c2,0x00090004,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t nullmodel_vert_spv[] = { const uint32_t nullmodel_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x0000002e,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x0000002e,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000027, 0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000027,
0x00000028,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065, 0x00000028,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,

View file

@ -1,7 +1,7 @@
// 8.13.3743 // 1112.2.0
#pragma once #pragma once
const uint32_t particle_vert_spv[] = { const uint32_t particle_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x0000002d,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x0000002d,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000022, 0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000022,
0x00000024,0x00000026,0x00000028,0x0000002b,0x00030003,0x00000002,0x000001c2,0x00090004, 0x00000024,0x00000026,0x00000028,0x0000002b,0x00030003,0x00000002,0x000001c2,0x00090004,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t point_particle_frag_spv[] = { const uint32_t point_particle_frag_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000020,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000020,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000c,0x0000001c,0x0000001e, 0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000c,0x0000001c,0x0000001e,
0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004, 0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,0x00000004,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t point_particle_vert_spv[] = { const uint32_t point_particle_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000055,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000055,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000051, 0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000051,
0x00000053,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065, 0x00000053,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t polygon_lmap_frag_spv[] = { const uint32_t polygon_lmap_frag_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000029,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000029,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000011,0x00000017,0x0000001b, 0x0009000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000011,0x00000017,0x0000001b,
0x0000001e,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005, 0x0000001e,0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00040005,

View file

@ -1,59 +1,63 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t polygon_lmap_vert_spv[] = { const uint32_t polygon_lmap_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000036,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000039,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029, 0x000e000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029,
0x0000002b,0x0000002d,0x0000002e,0x00000031,0x00030003,0x00000002,0x000001c2,0x00090004, 0x0000002b,0x0000002d,0x0000002e,0x00000031,0x00000036,0x00000038,0x00030003,0x00000002,
0x415f4c47,0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374, 0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,0x64616873,0x6f5f7265,
0x00040005,0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000008,0x505f6c67,0x65567265, 0x63656a62,0x00007374,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00060005,0x00000008,
0x78657472,0x00000000,0x00060006,0x00000008,0x00000000,0x505f6c67,0x7469736f,0x006e6f69, 0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,0x00000008,0x00000000,0x505f6c67,
0x00030005,0x0000000a,0x00000000,0x00060005,0x0000000e,0x68737550,0x736e6f43,0x746e6174, 0x7469736f,0x006e6f69,0x00030005,0x0000000a,0x00000000,0x00060005,0x0000000e,0x68737550,
0x00000000,0x00060006,0x0000000e,0x00000000,0x614d7076,0x78697274,0x00000000,0x00030005, 0x736e6f43,0x746e6174,0x00000000,0x00060006,0x0000000e,0x00000000,0x614d7076,0x78697274,
0x00000010,0x00006370,0x00070005,0x00000014,0x66696e55,0x426d726f,0x65666675,0x6a624f72, 0x00000000,0x00030005,0x00000010,0x00006370,0x00070005,0x00000014,0x66696e55,0x426d726f,
0x00746365,0x00050006,0x00000014,0x00000000,0x65646f6d,0x0000006c,0x00070006,0x00000014, 0x65666675,0x6a624f72,0x00746365,0x00050006,0x00000014,0x00000000,0x65646f6d,0x0000006c,
0x00000001,0x77656976,0x6867694c,0x70616d74,0x00000073,0x00030005,0x00000016,0x006f6275, 0x00070006,0x00000014,0x00000001,0x77656976,0x6867694c,0x70616d74,0x00000073,0x00030005,
0x00050005,0x0000001d,0x65566e69,0x78657472,0x00000000,0x00050005,0x00000029,0x43786574, 0x00000016,0x006f6275,0x00050005,0x0000001d,0x65566e69,0x78657472,0x00000000,0x00050005,
0x64726f6f,0x00000000,0x00050005,0x0000002b,0x65546e69,0x6f6f4378,0x00006472,0x00060005, 0x00000029,0x43786574,0x64726f6f,0x00000000,0x00050005,0x0000002b,0x65546e69,0x6f6f4378,
0x0000002d,0x43786574,0x64726f6f,0x70616d4c,0x00000000,0x00060005,0x0000002e,0x65546e69, 0x00006472,0x00060005,0x0000002d,0x43786574,0x64726f6f,0x70616d4c,0x00000000,0x00060005,
0x6f6f4378,0x6d4c6472,0x00007061,0x00060005,0x00000031,0x77656976,0x6867694c,0x70616d74, 0x0000002e,0x65546e69,0x6f6f4378,0x6d4c6472,0x00007061,0x00060005,0x00000031,0x77656976,
0x00000073,0x00050048,0x00000008,0x00000000,0x0000000b,0x00000000,0x00030047,0x00000008, 0x6867694c,0x70616d74,0x00000073,0x00050005,0x00000036,0x6f4e6e69,0x6c616d72,0x00000000,
0x00000002,0x00040048,0x0000000e,0x00000000,0x00000005,0x00050048,0x0000000e,0x00000000, 0x00040005,0x00000038,0x6c466e69,0x00736761,0x00050048,0x00000008,0x00000000,0x0000000b,
0x00000023,0x00000000,0x00050048,0x0000000e,0x00000000,0x00000007,0x00000010,0x00030047, 0x00000000,0x00030047,0x00000008,0x00000002,0x00040048,0x0000000e,0x00000000,0x00000005,
0x0000000e,0x00000002,0x00040048,0x00000014,0x00000000,0x00000005,0x00050048,0x00000014, 0x00050048,0x0000000e,0x00000000,0x00000023,0x00000000,0x00050048,0x0000000e,0x00000000,
0x00000000,0x00000023,0x00000000,0x00050048,0x00000014,0x00000000,0x00000007,0x00000010, 0x00000007,0x00000010,0x00030047,0x0000000e,0x00000002,0x00040048,0x00000014,0x00000000,
0x00050048,0x00000014,0x00000001,0x00000023,0x00000040,0x00030047,0x00000014,0x00000002, 0x00000005,0x00050048,0x00000014,0x00000000,0x00000023,0x00000000,0x00050048,0x00000014,
0x00040047,0x00000016,0x00000022,0x00000001,0x00040047,0x00000016,0x00000021,0x00000000, 0x00000000,0x00000007,0x00000010,0x00050048,0x00000014,0x00000001,0x00000023,0x00000040,
0x00040047,0x0000001d,0x0000001e,0x00000000,0x00040047,0x00000029,0x0000001e,0x00000000, 0x00030047,0x00000014,0x00000002,0x00040047,0x00000016,0x00000022,0x00000001,0x00040047,
0x00040047,0x0000002b,0x0000001e,0x00000001,0x00040047,0x0000002d,0x0000001e,0x00000001, 0x00000016,0x00000021,0x00000000,0x00040047,0x0000001d,0x0000001e,0x00000000,0x00040047,
0x00040047,0x0000002e,0x0000001e,0x00000002,0x00040047,0x00000031,0x0000001e,0x00000002, 0x00000029,0x0000001e,0x00000000,0x00040047,0x0000002b,0x0000001e,0x00000001,0x00040047,
0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020, 0x0000002d,0x0000001e,0x00000001,0x00040047,0x0000002e,0x0000001e,0x00000002,0x00040047,
0x00040017,0x00000007,0x00000006,0x00000004,0x0003001e,0x00000008,0x00000007,0x00040020, 0x00000031,0x0000001e,0x00000002,0x00040047,0x00000036,0x0000001e,0x00000003,0x00040047,
0x00000009,0x00000003,0x00000008,0x0004003b,0x00000009,0x0000000a,0x00000003,0x00040015, 0x00000038,0x0000001e,0x00000004,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,
0x0000000b,0x00000020,0x00000001,0x0004002b,0x0000000b,0x0000000c,0x00000000,0x00040018, 0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x0003001e,
0x0000000d,0x00000007,0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f, 0x00000008,0x00000007,0x00040020,0x00000009,0x00000003,0x00000008,0x0004003b,0x00000009,
0x00000009,0x0000000e,0x0004003b,0x0000000f,0x00000010,0x00000009,0x00040020,0x00000011, 0x0000000a,0x00000003,0x00040015,0x0000000b,0x00000020,0x00000001,0x0004002b,0x0000000b,
0x00000009,0x0000000d,0x0004001e,0x00000014,0x0000000d,0x00000006,0x00040020,0x00000015, 0x0000000c,0x00000000,0x00040018,0x0000000d,0x00000007,0x00000004,0x0003001e,0x0000000e,
0x00000002,0x00000014,0x0004003b,0x00000015,0x00000016,0x00000002,0x00040020,0x00000017, 0x0000000d,0x00040020,0x0000000f,0x00000009,0x0000000e,0x0004003b,0x0000000f,0x00000010,
0x00000002,0x0000000d,0x00040017,0x0000001b,0x00000006,0x00000003,0x00040020,0x0000001c, 0x00000009,0x00040020,0x00000011,0x00000009,0x0000000d,0x0004001e,0x00000014,0x0000000d,
0x00000001,0x0000001b,0x0004003b,0x0000001c,0x0000001d,0x00000001,0x0004002b,0x00000006, 0x00000006,0x00040020,0x00000015,0x00000002,0x00000014,0x0004003b,0x00000015,0x00000016,
0x0000001f,0x3f800000,0x00040020,0x00000025,0x00000003,0x00000007,0x00040017,0x00000027, 0x00000002,0x00040020,0x00000017,0x00000002,0x0000000d,0x00040017,0x0000001b,0x00000006,
0x00000006,0x00000002,0x00040020,0x00000028,0x00000003,0x00000027,0x0004003b,0x00000028, 0x00000003,0x00040020,0x0000001c,0x00000001,0x0000001b,0x0004003b,0x0000001c,0x0000001d,
0x00000029,0x00000003,0x00040020,0x0000002a,0x00000001,0x00000027,0x0004003b,0x0000002a, 0x00000001,0x0004002b,0x00000006,0x0000001f,0x3f800000,0x00040020,0x00000025,0x00000003,
0x0000002b,0x00000001,0x0004003b,0x00000028,0x0000002d,0x00000003,0x0004003b,0x0000002a, 0x00000007,0x00040017,0x00000027,0x00000006,0x00000002,0x00040020,0x00000028,0x00000003,
0x0000002e,0x00000001,0x00040020,0x00000030,0x00000003,0x00000006,0x0004003b,0x00000030, 0x00000027,0x0004003b,0x00000028,0x00000029,0x00000003,0x00040020,0x0000002a,0x00000001,
0x00000031,0x00000003,0x0004002b,0x0000000b,0x00000032,0x00000001,0x00040020,0x00000033, 0x00000027,0x0004003b,0x0000002a,0x0000002b,0x00000001,0x0004003b,0x00000028,0x0000002d,
0x00000002,0x00000006,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8, 0x00000003,0x0004003b,0x0000002a,0x0000002e,0x00000001,0x00040020,0x00000030,0x00000003,
0x00000005,0x00050041,0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d, 0x00000006,0x0004003b,0x00000030,0x00000031,0x00000003,0x0004002b,0x0000000b,0x00000032,
0x00000013,0x00000012,0x00050041,0x00000017,0x00000018,0x00000016,0x0000000c,0x0004003d, 0x00000001,0x00040020,0x00000033,0x00000002,0x00000006,0x0004003b,0x0000001c,0x00000036,
0x0000000d,0x00000019,0x00000018,0x00050092,0x0000000d,0x0000001a,0x00000013,0x00000019, 0x00000001,0x00040020,0x00000037,0x00000001,0x0000000b,0x0004003b,0x00000037,0x00000038,
0x0004003d,0x0000001b,0x0000001e,0x0000001d,0x00050051,0x00000006,0x00000020,0x0000001e, 0x00000001,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,
0x00000000,0x00050051,0x00000006,0x00000021,0x0000001e,0x00000001,0x00050051,0x00000006, 0x00050041,0x00000011,0x00000012,0x00000010,0x0000000c,0x0004003d,0x0000000d,0x00000013,
0x00000022,0x0000001e,0x00000002,0x00070050,0x00000007,0x00000023,0x00000020,0x00000021, 0x00000012,0x00050041,0x00000017,0x00000018,0x00000016,0x0000000c,0x0004003d,0x0000000d,
0x00000022,0x0000001f,0x00050091,0x00000007,0x00000024,0x0000001a,0x00000023,0x00050041, 0x00000019,0x00000018,0x00050092,0x0000000d,0x0000001a,0x00000013,0x00000019,0x0004003d,
0x00000025,0x00000026,0x0000000a,0x0000000c,0x0003003e,0x00000026,0x00000024,0x0004003d, 0x0000001b,0x0000001e,0x0000001d,0x00050051,0x00000006,0x00000020,0x0000001e,0x00000000,
0x00000027,0x0000002c,0x0000002b,0x0003003e,0x00000029,0x0000002c,0x0004003d,0x00000027, 0x00050051,0x00000006,0x00000021,0x0000001e,0x00000001,0x00050051,0x00000006,0x00000022,
0x0000002f,0x0000002e,0x0003003e,0x0000002d,0x0000002f,0x00050041,0x00000033,0x00000034, 0x0000001e,0x00000002,0x00070050,0x00000007,0x00000023,0x00000020,0x00000021,0x00000022,
0x00000016,0x00000032,0x0004003d,0x00000006,0x00000035,0x00000034,0x0003003e,0x00000031, 0x0000001f,0x00050091,0x00000007,0x00000024,0x0000001a,0x00000023,0x00050041,0x00000025,
0x00000035,0x000100fd,0x00010038 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
}; };

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t polygon_vert_spv[] = { const uint32_t polygon_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000030,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000030,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000022, 0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000022,
0x00000024,0x00000026,0x0000002e,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47, 0x00000024,0x00000026,0x0000002e,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t polygon_warp_vert_spv[] = { const uint32_t polygon_warp_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000058,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000058,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029, 0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029,
0x0000002b,0x00000051,0x00000056,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47, 0x0000002b,0x00000051,0x00000056,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,

View file

@ -1,7 +1,7 @@
// 1011.0.0 // 1112.2.0
#pragma once #pragma once
const uint32_t postprocess_frag_spv[] = { const uint32_t postprocess_frag_spv[] = {
0x07230203,0x00010000,0x0008000a,0x00000046,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000046,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000002c,0x00030010, 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000000b,0x0000002c,0x00030010,
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252, 0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t postprocess_vert_spv[] = { const uint32_t postprocess_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000029,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000029,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000c,0x0000001a, 0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000c,0x0000001a,
0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461, 0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t shadows_vert_spv[] = { const uint32_t shadows_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x0000002b,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x0000002b,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000027, 0x0008000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000027,
0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461, 0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t skybox_vert_spv[] = { const uint32_t skybox_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000032,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000032,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029, 0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029,
0x0000002b,0x0000002d,0x00000030,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47, 0x0000002b,0x0000002d,0x00000030,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t sprite_vert_spv[] = { const uint32_t sprite_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x0000002f,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x0000002f,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000022, 0x000b000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x00000016,0x00000022,
0x00000024,0x00000026,0x0000002d,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47, 0x00000024,0x00000026,0x0000002d,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,

View file

@ -1,7 +1,7 @@
// 1011.0.0 // 1112.2.0
#pragma once #pragma once
const uint32_t world_warp_frag_spv[] = { const uint32_t world_warp_frag_spv[] = {
0x07230203,0x00010000,0x0008000a,0x000000c1,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x000000c1,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000019,0x000000b9,0x00030010, 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000019,0x000000b9,0x00030010,
0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252, 0x00000004,0x00000007,0x00030003,0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,

View file

@ -1,7 +1,7 @@
// 8.13.3559 // 1112.2.0
#pragma once #pragma once
const uint32_t world_warp_vert_spv[] = { const uint32_t world_warp_vert_spv[] = {
0x07230203,0x00010000,0x00080008,0x00000024,0x00000000,0x00020011,0x00000001,0x0006000b, 0x07230203,0x00010000,0x0008000b,0x00000024,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000017,0x0000001b,0x00030003, 0x0007000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000017,0x0000001b,0x00030003,
0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,0x64616873, 0x00000002,0x000001c2,0x00090004,0x415f4c47,0x735f4252,0x72617065,0x5f657461,0x64616873,

View file

@ -1296,19 +1296,30 @@ static void CreatePipelines()
VK_VERTINFO(RGB_RGBA, sizeof(float) * 7, VK_INPUTATTR_DESC(0, VK_FORMAT_R32G32B32_SFLOAT, 0), VK_VERTINFO(RGB_RGBA, sizeof(float) * 7, VK_INPUTATTR_DESC(0, VK_FORMAT_R32G32B32_SFLOAT, 0),
VK_INPUTATTR_DESC(1, VK_FORMAT_R32G32B32A32_SFLOAT, sizeof(float) * 3)); VK_INPUTATTR_DESC(1, VK_FORMAT_R32G32B32A32_SFLOAT, sizeof(float) * 3));
VK_VERTINFO(RGB_RG_RG, sizeof(float) * 7, VK_INPUTATTR_DESC(0, VK_FORMAT_R32G32B32_SFLOAT, 0),
VK_INPUTATTR_DESC(1, VK_FORMAT_R32G32_SFLOAT, sizeof(float) * 3),
VK_INPUTATTR_DESC(2, VK_FORMAT_R32G32_SFLOAT, sizeof(float) * 5));
VK_VERTINFO(RGB_RGBA_RG, sizeof(float) * 9, VK_INPUTATTR_DESC(0, VK_FORMAT_R32G32B32_SFLOAT, 0), VK_VERTINFO(RGB_RGBA_RG, sizeof(float) * 9, VK_INPUTATTR_DESC(0, VK_FORMAT_R32G32B32_SFLOAT, 0),
VK_INPUTATTR_DESC(1, VK_FORMAT_R32G32B32A32_SFLOAT, sizeof(float) * 3), VK_INPUTATTR_DESC(1, VK_FORMAT_R32G32B32A32_SFLOAT, sizeof(float) * 3),
VK_INPUTATTR_DESC(2, VK_FORMAT_R32G32_SFLOAT, sizeof(float) * 7)); VK_INPUTATTR_DESC(2, VK_FORMAT_R32G32_SFLOAT, sizeof(float) * 7));
// no vertices passed to the pipeline (postprocessing)
/* Lightmap shaders input */
VK_VERTINFO(MEM_VERTEX_T, sizeof(mvtx_t), VK_INPUTATTR_DESC(0, VK_FORMAT_R32G32B32_SFLOAT, 0),
VK_INPUTATTR_DESC(1, VK_FORMAT_R32G32_SFLOAT, sizeof(float) * 3),
VK_INPUTATTR_DESC(2, VK_FORMAT_R32G32_SFLOAT, sizeof(float) * 5),
VK_INPUTATTR_DESC(3, VK_FORMAT_R32G32B32_SFLOAT, sizeof(float) * 8),
VK_INPUTATTR_DESC(4, VK_FORMAT_R8G8B8A8_SINT, sizeof(float) * 11));
/* no vertices passed to the pipeline (postprocessing) */
VkPipelineVertexInputStateCreateInfo vertInfoNull = VK_NULL_VERTEXINPUT_CINF; VkPipelineVertexInputStateCreateInfo vertInfoNull = VK_NULL_VERTEXINPUT_CINF;
// shared descriptor set layouts // shared descriptor set layouts
VkDescriptorSetLayout samplerUboDsLayouts[] = { vk_samplerDescSetLayout, vk_uboDescSetLayout }; VkDescriptorSetLayout samplerUboDsLayouts[] = {
VkDescriptorSetLayout samplerUboLmapDsLayouts[] = { vk_samplerDescSetLayout, vk_uboDescSetLayout, vk_samplerLightmapDescSetLayout }; vk_samplerDescSetLayout,
vk_uboDescSetLayout
};
VkDescriptorSetLayout samplerUboLmapDsLayouts[] = {
vk_samplerDescSetLayout,
vk_uboDescSetLayout,
vk_samplerLightmapDescSetLayout
};
// shader array (vertex and fragment, no compute... yet) // shader array (vertex and fragment, no compute... yet)
qvkshader_t shaders[SHADER_INDEX_SIZE] = {0}; qvkshader_t shaders[SHADER_INDEX_SIZE] = {0};
@ -1408,7 +1419,8 @@ static void CreatePipelines()
// draw lightmapped polygon // draw lightmapped polygon
VK_LOAD_VERTFRAG_SHADERS(shaders, polygon_lmap, polygon_lmap); VK_LOAD_VERTFRAG_SHADERS(shaders, polygon_lmap, polygon_lmap);
vk_drawPolyLmapPipeline.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; vk_drawPolyLmapPipeline.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
QVk_CreatePipeline(samplerUboLmapDsLayouts, 3, &vertInfoRGB_RG_RG, &vk_drawPolyLmapPipeline, &vk_renderpasses[RP_WORLD], shaders, 2); QVk_CreatePipeline(samplerUboLmapDsLayouts, 3, &vertInfoMEM_VERTEX_T,
&vk_drawPolyLmapPipeline, &vk_renderpasses[RP_WORLD], shaders, 2);
QVk_DebugSetObjectName((uint64_t)vk_drawPolyLmapPipeline.layout, VK_OBJECT_TYPE_PIPELINE_LAYOUT, "Pipeline Layout: lightmapped polygon"); QVk_DebugSetObjectName((uint64_t)vk_drawPolyLmapPipeline.layout, VK_OBJECT_TYPE_PIPELINE_LAYOUT, "Pipeline Layout: lightmapped polygon");
QVk_DebugSetObjectName((uint64_t)vk_drawPolyLmapPipeline.pl, VK_OBJECT_TYPE_PIPELINE, "Pipeline: lightmapped polygon"); QVk_DebugSetObjectName((uint64_t)vk_drawPolyLmapPipeline.pl, VK_OBJECT_TYPE_PIPELINE, "Pipeline: lightmapped polygon");
@ -1416,7 +1428,8 @@ static void CreatePipelines()
VK_LOAD_VERTFRAG_SHADERS(shaders, polygon_warp, basic); VK_LOAD_VERTFRAG_SHADERS(shaders, polygon_warp, basic);
vk_drawPolyWarpPipeline.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; vk_drawPolyWarpPipeline.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
vk_drawPolyWarpPipeline.blendOpts.blendEnable = VK_TRUE; vk_drawPolyWarpPipeline.blendOpts.blendEnable = VK_TRUE;
QVk_CreatePipeline(samplerUboLmapDsLayouts, 2, &vertInfoRGB_RG, &vk_drawPolyWarpPipeline, &vk_renderpasses[RP_WORLD], shaders, 2); QVk_CreatePipeline(samplerUboLmapDsLayouts, 2, &vertInfoRGB_RG,
&vk_drawPolyWarpPipeline, &vk_renderpasses[RP_WORLD], shaders, 2);
QVk_DebugSetObjectName((uint64_t)vk_drawPolyWarpPipeline.layout, VK_OBJECT_TYPE_PIPELINE_LAYOUT, "Pipeline Layout: warped polygon (liquids)"); QVk_DebugSetObjectName((uint64_t)vk_drawPolyWarpPipeline.layout, VK_OBJECT_TYPE_PIPELINE_LAYOUT, "Pipeline Layout: warped polygon (liquids)");
QVk_DebugSetObjectName((uint64_t)vk_drawPolyWarpPipeline.pl, VK_OBJECT_TYPE_PIPELINE, "Pipeline: warped polygon (liquids)"); QVk_DebugSetObjectName((uint64_t)vk_drawPolyWarpPipeline.pl, VK_OBJECT_TYPE_PIPELINE, "Pipeline: warped polygon (liquids)");

View file

@ -53,7 +53,7 @@ typedef struct {
} drawinfo_t; } drawinfo_t;
polyvert_t *verts_buffer = NULL; polyvert_t *verts_buffer = NULL;
lmappolyvert_t *lmappolyverts_buffer = NULL; mvtx_t *lmappolyverts_buffer = NULL;
static drawinfo_t *drawInfo[2] = {NULL, NULL}; static drawinfo_t *drawInfo[2] = {NULL, NULL};
static modelvert *vertList[2] = {NULL, NULL}; static modelvert *vertList[2] = {NULL, NULL};
static vec3_t *shadowverts = NULL; static vec3_t *shadowverts = NULL;

View file

@ -49,8 +49,10 @@ qvkshader_t QVk_CreateShader(const uint32_t *shaderSrc, size_t shaderCodeSize, V
return shader; return shader;
} }
void QVk_CreatePipeline(const VkDescriptorSetLayout *descriptorLayout, const uint32_t descLayoutCount, const VkPipelineVertexInputStateCreateInfo *vertexInputInfo, void QVk_CreatePipeline(const VkDescriptorSetLayout *descriptorLayout,
qvkpipeline_t *pipeline, const qvkrenderpass_t *renderpass, const qvkshader_t *shaders, uint32_t shaderCount) const uint32_t descLayoutCount, const VkPipelineVertexInputStateCreateInfo *vertexInputInfo,
qvkpipeline_t *pipeline, const qvkrenderpass_t *renderpass,
const qvkshader_t *shaders, uint32_t shaderCount)
{ {
VkPipelineShaderStageCreateInfo *ssCreateInfos = (VkPipelineShaderStageCreateInfo *)malloc(shaderCount * sizeof(VkPipelineShaderStageCreateInfo)); VkPipelineShaderStageCreateInfo *ssCreateInfos = (VkPipelineShaderStageCreateInfo *)malloc(shaderCount * sizeof(VkPipelineShaderStageCreateInfo));
for (int i = 0; i < shaderCount; i++) for (int i = 0; i < shaderCount; i++)

View file

@ -504,20 +504,15 @@ Vk_RenderLightmappedPoly(msurface_t *surf, float *modelMatrix, float alpha, enti
for (p = surf->polys; p; p = p->chain) for (p = surf->polys; p; p = p->chain)
{ {
mvtx_t *v; memcpy(lmappolyverts_buffer, p->verts, sizeof(mvtx_t) * nv);
v = p->verts; for (i = 0; i < nv; i++)
for (i = 0; i < nv; i++, v++)
{ {
VectorCopy(v->pos, lmappolyverts_buffer[i].vertex); lmappolyverts_buffer[i].texCoord[0] += scroll;
lmappolyverts_buffer[i].texCoord[0] = v->texCoord[0] + scroll;
lmappolyverts_buffer[i].texCoord[1] = v->texCoord[1];
lmappolyverts_buffer[i].lmTexCoord[0] = v->lmTexCoord[0];
lmappolyverts_buffer[i].lmTexCoord[1] = v->lmTexCoord[1];
} }
uint8_t *vertData = QVk_GetVertexBuffer(sizeof(lmappolyvert_t) * nv, &vbo, &vboOffset); uint8_t *vertData = QVk_GetVertexBuffer(sizeof(mvtx_t) * nv, &vbo, &vboOffset);
memcpy(vertData, lmappolyverts_buffer, sizeof(lmappolyvert_t) * nv); memcpy(vertData, lmappolyverts_buffer, sizeof(mvtx_t) * nv);
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo((nv - 2) * 3), 0, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo((nv - 2) * 3), 0, VK_INDEX_TYPE_UINT16);
@ -537,20 +532,8 @@ Vk_RenderLightmappedPoly(msurface_t *surf, float *modelMatrix, float alpha, enti
for (p = surf->polys; p; p = p->chain) for (p = surf->polys; p; p = p->chain)
{ {
mvtx_t *v; uint8_t *vertData = QVk_GetVertexBuffer(sizeof(mvtx_t) * nv, &vbo, &vboOffset);
memcpy(vertData, p->verts, sizeof(mvtx_t) * nv);
v = p->verts;
for (i = 0; i < nv; i++, v++)
{
VectorCopy(v->pos, lmappolyverts_buffer[i].vertex);
lmappolyverts_buffer[i].texCoord[0] = v->texCoord[0];
lmappolyverts_buffer[i].texCoord[1] = v->texCoord[1];
lmappolyverts_buffer[i].lmTexCoord[0] = v->lmTexCoord[0];
lmappolyverts_buffer[i].lmTexCoord[1] = v->lmTexCoord[1];
}
uint8_t *vertData = QVk_GetVertexBuffer(sizeof(lmappolyvert_t) * nv, &vbo, &vboOffset);
memcpy(vertData, lmappolyverts_buffer, sizeof(lmappolyvert_t) * nv);
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset); vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo((nv - 2) * 3), 0, VK_INDEX_TYPE_UINT16); vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo((nv - 2) * 3), 0, VK_INDEX_TYPE_UINT16);
@ -576,22 +559,17 @@ Vk_RenderLightmappedPoly(msurface_t *surf, float *modelMatrix, float alpha, enti
for (p = surf->polys; p; p = p->chain) for (p = surf->polys; p; p = p->chain)
{ {
mvtx_t *v; memcpy(lmappolyverts_buffer, p->verts, sizeof(mvtx_t) * nv);
v = p->verts; for (i = 0; i < nv; i++)
for (i = 0; i < nv; i++, v++)
{ {
VectorCopy(v->pos, lmappolyverts_buffer[i].vertex); lmappolyverts_buffer[i].texCoord[0] += scroll;
lmappolyverts_buffer[i].texCoord[0] = v->texCoord[0] + scroll;
lmappolyverts_buffer[i].texCoord[1] = v->texCoord[1];
lmappolyverts_buffer[i].lmTexCoord[0] = v->lmTexCoord[0];
lmappolyverts_buffer[i].lmTexCoord[1] = v->lmTexCoord[1];
} }
VkBuffer vbo; VkBuffer vbo;
VkDeviceSize vboOffset; VkDeviceSize vboOffset;
uint8_t *vertData = QVk_GetVertexBuffer(sizeof(lmappolyvert_t) * nv, &vbo, &vboOffset); uint8_t *vertData = QVk_GetVertexBuffer(sizeof(mvtx_t) * nv, &vbo, &vboOffset);
memcpy(vertData, lmappolyverts_buffer, sizeof(lmappolyvert_t) * nv); memcpy(vertData, lmappolyverts_buffer, sizeof(mvtx_t) * nv);
VkDescriptorSet descriptorSets[] = { VkDescriptorSet descriptorSets[] = {
image->vk_texture.descriptorSet, image->vk_texture.descriptorSet,
@ -610,22 +588,10 @@ Vk_RenderLightmappedPoly(msurface_t *surf, float *modelMatrix, float alpha, enti
//========== //==========
for (p = surf->polys; p; p = p->chain) for (p = surf->polys; p; p = p->chain)
{ {
mvtx_t *v;
v = p->verts;
for (i = 0; i < nv; i++, v++)
{
VectorCopy(v->pos, lmappolyverts_buffer[i].vertex);
lmappolyverts_buffer[i].texCoord[0] = v->texCoord[0];
lmappolyverts_buffer[i].texCoord[1] = v->texCoord[1];
lmappolyverts_buffer[i].lmTexCoord[0] = v->lmTexCoord[0];
lmappolyverts_buffer[i].lmTexCoord[1] = v->lmTexCoord[1];
}
VkBuffer vbo; VkBuffer vbo;
VkDeviceSize vboOffset; VkDeviceSize vboOffset;
uint8_t *vertData = QVk_GetVertexBuffer(sizeof(lmappolyvert_t) * nv, &vbo, &vboOffset); uint8_t *vertData = QVk_GetVertexBuffer(sizeof(mvtx_t) * nv, &vbo, &vboOffset);
memcpy(vertData, lmappolyverts_buffer, sizeof(lmappolyvert_t) * nv); memcpy(vertData, p->verts, sizeof(mvtx_t) * nv);
VkDescriptorSet descriptorSets[] = { VkDescriptorSet descriptorSets[] = {
image->vk_texture.descriptorSet, image->vk_texture.descriptorSet,

View file

@ -50,7 +50,6 @@ EmitWaterPolys(msurface_t *fa, image_t *texture, float *modelMatrix,
const float *color, qboolean solid_surface) const float *color, qboolean solid_surface)
{ {
mpoly_t *p, *bp; mpoly_t *p, *bp;
mvtx_t *v;
int i; int i;
struct { struct {
@ -131,6 +130,8 @@ EmitWaterPolys(msurface_t *fa, image_t *texture, float *modelMatrix,
for (bp = fa->polys; bp; bp = bp->next) for (bp = fa->polys; bp; bp = bp->next)
{ {
mvtx_t *v;
p = bp; p = bp;
if (Mesh_VertsRealloc(p->numverts)) if (Mesh_VertsRealloc(p->numverts))

View file

@ -4,6 +4,8 @@
layout(location = 0) in vec3 inVertex; layout(location = 0) in vec3 inVertex;
layout(location = 1) in vec2 inTexCoord; layout(location = 1) in vec2 inTexCoord;
layout(location = 2) in vec2 inTexCoordLmap; layout(location = 2) in vec2 inTexCoordLmap;
layout(location = 3) in vec3 inNormal;
layout(location = 4) in int inFlags;
layout(push_constant) uniform PushConstant layout(push_constant) uniform PushConstant
{ {