Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a RenderTest which writes custom values via gl_FragDepth.
- Loading branch information
Showing
9 changed files
with
93 additions
and
0 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
Binary file not shown.
Binary file not shown.
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,17 @@ | ||
#version 450 | ||
|
||
layout(location = 0) in vec2 fsin_UV; | ||
|
||
layout (set = 0, binding = 0) uniform FramebufferInfo | ||
{ | ||
vec4 OutputSize; | ||
}; | ||
|
||
void main() | ||
{ | ||
vec2 uv = gl_FragCoord.xy - vec2(0.5, 0.5); | ||
float xComp = uv.x; | ||
float yComp = uv.y * OutputSize.x; | ||
float val = (yComp + xComp) / (OutputSize.x * OutputSize.y); | ||
gl_FragDepth = val; | ||
} |
Binary file not shown.
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,12 @@ | ||
#version 450 | ||
|
||
layout(location = 0) out vec2 fsin_UV; | ||
|
||
void main() | ||
{ | ||
float x = -1.0 + float((gl_VertexIndex & 1) << 2); | ||
float y = -1.0 + float((gl_VertexIndex & 2) << 1); | ||
fsin_UV.x = (x + 1.0) * 0.5; | ||
fsin_UV.y = (y + 1.0) * 0.5; | ||
gl_Position = vec4(x, y, 0, 1); | ||
} |
Binary file not shown.
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