mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-12 14:46:08 +00:00
Add support for ushort2 vertex format.
Also fix some vertex format computations.
This commit is contained in:
committed by
Corentin Wallez
parent
ceec97978e
commit
0b1fbd9322
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user