diff --git a/next.json b/next.json index e1c6d239ef..a5695889ba 100644 --- a/next.json +++ b/next.json @@ -1239,14 +1239,18 @@ "vertex format": { "category": "enum", "values": [ - {"value": 0, "name": "float r32 g32 b32 a32"}, - {"value": 1, "name": "float r32 g32 b32"}, - {"value": 2, "name": "float r32 g32"}, - {"value": 3, "name": "float r32"}, - {"value": 4, "name": "ushort r16 g16 b16 a16"}, - {"value": 5, "name": "ushort r16 g16"}, - {"value": 6, "name": "unorm r8 g8 b8 a8"}, - {"value": 7, "name": "unorm r8 g8"} + {"value": 0, "name": "float r32 g32 b32 a32"}, + {"value": 1, "name": "float r32 g32 b32"}, + {"value": 2, "name": "float r32 g32"}, + {"value": 3, "name": "float r32"}, + {"value": 4, "name": "int r32 g32 b32 a32"}, + {"value": 5, "name": "int r32 g32 b32"}, + {"value": 6, "name": "int r32 g32"}, + {"value": 7, "name": "int r32"}, + {"value": 8, "name": "ushort r16 g16 b16 a16"}, + {"value": 9, "name": "ushort r16 g16"}, + {"value": 10, "name": "unorm r8 g8 b8 a8"}, + {"value": 11, "name": "unorm r8 g8"} ] }, "void": { diff --git a/src/backend/InputState.cpp b/src/backend/InputState.cpp index e9ba1ad2bd..ec2f932752 100644 --- a/src/backend/InputState.cpp +++ b/src/backend/InputState.cpp @@ -35,16 +35,20 @@ namespace backend { uint32_t VertexFormatNumComponents(nxt::VertexFormat format) { switch (format) { case nxt::VertexFormat::FloatR32G32B32A32: + case nxt::VertexFormat::IntR32G32B32A32: case nxt::VertexFormat::UshortR16G16B16A16: case nxt::VertexFormat::UnormR8G8B8A8: return 4; case nxt::VertexFormat::FloatR32G32B32: + case nxt::VertexFormat::IntR32G32B32: return 3; case nxt::VertexFormat::FloatR32G32: + case nxt::VertexFormat::IntR32G32: case nxt::VertexFormat::UshortR16G16: case nxt::VertexFormat::UnormR8G8: return 2; case nxt::VertexFormat::FloatR32: + case nxt::VertexFormat::IntR32: return 1; default: UNREACHABLE(); @@ -58,6 +62,11 @@ namespace backend { case nxt::VertexFormat::FloatR32G32: case nxt::VertexFormat::FloatR32: return sizeof(float); + case nxt::VertexFormat::IntR32G32B32A32: + case nxt::VertexFormat::IntR32G32B32: + case nxt::VertexFormat::IntR32G32: + case nxt::VertexFormat::IntR32: + return sizeof(int32_t); case nxt::VertexFormat::UshortR16G16B16A16: case nxt::VertexFormat::UshortR16G16: return sizeof(uint16_t); diff --git a/src/backend/d3d12/InputStateD3D12.cpp b/src/backend/d3d12/InputStateD3D12.cpp index 8950c2b3c4..9341fc6df0 100644 --- a/src/backend/d3d12/InputStateD3D12.cpp +++ b/src/backend/d3d12/InputStateD3D12.cpp @@ -28,6 +28,14 @@ namespace backend { namespace d3d12 { return DXGI_FORMAT_R32G32_FLOAT; case nxt::VertexFormat::FloatR32: return DXGI_FORMAT_R32_FLOAT; + case nxt::VertexFormat::IntR32G32B32A32: + return DXGI_FORMAT_R32G32B32A32_SINT; + case nxt::VertexFormat::IntR32G32B32: + return DXGI_FORMAT_R32G32B32_SINT; + case nxt::VertexFormat::IntR32G32: + return DXGI_FORMAT_R32G32_SINT; + case nxt::VertexFormat::IntR32: + return DXGI_FORMAT_R32_SINT; case nxt::VertexFormat::UshortR16G16B16A16: return DXGI_FORMAT_R16G16B16A16_UINT; case nxt::VertexFormat::UshortR16G16: diff --git a/src/backend/metal/InputStateMTL.mm b/src/backend/metal/InputStateMTL.mm index 4b30ceabca..23c8f115db 100644 --- a/src/backend/metal/InputStateMTL.mm +++ b/src/backend/metal/InputStateMTL.mm @@ -30,6 +30,14 @@ namespace backend { namespace metal { return MTLVertexFormatFloat2; case nxt::VertexFormat::FloatR32: return MTLVertexFormatFloat; + case nxt::VertexFormat::IntR32G32B32A32: + return MTLVertexFormatInt4; + case nxt::VertexFormat::IntR32G32B32: + return MTLVertexFormatInt3; + case nxt::VertexFormat::IntR32G32: + return MTLVertexFormatInt2; + case nxt::VertexFormat::IntR32: + return MTLVertexFormatInt; case nxt::VertexFormat::UshortR16G16B16A16: return MTLVertexFormatUShort4; case nxt::VertexFormat::UshortR16G16: diff --git a/src/backend/opengl/CommandBufferGL.cpp b/src/backend/opengl/CommandBufferGL.cpp index a2c360a8d5..14cf7ec6df 100644 --- a/src/backend/opengl/CommandBufferGL.cpp +++ b/src/backend/opengl/CommandBufferGL.cpp @@ -49,6 +49,11 @@ namespace backend { namespace opengl { case nxt::VertexFormat::FloatR32G32: case nxt::VertexFormat::FloatR32: return GL_FLOAT; + case nxt::VertexFormat::IntR32G32B32A32: + case nxt::VertexFormat::IntR32G32B32: + case nxt::VertexFormat::IntR32G32: + case nxt::VertexFormat::IntR32: + return GL_INT; case nxt::VertexFormat::UshortR16G16B16A16: case nxt::VertexFormat::UshortR16G16: return GL_UNSIGNED_SHORT; diff --git a/src/backend/vulkan/InputStateVk.cpp b/src/backend/vulkan/InputStateVk.cpp index 9bbe973857..3efcb550f4 100644 --- a/src/backend/vulkan/InputStateVk.cpp +++ b/src/backend/vulkan/InputStateVk.cpp @@ -41,6 +41,14 @@ namespace backend { namespace vulkan { return VK_FORMAT_R32G32_SFLOAT; case nxt::VertexFormat::FloatR32: return VK_FORMAT_R32_SFLOAT; + case nxt::VertexFormat::IntR32G32B32A32: + return VK_FORMAT_R32G32B32A32_SINT; + case nxt::VertexFormat::IntR32G32B32: + return VK_FORMAT_R32G32B32_SINT; + case nxt::VertexFormat::IntR32G32: + return VK_FORMAT_R32G32_SINT; + case nxt::VertexFormat::IntR32: + return VK_FORMAT_R32_SINT; case nxt::VertexFormat::UshortR16G16B16A16: return VK_FORMAT_R16G16B16A16_UINT; case nxt::VertexFormat::UshortR16G16: