Skip to content

Complete parity with wgpu 30.0, part 1 - #617

Open
inner-daemons wants to merge 1 commit into
gfx-rs:trunkfrom
inner-daemons:wgpu-parity-a
Open

Complete parity with wgpu 30.0, part 1#617
inner-daemons wants to merge 1 commit into
gfx-rs:trunkfrom
inner-daemons:wgpu-parity-a

Conversation

@inner-daemons

Copy link
Copy Markdown

Checklist

  • cargo clippy reports no issues
  • cargo doc reports no issues
  • cargo deny issues have been fixed or added to deny.toml
  • Human-readable change descriptions added to CHANGELOG.md under the "Unreleased" heading.
    • If the change does not affect the user (or is a process change), preface the change with "Internal:"
    • Add credit to yourself for each change: Added new functionality. @githubname

Description

Broken off from #594. See discussion there.

This brings basically all functionality from wpgu into wgpu-native, and has a few fixes for broken existing functionality. It was tested but that won't be part of this PR and will come later.

Related Issues

@inner-daemons
inner-daemons marked this pull request as draft July 10, 2026 22:58
@inner-daemons inner-daemons reopened this Jul 28, 2026
@inner-daemons inner-daemons mentioned this pull request Jul 28, 2026
6 tasks
@inner-daemons
inner-daemons marked this pull request as ready for review July 28, 2026 16:16

@Vipitis Vipitis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

started reading the diff, some notes... will take me a few more days to get through it and then trying some parts of it too.

Comment thread ffi/wgpu.h
WGPUSType_PrimitiveStateExtras = 0x0003000A,
/** Identifies @ref WGPUSamplerDescriptorExtras. */
WGPUSType_SamplerDescriptorExtras = 0x0003000B,
/** Identifies @ref WGPUComputePipelineDescriptorExtras. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

enum skips 0x0003000C and 0x00030011

Comment thread ffi/wgpu.h
* This is a native only feature.
*/
WGPUNativeFeature_StorageTextureArrayNonUniformIndexing = 0x00030010,
/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like it's the same upstream, but you need to enable a featured called AddressMode_ClampToZero (and also AddeessMode_ClampToBorder?) to now use the BorderColor extra with color zero?

I guess clamp to zero existed before and then other border colors got added so it got generalized away.

If that's the only way to use it, perhaps a docstring (or reference to example/test) could help.

E: looks like it was the other way around: gfx-rs/wgpu#2364 still odd to me and something I want to try, even if unrelated to this PR.

Comment thread ffi/wgpu.h
// WGPUNativeFeature_MeshShaderMultiview = 0x00030034,
// WGPUNativeFeature_ExtendedAccelerationStructureVertexFormats = 0x00030035,
// WGPUNativeFeature_PassthroughShaders = 0x00030036,
WGPUNativeFeature_MeshShader = 0x00030032,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no docstring on the first one

Comment thread ffi/wgpu.h
*
* Assignable to any @ref WGPULoadOp field (e.g. @ref WGPURenderPassColorAttachment::loadOp).
*/
#define WGPULoadOp_DontCare 0x00030001

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't believe these values should be done via a macro. It should likely be a WGPUNativeLoadOp

similar with WGPUTextureAspect further down

Comment thread ffi/wgpu.h
* The maximum number of views that can be used in multiview rendering.
*/
uint32_t maxMultiviewViewCount;
/**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if these are limits, why are they InstanceExtras instead of NativeLimits?

Comment thread ffi/wgpu.h
*
* This is an experimental, native-only feature.
*/
WGPUNativeFeature_ExperimentalRayTracingPipelines = 0x00030043,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

naming of Experimental*, as well as the docstring is not consistent. I think it's fine to name all experimental features experimental - as you also need to enable that for the adapter.

Comment thread ffi/wgpu.h
typedef struct WGPUDisplayChromaticity
{
WGPUBool present;
float redX, redY;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer if they were one per line.

@inner-daemons

Copy link
Copy Markdown
Author

I will look at these comments and I appreciate them. But I feel a little guilty because I have barely glanced at the actual header changes, you have done more in that regard.

Comment thread ffi/wgpu.h
* The other pair should be NULL/0.
* Pass to @ref wgpuDeviceCreateBlas.
*/
typedef struct WGPUBlasSizeDescriptors

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was curious on how this kind of union could be solved. Would it make sense to combined the sizes? Also do we need the nullable prefix? Similar example from webgpu.h is GPUBindGroupEntry

Comment thread ffi/wgpu.h
*
* Bit values match those of @c wgpu_types::TextureFormatFeatureFlags.
*/
typedef uint32_t WGPUNativeTextureFormatFeatureFlags;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a 64bit flag type, probably best to use that.

Comment thread ffi/wgpu.h
*/
WGPUBlas wgpuQueueCompactBlas(WGPUQueue queue, WGPUBlas blas);

/** Query internal wgpu-core/HAL resource counters for debugging. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The struct don't include core counters, but it also looks like that is cute and empty placeholder?

@cwfitzgerald cwfitzgerald self-assigned this Aug 5, 2026
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.

3 participants