|
@@ -959,8 +959,8 @@ export class Engine {
|
|
|
*/
|
|
|
public readonly premultipliedAlpha: boolean = true;
|
|
|
|
|
|
+ /** @hidden */
|
|
|
protected _isWebGPU: boolean = false;
|
|
|
-
|
|
|
/**
|
|
|
* Gets a boolean indicating if the engine runs in WebGPU or not.
|
|
|
*/
|
|
@@ -968,6 +968,15 @@ export class Engine {
|
|
|
return this._isWebGPU;
|
|
|
}
|
|
|
|
|
|
+ /** @hidden */
|
|
|
+ protected _shaderPlatformName: string;
|
|
|
+ /**
|
|
|
+ * Gets the shader platfrom name used by the effects.
|
|
|
+ */
|
|
|
+ public get shaderPlatformName: string {
|
|
|
+ return this._shaderPlatformName;
|
|
|
+ };
|
|
|
+
|
|
|
/**
|
|
|
* Creates a new engine
|
|
|
* @param canvasOrContext defines the canvas or WebGL context to use for rendering. If you provide a WebGL context, Babylon.js will not hook events on the canvas (like pointers, keyboards, etc...) so no event observables will be available. This is mostly used when Babylon.js is used as a plugin on a system which alreay used the WebGL context
|
|
@@ -1070,10 +1079,12 @@ export class Engine {
|
|
|
this._gl = <any>(canvas.getContext("webgl2", options) || canvas.getContext("experimental-webgl2", options));
|
|
|
if (this._gl) {
|
|
|
this._webGLVersion = 2.0;
|
|
|
+ this._shaderPlatformName = "WEBGL2";
|
|
|
|
|
|
// Prevent weird browsers to lie :-)
|
|
|
if (!this._gl.deleteQuery) {
|
|
|
this._webGLVersion = 1.0;
|
|
|
+ this._shaderPlatformName = "WEBGL1";
|
|
|
}
|
|
|
}
|
|
|
} catch (e) {
|
|
@@ -1139,6 +1150,7 @@ export class Engine {
|
|
|
|
|
|
if (this._gl.renderbufferStorageMultisample) {
|
|
|
this._webGLVersion = 2.0;
|
|
|
+ this._shaderPlatformName = "WEBGL2";
|
|
|
}
|
|
|
|
|
|
const attributes = this._gl.getContextAttributes();
|