-
Notifications
You must be signed in to change notification settings - Fork 907
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dxgi] Re-implement presentation shaders in GLSL
- Loading branch information
Showing
4 changed files
with
40 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#version 450 | ||
|
||
layout(binding = 0) uniform sampler s_sampler; | ||
layout(binding = 1) uniform texture2D t_texture; | ||
|
||
layout(location = 0) in vec2 i_texcoord; | ||
layout(location = 0) out vec4 o_color; | ||
|
||
void main() { | ||
o_color = texture(sampler2D(t_texture, s_sampler), i_texcoord); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#version 450 | ||
|
||
const vec4 g_vpos[4] = { | ||
vec4(-1.0f, -1.0f, 0.0f, 1.0f), | ||
vec4(-1.0f, 1.0f, 0.0f, 1.0f), | ||
vec4( 1.0f, -1.0f, 0.0f, 1.0f), | ||
vec4( 1.0f, 1.0f, 0.0f, 1.0f), | ||
}; | ||
|
||
layout(location = 0) out vec2 o_texcoord; | ||
|
||
void main() { | ||
vec4 pos = g_vpos[gl_VertexIndex]; | ||
o_texcoord = 0.5f + 0.5f * pos.xy; | ||
gl_Position = pos; | ||
} |