|
@@ -687,9 +687,15 @@ bool ImGui_ImplWGPU_CreateDeviceObjects()
|
|
// Vertex input configuration
|
|
// Vertex input configuration
|
|
WGPUVertexAttribute attribute_desc[] =
|
|
WGPUVertexAttribute attribute_desc[] =
|
|
{
|
|
{
|
|
|
|
+#ifdef IMGUI_IMPL_WEBGPU_BACKEND_DAWN
|
|
|
|
+ { nullptr, WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, pos), 0 },
|
|
|
|
+ { nullptr, WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, uv), 1 },
|
|
|
|
+ { nullptr, WGPUVertexFormat_Unorm8x4, (uint64_t)offsetof(ImDrawVert, col), 2 },
|
|
|
|
+#else
|
|
{ WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, pos), 0 },
|
|
{ WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, pos), 0 },
|
|
{ WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, uv), 1 },
|
|
{ WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, uv), 1 },
|
|
{ WGPUVertexFormat_Unorm8x4, (uint64_t)offsetof(ImDrawVert, col), 2 },
|
|
{ WGPUVertexFormat_Unorm8x4, (uint64_t)offsetof(ImDrawVert, col), 2 },
|
|
|
|
+#endif
|
|
};
|
|
};
|
|
|
|
|
|
WGPUVertexBufferLayout buffer_layouts[1];
|
|
WGPUVertexBufferLayout buffer_layouts[1];
|