fix: complete gputypes integration with wgpu-native v27#4
Merged
Conversation
Conversion layer fixes: - TextureViewDimension values match between gputypes and wgpu-native v27 - Add struct padding for FFI alignment (sampler/texture/storage binding layouts) - Fix VertexFormat, VertexStepMode, TextureSampleType conversions Example fixes: - Use CreatePipelineLayoutSimple in cube, rotating-triangle, mrt, textured-quad - Fix GetModuleHandleW: use kernel32.dll instead of user32.dll (8 examples) - render_bundle: fallback shader without primitive_index (works on all GPUs) Default value fixes: - sampler: MaxAnisotropy >= 1 - texture: SampleCount >= 1, MipLevelCount >= 1 All 11 examples now work on all supported hardware.
CHANGELOG.md: - Document conversion layer and all fixes README.md: - Update wgpu-native version to v27.0.4.0 ROADMAP.md (modernized following GitHub best practices): - Add disclaimer about plans vs commitments - Use phase labels instead of hardcoded dates - Add How to Contribute section - Link to GitHub Issues/Projects for live tracking - Add upstream dependencies tracking examples/README.md: - Update version to 0.2.0 - Add gputypes note
Conversion functions (toWGPUTextureFormat, fromWGPUTextureFormat, toWGPUVertexFormat) have large switch statements for enum mapping which are inherently high complexity but straightforward. CreateRenderPipeline has high complexity due to wire struct initialization but is a single-purpose function. Exclude convert.go and render_pipeline.go from gocyclo/cyclop/funlen checks since these patterns are acceptable for FFI conversion code.
e74fe37 to
6863de4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete the gputypes integration with comprehensive fixes for wgpu-native v27 compatibility.
Code Fixes
wgpu/convert.go): ~45 TextureFormats, ~30 VertexFormats, VertexStepMode, TextureSampleType, TextureViewDimensionCreatePipelineLayoutSimplein 4 examplesDocumentation Updates
Test Plan
Result
All examples now work on all supported hardware: