|
@@ -1,8 +1,8 @@
|
|
|
-import { GPUTextureFormat, GPUAddressMode, GPUFilterMode, GPUTextureDimension } from './constants.js';
|
|
|
+import { GPUTextureFormat, GPUAddressMode, GPUFilterMode, GPUTextureDimension, GPUFeatureName } from './constants.js';
|
|
|
import { VideoTexture, CubeTexture, Texture, NearestFilter, NearestMipmapNearestFilter, NearestMipmapLinearFilter, LinearFilter, RepeatWrapping, MirroredRepeatWrapping, RGB_ETC2_Format, RGBA_ETC2_EAC_Format,
|
|
|
- RGBAFormat, RedFormat, RGFormat, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, UnsignedByteType, FloatType, HalfFloatType, SRGBColorSpace, DepthFormat, DepthTexture,
|
|
|
+ RGBAFormat, RedFormat, RGFormat, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, UnsignedByteType, FloatType, HalfFloatType, SRGBColorSpace, DepthFormat, DepthStencilFormat, DepthTexture,
|
|
|
RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_ASTC_10x5_Format,
|
|
|
- RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, UnsignedIntType, UnsignedShortType
|
|
|
+ RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_10x10_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, UnsignedIntType, UnsignedShortType, UnsignedInt248Type
|
|
|
} from 'three';
|
|
|
import WebGPUTextureUtils from './WebGPUTextureUtils.js';
|
|
|
|
|
@@ -37,13 +37,11 @@ class WebGPUTextures {
|
|
|
|
|
|
}
|
|
|
|
|
|
- getDepthDefaultTexture() {
|
|
|
+ getDefaultDepthTexture() {
|
|
|
|
|
|
if ( this.depthDefaultTexture === null ) {
|
|
|
|
|
|
const depthTexture = new DepthTexture();
|
|
|
- depthTexture.minFilter = NearestFilter;
|
|
|
- depthTexture.magFilter = NearestFilter;
|
|
|
depthTexture.image.width = 1;
|
|
|
depthTexture.image.height = 1;
|
|
|
|
|
@@ -75,7 +73,7 @@ class WebGPUTextures {
|
|
|
|
|
|
}
|
|
|
|
|
|
- getVideoDefaultTexture() {
|
|
|
+ getDefaultVideoTexture() {
|
|
|
|
|
|
if ( this.defaultVideoTexture === null ) {
|
|
|
|
|
@@ -828,6 +826,33 @@ class WebGPUTextures {
|
|
|
|
|
|
break;
|
|
|
|
|
|
+ case DepthStencilFormat:
|
|
|
+
|
|
|
+ switch ( type ) {
|
|
|
+
|
|
|
+ case UnsignedInt248Type:
|
|
|
+ formatGPU = GPUTextureFormat.Depth24PlusStencil8;
|
|
|
+ break;
|
|
|
+
|
|
|
+ case FloatType:
|
|
|
+
|
|
|
+ if ( this.device.features.has( GPUFeatureName.Depth32FloatStencil8 ) === false ) {
|
|
|
+
|
|
|
+ console.error( 'WebGPURenderer: Depth textures with DepthStencilFormat + FloatType can only be used with the "depth32float-stencil8" GPU feature.' );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ formatGPU = GPUTextureFormat.Depth32FloatStencil8;
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ console.error( 'WebGPURenderer: Unsupported texture type with DepthStencilFormat.', type );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
default:
|
|
|
console.error( 'WebGPURenderer: Unsupported texture format.', format );
|
|
|
|