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

Include the label attribute of a WebGPU object in error messages #24675

Open
matthew-wong1 opened this issue Jul 22, 2024 · 1 comment
Open
Assignees
Labels
feat new feature (which has been agreed to/accepted) upstream Changes in upstream are required to solve these issues webgpu WebGPU API

Comments

@matthew-wong1
Copy link

Hi! I think it would be helpful if the label attribute of a WebGPU object was included in any validation error messages.

For example, if I create the following texture:

const texture = device.createTexture({
    label: "Texture 1",
    dimension: "2d",
    sampleCount: 1,
    format: "rgba8unorm-srgb",
    size: { 
        width: 36,
        height: 145,
        depthOrArrayLayers: 34
    },
    mipLevelCount: 10,
    usage: GPUTextureUsage.RENDER_ATTACHMENT.
    viewFormat: ["rgba8unorm"]
});

I'll get the error message: Device::create_texture error: Texture descriptor mip level count 10 is invalid, maximum allowed is 8.

I think it would be helpful if this error message could include the label e.g. Texture 1 in this case, to make it easier to debug. Thanks!

@crowlKats crowlKats self-assigned this Jul 22, 2024
@crowlKats
Copy link
Member

wgpu itself supports this, but not wgpu-core (which is what we use). this will be changed once gfx-rs/wgpu#5121 is completed.

@crowlKats crowlKats added feat new feature (which has been agreed to/accepted) upstream Changes in upstream are required to solve these issues webgpu WebGPU API labels Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat new feature (which has been agreed to/accepted) upstream Changes in upstream are required to solve these issues webgpu WebGPU API
Projects
None yet
Development

No branches or pull requests

2 participants