Implement unorm_rgba8 and unorm_rg8 vertex formats.

Backend support implemented in GL, Metal and D3D12.
Support for unorm values in the GL backend requires a
utility function to indicate if the format's components
are normalized.

Note that unorm_r8 is only supported on more recent MacOS SDKs (10.13),
so it's omitted for now.
This commit is contained in:
Stephen White
2018-02-04 08:49:43 -05:00
committed by Corentin Wallez
parent 33dfd0a78f
commit 8d742d1375
7 changed files with 45 additions and 4 deletions

View File

@@ -44,10 +44,12 @@ class InputStateTest : public NXTTest {
EXPECT_TRUE(component >= 0 && component < 4);
switch (format) {
case VertexFormat::FloatR32G32B32A32:
case VertexFormat::UnormR8G8B8A8:
return component >= 4;
case VertexFormat::FloatR32G32B32:
return component >= 3;
case VertexFormat::FloatR32G32:
case VertexFormat::UnormR8G8:
return component >= 2;
case VertexFormat::FloatR32:
return component >= 1;