|
|
@@ -31,7 +31,6 @@ class WebGPUBackend extends Backend {
|
|
|
* @typedef {Object} WebGPUBackend~Options
|
|
|
* @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
|
|
|
* @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
|
|
|
- * @property {boolean} [compatibilityMode=false] - Whether the backend should be in compatibility mode or not.
|
|
|
* @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not.
|
|
|
* @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
|
|
|
* @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not.
|
|
|
@@ -64,16 +63,18 @@ class WebGPUBackend extends Backend {
|
|
|
|
|
|
// some parameters require default values other than "undefined"
|
|
|
this.parameters.alpha = ( parameters.alpha === undefined ) ? true : parameters.alpha;
|
|
|
- this.parameters.compatibilityMode = ( parameters.compatibilityMode === undefined ) ? false : parameters.compatibilityMode;
|
|
|
|
|
|
this.parameters.requiredLimits = ( parameters.requiredLimits === undefined ) ? {} : parameters.requiredLimits;
|
|
|
|
|
|
/**
|
|
|
- * Indicates whether the backend is in compatibility mode or not.
|
|
|
- * @type {boolean}
|
|
|
- * @default false
|
|
|
+ * Indicates whether the backend is in WebGPU compatibility mode or not.
|
|
|
+ * The backend must be initialized before the property can be evaluated.
|
|
|
+ *
|
|
|
+ * @type {?boolean}
|
|
|
+ * @readonly
|
|
|
+ * @default null
|
|
|
*/
|
|
|
- this.compatibilityMode = this.parameters.compatibilityMode;
|
|
|
+ this.compatibilityMode = null;
|
|
|
|
|
|
/**
|
|
|
* A reference to the device.
|
|
|
@@ -175,7 +176,7 @@ class WebGPUBackend extends Backend {
|
|
|
|
|
|
const adapterOptions = {
|
|
|
powerPreference: parameters.powerPreference,
|
|
|
- featureLevel: parameters.compatibilityMode ? 'compatibility' : undefined
|
|
|
+ featureLevel: 'compatibility'
|
|
|
};
|
|
|
|
|
|
const adapter = ( typeof navigator !== 'undefined' ) ? await navigator.gpu.requestAdapter( adapterOptions ) : null;
|
|
|
@@ -215,6 +216,8 @@ class WebGPUBackend extends Backend {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ this.compatibilityMode = ! device.features.has( 'core-features-and-limits' );
|
|
|
+
|
|
|
device.lost.then( ( info ) => {
|
|
|
|
|
|
if ( info.reason === 'destroyed' ) return;
|