Skip to content

Update tips for wgpu 24.0.3.1 #29

Description

@NaitLee

There are significant changes in the newest wgpu API (I have 24.0.3.1 because I need to manually download it). In new version without updating the guide even basic ones like hello triangle would be broken.

Most notable ones:

  1. webgpu have its own "string" now

Old way setting a string no longer work:

CommandEncoderDescriptor encoderDesc = {};
encoderDesc.label = "My command encoder";

Now these fields need a WGPUStringView instance:

#define WSTR(s) WGPUStringView{ s, strlen(s) }

CommandEncoderDescriptor encoderDesc = {};
encoderDesc.label = WSTR("My command encoder");

I think this should be done in some c++ idiom :)

  1. some struct names are changed

Like the ShaderModuleWGSLDescriptor has been renamed to WGPUShaderSourceWGSL. For somewhat "complex" structures like these chains, this may confuse people.

  1. probably there are more

Sadly I progress very slowly on c++ and webgpu and may not help to write the guides directly, so updates would be glad :)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions