Create pipelines based on GLS_XXX state.
This commit is contained in:
parent
a45d37355e
commit
121afa2231
|
|
@ -9,8 +9,18 @@ layout(location = 2) in vec2 frag_tex_coord1;
|
|||
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
layout (constant_id = 0) const int alpha_test_func = 0;
|
||||
|
||||
void main() {
|
||||
vec4 color_a = frag_color * texture(texture0, frag_tex_coord0);
|
||||
vec4 color_b = texture(texture1, frag_tex_coord1);
|
||||
out_color = vec4(color_a.rgb + color_b.rgb, color_a.a * color_b.a);
|
||||
|
||||
if (alpha_test_func == 1) {
|
||||
if (out_color.a == 0.0f) discard;
|
||||
} else if (alpha_test_func == 2) {
|
||||
if (out_color.a >= 0.5f) discard;
|
||||
} else if (alpha_test_func == 3) {
|
||||
if (out_color.a < 0.5f) discard;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,16 @@ layout(location = 2) in vec2 frag_tex_coord1;
|
|||
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
layout (constant_id = 0) const int alpha_test_func = 0;
|
||||
|
||||
void main() {
|
||||
out_color = frag_color * texture(texture0, frag_tex_coord0) * texture(texture1, frag_tex_coord1);
|
||||
|
||||
if (alpha_test_func == 1) {
|
||||
if (out_color.a == 0.0f) discard;
|
||||
} else if (alpha_test_func == 2) {
|
||||
if (out_color.a >= 0.5f) discard;
|
||||
} else if (alpha_test_func == 3) {
|
||||
if (out_color.a < 0.5f) discard;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,16 @@ layout(location = 1) in vec2 frag_tex_coord;
|
|||
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
layout (constant_id = 0) const int alpha_test_func = 0;
|
||||
|
||||
void main() {
|
||||
out_color = frag_color * texture(texture0, frag_tex_coord);
|
||||
|
||||
if (alpha_test_func == 1) {
|
||||
if (out_color.a == 0.0f) discard;
|
||||
} else if (alpha_test_func == 2) {
|
||||
if (out_color.a >= 0.5f) discard;
|
||||
} else if (alpha_test_func == 3) {
|
||||
if (out_color.a < 0.5f) discard;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
unsigned char multi_texture_add_frag_spv[] = {
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, 0x32, 0x00, 0x00, 0x00,
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, 0x58, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
|
|
@ -17,70 +17,117 @@ unsigned char multi_texture_add_frag_spv[] = {
|
|||
0x19, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x31, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x06, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61, 0x67, 0x5F, 0x74, 0x65, 0x78,
|
||||
0x5F, 0x63, 0x6F, 0x6F, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, 0x05, 0x00, 0x1F, 0x00, 0x00, 0x00,
|
||||
0x6F, 0x75, 0x74, 0x5F, 0x63, 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x0B, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x1B, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x1F, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x0A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x0A, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00,
|
||||
0x0D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x1B, 0x00, 0x03, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x0F, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x0F, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x1E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x1E, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00,
|
||||
0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00,
|
||||
0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x0C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00,
|
||||
0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00,
|
||||
0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||
0x0E, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00,
|
||||
0x3E, 0x00, 0x03, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x27, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00,
|
||||
0x29, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x2C, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x2D, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
|
||||
0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x31, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
|
||||
0x2D, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00,
|
||||
0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
|
||||
0x6F, 0x75, 0x74, 0x5F, 0x63, 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00,
|
||||
0x33, 0x00, 0x00, 0x00, 0x61, 0x6C, 0x70, 0x68, 0x61, 0x5F, 0x74, 0x65, 0x73, 0x74, 0x5F, 0x66,
|
||||
0x75, 0x6E, 0x63, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00, 0x0E, 0x00, 0x00, 0x00,
|
||||
0x0D, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0E, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x28, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x35, 0x00, 0x00, 0x00, 0x34, 0x00, 0x06, 0x00,
|
||||
0x35, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00,
|
||||
0x34, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x39, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x32, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x34, 0x00, 0x06, 0x00, 0x35, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00,
|
||||
0xAA, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x2B, 0x00, 0x04, 0x00,
|
||||
0x32, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x34, 0x00, 0x06, 0x00,
|
||||
0x35, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00,
|
||||
0x4E, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||
0x0C, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x17, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00,
|
||||
0x1B, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00,
|
||||
0x1A, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x1D, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00, 0x20, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x4F, 0x00, 0x08, 0x00, 0x20, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x20, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x28, 0x00, 0x00, 0x00,
|
||||
0x29, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00,
|
||||
0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00,
|
||||
0x2C, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00,
|
||||
0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x2F, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x50, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00,
|
||||
0x2F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00,
|
||||
0x1F, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x38, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x36, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00,
|
||||
0x41, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x37, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00,
|
||||
0x39, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00,
|
||||
0xB4, 0x00, 0x05, 0x00, 0x35, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00,
|
||||
0x3C, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFA, 0x00, 0x04, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x3E, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x01, 0x00, 0xF8, 0x00, 0x02, 0x00,
|
||||
0x3F, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00,
|
||||
0x41, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFA, 0x00, 0x04, 0x00, 0x43, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x44, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x39, 0x00, 0x00, 0x00,
|
||||
0x46, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x05, 0x00,
|
||||
0x35, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00,
|
||||
0xF7, 0x00, 0x03, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00,
|
||||
0x49, 0x00, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00,
|
||||
0x4A, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x01, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x4B, 0x00, 0x00, 0x00,
|
||||
0xF9, 0x00, 0x02, 0x00, 0x45, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x4D, 0x00, 0x00, 0x00,
|
||||
0xF7, 0x00, 0x03, 0x00, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00,
|
||||
0x4F, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00,
|
||||
0x50, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x39, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00,
|
||||
0x1F, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x53, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0xB8, 0x00, 0x05, 0x00, 0x35, 0x00, 0x00, 0x00,
|
||||
0x54, 0x00, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00,
|
||||
0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x54, 0x00, 0x00, 0x00,
|
||||
0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x55, 0x00, 0x00, 0x00,
|
||||
0xFC, 0x00, 0x01, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x56, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||
0x51, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x51, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||
0x45, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x45, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||
0x38, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00,
|
||||
0x38, 0x00, 0x01, 0x00
|
||||
};
|
||||
long long multi_texture_add_frag_spv_size = 1320;
|
||||
long long multi_texture_add_frag_spv_size = 2068;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
unsigned char multi_texture_mul_frag_spv[] = {
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, 0x46, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
|
|
@ -15,44 +15,93 @@ unsigned char multi_texture_mul_frag_spv[] = {
|
|||
0x66, 0x72, 0x61, 0x67, 0x5F, 0x74, 0x65, 0x78, 0x5F, 0x63, 0x6F, 0x6F, 0x72, 0x64, 0x30, 0x00,
|
||||
0x05, 0x00, 0x05, 0x00, 0x18, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x31,
|
||||
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61, 0x67,
|
||||
0x5F, 0x74, 0x65, 0x78, 0x5F, 0x63, 0x6F, 0x6F, 0x72, 0x64, 0x31, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x0B, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x1A, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x0A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x0A, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00,
|
||||
0x0D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x1B, 0x00, 0x03, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x0F, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x0F, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x0C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00,
|
||||
0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00,
|
||||
0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x1B, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00,
|
||||
0x17, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x1D, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
|
||||
0x5F, 0x74, 0x65, 0x78, 0x5F, 0x63, 0x6F, 0x6F, 0x72, 0x64, 0x31, 0x00, 0x05, 0x00, 0x06, 0x00,
|
||||
0x1F, 0x00, 0x00, 0x00, 0x61, 0x6C, 0x70, 0x68, 0x61, 0x5F, 0x74, 0x65, 0x73, 0x74, 0x5F, 0x66,
|
||||
0x75, 0x6E, 0x63, 0x00, 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00, 0x0E, 0x00, 0x00, 0x00,
|
||||
0x0D, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0E, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x21, 0x00, 0x00, 0x00, 0x34, 0x00, 0x06, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x27, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x34, 0x00, 0x06, 0x00, 0x21, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00,
|
||||
0xAA, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x2B, 0x00, 0x04, 0x00,
|
||||
0x1E, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x34, 0x00, 0x06, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00,
|
||||
0x3C, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||
0x0C, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x1B, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x1C, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00,
|
||||
0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00,
|
||||
0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x23, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x23, 0x00, 0x00, 0x00,
|
||||
0x41, 0x00, 0x05, 0x00, 0x27, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x26, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00,
|
||||
0x29, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x2D, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00,
|
||||
0x2D, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x2C, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x01, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x2D, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x2F, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x33, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00,
|
||||
0x3B, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x32, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00,
|
||||
0x27, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
|
||||
0xBE, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00,
|
||||
0x36, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFA, 0x00, 0x04, 0x00, 0x37, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x01, 0x00, 0xF8, 0x00, 0x02, 0x00,
|
||||
0x39, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0x33, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00,
|
||||
0x3B, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFA, 0x00, 0x04, 0x00, 0x3D, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0x40, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xB8, 0x00, 0x05, 0x00,
|
||||
0x21, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00,
|
||||
0xF7, 0x00, 0x03, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00,
|
||||
0x42, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00,
|
||||
0x43, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x01, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x44, 0x00, 0x00, 0x00,
|
||||
0xF9, 0x00, 0x02, 0x00, 0x3F, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x3F, 0x00, 0x00, 0x00,
|
||||
0xF9, 0x00, 0x02, 0x00, 0x33, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x33, 0x00, 0x00, 0x00,
|
||||
0xF9, 0x00, 0x02, 0x00, 0x24, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
|
||||
};
|
||||
long long multi_texture_mul_frag_spv_size = 876;
|
||||
long long multi_texture_mul_frag_spv_size = 1656;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
unsigned char single_texture_frag_spv[] = {
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00, 0x40, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x06, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x4C, 0x53, 0x4C, 0x2E, 0x73, 0x74, 0x64, 0x2E, 0x34, 0x35, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
|
|
@ -12,35 +12,84 @@ unsigned char single_texture_frag_spv[] = {
|
|||
0x0B, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61, 0x67, 0x5F, 0x63, 0x6F, 0x6C, 0x6F, 0x72, 0x00, 0x00,
|
||||
0x05, 0x00, 0x05, 0x00, 0x10, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x14, 0x00, 0x00, 0x00, 0x66, 0x72, 0x61, 0x67,
|
||||
0x5F, 0x74, 0x65, 0x78, 0x5F, 0x63, 0x6F, 0x6F, 0x72, 0x64, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x0B, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x0A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x0A, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00,
|
||||
0x0D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x1B, 0x00, 0x03, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x0F, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x0C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00,
|
||||
0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x16, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00,
|
||||
0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00,
|
||||
0x38, 0x00, 0x01, 0x00
|
||||
0x5F, 0x74, 0x65, 0x78, 0x5F, 0x63, 0x6F, 0x6F, 0x72, 0x64, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x61, 0x6C, 0x70, 0x68, 0x61, 0x5F, 0x74, 0x65, 0x73, 0x74, 0x5F, 0x66,
|
||||
0x75, 0x6E, 0x63, 0x00, 0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x19, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x09, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00, 0x0E, 0x00, 0x00, 0x00,
|
||||
0x0D, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x0E, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x12, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x04, 0x00, 0x13, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x34, 0x00, 0x06, 0x00,
|
||||
0x1B, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x1A, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x34, 0x00, 0x06, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00,
|
||||
0xAA, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x04, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x2B, 0x00, 0x04, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x34, 0x00, 0x06, 0x00,
|
||||
0x1B, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00,
|
||||
0x36, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x3D, 0x00, 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
|
||||
0x0C, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x17, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFA, 0x00, 0x04, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x29, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x1D, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00,
|
||||
0x22, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x05, 0x00,
|
||||
0x1B, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0xF7, 0x00, 0x03, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00,
|
||||
0x25, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00,
|
||||
0x26, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x01, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x27, 0x00, 0x00, 0x00,
|
||||
0xF9, 0x00, 0x02, 0x00, 0x1E, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x29, 0x00, 0x00, 0x00,
|
||||
0xF7, 0x00, 0x03, 0x00, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00,
|
||||
0x2B, 0x00, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00,
|
||||
0x2C, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00,
|
||||
0x2F, 0x00, 0x00, 0x00, 0x2E, 0x00, 0x00, 0x00, 0xBE, 0x00, 0x05, 0x00, 0x1B, 0x00, 0x00, 0x00,
|
||||
0x31, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00,
|
||||
0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x31, 0x00, 0x00, 0x00,
|
||||
0x32, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x32, 0x00, 0x00, 0x00,
|
||||
0xFC, 0x00, 0x01, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x33, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00,
|
||||
0x2D, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x35, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00,
|
||||
0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x37, 0x00, 0x00, 0x00,
|
||||
0x38, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x38, 0x00, 0x00, 0x00,
|
||||
0x41, 0x00, 0x05, 0x00, 0x21, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00,
|
||||
0x3A, 0x00, 0x00, 0x00, 0xB8, 0x00, 0x05, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00,
|
||||
0x3B, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x03, 0x00, 0x3E, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xFA, 0x00, 0x04, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x00, 0x00,
|
||||
0x3E, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x02, 0x00, 0x3D, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x01, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x3E, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0x39, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x39, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0x2D, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x2D, 0x00, 0x00, 0x00, 0xF9, 0x00, 0x02, 0x00, 0x1E, 0x00, 0x00, 0x00,
|
||||
0xF8, 0x00, 0x02, 0x00, 0x1E, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
|
||||
|
||||
};
|
||||
long long single_texture_frag_spv_size = 676;
|
||||
long long single_texture_frag_spv_size = 1456;
|
||||
|
|
@ -1045,6 +1045,9 @@ void RE_Shutdown( qboolean destroyWindow ) {
|
|||
R_SyncRenderThread();
|
||||
R_ShutdownCommandBuffers();
|
||||
R_DeleteTextures();
|
||||
|
||||
// VULKAN
|
||||
vk_destroy_pipelines();
|
||||
}
|
||||
|
||||
R_DoneFreeType();
|
||||
|
|
|
|||
|
|
@ -53,12 +53,10 @@ long myftol( float f );
|
|||
// see QSORT_SHADERNUM_SHIFT
|
||||
#define MAX_SHADERS 16384
|
||||
|
||||
//#define MAX_SHADER_STATES 2048
|
||||
#define MAX_STATES_PER_SHADER 32
|
||||
#define MAX_STATE_NAME 32
|
||||
|
||||
// can't be increased without changing bit packing for drawsurfs
|
||||
|
||||
// VULKAN
|
||||
#define MAX_VK_PIPELINES 2048
|
||||
|
||||
typedef struct dlight_s {
|
||||
vec3_t origin;
|
||||
|
|
@ -324,6 +322,10 @@ typedef struct {
|
|||
acff_t adjustColorsForFog;
|
||||
|
||||
qboolean isDetail;
|
||||
|
||||
// VULKAN
|
||||
VkPipeline vk_pipeline = VK_NULL_HANDLE;
|
||||
|
||||
} shaderStage_t;
|
||||
|
||||
struct shaderCommands_s;
|
||||
|
|
@ -412,15 +414,6 @@ typedef struct shader_s {
|
|||
struct shader_s *next;
|
||||
} shader_t;
|
||||
|
||||
typedef struct shaderState_s {
|
||||
char shaderName[MAX_QPATH]; // name of shader this state belongs to
|
||||
char name[MAX_STATE_NAME]; // name of this state
|
||||
char stateShader[MAX_QPATH]; // shader this name invokes
|
||||
int cycleTime; // time this cycle lasts, <= 0 is forever
|
||||
shader_t *shader;
|
||||
} shaderState_t;
|
||||
|
||||
|
||||
// trRefdef_t holds everything that comes in refdef_t,
|
||||
// as well as the locally generated scene information
|
||||
typedef struct {
|
||||
|
|
@ -946,6 +939,11 @@ typedef struct {
|
|||
float sawToothTable[FUNCTABLE_SIZE];
|
||||
float inverseSawToothTable[FUNCTABLE_SIZE];
|
||||
float fogTable[FOG_TABLE_SIZE];
|
||||
|
||||
// VULKAN
|
||||
int vk_num_pipelines;
|
||||
Vk_Pipeline_Desc vk_pipeline_desc[MAX_VK_PIPELINES];
|
||||
VkPipeline vk_pipelines[MAX_VK_PIPELINES];
|
||||
} trGlobals_t;
|
||||
|
||||
extern backEndState_t backEnd;
|
||||
|
|
@ -1075,15 +1073,9 @@ extern cvar_t *r_saveFontData;
|
|||
float R_NoiseGet4f( float x, float y, float z, float t );
|
||||
void R_NoiseInit( void );
|
||||
|
||||
void R_SwapBuffers( int );
|
||||
|
||||
void R_RenderView( viewParms_t *parms );
|
||||
|
||||
void R_AddMD3Surfaces( trRefEntity_t *e );
|
||||
void R_AddNullModelSurfaces( trRefEntity_t *e );
|
||||
void R_AddBeamSurfaces( trRefEntity_t *e );
|
||||
void R_AddRailSurfaces( trRefEntity_t *e, qboolean isUnderwater );
|
||||
void R_AddLightningBoltSurfaces( trRefEntity_t *e );
|
||||
|
||||
void R_AddPolygonSurfaces( void );
|
||||
|
||||
|
|
|
|||
|
|
@ -817,7 +817,7 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
|
|||
DrawMultitextured( input, stage );
|
||||
|
||||
// VULKAN
|
||||
vulkan_demo->render_tess_multi(pStage->bundle[0].image[0], pStage->bundle[1].image[0]);
|
||||
vulkan_demo->render_tess_multi(pStage);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -838,7 +838,7 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
|
|||
R_DrawElements( input->numIndexes, input->indexes );
|
||||
|
||||
// VULKAN
|
||||
vulkan_demo->render_tess(pStage->bundle[0].image[0]);
|
||||
vulkan_demo->render_tess(pStage);
|
||||
}
|
||||
// allow skipping out to show just lightmaps during development
|
||||
if ( r_lightmap->integer && ( pStage->bundle[0].isLightmap || pStage->bundle[1].isLightmap ) )
|
||||
|
|
|
|||
|
|
@ -2161,6 +2161,26 @@ static shader_t *FinishShader( void ) {
|
|||
shader.sort = SS_FOG;
|
||||
}
|
||||
|
||||
// VULKAN
|
||||
Vk_Pipeline_Desc desc;
|
||||
desc.polygon_offset = (shader.polygonOffset == qtrue);
|
||||
|
||||
for (int i = 0; i < stage; i++) {
|
||||
shaderStage_t *pStage = &stages[i];
|
||||
desc.state_bits = pStage->stateBits;
|
||||
|
||||
if (pStage->bundle[1].image[0] == nullptr)
|
||||
desc.shader_type = Vk_Shader_Type::single_texture;
|
||||
else if (shader.multitextureEnv == GL_MODULATE)
|
||||
desc.shader_type = Vk_Shader_Type::multi_texture_mul;
|
||||
else if (shader.multitextureEnv == GL_ADD)
|
||||
desc.shader_type = Vk_Shader_Type::multi_texture_add;
|
||||
else
|
||||
ri.Error(ERR_DROP, "ERROR: could not determine vulkan shader type for shader '%s'\n", shader.name);
|
||||
|
||||
pStage->vk_pipeline = vk_find_pipeline(desc);
|
||||
}
|
||||
|
||||
return GeneratePermanentShader();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include "vk_demo.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
|
@ -420,3 +421,301 @@ void vk_update_cinematic_image(VkImage image, const Vk_Staging_Buffer& staging_b
|
|||
VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
|
||||
});
|
||||
}
|
||||
|
||||
static VkPipeline create_pipeline(const Vk_Pipeline_Desc& desc) {
|
||||
Shader_Module single_texture_vs(single_texture_vert_spv, single_texture_vert_spv_size);
|
||||
Shader_Module single_texture_fs(single_texture_frag_spv, single_texture_frag_spv_size);
|
||||
|
||||
Shader_Module multi_texture_vs(multi_texture_vert_spv, multi_texture_vert_spv_size);
|
||||
Shader_Module multi_texture_mul_fs(multi_texture_mul_frag_spv, multi_texture_mul_frag_spv_size);
|
||||
Shader_Module multi_texture_add_fs(multi_texture_add_frag_spv, multi_texture_add_frag_spv_size);
|
||||
|
||||
auto get_shader_stage_desc = [](VkShaderStageFlagBits stage, VkShaderModule shader_module, const char* entry) {
|
||||
VkPipelineShaderStageCreateInfo desc;
|
||||
desc.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
|
||||
desc.pNext = nullptr;
|
||||
desc.flags = 0;
|
||||
desc.stage = stage;
|
||||
desc.module = shader_module;
|
||||
desc.pName = entry;
|
||||
desc.pSpecializationInfo = nullptr;
|
||||
return desc;
|
||||
};
|
||||
|
||||
struct Specialization_Data {
|
||||
int32_t alpha_test_func;
|
||||
} specialization_data;
|
||||
|
||||
if ((desc.state_bits & GLS_ATEST_BITS) == 0)
|
||||
specialization_data.alpha_test_func = 0;
|
||||
else if (desc.state_bits & GLS_ATEST_GT_0)
|
||||
specialization_data.alpha_test_func = 1;
|
||||
else if (desc.state_bits & GLS_ATEST_LT_80)
|
||||
specialization_data.alpha_test_func = 2;
|
||||
else if (desc.state_bits & GLS_ATEST_GE_80)
|
||||
specialization_data.alpha_test_func = 3;
|
||||
else
|
||||
ri.Error(ERR_DROP, "create_pipeline: invalid alpha test state bits\n");
|
||||
|
||||
std::array<VkSpecializationMapEntry, 1> specialization_entries;
|
||||
specialization_entries[0].constantID = 0;
|
||||
specialization_entries[0].offset = offsetof(struct Specialization_Data, alpha_test_func);
|
||||
specialization_entries[0].size = sizeof(int32_t);
|
||||
|
||||
VkSpecializationInfo specialization_info;
|
||||
specialization_info.mapEntryCount = uint32_t(specialization_entries.size());
|
||||
specialization_info.pMapEntries = specialization_entries.data();
|
||||
specialization_info.dataSize = sizeof(Specialization_Data);
|
||||
specialization_info.pData = &specialization_data;
|
||||
|
||||
std::vector<VkPipelineShaderStageCreateInfo> shader_stages_state;
|
||||
|
||||
if (desc.shader_type == Vk_Shader_Type::single_texture) {
|
||||
shader_stages_state.push_back(get_shader_stage_desc(VK_SHADER_STAGE_VERTEX_BIT, single_texture_vs.handle, "main"));
|
||||
shader_stages_state.push_back(get_shader_stage_desc(VK_SHADER_STAGE_FRAGMENT_BIT, single_texture_fs.handle, "main"));
|
||||
} else if (desc.shader_type == Vk_Shader_Type::multi_texture_mul) {
|
||||
shader_stages_state.push_back(get_shader_stage_desc(VK_SHADER_STAGE_VERTEX_BIT, multi_texture_vs.handle, "main"));
|
||||
shader_stages_state.push_back(get_shader_stage_desc(VK_SHADER_STAGE_FRAGMENT_BIT, multi_texture_mul_fs.handle, "main"));
|
||||
} else if (desc.shader_type == Vk_Shader_Type::multi_texture_add) {
|
||||
shader_stages_state.push_back(get_shader_stage_desc(VK_SHADER_STAGE_VERTEX_BIT, multi_texture_vs.handle, "main"));
|
||||
shader_stages_state.push_back(get_shader_stage_desc(VK_SHADER_STAGE_FRAGMENT_BIT, multi_texture_add_fs.handle, "main"));
|
||||
}
|
||||
|
||||
if (desc.state_bits & GLS_ATEST_BITS)
|
||||
shader_stages_state.back().pSpecializationInfo = &specialization_info;
|
||||
|
||||
VkPipelineVertexInputStateCreateInfo vertex_input_state;
|
||||
vertex_input_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
|
||||
vertex_input_state.pNext = nullptr;
|
||||
vertex_input_state.flags = 0;
|
||||
auto bindings = Vertex::get_bindings();
|
||||
vertex_input_state.vertexBindingDescriptionCount = (uint32_t)bindings.size();
|
||||
vertex_input_state.pVertexBindingDescriptions = bindings.data();
|
||||
auto attribs = Vertex::get_attributes();
|
||||
vertex_input_state.vertexAttributeDescriptionCount = (uint32_t)attribs.size();
|
||||
vertex_input_state.pVertexAttributeDescriptions = attribs.data();
|
||||
|
||||
VkPipelineInputAssemblyStateCreateInfo input_assembly_state;
|
||||
input_assembly_state.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
|
||||
input_assembly_state.pNext = nullptr;
|
||||
input_assembly_state.flags = 0;
|
||||
input_assembly_state.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
|
||||
input_assembly_state.primitiveRestartEnable = VK_FALSE;
|
||||
|
||||
VkPipelineViewportStateCreateInfo viewport_state;
|
||||
viewport_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
|
||||
viewport_state.pNext = nullptr;
|
||||
viewport_state.flags = 0;
|
||||
viewport_state.viewportCount = 1;
|
||||
viewport_state.pViewports = nullptr; // dynamic viewport state
|
||||
viewport_state.scissorCount = 1;
|
||||
viewport_state.pScissors = nullptr; // dynamic scissor state
|
||||
|
||||
VkPipelineRasterizationStateCreateInfo rasterization_state;
|
||||
rasterization_state.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
||||
rasterization_state.pNext = nullptr;
|
||||
rasterization_state.flags = 0;
|
||||
rasterization_state.depthClampEnable = VK_FALSE;
|
||||
rasterization_state.rasterizerDiscardEnable = VK_FALSE;
|
||||
rasterization_state.polygonMode = (desc.state_bits & GLS_POLYMODE_LINE) ? VK_POLYGON_MODE_LINE : VK_POLYGON_MODE_FILL;
|
||||
rasterization_state.cullMode = VK_CULL_MODE_NONE/*VK_CULL_MODE_BACK_BIT*/;
|
||||
rasterization_state.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;
|
||||
rasterization_state.depthBiasEnable = desc.polygon_offset ? VK_TRUE : VK_FALSE;
|
||||
rasterization_state.depthBiasConstantFactor = 0.0f; // dynamic depth bias state
|
||||
rasterization_state.depthBiasClamp = 0.0f; // dynamic depth bias state
|
||||
rasterization_state.depthBiasSlopeFactor = 0.0f; // dynamic depth bias state
|
||||
rasterization_state.lineWidth = 1.0f;
|
||||
|
||||
VkPipelineMultisampleStateCreateInfo multisample_state;
|
||||
multisample_state.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
|
||||
multisample_state.pNext = nullptr;
|
||||
multisample_state.flags = 0;
|
||||
multisample_state.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
|
||||
multisample_state.sampleShadingEnable = VK_FALSE;
|
||||
multisample_state.minSampleShading = 1.0f;
|
||||
multisample_state.pSampleMask = nullptr;
|
||||
multisample_state.alphaToCoverageEnable = VK_FALSE;
|
||||
multisample_state.alphaToOneEnable = VK_FALSE;
|
||||
|
||||
VkPipelineDepthStencilStateCreateInfo depth_stencil_state;
|
||||
depth_stencil_state.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
|
||||
depth_stencil_state.pNext = nullptr;
|
||||
depth_stencil_state.flags = 0;
|
||||
depth_stencil_state.depthTestEnable = (desc.state_bits & GLS_DEPTHTEST_DISABLE) ? VK_FALSE : VK_TRUE;
|
||||
depth_stencil_state.depthWriteEnable = (desc.state_bits & GLS_DEPTHMASK_TRUE) ? VK_TRUE : VK_FALSE;
|
||||
depth_stencil_state.depthCompareOp = (desc.state_bits & GLS_DEPTHFUNC_EQUAL) ? VK_COMPARE_OP_EQUAL : VK_COMPARE_OP_LESS_OR_EQUAL;
|
||||
depth_stencil_state.depthBoundsTestEnable = VK_FALSE;
|
||||
depth_stencil_state.stencilTestEnable = VK_FALSE;
|
||||
depth_stencil_state.front = {};
|
||||
depth_stencil_state.back = {};
|
||||
depth_stencil_state.minDepthBounds = 0.0;
|
||||
depth_stencil_state.maxDepthBounds = 0.0;
|
||||
|
||||
VkPipelineColorBlendAttachmentState attachment_blend_state = {};
|
||||
attachment_blend_state.blendEnable = (desc.state_bits & (GLS_SRCBLEND_BITS | GLS_DSTBLEND_BITS)) ? VK_TRUE : VK_FALSE;
|
||||
attachment_blend_state.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
|
||||
|
||||
if (attachment_blend_state.blendEnable) {
|
||||
switch (desc.state_bits & GLS_SRCBLEND_BITS) {
|
||||
case GLS_SRCBLEND_ZERO:
|
||||
attachment_blend_state.srcColorBlendFactor = VK_BLEND_FACTOR_ZERO;
|
||||
break;
|
||||
case GLS_SRCBLEND_ONE:
|
||||
attachment_blend_state.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
||||
break;
|
||||
case GLS_SRCBLEND_DST_COLOR:
|
||||
attachment_blend_state.srcColorBlendFactor = VK_BLEND_FACTOR_DST_COLOR;
|
||||
break;
|
||||
case GLS_SRCBLEND_ONE_MINUS_DST_COLOR:
|
||||
attachment_blend_state.srcColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR;
|
||||
break;
|
||||
case GLS_SRCBLEND_SRC_ALPHA:
|
||||
attachment_blend_state.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
||||
break;
|
||||
case GLS_SRCBLEND_ONE_MINUS_SRC_ALPHA:
|
||||
attachment_blend_state.srcColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
|
||||
break;
|
||||
case GLS_SRCBLEND_DST_ALPHA:
|
||||
attachment_blend_state.srcColorBlendFactor = VK_BLEND_FACTOR_DST_ALPHA;
|
||||
break;
|
||||
case GLS_SRCBLEND_ONE_MINUS_DST_ALPHA:
|
||||
attachment_blend_state.srcColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA;
|
||||
break;
|
||||
case GLS_SRCBLEND_ALPHA_SATURATE:
|
||||
attachment_blend_state.srcColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA_SATURATE;
|
||||
break;
|
||||
default:
|
||||
ri.Error( ERR_DROP, "create_pipeline: invalid src blend state bits\n" );
|
||||
break;
|
||||
}
|
||||
switch (desc.state_bits & GLS_DSTBLEND_BITS) {
|
||||
case GLS_DSTBLEND_ZERO:
|
||||
attachment_blend_state.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO;
|
||||
break;
|
||||
case GLS_DSTBLEND_ONE:
|
||||
attachment_blend_state.dstColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
||||
break;
|
||||
case GLS_DSTBLEND_SRC_COLOR:
|
||||
attachment_blend_state.dstColorBlendFactor = VK_BLEND_FACTOR_SRC_COLOR;
|
||||
break;
|
||||
case GLS_DSTBLEND_ONE_MINUS_SRC_COLOR:
|
||||
attachment_blend_state.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR;
|
||||
break;
|
||||
case GLS_DSTBLEND_SRC_ALPHA:
|
||||
attachment_blend_state.dstColorBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
|
||||
break;
|
||||
case GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA:
|
||||
attachment_blend_state.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
|
||||
break;
|
||||
case GLS_DSTBLEND_DST_ALPHA:
|
||||
attachment_blend_state.dstColorBlendFactor = VK_BLEND_FACTOR_DST_ALPHA;
|
||||
break;
|
||||
case GLS_DSTBLEND_ONE_MINUS_DST_ALPHA:
|
||||
attachment_blend_state.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA;
|
||||
break;
|
||||
default:
|
||||
ri.Error( ERR_DROP, "create_pipeline: invalid dst blend state bits\n" );
|
||||
break;
|
||||
}
|
||||
|
||||
attachment_blend_state.srcAlphaBlendFactor = attachment_blend_state.srcColorBlendFactor;
|
||||
attachment_blend_state.dstAlphaBlendFactor = attachment_blend_state.dstColorBlendFactor;
|
||||
attachment_blend_state.colorBlendOp = VK_BLEND_OP_ADD;
|
||||
attachment_blend_state.alphaBlendOp = VK_BLEND_OP_ADD;
|
||||
}
|
||||
|
||||
VkPipelineColorBlendStateCreateInfo blend_state;
|
||||
blend_state.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
|
||||
blend_state.pNext = nullptr;
|
||||
blend_state.flags = 0;
|
||||
blend_state.logicOpEnable = VK_FALSE;
|
||||
blend_state.logicOp = VK_LOGIC_OP_COPY;
|
||||
blend_state.attachmentCount = 1;
|
||||
blend_state.pAttachments = &attachment_blend_state;
|
||||
blend_state.blendConstants[0] = 0.0f;
|
||||
blend_state.blendConstants[1] = 0.0f;
|
||||
blend_state.blendConstants[2] = 0.0f;
|
||||
blend_state.blendConstants[3] = 0.0f;
|
||||
|
||||
VkPipelineDynamicStateCreateInfo dynamic_state;
|
||||
dynamic_state.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
|
||||
dynamic_state.pNext = nullptr;
|
||||
dynamic_state.flags = 0;
|
||||
dynamic_state.dynamicStateCount = 3;
|
||||
VkDynamicState dynamic_state_array[3] = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR, VK_DYNAMIC_STATE_DEPTH_BIAS };
|
||||
dynamic_state.pDynamicStates = dynamic_state_array;
|
||||
|
||||
VkGraphicsPipelineCreateInfo create_info;
|
||||
create_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
|
||||
create_info.pNext = nullptr;
|
||||
create_info.flags = 0;
|
||||
create_info.stageCount = static_cast<uint32_t>(shader_stages_state.size());
|
||||
create_info.pStages = shader_stages_state.data();
|
||||
create_info.pVertexInputState = &vertex_input_state;
|
||||
create_info.pInputAssemblyState = &input_assembly_state;
|
||||
create_info.pTessellationState = nullptr;
|
||||
create_info.pViewportState = &viewport_state;
|
||||
create_info.pRasterizationState = &rasterization_state;
|
||||
create_info.pMultisampleState = &multisample_state;
|
||||
create_info.pDepthStencilState = &depth_stencil_state;
|
||||
create_info.pColorBlendState = &blend_state;
|
||||
create_info.pDynamicState = &dynamic_state;
|
||||
create_info.layout = vulkan_demo->pipeline_layout;
|
||||
create_info.renderPass = vulkan_demo->render_pass;
|
||||
create_info.subpass = 0;
|
||||
create_info.basePipelineHandle = VK_NULL_HANDLE;
|
||||
create_info.basePipelineIndex = -1;
|
||||
|
||||
VkPipeline pipeline;
|
||||
VkResult result = vkCreateGraphicsPipelines(get_device(), VK_NULL_HANDLE, 1, &create_info, nullptr, &pipeline);
|
||||
check_vk_result(result, "vkCreateGraphicsPipelines");
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
static float pipeline_create_time;
|
||||
|
||||
struct Timer {
|
||||
using Clock = std::chrono::high_resolution_clock;
|
||||
using Second = std::chrono::duration<float, std::ratio<1>>;
|
||||
|
||||
Clock::time_point start = Clock::now();
|
||||
float Elapsed_Seconds() const {
|
||||
const auto duration = Clock::now() - start;
|
||||
float seconds = std::chrono::duration_cast<Second>(duration).count();
|
||||
return seconds;
|
||||
}
|
||||
};
|
||||
|
||||
VkPipeline vk_find_pipeline(const Vk_Pipeline_Desc& desc) {
|
||||
for (int i = 0; i < tr.vk_num_pipelines; i++) {
|
||||
if (tr.vk_pipeline_desc[i] == desc) {
|
||||
return tr.vk_pipelines[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (tr.vk_num_pipelines == MAX_VK_PIPELINES) {
|
||||
ri.Error( ERR_DROP, "vk_find_pipeline: MAX_VK_PIPELINES hit\n");
|
||||
}
|
||||
|
||||
Timer t;
|
||||
VkPipeline pipeline = create_pipeline(desc);
|
||||
pipeline_create_time += t.Elapsed_Seconds();
|
||||
|
||||
tr.vk_pipeline_desc[tr.vk_num_pipelines] = desc;
|
||||
tr.vk_pipelines[tr.vk_num_pipelines] = pipeline;
|
||||
tr.vk_num_pipelines++;
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
void vk_destroy_pipelines() {
|
||||
for (int i = 0; i < tr.vk_num_pipelines; i++) {
|
||||
vkDestroyPipeline(get_device(), tr.vk_pipelines[i], nullptr);
|
||||
}
|
||||
|
||||
tr.vk_num_pipelines = 0;
|
||||
|
||||
Com_Memset(tr.vk_pipelines, 0, sizeof(tr.vk_pipelines));
|
||||
Com_Memset(tr.vk_pipeline_desc, 0, sizeof(tr.vk_pipeline_desc));
|
||||
|
||||
pipeline_create_time = 0.0f;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,29 @@ struct Vk_Staging_Buffer {
|
|||
VkImage vk_create_cinematic_image(int width, int height, Vk_Staging_Buffer& staging_buffer);
|
||||
void vk_update_cinematic_image(VkImage image, const Vk_Staging_Buffer& staging_buffer, int width, int height, const uint8_t* rgba_pixels);
|
||||
|
||||
// Pipelines.
|
||||
enum class Vk_Shader_Type {
|
||||
single_texture,
|
||||
multi_texture_mul,
|
||||
multi_texture_add
|
||||
};
|
||||
|
||||
struct Vk_Pipeline_Desc {
|
||||
Vk_Shader_Type shader_type;
|
||||
unsigned int state_bits; // GLS_XXX flags
|
||||
bool polygon_offset;
|
||||
|
||||
bool operator==(const Vk_Pipeline_Desc& other) const {
|
||||
return
|
||||
shader_type == other.shader_type &&
|
||||
state_bits == other.state_bits &&
|
||||
polygon_offset == other.polygon_offset;
|
||||
}
|
||||
};
|
||||
|
||||
VkPipeline vk_find_pipeline(const Vk_Pipeline_Desc& desc);
|
||||
void vk_destroy_pipelines();
|
||||
|
||||
// Shaders.
|
||||
extern unsigned char single_texture_vert_spv[];
|
||||
extern long long single_texture_vert_spv_size;
|
||||
|
|
|
|||
|
|
@ -6,10 +6,6 @@
|
|||
|
||||
#include "stb_image.h"
|
||||
|
||||
#include "glm/glm.hpp"
|
||||
#include "glm/gtc/matrix_transform.hpp"
|
||||
#include "glm/gtx/hash.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
|
|
@ -24,49 +20,6 @@ struct Uniform_Buffer_Object {
|
|||
glm::mat4 proj;
|
||||
};
|
||||
|
||||
struct Vertex {
|
||||
glm::vec3 pos;
|
||||
glm::vec4 color;
|
||||
glm::vec2 tex_coord;
|
||||
glm::vec2 tex_coord2;
|
||||
|
||||
static std::array<VkVertexInputBindingDescription, 1> get_bindings() {
|
||||
VkVertexInputBindingDescription binding_desc;
|
||||
binding_desc.binding = 0;
|
||||
binding_desc.stride = sizeof(Vertex);
|
||||
binding_desc.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
|
||||
return {binding_desc};
|
||||
}
|
||||
|
||||
static std::array<VkVertexInputAttributeDescription, 4> get_attributes() {
|
||||
VkVertexInputAttributeDescription position_attrib;
|
||||
position_attrib.location = 0;
|
||||
position_attrib.binding = 0;
|
||||
position_attrib.format = VK_FORMAT_R32G32B32_SFLOAT;
|
||||
position_attrib.offset = offsetof(struct Vertex, pos);
|
||||
|
||||
VkVertexInputAttributeDescription color_attrib;
|
||||
color_attrib.location = 1;
|
||||
color_attrib.binding = 0;
|
||||
color_attrib.format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
color_attrib.offset = offsetof(struct Vertex, color);
|
||||
|
||||
VkVertexInputAttributeDescription tex_coord_attrib;
|
||||
tex_coord_attrib.location = 2;
|
||||
tex_coord_attrib.binding = 0;
|
||||
tex_coord_attrib.format = VK_FORMAT_R32G32_SFLOAT;
|
||||
tex_coord_attrib.offset = offsetof(struct Vertex, tex_coord);
|
||||
|
||||
VkVertexInputAttributeDescription tex_coord2_attrib;
|
||||
tex_coord2_attrib.location = 3;
|
||||
tex_coord2_attrib.binding = 0;
|
||||
tex_coord2_attrib.format = VK_FORMAT_R32G32_SFLOAT;
|
||||
tex_coord2_attrib.offset = offsetof(struct Vertex, tex_coord2);
|
||||
|
||||
return {position_attrib, color_attrib, tex_coord_attrib, tex_coord2_attrib};
|
||||
}
|
||||
};
|
||||
|
||||
struct Model {
|
||||
std::vector<Vertex> vertices;
|
||||
std::vector<uint32_t> indices;
|
||||
|
|
@ -146,9 +99,6 @@ Vulkan_Demo::Vulkan_Demo(int window_width, int window_height)
|
|||
create_framebuffers();
|
||||
create_pipeline_layout();
|
||||
pipeline_2d = create_pipeline(false, false);
|
||||
pipeline_2d_multitexture = create_pipeline(false, true);
|
||||
pipeline_3d = create_pipeline(true, false);
|
||||
pipeline_3d_multitexture = create_pipeline(true, true);
|
||||
|
||||
upload_geometry();
|
||||
update_ubo_descriptor(descriptor_set);
|
||||
|
|
@ -584,9 +534,9 @@ VkPipeline Vulkan_Demo::create_pipeline(bool depth_test, bool multitexture) {
|
|||
viewport_state.pNext = nullptr;
|
||||
viewport_state.flags = 0;
|
||||
viewport_state.viewportCount = 1;
|
||||
viewport_state.pViewports = depth_test ? nullptr : &viewport;
|
||||
viewport_state.pViewports = &viewport;
|
||||
viewport_state.scissorCount = 1;
|
||||
viewport_state.pScissors = depth_test ? nullptr : &scissor;
|
||||
viewport_state.pScissors = &scissor;
|
||||
|
||||
VkPipelineRasterizationStateCreateInfo rasterization_state;
|
||||
rasterization_state.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
||||
|
|
@ -675,7 +625,7 @@ VkPipeline Vulkan_Demo::create_pipeline(bool depth_test, bool multitexture) {
|
|||
desc.pMultisampleState = &multisample_state;
|
||||
desc.pDepthStencilState = &depth_stencil_state;
|
||||
desc.pColorBlendState = &blend_state;
|
||||
desc.pDynamicState = depth_test ? &dynamic_state : nullptr;
|
||||
desc.pDynamicState = nullptr;
|
||||
desc.layout = pipeline_layout;
|
||||
desc.renderPass = render_pass;
|
||||
desc.subpass = 0;
|
||||
|
|
@ -873,7 +823,7 @@ void Vulkan_Demo::end_frame() {
|
|||
vkCmdEndRenderPass(command_buffer);
|
||||
}
|
||||
|
||||
void Vulkan_Demo::render_tess(const image_t* image) {
|
||||
void Vulkan_Demo::render_tess(const shaderStage_t* stage) {
|
||||
fprintf(logfile, "render_tess (vert %d, inds %d)\n", tess.numVertexes, tess.numIndexes);
|
||||
fflush(logfile);
|
||||
|
||||
|
|
@ -908,6 +858,8 @@ void Vulkan_Demo::render_tess(const image_t* image) {
|
|||
|
||||
VkDescriptorSet* set = &descriptor_set;
|
||||
VkDescriptorSet image_set;
|
||||
|
||||
image_t* image = stage->bundle[0].image[0];
|
||||
if (image != nullptr) {
|
||||
image_set = image_descriptor_sets[image];
|
||||
set = &image_set;
|
||||
|
|
@ -942,20 +894,21 @@ void Vulkan_Demo::render_tess(const image_t* image) {
|
|||
if (scissor.offset.y < 0) scissor.offset.y = 0; // receive such data from backEnd, so just adjust to valid value to prevent vulkan warnings
|
||||
scissor.extent = {(uint32_t)backEnd.viewParms.viewportWidth, (uint32_t)backEnd.viewParms.viewportHeight};
|
||||
}
|
||||
vkCmdSetViewport(command_buffer, 0, 1, &viewport);
|
||||
vkCmdSetScissor(command_buffer, 0, 1, &scissor);
|
||||
|
||||
if (!backEnd.projection2D) {
|
||||
vkCmdSetViewport(command_buffer, 0, 1, &viewport);
|
||||
vkCmdSetScissor(command_buffer, 0, 1, &scissor);
|
||||
if (tess.shader->polygonOffset) {
|
||||
vkCmdSetDepthBias(command_buffer, r_offsetUnits->value, 0.0f, r_offsetFactor->value);
|
||||
}
|
||||
|
||||
vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, backEnd.projection2D ? pipeline_2d : pipeline_3d);
|
||||
vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, stage->vk_pipeline);
|
||||
|
||||
vkCmdDrawIndexed(command_buffer, tess.numIndexes, 1, 0, 0, 0);
|
||||
tess_vertex_buffer_offset += tess.numVertexes * sizeof(Vertex);
|
||||
tess_index_buffer_offset += tess.numIndexes * sizeof(uint32_t);
|
||||
}
|
||||
|
||||
void Vulkan_Demo::render_tess_multi(const image_t* image, const image_t* image2) {
|
||||
void Vulkan_Demo::render_tess_multi(const shaderStage_t* stage) {
|
||||
fprintf(logfile, "render_tess_multi (vert %d, inds %d)\n", tess.numVertexes, tess.numIndexes);
|
||||
fflush(logfile);
|
||||
|
||||
|
|
@ -990,6 +943,8 @@ void Vulkan_Demo::render_tess_multi(const image_t* image, const image_t* image2)
|
|||
vkCmdBindVertexBuffers(command_buffer, 0, 1, &tess_vertex_buffer, &tess_vertex_buffer_offset);
|
||||
vkCmdBindIndexBuffer(command_buffer, tess_index_buffer, tess_index_buffer_offset, VK_INDEX_TYPE_UINT32);
|
||||
|
||||
image_t* image = stage->bundle[0].image[0];
|
||||
image_t* image2 = stage->bundle[1].image[0];
|
||||
auto images = std::make_pair(image, image2);
|
||||
auto it = multitexture_descriptor_sets.find(images);
|
||||
if (it == multitexture_descriptor_sets.cend()) {
|
||||
|
|
@ -1027,13 +982,14 @@ void Vulkan_Demo::render_tess_multi(const image_t* image, const image_t* image2)
|
|||
if (scissor.offset.y < 0) scissor.offset.y = 0; // receive such data from backEnd, so just adjust to valid value to prevent vulkan warnings
|
||||
scissor.extent = {(uint32_t)backEnd.viewParms.viewportWidth, (uint32_t)backEnd.viewParms.viewportHeight};
|
||||
}
|
||||
vkCmdSetViewport(command_buffer, 0, 1, &viewport);
|
||||
vkCmdSetScissor(command_buffer, 0, 1, &scissor);
|
||||
|
||||
if (!backEnd.projection2D) {
|
||||
vkCmdSetViewport(command_buffer, 0, 1, &viewport);
|
||||
vkCmdSetScissor(command_buffer, 0, 1, &scissor);
|
||||
if (tess.shader->polygonOffset) {
|
||||
vkCmdSetDepthBias(command_buffer, r_offsetUnits->value, 0.0f, r_offsetFactor->value);
|
||||
}
|
||||
|
||||
vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, backEnd.projection2D ? pipeline_2d_multitexture : pipeline_3d_multitexture);
|
||||
vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, stage->vk_pipeline);
|
||||
|
||||
vkCmdDrawIndexed(command_buffer, tess.numIndexes, 1, 0, 0, 0);
|
||||
tess_vertex_buffer_offset += tess.numVertexes * sizeof(Vertex);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,60 @@
|
|||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "vk.h"
|
||||
|
||||
#include "glm/glm.hpp"
|
||||
#include "glm/gtc/matrix_transform.hpp"
|
||||
#include "glm/gtx/hash.hpp"
|
||||
|
||||
#include "vk.h"
|
||||
#include "tr_local.h"
|
||||
|
||||
struct Vertex {
|
||||
glm::vec3 pos;
|
||||
glm::vec4 color;
|
||||
glm::vec2 tex_coord;
|
||||
glm::vec2 tex_coord2;
|
||||
|
||||
static std::array<VkVertexInputBindingDescription, 1> get_bindings() {
|
||||
VkVertexInputBindingDescription binding_desc;
|
||||
binding_desc.binding = 0;
|
||||
binding_desc.stride = sizeof(Vertex);
|
||||
binding_desc.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
|
||||
return {binding_desc};
|
||||
}
|
||||
|
||||
static std::array<VkVertexInputAttributeDescription, 4> get_attributes() {
|
||||
VkVertexInputAttributeDescription position_attrib;
|
||||
position_attrib.location = 0;
|
||||
position_attrib.binding = 0;
|
||||
position_attrib.format = VK_FORMAT_R32G32B32_SFLOAT;
|
||||
position_attrib.offset = offsetof(struct Vertex, pos);
|
||||
|
||||
VkVertexInputAttributeDescription color_attrib;
|
||||
color_attrib.location = 1;
|
||||
color_attrib.binding = 0;
|
||||
color_attrib.format = VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
color_attrib.offset = offsetof(struct Vertex, color);
|
||||
|
||||
VkVertexInputAttributeDescription tex_coord_attrib;
|
||||
tex_coord_attrib.location = 2;
|
||||
tex_coord_attrib.binding = 0;
|
||||
tex_coord_attrib.format = VK_FORMAT_R32G32_SFLOAT;
|
||||
tex_coord_attrib.offset = offsetof(struct Vertex, tex_coord);
|
||||
|
||||
VkVertexInputAttributeDescription tex_coord2_attrib;
|
||||
tex_coord2_attrib.location = 3;
|
||||
tex_coord2_attrib.binding = 0;
|
||||
tex_coord2_attrib.format = VK_FORMAT_R32G32_SFLOAT;
|
||||
tex_coord2_attrib.offset = offsetof(struct Vertex, tex_coord2);
|
||||
|
||||
return {position_attrib, color_attrib, tex_coord_attrib, tex_coord2_attrib};
|
||||
}
|
||||
};
|
||||
|
||||
class Vulkan_Demo {
|
||||
public:
|
||||
Vulkan_Demo(int window_width, int window_height);
|
||||
|
|
@ -14,8 +62,8 @@ public:
|
|||
|
||||
void begin_frame();
|
||||
void end_frame();
|
||||
void render_tess(const image_t* image);
|
||||
void render_tess_multi(const image_t* image, const image_t* image2);
|
||||
void render_tess(const shaderStage_t* stage);
|
||||
void render_tess_multi(const shaderStage_t* stage);
|
||||
void render_cinematic_frame();
|
||||
|
||||
public:
|
||||
|
|
@ -66,9 +114,6 @@ public:
|
|||
VkPipelineLayout pipeline_layout = VK_NULL_HANDLE;
|
||||
|
||||
VkPipeline pipeline_2d = VK_NULL_HANDLE;
|
||||
VkPipeline pipeline_2d_multitexture = VK_NULL_HANDLE;
|
||||
VkPipeline pipeline_3d = VK_NULL_HANDLE;
|
||||
VkPipeline pipeline_3d_multitexture = VK_NULL_HANDLE;
|
||||
|
||||
VkBuffer vertex_buffer = VK_NULL_HANDLE;
|
||||
VkBuffer index_buffer = VK_NULL_HANDLE;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user