@predy-js/render-interface 0.1.49 → 0.1.51

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.
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  * Name: @predy-js/render-interface
3
3
  * Description: undefined
4
4
  * Author: undefined
5
- * Version: v0.1.49
5
+ * Version: v0.1.51
6
6
  */
7
7
 
8
8
  /******************************************************************************
@@ -206,8 +206,17 @@ var ShaderCompileResultStatus;
206
206
  })(ShaderCompileResultStatus || (ShaderCompileResultStatus = {}));
207
207
  var ShaderLibraryEmpty = /** @class */ (function () {
208
208
  function ShaderLibraryEmpty() {
209
- this.shaderResults = {};
210
209
  }
210
+ Object.defineProperty(ShaderLibraryEmpty.prototype, "cacheIds", {
211
+ get: function () {
212
+ return [];
213
+ },
214
+ enumerable: false,
215
+ configurable: true
216
+ });
217
+ ShaderLibraryEmpty.prototype.getShaderResult = function (cacheId) {
218
+ return undefined;
219
+ };
211
220
  ShaderLibraryEmpty.prototype.addShader = function (shader, marcos) {
212
221
  return '';
213
222
  };
@@ -1945,6 +1954,18 @@ var GLShaderLibrary = /** @class */ (function () {
1945
1954
  var gl = this.renderer.gl;
1946
1955
  this._glAsyncCompileExt = gl.getExtension('KHR_parallel_shader_compile');
1947
1956
  }
1957
+ Object.defineProperty(GLShaderLibrary.prototype, "cacheIds", {
1958
+ get: function () {
1959
+ return Object.keys(this.shaderResults);
1960
+ },
1961
+ enumerable: false,
1962
+ configurable: true
1963
+ });
1964
+ GLShaderLibrary.prototype.getShaderResult = function (cacheId) {
1965
+ if (this.shaderResults) {
1966
+ return this.shaderResults[cacheId];
1967
+ }
1968
+ };
1948
1969
  GLShaderLibrary.prototype.compileAllShaders = function (asyncCallback) {
1949
1970
  var _this = this;
1950
1971
  if (!this._shaderAllDone) {
@@ -4418,8 +4439,8 @@ var GLMaterial = /** @class */ (function () {
4418
4439
  GLMaterial.prototype.destroy = function () {
4419
4440
  var _a;
4420
4441
  var lib = (_a = this.renderer) === null || _a === void 0 ? void 0 : _a.shaderLibrary;
4421
- if (lib && lib.shaderResults) {
4422
- var shader = lib.shaderResults[this.shaderCacheId];
4442
+ if (lib) {
4443
+ var shader = lib.getShaderResult(this.shaderCacheId);
4423
4444
  if (shader && !shader.shared) {
4424
4445
  lib.deleteShader(this.shaderCacheId);
4425
4446
  }
@@ -5705,7 +5726,7 @@ var MarsSharedGeometry = /** @class */ (function (_super) {
5705
5726
  return MarsSharedGeometry;
5706
5727
  }(MarsGeometry));
5707
5728
 
5708
- consoleLog('version: ' + "0.1.49");
5729
+ consoleLog('version: ' + "0.1.51");
5709
5730
  consoleLog('Update : xxx');
5710
5731
 
5711
5732
  export { DestroyOptions, MarsGeometry as Geometry, MarsInstancedMesh as InstancedMesh, MarsTextureFactory, MarsMaterial as Material, MarsMaterialDataBlock as MaterialDataBlock, MarsMesh as Mesh, MarsRenderFrame as RenderFrame, MarsRenderPass as RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassMeshOrder, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, MarsRenderer as Renderer, ShaderCompileResultStatus, ShaderLibraryEmpty, MarsSharedGeometry as SharedGeometry, MarsTexture as Texture, TextureLoadAction, TextureSourceType, TextureStoreAction, constants, getDefaultGPUCapability, getDefaultTextureFactory, setDefaultTextureFactory };