Browse Source

Merge pull request #8658 from sebavan/WebGPU

Add BC formats
sebavan 5 years ago
parent
commit
49c34552c8
2 changed files with 30 additions and 1 deletions
  1. 15 0
      src/Engines/WebGPU/webgpuConstants.ts
  2. 15 1
      src/LibDeclarations/webgpu.d.ts

+ 15 - 0
src/Engines/WebGPU/webgpuConstants.ts

@@ -70,6 +70,21 @@ export class WebGPUConstants {
     public static readonly GPUTextureFormat_depth32float: GPUTextureFormat = "depth32float";
     public static readonly GPUTextureFormat_depth24plus: GPUTextureFormat = "depth24plus";
     public static readonly GPUTextureFormat_depth24plusStencil8: GPUTextureFormat = "depth24plus-stencil8";
+    /* Compressed formats */
+    public static readonly GPUTextureFormat_bc1rgbaunorm: GPUTextureFormat = "bc1-rgba-unorm";
+    public static readonly GPUTextureFormat_bc1rgbaunorm_srgb: GPUTextureFormat = "bc1-rgba-unorm-srgb";
+    public static readonly GPUTextureFormat_bc2rgbaunorm: GPUTextureFormat = "bc2-rgba-unorm";
+    public static readonly GPUTextureFormat_bc2rgbaunorm_srgb: GPUTextureFormat = "bc2-rgba-unorm-srgb";
+    public static readonly GPUTextureFormat_bc3rgbaunorm: GPUTextureFormat = "bc3-rgba-unorm";
+    public static readonly GPUTextureFormat_bc3rgbaunorm_srgb: GPUTextureFormat = "bc3-rgba-unorm-srgb";
+    public static readonly GPUTextureFormat_bc4runorm: GPUTextureFormat = "bc4-r-unorm";
+    public static readonly GPUTextureFormat_bc4rsnorm: GPUTextureFormat = "bc4-r-snorm";
+    public static readonly GPUTextureFormat_bc5rgunorm: GPUTextureFormat = "bc5-rg-unorm";
+    public static readonly GPUTextureFormat_bc5rgsnorm: GPUTextureFormat = "bc5-rg-snorm";
+    public static readonly GPUTextureFormat_bc6hrgbufloat: GPUTextureFormat = "bc6h-rgb-ufloat";
+    public static readonly GPUTextureFormat_bc6hrgbsfloat: GPUTextureFormat = "bc6h-rgb-sfloat";
+    public static readonly GPUTextureFormat_bc7rgbaunorm: GPUTextureFormat = "bc7-rgba-unorm";
+    public static readonly GPUTextureFormat_bc7rgbaunormsrgb: GPUTextureFormat = "bc7-rgba-unorm-srgb";
 
     public static readonly GPUTextureViewDimension_1d: GPUTextureViewDimension = "1d";
     public static readonly GPUTextureViewDimension_2d: GPUTextureViewDimension = "2d";

+ 15 - 1
src/LibDeclarations/webgpu.d.ts

@@ -141,7 +141,21 @@ type GPUTextureFormat =
   | "rgba32float"
   | "depth32float"
   | "depth24plus"
-  | "depth24plus-stencil8";
+  | "depth24plus-stencil8"
+  | "bc1-rgba-unorm"
+  | "bc1-rgba-unorm-srgb"
+  | "bc2-rgba-unorm"
+  | "bc2-rgba-unorm-srgb"
+  | "bc3-rgba-unorm"
+  | "bc3-rgba-unorm-srgb"
+  | "bc4-r-unorm"
+  | "bc4-r-snorm"
+  | "bc5-rg-unorm"
+  | "bc5-rg-snorm"
+  | "bc6h-rgb-ufloat"
+  | "bc6h-rgb-sfloat"
+  | "bc7-rgba-unorm"
+  | "bc7-rgba-unorm-srgb";
 type GPUTextureComponentType = "float" | "sint" | "uint";
 type GPUTextureViewDimension =
   | "1d"