StorageTextureFormat
이 페이지에서

StorageTextureFormat

타입, 타입 분류

The texel formats a storage texture may carry, which is WebGPU's set of formats every device supports with STORAGE_BINDING and no optional feature.

import type { StorageTextureFormat } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

type StorageTextureFormat =
| 'rgba8unorm'
| 'rgba8snorm'
| 'rgba8uint'
| 'rgba8sint'
| 'rgba16uint'
| 'rgba16sint'
| 'rgba16float'
| 'r32uint'
| 'r32sint'
| 'r32float'
| 'rg32uint'
| 'rg32sint'
| 'rg32float'
| 'rgba32uint'
| 'rgba32sint'
| 'rgba32float'
| 'bgra8unorm';

설명

Measured rather than read off a spec: a real device was asked to build a bind group layout for each format at each access mode, and these sixteen are the ones a device with nothing requested took. The tiered texture-format formats (r8unorm, rg8unorm, rgb10a2unorm, rg16float and their siblings) are not here: a module naming one compiles on Tint and then fails at createBindGroupLayout, which is a wrong program emitted without a diagnostic.

bgra8unorm Is here, as the seventeenth and the only one that is not core. It is measured too, on two independent Chromium builds: a device with no feature requested refuses it (“Texture format TextureFormat::BGRA8Unorm does not support storage texture access StorageTextureAccess::WriteOnly”), a device that requested bgra8unorm-storage takes it at write, and both refuse it at read and read_write. Tint accepts every one of those spellings, so the compile gate cannot see the difference and a capability is what carries it: a module using the format needs bgra8unormStorage, which reflect().requiredFeatures hands the host as the feature to request. WRITE_ONLY_STORAGE_FORMATS is the access half of the same measurement.

함께 보기

소스

src/core/ir/types.ts, 53행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고