@carbonenginejs/runtime-resource 0.12.0 → 0.12.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.
Files changed (170) hide show
  1. package/dist/CjsResMan.js +4 -4
  2. package/dist/CjsResMan.js.map +1 -1
  3. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -4
  4. package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  5. package/dist/format/CjsByteReader.js +310 -0
  6. package/dist/format/CjsByteReader.js.map +1 -0
  7. package/dist/format/CjsByteWriter.js +242 -0
  8. package/dist/format/CjsByteWriter.js.map +1 -0
  9. package/dist/format/CjsFormatError.js +41 -0
  10. package/dist/format/CjsFormatError.js.map +1 -0
  11. package/dist/format/CjsStringTable.js +268 -0
  12. package/dist/format/CjsStringTable.js.map +1 -0
  13. package/dist/format/carbonEffect/CjsCarbonEffectReader.js +361 -0
  14. package/dist/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -0
  15. package/dist/format/carbonEffect/CjsCarbonEffectWriter.js +373 -0
  16. package/dist/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -0
  17. package/dist/format/carbonEffect/carbonDescriptionFromPortable.js +372 -0
  18. package/dist/format/carbonEffect/carbonDescriptionFromPortable.js.map +1 -0
  19. package/dist/format/carbonEffect/carbonEffectBackendBlock.js +427 -0
  20. package/dist/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -0
  21. package/dist/format/carbonEffect/carbonEffectRecords.js +955 -0
  22. package/dist/format/carbonEffect/carbonEffectRecords.js.map +1 -0
  23. package/dist/format/compareUtf8.js +36 -0
  24. package/dist/format/compareUtf8.js.map +1 -0
  25. package/dist/format/index.js +11 -0
  26. package/dist/format/index.js.map +1 -0
  27. package/dist/formats/bnk/CjsBnkFormat.js +10 -4
  28. package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
  29. package/dist/formats/bnk/core/eventAction.js +305 -0
  30. package/dist/formats/bnk/core/eventAction.js.map +1 -0
  31. package/dist/formats/bnk/core/helpers.js +11 -2
  32. package/dist/formats/bnk/core/helpers.js.map +1 -1
  33. package/dist/formats/bnk/core/nodeBase.js +532 -0
  34. package/dist/formats/bnk/core/nodeBase.js.map +1 -0
  35. package/dist/formats/bnk/core/sfxNodes.js +252 -152
  36. package/dist/formats/bnk/core/sfxNodes.js.map +1 -1
  37. package/dist/formats/hlsl/core/HlslReader.js +7 -257
  38. package/dist/formats/hlsl/core/HlslReader.js.map +1 -1
  39. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js +781 -0
  40. package/dist/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -0
  41. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +21 -1
  42. package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -1
  43. package/dist/formats/index.js +1 -1
  44. package/dist/formats/webgl/core/cewg/CewgPackage.js +2 -1
  45. package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -1
  46. package/dist/formats/webgl/core/cewg/binary.js +11 -93
  47. package/dist/formats/webgl/core/cewg/binary.js.map +1 -1
  48. package/dist/formats/webgl/core/effectPackage.js +1 -1
  49. package/dist/formats/webgpu/CjsWebgpuFormat.js +4 -23
  50. package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  51. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js +197 -0
  52. package/dist/formats/webgpu/core/buildCarbonEffectContainer.js.map +1 -0
  53. package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js +368 -0
  54. package/dist/formats/webgpu/core/cewgpu/CewgpuContainer.js.map +1 -0
  55. package/dist/formats/webgpu/core/cewgpu/containerViews.js +355 -0
  56. package/dist/formats/webgpu/core/cewgpu/containerViews.js.map +1 -0
  57. package/dist/formats/webgpu/core/cewgpu/validateContainer.js +90 -0
  58. package/dist/formats/webgpu/core/cewgpu/validateContainer.js.map +1 -0
  59. package/dist/formats/webgpu/core/effectBackendBodySet.js +21 -20
  60. package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -1
  61. package/dist/formats/webgpu/core/helpers.js +87 -92
  62. package/dist/formats/webgpu/core/helpers.js.map +1 -1
  63. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +14 -13
  64. package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -1
  65. package/dist/formats/webgpu/core/ir/inferValueTypes.js +10 -8
  66. package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -1
  67. package/dist/formats/webgpu/core/packageEffect.js +94 -9
  68. package/dist/formats/webgpu/core/packageEffect.js.map +1 -1
  69. package/dist/formats/webgpu/core/packageMetadata.js +10 -1
  70. package/dist/formats/webgpu/core/packageMetadata.js.map +1 -1
  71. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +17 -15
  72. package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -1
  73. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +13 -12
  74. package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -1
  75. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +9 -8
  76. package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
  77. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +23 -22
  78. package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -1
  79. package/dist/formats/webgpu/core/wgsl/selectionPlans.js +46 -44
  80. package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -1
  81. package/dist/resource/CjsResource.js +700 -684
  82. package/dist/resource/CjsResource.js.map +1 -1
  83. package/dist/resource/Tr2LightProfileRes.js +18 -27
  84. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  85. package/dist/resource/audio/CjsAudioBufferRes.js +2 -2
  86. package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -1
  87. package/dist/resource/audio/CjsAudioRes.js +2 -2
  88. package/dist/resource/audio/CjsAudioRes.js.map +1 -1
  89. package/dist/resource/geometry/TriGeometryRes.js +605 -586
  90. package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
  91. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +21 -30
  92. package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
  93. package/dist/resource/geometry/granny/TriGrannyRes.js +21 -30
  94. package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
  95. package/dist/resource/shader/Tr2EffectRes.js +9 -7
  96. package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
  97. package/dist/resource/shader/Tr2MaterialArea.js +5 -3
  98. package/dist/resource/shader/Tr2MaterialArea.js.map +1 -1
  99. package/dist/resource/shader/Tr2MaterialMesh.js +4 -2
  100. package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -1
  101. package/dist/resource/shader/Tr2MaterialRes.js +5 -3
  102. package/dist/resource/shader/Tr2MaterialRes.js.map +1 -1
  103. package/dist/resource/shader/Tr2Shader.js +26 -21
  104. package/dist/resource/shader/Tr2Shader.js.map +1 -1
  105. package/dist/resource/shader/Tr2ShaderPermutation.js +8 -6
  106. package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -1
  107. package/dist/resource/shader/reflection/Tr2EffectDefine.js +5 -3
  108. package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -1
  109. package/dist/resource/shader/reflection/Tr2EffectDescription.js +5 -3
  110. package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
  111. package/dist/resource/shader/reflection/Tr2EffectLibrary.js +17 -15
  112. package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
  113. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +11 -9
  114. package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
  115. package/dist/resource/shader/reflection/Tr2EffectResource.js +8 -6
  116. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  117. package/dist/resource/shader/reflection/Tr2EffectStageInput.js +15 -13
  118. package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
  119. package/dist/resource/shader/reflection/Tr2EffectTechnique.js +7 -5
  120. package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
  121. package/dist/resource/shader/reflection/Tr2Pass.js +11 -9
  122. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  123. package/dist/resource/shader/sampler/Tr2SamplerSetup.js +8 -6
  124. package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
  125. package/dist/resource/texture/CjsTextureArrayRes.js +400 -411
  126. package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
  127. package/dist/resource/texture/Tr2ImageRes.js +99 -95
  128. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  129. package/dist/resource/texture/TriTextureRes.js +312 -273
  130. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  131. package/docs/README.md +13 -1
  132. package/docs/architecture.md +3 -3
  133. package/docs/concepts/resource-lifecycle.md +9 -2
  134. package/docs/concepts/shader-resource-model.md +114 -0
  135. package/docs/concepts/writing-an-engine-adapter.md +115 -0
  136. package/docs/formats/README.md +24 -1
  137. package/docs/formats/carbon-effect-container.md +452 -0
  138. package/docs/formats/dxbc/reference/classes/README.md +5 -72
  139. package/docs/formats/hlsl/reference/api.md +5 -4
  140. package/docs/formats/hlsl/reference/classes/README.md +6 -11
  141. package/docs/formats/provenance.md +23 -13
  142. package/docs/formats/webgl/reference/classes/README.md +5 -92
  143. package/docs/formats/webgpu/README.md +19 -16
  144. package/docs/formats/webgpu/architecture.md +15 -12
  145. package/docs/formats/webgpu/formats/cewgpu.md +175 -438
  146. package/docs/formats/webgpu/guides/effect-packaging.md +132 -140
  147. package/docs/formats/webgpu/reference/api.md +131 -131
  148. package/docs/formats/webgpu/reference/classes/README.md +5 -62
  149. package/docs/formats/webgpu/reference/wgsl-compatibility.md +146 -45
  150. package/docs/formats/wwise.md +34 -8
  151. package/docs/reference/classes/core.md +80 -0
  152. package/docs/reference/classes/formats.md +18 -28
  153. package/docs/reference/events.md +25 -0
  154. package/docs/reference/motherlode-cache.md +22 -8
  155. package/docs/reference/workers.md +5 -5
  156. package/docs/roadmap.md +61 -41
  157. package/package.json +2 -1
  158. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +0 -415
  159. package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +0 -1
  160. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +0 -100
  161. package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +0 -1
  162. package/dist/formats/webgpu/core/cewgpu/binary.js +0 -93
  163. package/dist/formats/webgpu/core/cewgpu/binary.js.map +0 -1
  164. package/dist/formats/webgpu/core/cewgpu/tags.js +0 -17
  165. package/dist/formats/webgpu/core/cewgpu/tags.js.map +0 -1
  166. package/dist/formats/webgpu/core/effectPackageValidation.js +0 -1078
  167. package/dist/formats/webgpu/core/effectPackageValidation.js.map +0 -1
  168. package/docs/formats/hlsl/reference/classes/carbon-compatibility.md +0 -66
  169. package/docs/formats/hlsl/reference/classes/public-api.md +0 -26
  170. package/docs/formats/hlsl/reference/classes/tr2-effect-model.md +0 -150
@@ -1,11 +1,8 @@
1
- import { identity as _identity, applyDecs2311 as _applyDecs2311 } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { type } from '@carbonenginejs/runtime-utils/schema';
1
+ import { CjsSchema } from '@carbonenginejs/runtime-utils/schema';
3
2
  import { normalizeResourcePath } from '@carbonenginejs/runtime-utils/path';
4
- import { CjsResource as _CjsResource } from '../CjsResource.js';
3
+ import { CjsResource } from '../CjsResource.js';
5
4
  import { CjsTextureArrayResParameterProxy } from './CjsTextureArrayResParameterProxy.js';
6
5
 
7
- let _initClass;
8
-
9
6
  /**
10
7
  * Mutable runtime aggregate for an ordered texture-array request.
11
8
  *
@@ -13,471 +10,463 @@ let _initClass;
13
10
  * manager or engine scheduler consumes the coalesced update on a later frame
14
11
  * and prepares the corresponding immutable/cached texture-array payload.
15
12
  */
16
- let _CjsTextureArrayRes;
17
- new class extends _identity {
18
- static [class CjsTextureArrayRes extends _CjsResource {
19
- static {
20
- [_CjsTextureArrayRes, _initClass] = _applyDecs2311(this, [type.define({
21
- className: "CjsTextureArrayRes",
22
- family: "resource"
23
- })], [], 0, void 0, _CjsResource).c;
24
- }
25
- #layers = [];
26
- #dirtyLayers = new Set();
27
- #requestedRevision = 0;
28
- #preparedRevision = 0;
29
- #updateScheduled = false;
30
- #topologyChanged = false;
31
- #inFlightRequests = new Map();
32
- #readyWaiters = [];
33
- #failedRevision = 0;
34
- #failedError = null;
35
- #updateScheduler = null;
36
- #updateHandler = null;
37
-
38
- /** Creates a CjsTextureArrayRes with caller-provided initial state. */
39
- constructor(values = null) {
40
- const options = values && typeof values === "object" && !Array.isArray(values) ? values : {};
41
- const resourceValues = {
42
- ...options
43
- };
44
- delete resourceValues.layers;
45
- delete resourceValues.paths;
46
- delete resourceValues.layerCount;
47
- delete resourceValues.layerNames;
48
- delete resourceValues.updateScheduler;
49
- delete resourceValues.updateHandler;
50
- super(resourceValues);
51
- if (options.updateScheduler) this.SetUpdateScheduler(options.updateScheduler);
52
- if (options.updateHandler) this.SetUpdateHandler(options.updateHandler);
53
- const paths = options.layers || options.paths;
54
- if (paths !== undefined) {
55
- this.SetLayerResourcePaths(paths, options.layerNames);
56
- } else if (options.layerCount !== undefined) {
57
- this.SetLayerCount(options.layerCount, options.layerNames);
58
- }
13
+ class CjsTextureArrayRes extends CjsResource {
14
+ #layers = [];
15
+ #dirtyLayers = new Set();
16
+ #requestedRevision = 0;
17
+ #preparedRevision = 0;
18
+ #updateScheduled = false;
19
+ #topologyChanged = false;
20
+ #inFlightRequests = new Map();
21
+ #readyWaiters = [];
22
+ #failedRevision = 0;
23
+ #failedError = null;
24
+ #updateScheduler = null;
25
+ #updateHandler = null;
26
+
27
+ /** Creates a CjsTextureArrayRes with caller-provided initial state. */
28
+ constructor(values = null) {
29
+ const options = values && typeof values === "object" && !Array.isArray(values) ? values : {};
30
+ const resourceValues = {
31
+ ...options
32
+ };
33
+ delete resourceValues.layers;
34
+ delete resourceValues.paths;
35
+ delete resourceValues.layerCount;
36
+ delete resourceValues.layerNames;
37
+ delete resourceValues.updateScheduler;
38
+ delete resourceValues.updateHandler;
39
+ super(resourceValues);
40
+ if (options.updateScheduler) this.SetUpdateScheduler(options.updateScheduler);
41
+ if (options.updateHandler) this.SetUpdateHandler(options.updateHandler);
42
+ const paths = options.layers || options.paths;
43
+ if (paths !== undefined) {
44
+ this.SetLayerResourcePaths(paths, options.layerNames);
45
+ } else if (options.layerCount !== undefined) {
46
+ this.SetLayerCount(options.layerCount, options.layerNames);
59
47
  }
48
+ }
60
49
 
61
- /** Returns layer count from the current texture-array resource. */
62
- GetLayerCount() {
63
- return this.#layers.length;
64
- }
50
+ /** Returns layer count from the current texture-array resource. */
51
+ GetLayerCount() {
52
+ return this.#layers.length;
53
+ }
65
54
 
66
- /** Updates layer count in the current texture-array resource. */
67
- SetLayerCount(value, names = null) {
68
- const count = Number(value);
69
- if (!Number.isInteger(count) || count < 1) {
70
- throw new RangeError("CjsTextureArrayRes layer count must be a positive integer.");
71
- }
72
- if (count === this.#layers.length) {
73
- this.#SetLayerNames(names);
74
- return false;
75
- }
76
- const previousCount = this.#layers.length;
77
- if (count < previousCount) {
78
- this.#layers.length = count;
79
- } else {
80
- for (let layer = previousCount; layer < count; layer++) {
81
- this.#layers.push(this.#CreateLayer(layer, names?.[layer]));
82
- }
83
- }
55
+ /** Updates layer count in the current texture-array resource. */
56
+ SetLayerCount(value, names = null) {
57
+ const count = Number(value);
58
+ if (!Number.isInteger(count) || count < 1) {
59
+ throw new RangeError("CjsTextureArrayRes layer count must be a positive integer.");
60
+ }
61
+ if (count === this.#layers.length) {
84
62
  this.#SetLayerNames(names);
85
- this.#InvalidateRange(count, true);
86
- return true;
63
+ return false;
64
+ }
65
+ const previousCount = this.#layers.length;
66
+ if (count < previousCount) {
67
+ this.#layers.length = count;
68
+ } else {
69
+ for (let layer = previousCount; layer < count; layer++) {
70
+ this.#layers.push(this.#CreateLayer(layer, names?.[layer]));
71
+ }
87
72
  }
73
+ this.#SetLayerNames(names);
74
+ this.#InvalidateRange(count, true);
75
+ return true;
76
+ }
88
77
 
89
- /** Returns layer parameter from the current texture-array resource. */
90
- GetLayerParameter(layer) {
91
- return this.#GetLayer(layer).proxy;
92
- }
78
+ /** Returns layer parameter from the current texture-array resource. */
79
+ GetLayerParameter(layer) {
80
+ return this.#GetLayer(layer).proxy;
81
+ }
93
82
 
94
- /** Returns layer parameters from the current texture-array resource. */
95
- GetLayerParameters(out = []) {
96
- for (const layer of this.#layers) out.push(layer.proxy);
97
- return out;
98
- }
83
+ /** Returns layer parameters from the current texture-array resource. */
84
+ GetLayerParameters(out = []) {
85
+ for (const layer of this.#layers) out.push(layer.proxy);
86
+ return out;
87
+ }
99
88
 
100
- /** Returns layer resource path from the current texture-array resource. */
101
- GetLayerResourcePath(layer) {
102
- return this.#GetLayer(layer).path;
103
- }
89
+ /** Returns layer resource path from the current texture-array resource. */
90
+ GetLayerResourcePath(layer) {
91
+ return this.#GetLayer(layer).path;
92
+ }
104
93
 
105
- /** Returns layer resource paths from the current texture-array resource. */
106
- GetLayerResourcePaths(out = []) {
107
- for (const layer of this.#layers) out.push(layer.path);
108
- return out;
109
- }
94
+ /** Returns layer resource paths from the current texture-array resource. */
95
+ GetLayerResourcePaths(out = []) {
96
+ for (const layer of this.#layers) out.push(layer.path);
97
+ return out;
98
+ }
110
99
 
111
- /** Updates layer resource path in the current texture-array resource. */
112
- SetLayerResourcePath(layer, value) {
113
- const record = this.#GetLayer(layer);
114
- const path = normalizeResourcePath(value);
115
- if (path === record.path) return false;
116
- record.path = path;
117
- record.resource = null;
118
- this.#InvalidateLayer(layer);
119
- return true;
120
- }
100
+ /** Updates layer resource path in the current texture-array resource. */
101
+ SetLayerResourcePath(layer, value) {
102
+ const record = this.#GetLayer(layer);
103
+ const path = normalizeResourcePath(value);
104
+ if (path === record.path) return false;
105
+ record.path = path;
106
+ record.resource = null;
107
+ this.#InvalidateLayer(layer);
108
+ return true;
109
+ }
121
110
 
122
- /** Updates layer resource paths in the current texture-array resource. */
123
- SetLayerResourcePaths(values, names = null) {
124
- if (!Array.isArray(values) || values.length === 0) {
125
- throw new TypeError("CjsTextureArrayRes layers must be a non-empty array of resource paths.");
126
- }
127
- const paths = values.map(value => normalizeResourcePath(value && typeof value === "object" ? value.resourcePath ?? value.path ?? value.GetPath?.() ?? "" : value));
128
- const topologyChanged = paths.length !== this.#layers.length;
129
- let contentChanged = topologyChanged;
130
- let namesChanged = false;
131
- const changedLayers = new Set();
132
- const next = [];
133
- for (let layer = 0; layer < paths.length; layer++) {
134
- const current = this.#layers[layer];
135
- const name = names?.[layer] ?? current?.proxy?.GetParameterName?.() ?? "";
136
- if (!current) {
137
- next.push(this.#CreateLayer(layer, name, paths[layer]));
138
- } else {
139
- if (current.path !== paths[layer]) {
140
- current.path = paths[layer];
141
- current.resource = null;
142
- contentChanged = true;
143
- changedLayers.add(layer);
144
- }
145
- if (current.proxy.SetParameterName(name)) namesChanged = true;
146
- next.push(current);
111
+ /** Updates layer resource paths in the current texture-array resource. */
112
+ SetLayerResourcePaths(values, names = null) {
113
+ if (!Array.isArray(values) || values.length === 0) {
114
+ throw new TypeError("CjsTextureArrayRes layers must be a non-empty array of resource paths.");
115
+ }
116
+ const paths = values.map(value => normalizeResourcePath(value && typeof value === "object" ? value.resourcePath ?? value.path ?? value.GetPath?.() ?? "" : value));
117
+ const topologyChanged = paths.length !== this.#layers.length;
118
+ let contentChanged = topologyChanged;
119
+ let namesChanged = false;
120
+ const changedLayers = new Set();
121
+ const next = [];
122
+ for (let layer = 0; layer < paths.length; layer++) {
123
+ const current = this.#layers[layer];
124
+ const name = names?.[layer] ?? current?.proxy?.GetParameterName?.() ?? "";
125
+ if (!current) {
126
+ next.push(this.#CreateLayer(layer, name, paths[layer]));
127
+ } else {
128
+ if (current.path !== paths[layer]) {
129
+ current.path = paths[layer];
130
+ current.resource = null;
131
+ contentChanged = true;
132
+ changedLayers.add(layer);
147
133
  }
134
+ if (current.proxy.SetParameterName(name)) namesChanged = true;
135
+ next.push(current);
148
136
  }
149
- this.#layers = next;
150
- if (topologyChanged) {
151
- this.#InvalidateRange(paths.length, true);
152
- } else if (contentChanged) {
153
- this.#InvalidateLayers(changedLayers);
154
- }
155
- return contentChanged || namesChanged;
156
137
  }
157
-
158
- /** Returns layer resource from the current texture-array resource. */
159
- GetLayerResource(layer) {
160
- return this.#GetLayer(layer).resource;
138
+ this.#layers = next;
139
+ if (topologyChanged) {
140
+ this.#InvalidateRange(paths.length, true);
141
+ } else if (contentChanged) {
142
+ this.#InvalidateLayers(changedLayers);
161
143
  }
144
+ return contentChanged || namesChanged;
145
+ }
162
146
 
163
- /** Updates layer resource in the current texture-array resource. */
164
- SetLayerResource(layer, resource) {
165
- const record = this.#GetLayer(layer);
166
- const next = resource ?? null;
167
- if (record.resource === next) return false;
168
- record.resource = next;
169
- this.#InvalidateLayer(layer);
170
- return true;
171
- }
147
+ /** Returns layer resource from the current texture-array resource. */
148
+ GetLayerResource(layer) {
149
+ return this.#GetLayer(layer).resource;
150
+ }
172
151
 
173
- /** Invalidate a layer whose resolved resource changed without changing identity. */
174
- TouchLayer(layer) {
175
- this.#GetLayer(layer);
176
- this.#InvalidateLayer(layer);
177
- return this;
178
- }
152
+ /** Updates layer resource in the current texture-array resource. */
153
+ SetLayerResource(layer, resource) {
154
+ const record = this.#GetLayer(layer);
155
+ const next = resource ?? null;
156
+ if (record.resource === next) return false;
157
+ record.resource = next;
158
+ this.#InvalidateLayer(layer);
159
+ return true;
160
+ }
179
161
 
180
- /** Invalidate every current layer, for example after an adapter generation loss. */
181
- TouchAllLayers(options = {}) {
182
- this.#InvalidateRange(this.#layers.length, !!options.topologyChanged);
183
- return this;
184
- }
162
+ /** Invalidate a layer whose resolved resource changed without changing identity. */
163
+ TouchLayer(layer) {
164
+ this.#GetLayer(layer);
165
+ this.#InvalidateLayer(layer);
166
+ return this;
167
+ }
185
168
 
186
- /** Returns requested revision from the current texture-array resource. */
187
- GetRequestedRevision() {
188
- return this.#requestedRevision;
189
- }
169
+ /** Invalidate every current layer, for example after an adapter generation loss. */
170
+ TouchAllLayers(options = {}) {
171
+ this.#InvalidateRange(this.#layers.length, !!options.topologyChanged);
172
+ return this;
173
+ }
190
174
 
191
- /** Returns prepared revision from the current texture-array resource. */
192
- GetPreparedRevision() {
193
- return this.#preparedRevision;
194
- }
175
+ /** Returns requested revision from the current texture-array resource. */
176
+ GetRequestedRevision() {
177
+ return this.#requestedRevision;
178
+ }
195
179
 
196
- /** Reports whether update is required by the current texture-array resource. */
197
- NeedsUpdate() {
198
- return this.#updateScheduled || this.#dirtyLayers.size > 0 || this.#preparedRevision < this.#requestedRevision;
199
- }
180
+ /** Returns prepared revision from the current texture-array resource. */
181
+ GetPreparedRevision() {
182
+ return this.#preparedRevision;
183
+ }
200
184
 
201
- /** Returns dirty layers from the current texture-array resource. */
202
- GetDirtyLayers() {
203
- return new Set(this.#dirtyLayers);
204
- }
185
+ /** Reports whether update is required by the current texture-array resource. */
186
+ NeedsUpdate() {
187
+ return this.#updateScheduled || this.#dirtyLayers.size > 0 || this.#preparedRevision < this.#requestedRevision;
188
+ }
205
189
 
206
- /**
207
- * Returns revisions currently being prepared by the update handler for the
208
- * texture-array resource.
209
- */
210
- GetInFlightRevisions(out = []) {
211
- for (const revision of this.#inFlightRequests.keys()) out.push(revision);
212
- return out.sort((a, b) => a - b);
213
- }
190
+ /** Returns dirty layers from the current texture-array resource. */
191
+ GetDirtyLayers() {
192
+ return new Set(this.#dirtyLayers);
193
+ }
214
194
 
215
- /**
216
- * Reports whether a requested revision is currently being prepared for the
217
- * texture-array resource.
218
- */
219
- IsRevisionInFlight(revision) {
220
- return this.#inFlightRequests.has(revision);
221
- }
195
+ /**
196
+ * Returns revisions currently being prepared by the update handler for the
197
+ * texture-array resource.
198
+ */
199
+ GetInFlightRevisions(out = []) {
200
+ for (const revision of this.#inFlightRequests.keys()) out.push(revision);
201
+ return out.sort((a, b) => a - b);
202
+ }
222
203
 
223
- /** Updates update scheduler in the current texture-array resource. */
224
- SetUpdateScheduler(schedule = null) {
225
- if (schedule !== null && typeof schedule !== "function") {
226
- throw new TypeError("CjsTextureArrayRes update scheduler must be a function or null.");
227
- }
228
- this.#updateScheduler = schedule;
229
- if (schedule && this.#updateScheduled) schedule(this);
230
- return this;
231
- }
204
+ /**
205
+ * Reports whether a requested revision is currently being prepared for the
206
+ * texture-array resource.
207
+ */
208
+ IsRevisionInFlight(revision) {
209
+ return this.#inFlightRequests.has(revision);
210
+ }
232
211
 
233
- /** Updates update handler in the current texture-array resource. */
234
- SetUpdateHandler(handler = null) {
235
- if (handler !== null && typeof handler !== "function") {
236
- throw new TypeError("CjsTextureArrayRes update handler must be a function or null.");
237
- }
238
- this.#updateHandler = handler;
239
- return this;
212
+ /** Updates update scheduler in the current texture-array resource. */
213
+ SetUpdateScheduler(schedule = null) {
214
+ if (schedule !== null && typeof schedule !== "function") {
215
+ throw new TypeError("CjsTextureArrayRes update scheduler must be a function or null.");
240
216
  }
217
+ this.#updateScheduler = schedule;
218
+ if (schedule && this.#updateScheduled) schedule(this);
219
+ return this;
220
+ }
241
221
 
242
- /**
243
- * Consume all proxy changes as one immutable request snapshot.
244
- * A frame scheduler should call this at most once per parent per frame.
245
- */
246
- ConsumeUpdateRequest() {
247
- if (!this.#updateScheduled && this.#dirtyLayers.size === 0) return null;
248
- const request = Object.freeze({
249
- revision: this.#requestedRevision,
250
- paths: Object.freeze(this.GetLayerResourcePaths()),
251
- resources: Object.freeze(this.#layers.map(layer => layer.resource)),
252
- dirtyLayers: Object.freeze([...this.#dirtyLayers].sort((a, b) => a - b)),
253
- topologyChanged: this.#topologyChanged
254
- });
255
- this.#dirtyLayers.clear();
256
- this.#topologyChanged = false;
257
- this.#updateScheduled = false;
258
- this.#inFlightRequests.set(request.revision, request);
259
- return request;
222
+ /** Updates update handler in the current texture-array resource. */
223
+ SetUpdateHandler(handler = null) {
224
+ if (handler !== null && typeof handler !== "function") {
225
+ throw new TypeError("CjsTextureArrayRes update handler must be a function or null.");
260
226
  }
227
+ this.#updateHandler = handler;
228
+ return this;
229
+ }
261
230
 
262
- /** Requeue a consumed current request after cancellation, loss, or retryable failure. */
263
- RetryUpdateRequest(revision = this.#requestedRevision) {
264
- const request = this.#inFlightRequests.get(revision);
265
- if (!request) return false;
266
- this.#inFlightRequests.delete(revision);
267
- if (revision !== this.#requestedRevision) return false;
268
- if (this.#failedRevision === revision) {
269
- this.#failedRevision = 0;
270
- this.#failedError = null;
271
- }
272
- for (const layer of request.dirtyLayers) {
273
- if (layer < this.#layers.length) this.#dirtyLayers.add(layer);
274
- }
275
- this.#topologyChanged ||= request.topologyChanged;
276
- this.#ScheduleUpdate();
277
- this.EmitEvent("revisionretry", this, revision);
278
- return true;
279
- }
231
+ /**
232
+ * Consume all proxy changes as one immutable request snapshot.
233
+ * A frame scheduler should call this at most once per parent per frame.
234
+ */
235
+ ConsumeUpdateRequest() {
236
+ if (!this.#updateScheduled && this.#dirtyLayers.size === 0) return null;
237
+ const request = Object.freeze({
238
+ revision: this.#requestedRevision,
239
+ paths: Object.freeze(this.GetLayerResourcePaths()),
240
+ resources: Object.freeze(this.#layers.map(layer => layer.resource)),
241
+ dirtyLayers: Object.freeze([...this.#dirtyLayers].sort((a, b) => a - b)),
242
+ topologyChanged: this.#topologyChanged
243
+ });
244
+ this.#dirtyLayers.clear();
245
+ this.#topologyChanged = false;
246
+ this.#updateScheduled = false;
247
+ this.#inFlightRequests.set(request.revision, request);
248
+ return request;
249
+ }
280
250
 
281
- /** Complete a consumed request as failed, optionally making it retryable. */
282
- FailUpdateRequest(revision, error, options = {}) {
283
- if (options.retry) return this.RetryUpdateRequest(revision);
284
- if (!this.#inFlightRequests.has(revision)) return false;
285
- this.#inFlightRequests.delete(revision);
286
- if (revision !== this.#requestedRevision) return false;
287
- const failure = error instanceof Error ? error : new Error(String(error ?? "Texture array preparation failed."));
288
- this.#failedRevision = revision;
289
- this.#failedError = failure;
290
- if (this.#preparedRevision === 0) this.SetError(failure);
291
- this.EmitEvent("revisionfailed", this, revision, failure);
292
- this.#RejectReadyWaiters(revision, failure);
293
- return true;
251
+ /** Requeue a consumed current request after cancellation, loss, or retryable failure. */
252
+ RetryUpdateRequest(revision = this.#requestedRevision) {
253
+ const request = this.#inFlightRequests.get(revision);
254
+ if (!request) return false;
255
+ this.#inFlightRequests.delete(revision);
256
+ if (revision !== this.#requestedRevision) return false;
257
+ if (this.#failedRevision === revision) {
258
+ this.#failedRevision = 0;
259
+ this.#failedError = null;
294
260
  }
295
-
296
- /** Run the registered update handler for the current coalesced frame request. */
297
- Update(context = {}) {
298
- const request = this.ConsumeUpdateRequest();
299
- if (!request) return null;
300
- this.EmitEvent("update", this, request, context);
301
- return this.#updateHandler ? this.#updateHandler(this, request, context) : request;
261
+ for (const layer of request.dirtyLayers) {
262
+ if (layer < this.#layers.length) this.#dirtyLayers.add(layer);
302
263
  }
264
+ this.#topologyChanged ||= request.topologyChanged;
265
+ this.#ScheduleUpdate();
266
+ this.EmitEvent("revisionretry", this, revision);
267
+ return true;
268
+ }
303
269
 
304
- /**
305
- * Atomically publish an opaque adapter allocation with its prepared revision.
306
- * The caller owns disposal of a successfully displaced allocation.
307
- */
308
- CommitPreparedAdapterRevision(revision, adapterKey, candidate, options = {}) {
309
- if (!adapterKey) throw new TypeError("CjsTextureArrayRes adapter publication requires a key.");
310
- if (candidate === null || candidate === undefined) {
311
- throw new TypeError("CjsTextureArrayRes adapter publication requires a candidate allocation.");
312
- }
313
- const inFlight = this.#inFlightRequests.has(revision);
314
- if (!inFlight || revision !== this.#requestedRevision) {
315
- if (inFlight) this.#inFlightRequests.delete(revision);
316
- if (options.destroyRejected !== false) destroyAdapterValue(candidate);
317
- return Object.freeze({
318
- published: false,
319
- revision,
320
- displaced: null
321
- });
322
- }
323
- const displaced = this.GetAdapterResource(adapterKey);
324
- this.SetAdapterResource(adapterKey, candidate);
325
- this.#preparedRevision = revision;
326
- this.#failedRevision = 0;
327
- this.#failedError = null;
328
- this.#inFlightRequests.delete(revision);
329
- for (const pendingRevision of this.#inFlightRequests.keys()) {
330
- if (pendingRevision < revision) this.#inFlightRequests.delete(pendingRevision);
331
- }
332
- this.MarkPrepared();
333
- this.EmitEvent("revisionprepared", this, revision, adapterKey, candidate);
334
- this.#ResolveReadyWaiters(revision);
270
+ /** Complete a consumed request as failed, optionally making it retryable. */
271
+ FailUpdateRequest(revision, error, options = {}) {
272
+ if (options.retry) return this.RetryUpdateRequest(revision);
273
+ if (!this.#inFlightRequests.has(revision)) return false;
274
+ this.#inFlightRequests.delete(revision);
275
+ if (revision !== this.#requestedRevision) return false;
276
+ const failure = error instanceof Error ? error : new Error(String(error ?? "Texture array preparation failed."));
277
+ this.#failedRevision = revision;
278
+ this.#failedError = failure;
279
+ if (this.#preparedRevision === 0) this.SetError(failure);
280
+ this.EmitEvent("revisionfailed", this, revision, failure);
281
+ this.#RejectReadyWaiters(revision, failure);
282
+ return true;
283
+ }
284
+
285
+ /** Run the registered update handler for the current coalesced frame request. */
286
+ Update(context = {}) {
287
+ const request = this.ConsumeUpdateRequest();
288
+ if (!request) return null;
289
+ this.EmitEvent("update", this, request, context);
290
+ return this.#updateHandler ? this.#updateHandler(this, request, context) : request;
291
+ }
292
+
293
+ /**
294
+ * Atomically publish an opaque adapter allocation with its prepared revision.
295
+ * The caller owns disposal of a successfully displaced allocation.
296
+ */
297
+ CommitPreparedAdapterRevision(revision, adapterKey, candidate, options = {}) {
298
+ if (!adapterKey) throw new TypeError("CjsTextureArrayRes adapter publication requires a key.");
299
+ if (candidate === null || candidate === undefined) {
300
+ throw new TypeError("CjsTextureArrayRes adapter publication requires a candidate allocation.");
301
+ }
302
+ const inFlight = this.#inFlightRequests.has(revision);
303
+ if (!inFlight || revision !== this.#requestedRevision) {
304
+ if (inFlight) this.#inFlightRequests.delete(revision);
305
+ if (options.destroyRejected !== false) destroyAdapterValue(candidate);
335
306
  return Object.freeze({
336
- published: true,
307
+ published: false,
337
308
  revision,
338
- displaced: displaced === candidate ? null : displaced
309
+ displaced: null
339
310
  });
340
311
  }
312
+ const displaced = this.GetAdapterResource(adapterKey);
313
+ this.SetAdapterResource(adapterKey, candidate);
314
+ this.#preparedRevision = revision;
315
+ this.#failedRevision = 0;
316
+ this.#failedError = null;
317
+ this.#inFlightRequests.delete(revision);
318
+ for (const pendingRevision of this.#inFlightRequests.keys()) {
319
+ if (pendingRevision < revision) this.#inFlightRequests.delete(pendingRevision);
320
+ }
321
+ this.MarkPrepared();
322
+ this.EmitEvent("revisionprepared", this, revision, adapterKey, candidate);
323
+ this.#ResolveReadyWaiters(revision);
324
+ return Object.freeze({
325
+ published: true,
326
+ revision,
327
+ displaced: displaced === candidate ? null : displaced
328
+ });
329
+ }
341
330
 
342
- /** Destroy an unusable adapter allocation and request a complete rebuild. */
343
- HandleAdapterLoss(adapterKey, options = {}) {
344
- if (!adapterKey) throw new TypeError("CjsTextureArrayRes adapter loss requires a key.");
345
- const lost = this.GetAdapterResource(adapterKey);
346
- if (this.HasAdapterResource(adapterKey)) this.DestroyAdapterResource(adapterKey, options);
347
- this.#preparedRevision = 0;
348
- if (this.#layers.length) this.#InvalidateRange(this.#layers.length, true);
349
- if (this.state === _CjsResource.State.PREPARED) this.MarkPreparing();
350
- this.EmitEvent("adapterlost", this, adapterKey, lost);
351
- return lost;
352
- }
331
+ /** Destroy an unusable adapter allocation and request a complete rebuild. */
332
+ HandleAdapterLoss(adapterKey, options = {}) {
333
+ if (!adapterKey) throw new TypeError("CjsTextureArrayRes adapter loss requires a key.");
334
+ const lost = this.GetAdapterResource(adapterKey);
335
+ if (this.HasAdapterResource(adapterKey)) this.DestroyAdapterResource(adapterKey, options);
336
+ this.#preparedRevision = 0;
337
+ if (this.#layers.length) this.#InvalidateRange(this.#layers.length, true);
338
+ if (this.state === CjsResource.State.PREPARED) this.MarkPreparing();
339
+ this.EmitEvent("adapterlost", this, adapterKey, lost);
340
+ return lost;
341
+ }
353
342
 
354
- /** Resolve when the generation requested at call time has been prepared. */
355
- Ready() {
356
- if (this.#requestedRevision === 0) {
357
- const error = new Error("Texture array resource has no configured layers.");
358
- error.code = "CJS_TEXTURE_ARRAY_UNCONFIGURED";
359
- return Promise.reject(error);
360
- }
361
- const revision = this.#requestedRevision;
362
- if (this.#preparedRevision >= revision && this.IsPrepared()) return Promise.resolve(this);
363
- if (this.#failedRevision === revision) return Promise.reject(this.#failedError);
364
- return new Promise((resolve, reject) => {
365
- this.#readyWaiters.push({
366
- revision,
367
- resolve,
368
- reject
369
- });
343
+ /** Resolve when the generation requested at call time has been prepared. */
344
+ Ready() {
345
+ if (this.#requestedRevision === 0) {
346
+ const error = new Error("Texture array resource has no configured layers.");
347
+ error.code = "CJS_TEXTURE_ARRAY_UNCONFIGURED";
348
+ return Promise.reject(error);
349
+ }
350
+ const revision = this.#requestedRevision;
351
+ if (this.#preparedRevision >= revision && this.IsPrepared()) return Promise.resolve(this);
352
+ if (this.#failedRevision === revision) return Promise.reject(this.#failedError);
353
+ return new Promise((resolve, reject) => {
354
+ this.#readyWaiters.push({
355
+ revision,
356
+ resolve,
357
+ reject
370
358
  });
371
- }
359
+ });
360
+ }
372
361
 
373
- /** Creates one texture-array layer record for the texture-array resource. */
374
- #CreateLayer(layer, name = "", path = "") {
375
- return {
376
- path: normalizeResourcePath(path),
377
- resource: null,
378
- proxy: new CjsTextureArrayResParameterProxy(this, layer, {
379
- name
380
- })
381
- };
382
- }
362
+ /** Creates one texture-array layer record for the texture-array resource. */
363
+ #CreateLayer(layer, name = "", path = "") {
364
+ return {
365
+ path: normalizeResourcePath(path),
366
+ resource: null,
367
+ proxy: new CjsTextureArrayResParameterProxy(this, layer, {
368
+ name
369
+ })
370
+ };
371
+ }
383
372
 
384
- /**
385
- * Returns a validated texture-array layer record for the texture-array
386
- * resource.
387
- */
388
- #GetLayer(layer) {
389
- if (!Number.isInteger(layer) || layer < 0 || layer >= this.#layers.length) {
390
- throw new RangeError(`CjsTextureArrayRes layer ${layer} is out of range.`);
391
- }
392
- return this.#layers[layer];
373
+ /**
374
+ * Returns a validated texture-array layer record for the texture-array
375
+ * resource.
376
+ */
377
+ #GetLayer(layer) {
378
+ if (!Number.isInteger(layer) || layer < 0 || layer >= this.#layers.length) {
379
+ throw new RangeError(`CjsTextureArrayRes layer ${layer} is out of range.`);
393
380
  }
381
+ return this.#layers[layer];
382
+ }
394
383
 
395
- /** Updates layer names in the current texture-array resource. */
396
- #SetLayerNames(names) {
397
- if (!names) return;
398
- for (let layer = 0; layer < Math.min(names.length, this.#layers.length); layer++) {
399
- this.#layers[layer].proxy.SetParameterName(names[layer]);
400
- }
384
+ /** Updates layer names in the current texture-array resource. */
385
+ #SetLayerNames(names) {
386
+ if (!names) return;
387
+ for (let layer = 0; layer < Math.min(names.length, this.#layers.length); layer++) {
388
+ this.#layers[layer].proxy.SetParameterName(names[layer]);
401
389
  }
390
+ }
402
391
 
403
- /** Invalidates one texture-array layer for the texture-array resource. */
404
- #InvalidateLayer(layer) {
405
- this.#InvalidateLayers([layer]);
406
- }
392
+ /** Invalidates one texture-array layer for the texture-array resource. */
393
+ #InvalidateLayer(layer) {
394
+ this.#InvalidateLayers([layer]);
395
+ }
407
396
 
408
- /**
409
- * Invalidates the requested texture-array layer range for the texture-array
410
- * resource.
411
- */
412
- #InvalidateRange(count, topologyChanged = false) {
413
- const layers = [];
414
- for (let layer = 0; layer < count; layer++) layers.push(layer);
415
- this.#InvalidateLayers(layers, topologyChanged);
416
- }
397
+ /**
398
+ * Invalidates the requested texture-array layer range for the texture-array
399
+ * resource.
400
+ */
401
+ #InvalidateRange(count, topologyChanged = false) {
402
+ const layers = [];
403
+ for (let layer = 0; layer < count; layer++) layers.push(layer);
404
+ this.#InvalidateLayers(layers, topologyChanged);
405
+ }
417
406
 
418
- /**
419
- * Invalidates the supplied texture-array layers for the texture-array
420
- * resource.
421
- */
422
- #InvalidateLayers(layers, topologyChanged = false) {
423
- const changed = [];
424
- for (const layer of layers) {
425
- if (!Number.isInteger(layer) || layer < 0 || layer >= this.#layers.length) continue;
426
- this.#dirtyLayers.add(layer);
427
- changed.push(layer);
428
- }
429
- if (!changed.length && !topologyChanged) return;
430
- this.#topologyChanged ||= topologyChanged;
431
- this.#failedRevision = 0;
432
- this.#failedError = null;
433
- this.#requestedRevision += 1;
434
- this.#ScheduleUpdate();
435
- this.EmitEvent("invalidated", this, Object.freeze(changed), this.#requestedRevision, Object.freeze({
436
- topologyChanged: this.#topologyChanged
437
- }));
438
- }
407
+ /**
408
+ * Invalidates the supplied texture-array layers for the texture-array
409
+ * resource.
410
+ */
411
+ #InvalidateLayers(layers, topologyChanged = false) {
412
+ const changed = [];
413
+ for (const layer of layers) {
414
+ if (!Number.isInteger(layer) || layer < 0 || layer >= this.#layers.length) continue;
415
+ this.#dirtyLayers.add(layer);
416
+ changed.push(layer);
417
+ }
418
+ if (!changed.length && !topologyChanged) return;
419
+ this.#topologyChanged ||= topologyChanged;
420
+ this.#failedRevision = 0;
421
+ this.#failedError = null;
422
+ this.#requestedRevision += 1;
423
+ this.#ScheduleUpdate();
424
+ this.EmitEvent("invalidated", this, Object.freeze(changed), this.#requestedRevision, Object.freeze({
425
+ topologyChanged: this.#topologyChanged
426
+ }));
427
+ }
439
428
 
440
- /** Schedules the coalesced texture-array update for the texture-array resource. */
441
- #ScheduleUpdate() {
442
- if (this.#updateScheduled) return;
443
- this.#updateScheduled = true;
444
- this.#updateScheduler?.(this);
445
- }
429
+ /** Schedules the coalesced texture-array update for the texture-array resource. */
430
+ #ScheduleUpdate() {
431
+ if (this.#updateScheduled) return;
432
+ this.#updateScheduled = true;
433
+ this.#updateScheduler?.(this);
434
+ }
446
435
 
447
- /**
448
- * Resolves waiters satisfied by the prepared revision for the texture-array
449
- * resource.
450
- */
451
- #ResolveReadyWaiters(revision) {
452
- const pending = [];
453
- for (const waiter of this.#readyWaiters) {
454
- if (waiter.revision <= revision) waiter.resolve(this);else pending.push(waiter);
455
- }
456
- this.#readyWaiters = pending;
436
+ /**
437
+ * Resolves waiters satisfied by the prepared revision for the texture-array
438
+ * resource.
439
+ */
440
+ #ResolveReadyWaiters(revision) {
441
+ const pending = [];
442
+ for (const waiter of this.#readyWaiters) {
443
+ if (waiter.revision <= revision) waiter.resolve(this);else pending.push(waiter);
457
444
  }
445
+ this.#readyWaiters = pending;
446
+ }
458
447
 
459
- /**
460
- * Rejects waiters affected by a failed revision for the texture-array
461
- * resource.
462
- */
463
- #RejectReadyWaiters(revision, error) {
464
- const pending = [];
465
- for (const waiter of this.#readyWaiters) {
466
- if (waiter.revision <= revision) waiter.reject(error);else pending.push(waiter);
467
- }
468
- this.#readyWaiters = pending;
448
+ /**
449
+ * Rejects waiters affected by a failed revision for the texture-array
450
+ * resource.
451
+ */
452
+ #RejectReadyWaiters(revision, error) {
453
+ const pending = [];
454
+ for (const waiter of this.#readyWaiters) {
455
+ if (waiter.revision <= revision) waiter.reject(error);else pending.push(waiter);
469
456
  }
470
- }];
471
- payload = "texture-array";
472
- constructor() {
473
- super(_CjsTextureArrayRes), _initClass();
457
+ this.#readyWaiters = pending;
474
458
  }
475
- }();
459
+ static payload = "texture-array";
460
+ }
476
461
  function destroyAdapterValue(value) {
477
462
  if (!value || typeof value !== "object" && typeof value !== "function") return;
478
463
  const destroy = value.Destroy || value.Dispose || value.destroy || value.dispose;
479
464
  if (typeof destroy === "function") destroy.call(value);
480
465
  }
466
+ CjsSchema.define(CjsTextureArrayRes, {
467
+ className: "CjsTextureArrayRes",
468
+ family: "resource"
469
+ });
481
470
 
482
- export { _CjsTextureArrayRes as CjsTextureArrayRes };
471
+ export { CjsTextureArrayRes };
483
472
  //# sourceMappingURL=CjsTextureArrayRes.js.map