这是indexloc提供的服务,不要输入任何密码
Skip to content

Compat: Validating out viewFormats / view reinterpretation #4404

@greggman

Description

@greggman

In WebGPU you can create a texture and request compatible viewFormats.

const tex = device.createTexture({
  ...
  format: 'rgba8unorm',
  viewFormats: ['rgba8unorm', 'rgba8norm-srgb'],
});

OpenGL ES 3.1 has no such facility.

We'd like to validate this out in compatibility mode. 2 options

  1. Require the formats in viewFormats to be the same format

    { ... format: 'rgba8unorm', viewFormats: ['rgba8unorm', 'rgba8norm-srgb'], }  // bad
    { ... format: 'rgba8unorm', viewFormats: ['rgba8unorm'], }                    // ok
  2. Require viewFormats to be unset

    { ... format: 'rgba8unorm', viewFormats: ['rgba8unorm'], }                    // bad
    { ... format: 'rgba8unorm' }                                                  // ok

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatWebGPU Compatibility Mode

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions