Make gl_Position(-1, -1) map to texel (0, 0) of the render target

There was a lot of missing around with viewports and flip the Y
coordinate in vertex shaders before. Turns out things are simpler than
we thought: *all* APIs have gl_Position(-1, -1) map to texel (0, 0). It
is just the present coordinate system that changes.

Remove some of the hacks we had to work around non-existent viewport
issues and fix tests.
This commit is contained in:
Corentin Wallez
2018-01-12 14:50:33 -05:00
committed by Corentin Wallez
parent d0d6e5cd20
commit 47155a3555
5 changed files with 18 additions and 18 deletions

View File

@@ -23,7 +23,6 @@ namespace backend { namespace d3d12 {
spirv_cross::CompilerHLSL compiler(builder->AcquireSpirv());
spirv_cross::CompilerGLSL::Options options_glsl;
options_glsl.vertex.flip_vert_y = false;
options_glsl.vertex.fixup_clipspace = true;
compiler.spirv_cross::CompilerGLSL::set_options(options_glsl);

View File

@@ -56,7 +56,6 @@ namespace backend { namespace opengl {
#else
options.version = 440;
#endif
options.vertex.flip_vert_y = true;
compiler.set_options(options);
// Rename the push constant block to be prefixed with the shader stage type so that uniform