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:
parent
92d6f26130
commit
07408bcdcc
@ -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',
|
||||
|
19
src/dxvk/shaders/dxvk_fullscreen_geom.geom
Normal file
19
src/dxvk/shaders/dxvk_fullscreen_geom.geom
Normal 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();
|
||||
}
|
15
src/dxvk/shaders/dxvk_fullscreen_layer_vert.vert
Normal file
15
src/dxvk/shaders/dxvk_fullscreen_layer_vert.vert
Normal 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);
|
||||
}
|
14
src/dxvk/shaders/dxvk_fullscreen_vert.vert
Normal file
14
src/dxvk/shaders/dxvk_fullscreen_vert.vert
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user