gamma calculation in shaders

This commit is contained in:
Denis Pauk 2020-05-09 18:16:43 +03:00 committed by Yamagi
parent a69c97f046
commit 2e5c5974d6
29 changed files with 158 additions and 75 deletions

View file

@ -190,7 +190,6 @@ extern int registration_sequence;
extern qvksampler_t vk_current_sampler;
extern qvksampler_t vk_current_lmap_sampler;
qboolean R_Init( void );
void R_Shutdown( void );
void Vk_ScreenShot_f (void);

View file

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

View file

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

View file

@ -1,33 +1,51 @@
// 7.12.3352
// 8.13.3559
#pragma once
const uint32_t basic_frag_spv[] = {
0x07230203,0x00010000,0x00080007,0x00000025,0x00000000,0x00020011,0x00000001,0x0006000b,
0x07230203,0x00010000,0x00080008,0x00000039,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
0x0000001e,0x65725461,0x6c6f6873,0x00000064,0x00060005,0x00000029,0x68737550,0x736e6f43,
0x746e6174,0x00000000,0x00060006,0x00000029,0x00000000,0x614d7076,0x78697274,0x00000000,
0x00050006,0x00000029,0x00000001,0x6d6d6167,0x00000061,0x00030005,0x0000002b,0x00006370,
0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x00000022,0x00000000,
0x00040047,0x0000000d,0x00000021,0x00000000,0x00040047,0x00000011,0x0000001e,0x00000000,
0x00040047,0x00000015,0x0000001e,0x00000001,0x00040047,0x0000001e,0x0000001e,0x00000002,
0x00040048,0x00000029,0x00000000,0x00000005,0x00050048,0x00000029,0x00000000,0x00000023,
0x00000000,0x00050048,0x00000029,0x00000000,0x00000007,0x00000010,0x00050048,0x00000029,
0x00000001,0x00000023,0x00000040,0x00030047,0x00000029,0x00000002,0x00020013,0x00000002,
0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,
0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007,0x0004003b,0x00000008,
0x00000009,0x00000003,0x00090019,0x0000000a,0x00000006,0x00000001,0x00000000,0x00000000,
0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a,0x00040020,0x0000000c,
0x00000000,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000000,0x00040017,0x0000000f,
0x00000006,0x00000002,0x00040020,0x00000010,0x00000001,0x0000000f,0x0004003b,0x00000010,
0x00000011,0x00000001,0x00040020,0x00000014,0x00000001,0x00000007,0x0004003b,0x00000014,
0x00000015,0x00000001,0x00040015,0x00000018,0x00000020,0x00000000,0x0004002b,0x00000018,
0x00000019,0x00000003,0x00040020,0x0000001a,0x00000003,0x00000006,0x00040020,0x0000001d,
0x00000001,0x00000006,0x0004003b,0x0000001d,0x0000001e,0x00000001,0x00020014,0x00000020,
0x00040017,0x00000025,0x00000006,0x00000003,0x00040018,0x00000028,0x00000007,0x00000004,
0x0004001e,0x00000029,0x00000028,0x00000006,0x00040020,0x0000002a,0x00000009,0x00000029,
0x0004003b,0x0000002a,0x0000002b,0x00000009,0x00040015,0x0000002c,0x00000020,0x00000001,
0x0004002b,0x0000002c,0x0000002d,0x00000001,0x00040020,0x0000002e,0x00000009,0x00000006,
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,
0x0000000b,0x0000000e,0x0000000d,0x0004003d,0x0000000f,0x00000012,0x00000011,0x00050057,
0x00000007,0x00000013,0x0000000e,0x00000012,0x0004003d,0x00000007,0x00000016,0x00000015,
0x00050085,0x00000007,0x00000017,0x00000013,0x00000016,0x0003003e,0x00000009,0x00000017,
0x00050041,0x0000001a,0x0000001b,0x00000009,0x00000019,0x0004003d,0x00000006,0x0000001c,
0x0000001b,0x0004003d,0x00000006,0x0000001f,0x0000001e,0x000500b8,0x00000020,0x00000021,
0x0000001c,0x0000001f,0x000300f7,0x00000023,0x00000000,0x000400fa,0x00000021,0x00000022,
0x00000023,0x000200f8,0x00000022,0x000100fc,0x000200f8,0x00000023,0x0004003d,0x00000007,
0x00000026,0x00000009,0x0008004f,0x00000025,0x00000027,0x00000026,0x00000026,0x00000000,
0x00000001,0x00000002,0x00050041,0x0000002e,0x0000002f,0x0000002b,0x0000002d,0x0004003d,
0x00000006,0x00000030,0x0000002f,0x00060050,0x00000025,0x00000031,0x00000030,0x00000030,
0x00000030,0x0007000c,0x00000025,0x00000032,0x00000001,0x0000001a,0x00000027,0x00000031,
0x00050041,0x0000001a,0x00000033,0x00000009,0x00000019,0x0004003d,0x00000006,0x00000034,
0x00000033,0x00050051,0x00000006,0x00000035,0x00000032,0x00000000,0x00050051,0x00000006,
0x00000036,0x00000032,0x00000001,0x00050051,0x00000006,0x00000037,0x00000032,0x00000002,
0x00070050,0x00000007,0x00000038,0x00000035,0x00000036,0x00000037,0x00000034,0x0003003e,
0x00000009,0x00000038,0x000100fd,0x00010038
};

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
// 7.12.3352
// 8.13.3559
#pragma once
const uint32_t polygon_lmap_vert_spv[] = {
0x07230203,0x00010000,0x00080007,0x00000036,0x00000000,0x00020011,0x00000001,0x0006000b,
0x07230203,0x00010000,0x00080008,0x00000036,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000a,0x0000001d,0x00000029,
0x0000002b,0x0000002d,0x0000002e,0x00000031,0x00030003,0x00000002,0x000001c2,0x00090004,

View file

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

View file

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

View file

@ -1,7 +1,7 @@
// 7.12.3352
// 8.13.3559
#pragma once
const uint32_t postprocess_frag_spv[] = {
0x07230203,0x00010000,0x00080007,0x00000033,0x00000000,0x00020011,0x00000001,0x0006000b,
0x07230203,0x00010000,0x00080008,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,

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
// 7.12.3352
// 8.13.3559
#pragma once
const uint32_t world_warp_frag_spv[] = {
0x07230203,0x00010000,0x00080007,0x00000078,0x00000000,0x00020011,0x00000001,0x0006000b,
0x07230203,0x00010000,0x00080008,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,

View file

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

View file

@ -2368,6 +2368,14 @@ void QVk_DrawTexRect(const float *ubo, VkDeviceSize uboSize, qvktexture_t *textu
QVk_BindPipeline(&vk_drawTexQuadPipeline);
VkDeviceSize offsets = 0;
VkDescriptorSet descriptorSets[] = { texture->descriptorSet, uboDescriptorSet };
float fragment_constants[17] = {0};
memcpy(fragment_constants, r_viewproj_matrix, sizeof(r_viewproj_matrix));
fragment_constants[16] = 2.1F - vid_gamma->value;
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawTexQuadPipeline.layout,
VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragment_constants), &fragment_constants);
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawTexQuadPipeline.layout, 0, 2, descriptorSets, 1, &uboOffset);
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1,
&vk_texRectVbo.resource.buffer, &offsets);

View file

@ -220,7 +220,8 @@ void R_DrawSpriteModel (entity_t *e)
spriteQuad[2][0], spriteQuad[2][1], spriteQuad[2][2], 1.f, 0.f,
spriteQuad[3][0], spriteQuad[3][1], spriteQuad[3][2], 1.f, 1.f };
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawSpritePipeline.layout, VK_SHADER_STAGE_VERTEX_BIT, sizeof(r_viewproj_matrix), sizeof(float), &alpha);
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawSpritePipeline.layout,
VK_SHADER_STAGE_VERTEX_BIT, sizeof(r_viewproj_matrix), sizeof(float), &alpha);
QVk_BindPipeline(&vk_drawSpritePipeline);
VkBuffer vbo;
@ -229,6 +230,14 @@ void R_DrawSpriteModel (entity_t *e)
memcpy(vertData, quadVerts, sizeof(quadVerts));
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
float fragment_constants[17] = {0};
memcpy(fragment_constants, r_viewproj_matrix, sizeof(r_viewproj_matrix));
fragment_constants[16] = 2.1F - vid_gamma->value;
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawSpritePipeline.layout,
VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragment_constants), &fragment_constants);
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawSpritePipeline.layout, 0, 1, &currentmodel->skins[e->frame]->vk_texture.descriptorSet, 0, NULL);
vkCmdDraw(vk_activeCmdbuffer, 6, 1, 0, 0);
}
@ -486,6 +495,13 @@ void Vk_DrawParticles(int num_particles, const particle_t particles[], const uns
uint8_t *vertData = QVk_GetVertexBuffer((currentvertex - visibleParticles) * sizeof(pvertex), &vbo, &vboOffset);
memcpy(vertData, &visibleParticles, (currentvertex - visibleParticles) * sizeof(pvertex));
float fragment_constants[17] = {0};
memcpy(fragment_constants, r_viewproj_matrix, sizeof(r_viewproj_matrix));
fragment_constants[16] = 2.1F - vid_gamma->value;
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawParticlesPipeline.layout,
VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragment_constants), &fragment_constants);
if (particle_square)
{
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
@ -498,6 +514,7 @@ void Vk_DrawParticles(int num_particles, const particle_t particles[], const uns
vk_drawParticlesPipeline.layout, 0, 1,
&r_particletexture->vk_texture.descriptorSet, 0, NULL);
}
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdDraw(vk_activeCmdbuffer, (currentvertex - visibleParticles), 1, 0, 0);
}
@ -1231,7 +1248,7 @@ static SDL_Window *window = NULL;
R_Init
===============
*/
qboolean R_Init( void )
static qboolean R_Init( void )
{
R_Printf(PRINT_ALL, "Refresh: " REF_VERSION "\n");

View file

@ -132,6 +132,14 @@ static void DrawVkPoly (vkpoly_t *p, image_t *texture, float *color)
memcpy(uboData, color, sizeof(float) * 4);
VkDescriptorSet descriptorSets[] = { texture->vk_texture.descriptorSet, uboDescriptorSet };
float fragment_constants[17] = {0};
memcpy(fragment_constants, r_viewproj_matrix, sizeof(r_viewproj_matrix));
fragment_constants[16] = 2.1F - vid_gamma->value;
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawPolyPipeline.layout,
VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragment_constants), &fragment_constants);
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawPolyPipeline.layout, 0, 2, descriptorSets, 1, &uboOffset);
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo((p->numverts - 2) * 3), 0, VK_INDEX_TYPE_UINT16);
@ -187,6 +195,14 @@ static void DrawVkFlowingPoly (msurface_t *fa, image_t *texture, float *color)
memcpy(uboData, color, sizeof(float) * 4);
VkDescriptorSet descriptorSets[] = { texture->vk_texture.descriptorSet, uboDescriptorSet };
float fragment_constants[17] = {0};
memcpy(fragment_constants, r_viewproj_matrix, sizeof(r_viewproj_matrix));
fragment_constants[16] = 2.1F - vid_gamma->value;
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawPolyPipeline.layout,
VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragment_constants), &fragment_constants);
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawPolyPipeline.layout, 0, 2, descriptorSets, 1, &uboOffset);
vkCmdBindVertexBuffers(vk_activeCmdbuffer, 0, 1, &vbo, &vboOffset);
vkCmdBindIndexBuffer(vk_activeCmdbuffer, QVk_GetTriangleFanIbo((p->numverts - 2) * 3), 0, VK_INDEX_TYPE_UINT16);

View file

@ -251,6 +251,14 @@ void EmitWaterPolys (msurface_t *fa, image_t *texture, float *modelMatrix, float
VkBuffer vbo;
VkDeviceSize vboOffset;
VkDescriptorSet descriptorSets[] = { texture->vk_texture.descriptorSet, uboDescriptorSet };
float fragment_constants[17] = {0};
memcpy(fragment_constants, r_viewproj_matrix, sizeof(r_viewproj_matrix));
fragment_constants[16] = 2.1F - vid_gamma->value;
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawPolyWarpPipeline.layout,
VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragment_constants), &fragment_constants);
vkCmdBindDescriptorSets(vk_activeCmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, vk_drawPolyWarpPipeline.layout, 0, 2, descriptorSets, 1, &uboOffset);
for (bp = fa->polys; bp; bp = bp->next)
@ -640,7 +648,16 @@ void R_DrawSkyBox (void)
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);
float fragment_constants[17] = {0};
memcpy(fragment_constants, r_viewproj_matrix, sizeof(r_viewproj_matrix));
fragment_constants[16] = 2.1F - vid_gamma->value;
vkCmdPushConstants(vk_activeCmdbuffer, vk_drawSkyboxPipeline.layout,
VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(fragment_constants), &fragment_constants);
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);
}

View file

@ -1,5 +1,11 @@
#version 450
layout(push_constant) uniform PushConstant
{
mat4 vpMatrix;
float gamma;
} pc;
layout(set = 0, binding = 0) uniform sampler2D sTexture;
layout(location = 0) in vec2 texCoord;
@ -10,7 +16,9 @@ layout(location = 0) out vec4 fragmentColor;
void main()
{
fragmentColor = texture(sTexture, texCoord) * color;
if(fragmentColor.a < aTreshold)
discard;
fragmentColor = texture(sTexture, texCoord) * color;
if(fragmentColor.a < aTreshold)
discard;
fragmentColor = vec4(pow(fragmentColor.rgb, vec3(pc.gamma)), fragmentColor.a);
}