@onerjs/core 8.53.7 → 8.53.8

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.
@@ -371,7 +371,10 @@ export declare class WebGPUEngine extends ThinWebGPUEngine {
371
371
  */
372
372
  get compatibilityMode(): boolean;
373
373
  set compatibilityMode(mode: boolean);
374
- /** @internal */
374
+ /**
375
+ * Gets the number of samples used by the current render target
376
+ * @returns the current sample count, or 1 when multisampling is disabled
377
+ */
375
378
  get currentSampleCount(): number;
376
379
  /**
377
380
  * Create a new instance of the gpu engine asynchronously
@@ -494,6 +497,11 @@ export declare class WebGPUEngine extends ThinWebGPUEngine {
494
497
  * @returns the current color writing state
495
498
  */
496
499
  getColorWrite(): boolean;
500
+ /**
501
+ * Enable or disable alpha-to-coverage
502
+ * @param enable defines the state to set
503
+ */
504
+ setAlphaToCoverage(enable: boolean): void;
497
505
  private _viewportsCurrent;
498
506
  private _mustUpdateViewport;
499
507
  private _applyViewport;
@@ -215,7 +215,10 @@ export class WebGPUEngine extends ThinWebGPUEngine {
215
215
  set compatibilityMode(mode) {
216
216
  this._compatibilityMode = mode;
217
217
  }
218
- /** @internal */
218
+ /**
219
+ * Gets the number of samples used by the current render target
220
+ * @returns the current sample count, or 1 when multisampling is disabled
221
+ */
219
222
  get currentSampleCount() {
220
223
  return this._currentRenderTarget ? this._currentRenderTarget.samples : this._mainPassSampleCount;
221
224
  }
@@ -953,6 +956,7 @@ export class WebGPUEngine extends ThinWebGPUEngine {
953
956
  this._depthCullingState.depthFunc = 515;
954
957
  this._alphaState.reset();
955
958
  this._resetAlphaMode();
959
+ this._cacheRenderPipeline.setAlphaToCoverage(this._alphaState.alphaToCoverage);
956
960
  this._cacheRenderPipeline.setAlphaBlendFactors(this._alphaState._blendFunctionParameters, this._alphaState._blendEquationParameters);
957
961
  this._cacheRenderPipeline.setAlphaBlendEnabled(this._alphaState._alphaBlend, this._alphaState._numTargetEnabled);
958
962
  this.setColorWrite(true);
@@ -976,6 +980,14 @@ export class WebGPUEngine extends ThinWebGPUEngine {
976
980
  getColorWrite() {
977
981
  return this._colorWriteLocal;
978
982
  }
983
+ /**
984
+ * Enable or disable alpha-to-coverage
985
+ * @param enable defines the state to set
986
+ */
987
+ setAlphaToCoverage(enable) {
988
+ super.setAlphaToCoverage(enable);
989
+ this._cacheRenderPipeline.setAlphaToCoverage(enable);
990
+ }
979
991
  _mustUpdateViewport() {
980
992
  const x = this._viewportCached.x, y = this._viewportCached.y, w = this._viewportCached.z, h = this._viewportCached.w;
981
993
  const update = this._viewportsCurrent.x !== x || this._viewportsCurrent.y !== y || this._viewportsCurrent.w !== w || this._viewportsCurrent.h !== h;