@babylonjs/core 8.3.0 → 8.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -505,7 +505,7 @@ export class NativeEngine extends Engine {
505
505
  }
506
506
  // Apply states
507
507
  this._drawCalls.addCount(1, false);
508
- if (instancesCount && _native.Engine.COMMAND_DRAWINDEXEDINSTANCED) {
508
+ if (instancesCount) {
509
509
  this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINDEXEDINSTANCED);
510
510
  this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode);
511
511
  this._commandBufferEncoder.encodeCommandArgAsUInt32(indexStart);
@@ -519,7 +519,6 @@ export class NativeEngine extends Engine {
519
519
  this._commandBufferEncoder.encodeCommandArgAsUInt32(indexCount);
520
520
  }
521
521
  this._commandBufferEncoder.finishEncodingCommand();
522
- // }
523
522
  }
524
523
  /**
525
524
  * Draw a list of unindexed primitives
@@ -534,7 +533,7 @@ export class NativeEngine extends Engine {
534
533
  }
535
534
  // Apply states
536
535
  this._drawCalls.addCount(1, false);
537
- if (instancesCount && _native.Engine.COMMAND_DRAWINSTANCED) {
536
+ if (instancesCount) {
538
537
  this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DRAWINSTANCED);
539
538
  this._commandBufferEncoder.encodeCommandArgAsUInt32(fillMode);
540
539
  this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesStart);
@@ -548,10 +547,9 @@ export class NativeEngine extends Engine {
548
547
  this._commandBufferEncoder.encodeCommandArgAsUInt32(verticesCount);
549
548
  }
550
549
  this._commandBufferEncoder.finishEncodingCommand();
551
- // }
552
550
  }
553
551
  createPipelineContext(shaderProcessingContext) {
554
- const isAsync = !!(this._caps.parallelShaderCompile && this._engine.createProgramAsync);
552
+ const isAsync = !!this._caps.parallelShaderCompile;
555
553
  return new NativePipelineContext(this, isAsync, shaderProcessingContext);
556
554
  }
557
555
  createMaterialContext() {
@@ -1298,20 +1296,14 @@ export class NativeEngine extends Engine {
1298
1296
  }
1299
1297
  if (!!texture && !!texture._hardwareTexture) {
1300
1298
  const destination = texture._hardwareTexture.underlyingResource;
1301
- if (this._engine.copyTexture) {
1302
- const source = canvas.getCanvasTexture();
1303
- this._engine.copyTexture(destination, source);
1304
- }
1305
- else if (_native.Engine.COMMAND_COPYTEXTURE) {
1306
- const context = canvas.getContext();
1307
- // flush need to happen before getCanvasTexture: flush will create the render target synchronously (if it's not been created before)
1308
- context.flush();
1309
- const source = canvas.getCanvasTexture();
1310
- this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_COPYTEXTURE);
1311
- this._commandBufferEncoder.encodeCommandArgAsNativeData(source);
1312
- this._commandBufferEncoder.encodeCommandArgAsNativeData(destination);
1313
- this._commandBufferEncoder.finishEncodingCommand();
1314
- }
1299
+ const context = canvas.getContext();
1300
+ // flush need to happen before getCanvasTexture: flush will create the render target synchronously (if it's not been created before)
1301
+ context.flush();
1302
+ const source = canvas.getCanvasTexture();
1303
+ this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_COPYTEXTURE);
1304
+ this._commandBufferEncoder.encodeCommandArgAsNativeData(source);
1305
+ this._commandBufferEncoder.encodeCommandArgAsNativeData(destination);
1306
+ this._commandBufferEncoder.finishEncodingCommand();
1315
1307
  texture.isReady = true;
1316
1308
  }
1317
1309
  }
@@ -1970,9 +1962,6 @@ export class NativeEngine extends Engine {
1970
1962
  this._commandBufferEncoder.finishEncodingCommand();
1971
1963
  }
1972
1964
  _unsetNativeTexture(uniform) {
1973
- if (!_native.Engine.COMMAND_UNSETTEXTURE) {
1974
- return;
1975
- }
1976
1965
  this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_UNSETTEXTURE);
1977
1966
  this._commandBufferEncoder.encodeCommandArgAsNativeData(uniform);
1978
1967
  this._commandBufferEncoder.finishEncodingCommand();
@@ -2013,9 +2002,6 @@ export class NativeEngine extends Engine {
2013
2002
  * Unbind all textures
2014
2003
  */
2015
2004
  unbindAllTextures() {
2016
- if (!_native.Engine.COMMAND_DISCARDALLTEXTURES) {
2017
- return;
2018
- }
2019
2005
  this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_DISCARDALLTEXTURES);
2020
2006
  this._commandBufferEncoder.finishEncodingCommand();
2021
2007
  }
@@ -2140,10 +2126,10 @@ export class NativeEngine extends Engine {
2140
2126
  return this._gpuFrameTimeToken;
2141
2127
  }
2142
2128
  endTimeQuery(token) {
2143
- this._engine.populateFrameStats?.(this._frameStats);
2129
+ this._engine.populateFrameStats(this._frameStats);
2144
2130
  return this._frameStats.gpuTimeNs;
2145
2131
  }
2146
2132
  }
2147
2133
  // This must match the protocol version in NativeEngine.cpp
2148
- NativeEngine.PROTOCOL_VERSION = 8;
2134
+ NativeEngine.PROTOCOL_VERSION = 9;
2149
2135
  //# sourceMappingURL=nativeEngine.js.map