-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[d3d9] Implement presentation regions
- Loading branch information
Showing
5 changed files
with
119 additions
and
29 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
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,21 @@ | ||
#version 450 | ||
|
||
layout(constant_id = 1) const bool s_gamma_bound = true; | ||
|
||
layout(binding = 0) uniform sampler2D s_image; | ||
layout(binding = 1) uniform sampler1D s_gamma; | ||
|
||
layout(location = 0) in vec2 i_texcoord; | ||
layout(location = 0) out vec4 o_color; | ||
|
||
void main() { | ||
o_color = texture(s_image, i_texcoord); | ||
|
||
if (s_gamma_bound) { | ||
o_color = vec4( | ||
texture(s_gamma, o_color.r).r, | ||
texture(s_gamma, o_color.g).g, | ||
texture(s_gamma, o_color.b).b, | ||
o_color.a); | ||
} | ||
} |
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,21 @@ | ||
#version 450 | ||
|
||
layout(location = 0) out vec2 o_texcoord; | ||
|
||
layout(push_constant) uniform present_info_t { | ||
vec2 scale; | ||
vec2 offset; | ||
} u_presentInfo; | ||
|
||
void main() { | ||
vec2 coord = vec2( | ||
float(gl_VertexIndex & 2), | ||
float(gl_VertexIndex & 1) * 2.0f); | ||
|
||
gl_Position = vec4(-1.0f + 2.0f * coord, 0.0f, 1.0f); | ||
|
||
coord *= u_presentInfo.scale; | ||
coord += u_presentInfo.offset; | ||
|
||
o_texcoord = coord; | ||
} |