Better viewport flipping and depth mode detection method (#1556)

* Use a better viewport flipping approach

* New approach to detect depth mode

* nit: Sort method on the OpenGL backend

* Adjust spacing on comment

* Unswap near and far parameters based on ScaleZ
This commit is contained in:
gdkchan
2020-09-19 19:46:49 -03:00
committed by GitHub
parent 4b1bed1b05
commit 1eea35554c
6 changed files with 101 additions and 136 deletions

View File

@ -64,22 +64,9 @@
return true;
}
public bool QuerySupportsViewportSwizzle()
{
return true;
}
public TextureFormat QueryTextureFormat(int handle)
{
return TextureFormat.R8G8B8A8Unorm;
}
public int QueryViewportSwizzle(int component)
{
// Bit 0: Negate flag.
// Bits 2-1: Component.
// Example: 0b110 = W, 0b111 = -W, 0b000 = X, 0b010 = Y etc.
return component << 1;
}
}
}