Skip to content

Update to wgpu-native v29.0.0.0 (includes updated headers!)#805

Open
Vipitis wants to merge 18 commits intopygfx:mainfrom
Vipitis:new-headers
Open

Update to wgpu-native v29.0.0.0 (includes updated headers!)#805
Vipitis wants to merge 18 commits intopygfx:mainfrom
Vipitis:new-headers

Conversation

@Vipitis
Copy link
Copy Markdown
Contributor

@Vipitis Vipitis commented Apr 10, 2026

as usual... still in progress but I am happy to get into this again and enjoy my free time.

There was a release for v27 with just the header updated, but there were quite a few missing symbols etc, so that release won't really work. So one PR to do both. The headers are also now considered stable. So this might be last major update for a long while.

I will put quite a few code comments in for things I feel like could be improved in the codegen, these are also meant for discussion.

more to come, I will try to keep the commits tidy and topic, since it's quite helpful to look at the individual diffs

TODOs:

  • tests green
  • examples green
  • mem tests green
  • instance flags extras changed quite a bit
  • changelog explaining the breaking changes
  • copy the issue template here?
  • try joined cleaned header
  • the backend extras documentation needs to be updated
    • for immediates
    • the instance extras

Comment thread wgpu/backends/wgpu_native/_ffi.py Outdated
)


# TODO: can we avoid doing this every single time the lib is loaded? I feel like we should provide a cleaned header file to ship instead?
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this particular. It's probably a small amount, but if we cleanup the header file(like this function does, as part of codegen perhaps), combine both headers and save to to something like wgpu-native-min.h which can be read by cdef() directly?

I want to try give this a try, also makes the preprepreprocessing here more visible and easier to debug

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea to save work at runtime!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a commit to give this a rough try. seems to still work - but didn't thoroughly test this. Without some kind of time to first frame benchmark (also for #789) hard to tell if it makes a meaningful difference. Either way it would avoid the prepreprocessor code duplication.

@Vipitis
Copy link
Copy Markdown
Contributor Author

Vipitis commented Apr 13, 2026

I get test failure locally in tests_mem/test_gui_qt.py but CI seems to be happy. I am on rendercanvas main, and there were quite a few changes since. CI seems to have installed 2.6.3 so I guess it's fine. I suspect these test are outdated anyway.

Comment thread docs/backends.rst
`here <https://vkguide.dev/docs/chapter-3/push_constants/>`_.
Using push constants in WGPU closely follows the Vulkan model.
The wgpu_native backend provides support for immediates.
Immediates are not yet part of the WebGPU spec, but the headers for native webgpu have converged officially.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like this is rather close to becoming official spec gpuweb/gpuweb#5423

)

# H: nextInChain: WGPUChainedStruct *, label: WGPUStringView, bindGroupLayoutCount: int, bindGroupLayouts: WGPUBindGroupLayout *
# TODO: there is an immediateSize field in this struct too. so do we even need the extras?
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread wgpu/resources/wgpu.h
} WGPUGLFenceBehaviour;

typedef enum WGPUDx12SwapchainKind {
typedef enum WGPUDx12SwapchainKind
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this gets added to extras in #775

@Vipitis Vipitis marked this pull request as ready for review April 23, 2026 08:12
@Vipitis
Copy link
Copy Markdown
Contributor Author

Vipitis commented Apr 23, 2026

apart from a new instance extra WGPUNativeDisplayHandle this should be ready.

The "combined" header is nice for avoiding code duplication and it should theoretically be faster and thinner. I haven't updated the packing or contributor instructions (you need to run codegen locally after downloading the via the script I believe). There could be other problems with people bringing in a custom lib dir etc

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants