app/internal/d3d11: add Direct3D backend

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-15 19:26:16 +01:00
parent d65bfdc275
commit e03b3cd808
10 changed files with 2431 additions and 44 deletions
+29 -29
View File
File diff suppressed because one or more lines are too long
+10
View File
@@ -7,15 +7,25 @@
// to be [0, 0, 1].
vec3[2] fboTextureTransform() {
vec3[2] t;
#ifdef HLSL
t[0] = vec3(1.0, 0.0, 0.0);
t[1] = vec3(0.0, -1.0, 1.0);
#else
t[0] = vec3(1.0, 0.0, 0.0);
t[1] = vec3(0.0, 1.0, 0.0);
#endif
return t;
}
// toClipSpace converts an OpenGL gl_Position value to a
// native GPU position.
vec4 toClipSpace(vec4 pos) {
#ifdef HLSL
// Map depths to the Direct3D [0; 1] range.
return vec4(pos.xy, (pos.z + pos.w)*.5, pos.w);
#else
return pos;
#endif
}
vec3 transform3x2(vec3[2] t, vec3 v) {