Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

alan-j-hu
Copy link
Contributor

Compilation using Dawn fails with the following error:

imgui/backends/imgui_impl_wgpu.cpp: In function ‘bool ImGui_ImplWGPU_CreateDeviceObjects()’:
imgui/backends/imgui_impl_wgpu.cpp:690:11: error: cannot convert ‘WGPUVertexFormat’ to ‘WGPUChainedStruct*’ in initialization
  690 |         { WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, pos), 0 },
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |           |
      |           WGPUVertexFormat
/home/alan/cpp-projects/hikari/third_party/imgui/backends/imgui_impl_wgpu.cpp:691:11: error: cannot convert ‘WGPUVertexFormat’ to ‘WGPUChainedStruct*’ in initialization
  691 |         { WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, uv),  1 },
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |           |
      |           WGPUVertexFormat
/home/alan/cpp-projects/hikari/third_party/imgui/backends/imgui_impl_wgpu.cpp:692:11: error: cannot convert ‘WGPUVertexFormat’ to ‘WGPUChainedStruct*’ in initialization
  692 |         { WGPUVertexFormat_Unorm8x4,  (uint64_t)offsetof(ImDrawVert, col), 2 },
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~
      |           |
      |           WGPUVertexFormat

This commit fixes this issue. As far as I know, the Rust wgpu implementation does not have this field: https://docs.rs/wgpu/latest/wgpu/struct.VertexAttribute.html

@alan-j-hu
Copy link
Contributor Author

See my remarks at #8381 (review).

@ocornut ocornut merged commit cdafefd into ocornut:master Feb 27, 2025
6 checks passed
@ocornut
Copy link
Owner

ocornut commented Feb 27, 2025

Merged, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants