@@ -1710,8 +1710,26 @@ export const kStencilTextureFormats = kDepthStencilFormats.filter(
17101710 v => kTextureFormatInfo [ v ] . stencil
17111711) ;
17121712
1713- export const kTextureFormatTier1AllowsRenderAttachmentBlendableMultisampleResolve : readonly ColorTextureFormat [ ] =
1714- [ 'r8snorm' , 'rg8snorm' , 'rgba8snorm' , 'rg11b10ufloat' ] as const ;
1713+ export const kTextureFormatTier1AllowsResolve : readonly ColorTextureFormat [ ] = [
1714+ 'r8snorm' ,
1715+ 'rg8snorm' ,
1716+ 'rgba8snorm' ,
1717+ 'rg11b10ufloat' ,
1718+ ] as const ;
1719+
1720+ export const kTextureFormatTier1AllowsRenderAttachmentBlendableMultisample : readonly ColorTextureFormat [ ] =
1721+ [
1722+ 'r16unorm' ,
1723+ 'r16snorm' ,
1724+ 'rg16unorm' ,
1725+ 'rg16snorm' ,
1726+ 'rgba16unorm' ,
1727+ 'rgba16snorm' ,
1728+ 'r8snorm' ,
1729+ 'rg8snorm' ,
1730+ 'rgba8snorm' ,
1731+ 'rg11b10ufloat' ,
1732+ ] as const ;
17151733
17161734export const kTextureFormatsTier1EnablesStorageReadOnlyWriteOnly : readonly ColorTextureFormat [ ] = [
17171735 'r8unorm' ,
@@ -2183,14 +2201,16 @@ export function filterFormatsByFeature<T>(
21832201 return formats . filter ( f => f === undefined || kTextureFormatInfo [ f ] . feature === feature ) ;
21842202}
21852203
2186- function isTextureFormatTier1EnablesRenderAttachmentBlendableMultisampleResolve (
2187- format : GPUTextureFormat
2188- ) {
2189- return kTextureFormatTier1AllowsRenderAttachmentBlendableMultisampleResolve . includes (
2204+ function isTextureFormatTier1EnablesRenderAttachmentBlendableMultisample ( format : GPUTextureFormat ) {
2205+ return kTextureFormatTier1AllowsRenderAttachmentBlendableMultisample . includes (
21902206 format as ColorTextureFormat
21912207 ) ;
21922208}
21932209
2210+ function isTextureFormatTier1EnablesResolve ( format : GPUTextureFormat ) {
2211+ return kTextureFormatTier1AllowsResolve . includes ( format as ColorTextureFormat ) ;
2212+ }
2213+
21942214function isTextureFormatTier1EnablesStorageReadOnlyWriteOnly ( format : GPUTextureFormat ) {
21952215 return kTextureFormatsTier1EnablesStorageReadOnlyWriteOnly . includes ( format as ColorTextureFormat ) ;
21962216}
@@ -2318,7 +2338,7 @@ export function isTextureFormatColorRenderable(
23182338 if ( format === 'rg11b10ufloat' ) {
23192339 return device . features . has ( 'rg11b10ufloat-renderable' ) ;
23202340 }
2321- if ( isTextureFormatTier1EnablesRenderAttachmentBlendableMultisampleResolve ( format ) ) {
2341+ if ( isTextureFormatTier1EnablesRenderAttachmentBlendableMultisample ( format ) ) {
23222342 return device . features . has ( 'texture-formats-tier1' ) ;
23232343 }
23242344 return ! ! kAllTextureFormatInfo [ format ] . colorRender ;
@@ -2369,7 +2389,7 @@ export function isTextureFormatPossiblyUsableAsRenderAttachment(format: GPUTextu
23692389 return (
23702390 isDepthOrStencilTextureFormat ( format ) ||
23712391 ! ! info . colorRender ||
2372- isTextureFormatTier1EnablesRenderAttachmentBlendableMultisampleResolve ( format )
2392+ isTextureFormatTier1EnablesRenderAttachmentBlendableMultisample ( format )
23732393 ) ;
23742394}
23752395
@@ -2380,8 +2400,7 @@ export function isTextureFormatPossiblyUsableAsRenderAttachment(format: GPUTextu
23802400export function isTextureFormatPossiblyUsableAsColorRenderAttachment ( format : GPUTextureFormat ) {
23812401 const info = kTextureFormatInfo [ format ] ;
23822402 return (
2383- ! ! info . colorRender ||
2384- isTextureFormatTier1EnablesRenderAttachmentBlendableMultisampleResolve ( format )
2403+ ! ! info . colorRender || isTextureFormatTier1EnablesRenderAttachmentBlendableMultisample ( format )
23852404 ) ;
23862405}
23872406
@@ -2392,8 +2411,7 @@ export function isTextureFormatPossiblyUsableAsColorRenderAttachment(format: GPU
23922411export function isTextureFormatPossiblyMultisampled ( format : GPUTextureFormat ) {
23932412 const info = kTextureFormatInfo [ format ] ;
23942413 return (
2395- info . multisample ||
2396- isTextureFormatTier1EnablesRenderAttachmentBlendableMultisampleResolve ( format )
2414+ info . multisample || isTextureFormatTier1EnablesRenderAttachmentBlendableMultisample ( format )
23972415 ) ;
23982416}
23992417
@@ -2602,7 +2620,7 @@ export function isTextureFormatMultisampled(device: GPUDevice, format: GPUTextur
26022620 if ( format === 'rg11b10ufloat' ) {
26032621 return device . features . has ( 'rg11b10ufloat-renderable' ) ;
26042622 }
2605- if ( isTextureFormatTier1EnablesRenderAttachmentBlendableMultisampleResolve ( format ) ) {
2623+ if ( isTextureFormatTier1EnablesRenderAttachmentBlendableMultisample ( format ) ) {
26062624 return device . features . has ( 'texture-formats-tier1' ) ;
26072625 }
26082626 return kAllTextureFormatInfo [ format ] . multisample ;
@@ -2616,7 +2634,7 @@ export function isTextureFormatResolvable(device: GPUDevice, format: GPUTextureF
26162634 if ( format === 'rg11b10ufloat' ) {
26172635 return device . features . has ( 'rg11b10ufloat-renderable' ) ;
26182636 }
2619- if ( isTextureFormatTier1EnablesRenderAttachmentBlendableMultisampleResolve ( format ) ) {
2637+ if ( isTextureFormatTier1EnablesResolve ( format ) ) {
26202638 return device . features . has ( 'texture-formats-tier1' ) ;
26212639 }
26222640 // You can't resolve a non-multisampled format.
0 commit comments