1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 04:24:11 +01:00

[dxvk] Add new vertex and geometry shaders for fullscreen passes

These new shaders are aimed to be used by all meta operations
and will work without geometry shaders on supported hardware.
This commit is contained in:
Philip Rebohle 2019-07-18 18:12:40 +02:00
parent 92d6f26130
commit 07408bcdcc
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 52 additions and 0 deletions

View File

@ -24,6 +24,10 @@ dxvk_shaders = files([
'shaders/dxvk_copy_depth_stencil_2d.frag',
'shaders/dxvk_copy_depth_stencil_ms.frag',
'shaders/dxvk_fullscreen_geom.geom',
'shaders/dxvk_fullscreen_vert.vert',
'shaders/dxvk_fullscreen_layer_vert.vert',
'shaders/dxvk_mipgen_vert.vert',
'shaders/dxvk_mipgen_geom.geom',
'shaders/dxvk_mipgen_frag_1d.frag',

View File

@ -0,0 +1,19 @@
#version 450
layout(triangles) in;
layout(triangle_strip, max_vertices = 3) out;
layout(location = 0) in int i_instance[3];
layout(location = 1) in vec2 i_texcoord[3];
layout(location = 0) out vec2 o_texcoord;
void main() {
for (int i = 0; i < 3; i++) {
o_texcoord = i_texcoord[i];
gl_Layer = i_instance[i];
gl_Position = gl_in[i].gl_Position;
EmitVertex();
}
EndPrimitive();
}

View File

@ -0,0 +1,15 @@
#version 450
#extension GL_ARB_shader_viewport_layer_array : enable
layout(location = 0) out vec2 o_texcoord;
void main() {
vec2 coord = vec2(
float(gl_VertexIndex & 2),
float(gl_VertexIndex & 1) * 2.0f);
o_texcoord = coord;
gl_Layer = gl_InstanceIndex;
gl_Position = vec4(-1.0f + 2.0f * coord, 0.0f, 1.0f);
}

View File

@ -0,0 +1,14 @@
#version 450
layout(location = 0) out int o_instance;
layout(location = 1) out vec2 o_texcoord;
void main() {
vec2 coord = vec2(
float(gl_VertexIndex & 2),
float(gl_VertexIndex & 1) * 2.0f);
o_instance = gl_InstanceIndex;
o_texcoord = coord;
gl_Position = vec4(-1.0f + 2.0f * coord, 0.0f, 1.0f);
}