Backends: WebGPU: Add nextInChain field for VertexAttributes under Dawn (#8438)

This commit is contained in:
Alan
2025-02-27 07:47:33 -05:00
committed by GitHub
parent 8bd3e20c86
commit cdafefd4be

View File

@@ -687,9 +687,15 @@ bool ImGui_ImplWGPU_CreateDeviceObjects()
// Vertex input configuration
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, uv), 1 },
{ WGPUVertexFormat_Unorm8x4, (uint64_t)offsetof(ImDrawVert, col), 2 },
#endif
};
WGPUVertexBufferLayout buffer_layouts[1];