diff --git a/next.json b/next.json index 27eb7da52b..f6b6ae75e1 100644 --- a/next.json +++ b/next.json @@ -1244,7 +1244,8 @@ {"value": 2, "name": "float r32 g32"}, {"value": 3, "name": "float r32"}, {"value": 4, "name": "unorm r8 g8 b8 a8"}, - {"value": 5, "name": "unorm r8 g8"} + {"value": 5, "name": "unorm r8 g8"}, + {"value": 6, "name": "ushort r16 g16"} ] }, "void": { diff --git a/src/backend/InputState.cpp b/src/backend/InputState.cpp index 4e0b31b34f..c44172f479 100644 --- a/src/backend/InputState.cpp +++ b/src/backend/InputState.cpp @@ -44,6 +44,8 @@ namespace backend { return 2; case nxt::VertexFormat::FloatR32: return 1; + case nxt::VertexFormat::UshortR16G16: + return 2; default: UNREACHABLE(); } @@ -59,6 +61,8 @@ namespace backend { case nxt::VertexFormat::UnormR8G8B8A8: case nxt::VertexFormat::UnormR8G8: return sizeof(uint8_t); + case nxt::VertexFormat::UshortR16G16: + return sizeof(unsigned short); default: UNREACHABLE(); } diff --git a/src/backend/d3d12/InputStateD3D12.cpp b/src/backend/d3d12/InputStateD3D12.cpp index 0d5d9f4c82..d2ebfc99a6 100644 --- a/src/backend/d3d12/InputStateD3D12.cpp +++ b/src/backend/d3d12/InputStateD3D12.cpp @@ -28,6 +28,8 @@ namespace backend { namespace d3d12 { return DXGI_FORMAT_R32G32_FLOAT; case nxt::VertexFormat::FloatR32: return DXGI_FORMAT_R32_FLOAT; + case nxt::VertexFormat::UshortR16G16: + return DXGI_FORMAT_R16G16_UINT; case nxt::VertexFormat::UnormR8G8B8A8: return DXGI_FORMAT_R8G8B8A8_UNORM; case nxt::VertexFormat::UnormR8G8: diff --git a/src/backend/metal/InputStateMTL.mm b/src/backend/metal/InputStateMTL.mm index 061903dec2..6ef9cde7cf 100644 --- a/src/backend/metal/InputStateMTL.mm +++ b/src/backend/metal/InputStateMTL.mm @@ -30,6 +30,8 @@ namespace backend { namespace metal { return MTLVertexFormatFloat2; case nxt::VertexFormat::FloatR32: return MTLVertexFormatFloat; + case nxt::VertexFormat::UshortR16G16: + return MTLVertexFormatUShort2; case nxt::VertexFormat::UnormR8G8B8A8: return MTLVertexFormatUChar4Normalized; case nxt::VertexFormat::UnormR8G8: diff --git a/src/backend/opengl/CommandBufferGL.cpp b/src/backend/opengl/CommandBufferGL.cpp index 5f361d29bd..2a9f01e5fc 100644 --- a/src/backend/opengl/CommandBufferGL.cpp +++ b/src/backend/opengl/CommandBufferGL.cpp @@ -49,6 +49,8 @@ namespace backend { namespace opengl { case nxt::VertexFormat::FloatR32G32: case nxt::VertexFormat::FloatR32: return GL_FLOAT; + case nxt::VertexFormat::UshortR16G16: + return GL_UNSIGNED_SHORT; case nxt::VertexFormat::UnormR8G8B8A8: case nxt::VertexFormat::UnormR8G8: return GL_UNSIGNED_BYTE; @@ -63,6 +65,7 @@ namespace backend { namespace opengl { case nxt::VertexFormat::FloatR32G32B32: case nxt::VertexFormat::FloatR32G32: case nxt::VertexFormat::FloatR32: + case nxt::VertexFormat::UshortR16G16: return GL_FALSE; case nxt::VertexFormat::UnormR8G8B8A8: case nxt::VertexFormat::UnormR8G8: