@babylonjs/core 5.7.0 → 5.8.0
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/DeviceInput/InputDevices/webDeviceInputSystem.js +1 -1
- package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.dynamicBuffer.js +7 -5
- package/Engines/Extensions/engine.dynamicBuffer.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.d.ts +4 -2
- package/Engines/Extensions/engine.rawTexture.js +7 -4
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +3 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.dynamicBuffer.js +3 -21
- package/Engines/WebGPU/Extensions/engine.dynamicBuffer.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +7 -3
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +8 -2
- package/Engines/WebGPU/webgpuConstants.js +15 -8
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +4 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/engine.d.ts +57 -49
- package/Engines/nativeEngine.d.ts +4 -4
- package/Engines/nativeEngine.js +9 -5
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +4 -2
- package/Engines/nullEngine.js +8 -2
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.js +30 -4
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +2 -8
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.js +5 -0
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +1 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +7 -0
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +4 -2
- package/Materials/Node/nodeMaterial.js +12 -4
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/internalTexture.js +1 -1
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +10 -4
- package/Materials/Textures/rawTexture.js +20 -9
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/standardMaterial.js +5 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.vector.js +5 -5
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/groundBuilder.d.ts +1 -1
- package/Meshes/Builders/groundBuilder.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +0 -5
- package/Meshes/abstractMesh.js +1 -13
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/instancedMesh.js +1 -0
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +1 -1
- package/Meshes/mesh.js +60 -32
- package/Meshes/mesh.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.js +2 -4
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/Shaders/ShadersInclude/defaultFragmentDeclaration.js +1 -1
- package/Shaders/ShadersInclude/defaultFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
- package/Shaders/ShadersInclude/vertexColorMixing.js +1 -1
- package/Shaders/ShadersInclude/vertexColorMixing.js.map +1 -1
- package/Shaders/default.fragment.js +1 -1
- package/Shaders/default.fragment.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +1 -1
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/package.json +1 -1
package/Engines/engine.d.ts
CHANGED
|
@@ -1093,6 +1093,8 @@ interface WebGLRenderingContext {
|
|
|
1093
1093
|
COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: number;
|
|
1094
1094
|
COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: number;
|
|
1095
1095
|
COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: number;
|
|
1096
|
+
COMPRESSED_SRGB8_ETC2: number;
|
|
1097
|
+
COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: number;
|
|
1096
1098
|
|
|
1097
1099
|
UNSIGNED_INT_24_8: number;
|
|
1098
1100
|
DEPTH24_STENCIL8: number;
|
|
@@ -1365,6 +1367,7 @@ interface WorkerNavigator {
|
|
|
1365
1367
|
class GPU {
|
|
1366
1368
|
private __brand: void;
|
|
1367
1369
|
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter | null>;
|
|
1370
|
+
getPreferredCanvasFormat(): GPUTextureFormat;
|
|
1368
1371
|
}
|
|
1369
1372
|
|
|
1370
1373
|
interface GPURequestAdapterOptions {
|
|
@@ -1388,6 +1391,7 @@ class GPUAdapter {
|
|
|
1388
1391
|
interface GPUDeviceDescriptor extends GPUObjectDescriptorBase {
|
|
1389
1392
|
requiredFeatures?: GPUFeatureName[] /* default=[] */;
|
|
1390
1393
|
requiredLimits?: { [name: string]: GPUSize64 } /* default={} */;
|
|
1394
|
+
defaultQueue?: GPUQueueDescriptor /* default={} */;
|
|
1391
1395
|
}
|
|
1392
1396
|
|
|
1393
1397
|
type GPUFeatureName =
|
|
@@ -1398,7 +1402,9 @@ type GPUFeatureName =
|
|
|
1398
1402
|
| "texture-compression-etc2"
|
|
1399
1403
|
| "texture-compression-astc"
|
|
1400
1404
|
| "timestamp-query"
|
|
1401
|
-
| "indirect-first-instance"
|
|
1405
|
+
| "indirect-first-instance"
|
|
1406
|
+
| "shader-f16"
|
|
1407
|
+
| "bgra8unorm-storage";
|
|
1402
1408
|
|
|
1403
1409
|
class GPUDevice extends EventTarget implements GPUObjectBase {
|
|
1404
1410
|
private __brand: void;
|
|
@@ -1665,8 +1671,6 @@ interface GPUBindGroupLayoutDescriptor extends GPUObjectDescriptorBase {
|
|
|
1665
1671
|
entries: GPUBindGroupLayoutEntry[];
|
|
1666
1672
|
}
|
|
1667
1673
|
|
|
1668
|
-
type GPUShaderStageFlags = number;
|
|
1669
|
-
|
|
1670
1674
|
interface GPUBindGroupLayoutEntry {
|
|
1671
1675
|
binding: GPUIndex32;
|
|
1672
1676
|
visibility: GPUShaderStageFlags;
|
|
@@ -1678,6 +1682,8 @@ interface GPUBindGroupLayoutEntry {
|
|
|
1678
1682
|
externalTexture?: GPUExternalTextureBindingLayout;
|
|
1679
1683
|
}
|
|
1680
1684
|
|
|
1685
|
+
type GPUShaderStageFlags = number;
|
|
1686
|
+
|
|
1681
1687
|
type GPUBufferBindingType = "uniform" | "storage" | "read-only-storage";
|
|
1682
1688
|
|
|
1683
1689
|
interface GPUBufferBindingLayout {
|
|
@@ -1749,16 +1755,16 @@ class GPUShaderModule implements GPUObjectBase {
|
|
|
1749
1755
|
compilationInfo(): Promise<GPUCompilationInfo>;
|
|
1750
1756
|
}
|
|
1751
1757
|
|
|
1752
|
-
interface GPUShaderModuleCompilationHint {
|
|
1753
|
-
layout: GPUPipelineLayout;
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
1758
|
interface GPUShaderModuleDescriptor extends GPUObjectDescriptorBase {
|
|
1757
1759
|
code: string | Uint32Array;
|
|
1758
1760
|
sourceMap?: object;
|
|
1759
1761
|
hints?: { [name: string]: GPUShaderModuleCompilationHint };
|
|
1760
1762
|
}
|
|
1761
1763
|
|
|
1764
|
+
interface GPUShaderModuleCompilationHint {
|
|
1765
|
+
layout: GPUPipelineLayout | GPUAutoLayoutMode;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1762
1768
|
type GPUCompilationMessageType = "error" | "warning" | "info";
|
|
1763
1769
|
|
|
1764
1770
|
interface GPUCompilationMessage {
|
|
@@ -1774,8 +1780,10 @@ interface GPUCompilationInfo {
|
|
|
1774
1780
|
readonly messages: readonly GPUCompilationMessage[];
|
|
1775
1781
|
}
|
|
1776
1782
|
|
|
1783
|
+
type GPUAutoLayoutMode = "auto";
|
|
1784
|
+
|
|
1777
1785
|
interface GPUPipelineDescriptorBase extends GPUObjectDescriptorBase {
|
|
1778
|
-
layout?: GPUPipelineLayout;
|
|
1786
|
+
layout?: GPUPipelineLayout | GPUAutoLayoutMode;
|
|
1779
1787
|
}
|
|
1780
1788
|
|
|
1781
1789
|
interface GPUPipelineBase {
|
|
@@ -1788,7 +1796,7 @@ interface GPUProgrammableStage {
|
|
|
1788
1796
|
constants?: { [name: string]: GPUPipelineConstantValue };
|
|
1789
1797
|
}
|
|
1790
1798
|
|
|
1791
|
-
type GPUPipelineConstantValue = number; // May represent WGSL’s bool, f32, i32, u32.
|
|
1799
|
+
type GPUPipelineConstantValue = number; // May represent WGSL’s bool, f32, i32, u32, and f16 if enabled.
|
|
1792
1800
|
|
|
1793
1801
|
class GPUComputePipeline implements GPUObjectBase, GPUPipelineBase {
|
|
1794
1802
|
private __brand: void;
|
|
@@ -1816,8 +1824,6 @@ interface GPURenderPipelineDescriptor extends GPUPipelineDescriptorBase {
|
|
|
1816
1824
|
fragment?: GPUFragmentState;
|
|
1817
1825
|
}
|
|
1818
1826
|
|
|
1819
|
-
type GPUPrimitiveTopology = "point-list" | "line-list" | "line-strip" | "triangle-list" | "triangle-strip";
|
|
1820
|
-
|
|
1821
1827
|
interface GPUPrimitiveState {
|
|
1822
1828
|
topology?: GPUPrimitiveTopology /* default="triangle-list" */;
|
|
1823
1829
|
stripIndexFormat?: GPUIndexFormat;
|
|
@@ -1828,6 +1834,8 @@ interface GPUPrimitiveState {
|
|
|
1828
1834
|
unclippedDepth?: boolean /* default=false */;
|
|
1829
1835
|
}
|
|
1830
1836
|
|
|
1837
|
+
type GPUPrimitiveTopology = "point-list" | "line-list" | "line-strip" | "triangle-list" | "triangle-strip";
|
|
1838
|
+
|
|
1831
1839
|
type GPUFrontFace = "ccw" | "cw";
|
|
1832
1840
|
|
|
1833
1841
|
type GPUCullMode = "none" | "front" | "back";
|
|
@@ -1839,7 +1847,7 @@ interface GPUMultisampleState {
|
|
|
1839
1847
|
}
|
|
1840
1848
|
|
|
1841
1849
|
interface GPUFragmentState extends GPUProgrammableStage {
|
|
1842
|
-
targets: (GPUColorTargetState | null
|
|
1850
|
+
targets: (GPUColorTargetState | null)[];
|
|
1843
1851
|
}
|
|
1844
1852
|
|
|
1845
1853
|
interface GPUColorTargetState {
|
|
@@ -2020,13 +2028,9 @@ interface GPUImageCopyExternalImage {
|
|
|
2020
2028
|
flipY?: boolean /* default=false */;
|
|
2021
2029
|
}
|
|
2022
2030
|
|
|
2023
|
-
interface
|
|
2031
|
+
interface GPUBindingCommandsMixin {
|
|
2024
2032
|
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsets?: GPUBufferDynamicOffset[]): void;
|
|
2025
2033
|
setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup, dynamicOffsetData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): void;
|
|
2026
|
-
|
|
2027
|
-
pushDebugGroup(groupLabel: string): void;
|
|
2028
|
-
popDebugGroup(): void;
|
|
2029
|
-
insertDebugMarker(markerLabel: string): void;
|
|
2030
2034
|
}
|
|
2031
2035
|
|
|
2032
2036
|
interface GPUDebugCommandsMixin {
|
|
@@ -2035,7 +2039,7 @@ interface GPUDebugCommandsMixin {
|
|
|
2035
2039
|
insertDebugMarker(markerLabel: string): void;
|
|
2036
2040
|
}
|
|
2037
2041
|
|
|
2038
|
-
class GPUComputePassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin,
|
|
2042
|
+
class GPUComputePassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin {
|
|
2039
2043
|
private __brand: void;
|
|
2040
2044
|
label: string | undefined;
|
|
2041
2045
|
|
|
@@ -2047,8 +2051,8 @@ class GPUComputePassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebug
|
|
|
2047
2051
|
insertDebugMarker(markerLabel: string): void;
|
|
2048
2052
|
|
|
2049
2053
|
setPipeline(pipeline: GPUComputePipeline): void;
|
|
2050
|
-
|
|
2051
|
-
|
|
2054
|
+
dispatchWorkgroups(workgroupCountX: GPUSize32, workgroupCountY?: GPUSize32 /* default=1 */, workgroupCountZ?: GPUSize32 /* default=1 */): void;
|
|
2055
|
+
dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2052
2056
|
|
|
2053
2057
|
end(): void;
|
|
2054
2058
|
}
|
|
@@ -2067,26 +2071,7 @@ interface GPUComputePassDescriptor extends GPUObjectDescriptorBase {
|
|
|
2067
2071
|
timestampWrites?: GPUComputePassTimestampWrites /* default=[] */;
|
|
2068
2072
|
}
|
|
2069
2073
|
|
|
2070
|
-
|
|
2071
|
-
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2072
|
-
|
|
2073
|
-
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
|
|
2074
|
-
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
|
|
2075
|
-
|
|
2076
|
-
draw(vertexCount: GPUSize32, instanceCount?: GPUSize32 /* default=1 */, firstVertex?: GPUSize32 /* default=0 */, firstInstance?: GPUSize32 /* default=0 */): void;
|
|
2077
|
-
drawIndexed(
|
|
2078
|
-
indexCount: GPUSize32,
|
|
2079
|
-
instanceCount?: GPUSize32 /* default=1 */,
|
|
2080
|
-
firstIndex?: GPUSize32 /* default=0 */,
|
|
2081
|
-
baseVertex?: GPUSignedOffset32 /* default=0 */,
|
|
2082
|
-
firstInstance?: GPUSize32 /* default=0 */
|
|
2083
|
-
): void;
|
|
2084
|
-
|
|
2085
|
-
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2086
|
-
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
class GPURenderPassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUProgrammablePassEncoder, GPURenderEncoderBase {
|
|
2074
|
+
class GPURenderPassEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin {
|
|
2090
2075
|
private __brand: void;
|
|
2091
2076
|
label: string | undefined;
|
|
2092
2077
|
|
|
@@ -2139,7 +2124,7 @@ interface GPURenderPassTimestampWrite {
|
|
|
2139
2124
|
type GPURenderPassTimestampWrites = Array<GPURenderPassTimestampWrite>;
|
|
2140
2125
|
|
|
2141
2126
|
interface GPURenderPassDescriptor extends GPUObjectDescriptorBase {
|
|
2142
|
-
colorAttachments: (GPURenderPassColorAttachment | null
|
|
2127
|
+
colorAttachments: (GPURenderPassColorAttachment | null)[];
|
|
2143
2128
|
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
2144
2129
|
occlusionQuerySet?: GPUQuerySet;
|
|
2145
2130
|
timestampWrites?: GPURenderPassTimestampWrites /* default=[] */;
|
|
@@ -2173,11 +2158,30 @@ type GPULoadOp = "load" | "clear";
|
|
|
2173
2158
|
type GPUStoreOp = "store" | "discard";
|
|
2174
2159
|
|
|
2175
2160
|
interface GPURenderPassLayout extends GPUObjectDescriptorBase {
|
|
2176
|
-
colorFormats: (GPUTextureFormat | null
|
|
2161
|
+
colorFormats: (GPUTextureFormat | null)[];
|
|
2177
2162
|
depthStencilFormat?: GPUTextureFormat;
|
|
2178
2163
|
sampleCount?: GPUSize32 /* default=1 */;
|
|
2179
2164
|
}
|
|
2180
2165
|
|
|
2166
|
+
interface GPURenderCommandsMixin {
|
|
2167
|
+
setPipeline(pipeline: GPURenderPipeline): void;
|
|
2168
|
+
|
|
2169
|
+
setIndexBuffer(buffer: GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
|
|
2170
|
+
setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer, offset?: GPUSize64 /* default=0 */, size?: GPUSize64 /* default=0 */): void;
|
|
2171
|
+
|
|
2172
|
+
draw(vertexCount: GPUSize32, instanceCount?: GPUSize32 /* default=1 */, firstVertex?: GPUSize32 /* default=0 */, firstInstance?: GPUSize32 /* default=0 */): void;
|
|
2173
|
+
drawIndexed(
|
|
2174
|
+
indexCount: GPUSize32,
|
|
2175
|
+
instanceCount?: GPUSize32 /* default=1 */,
|
|
2176
|
+
firstIndex?: GPUSize32 /* default=0 */,
|
|
2177
|
+
baseVertex?: GPUSignedOffset32 /* default=0 */,
|
|
2178
|
+
firstInstance?: GPUSize32 /* default=0 */
|
|
2179
|
+
): void;
|
|
2180
|
+
|
|
2181
|
+
drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2182
|
+
drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): void;
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2181
2185
|
class GPURenderBundle implements GPUObjectBase {
|
|
2182
2186
|
private __brand: void;
|
|
2183
2187
|
label: string | undefined;
|
|
@@ -2185,7 +2189,7 @@ class GPURenderBundle implements GPUObjectBase {
|
|
|
2185
2189
|
|
|
2186
2190
|
interface GPURenderBundleDescriptor extends GPUObjectDescriptorBase {}
|
|
2187
2191
|
|
|
2188
|
-
class GPURenderBundleEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin,
|
|
2192
|
+
class GPURenderBundleEncoder implements GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin {
|
|
2189
2193
|
private __brand: void;
|
|
2190
2194
|
label: string | undefined;
|
|
2191
2195
|
|
|
@@ -2221,6 +2225,8 @@ interface GPURenderBundleEncoderDescriptor extends GPURenderPassLayout {
|
|
|
2221
2225
|
stencilReadOnly?: boolean /* default=false */;
|
|
2222
2226
|
}
|
|
2223
2227
|
|
|
2228
|
+
interface GPUQueueDescriptor extends GPUObjectDescriptorBase {}
|
|
2229
|
+
|
|
2224
2230
|
class GPUQueue implements GPUObjectBase {
|
|
2225
2231
|
private __brand: void;
|
|
2226
2232
|
label: string | undefined;
|
|
@@ -2258,7 +2264,6 @@ class GPUCanvasContext {
|
|
|
2258
2264
|
configure(configuration?: GPUCanvasConfiguration): void;
|
|
2259
2265
|
unconfigure(): void;
|
|
2260
2266
|
|
|
2261
|
-
getPreferredFormat(adapter: GPUAdapter): GPUTextureFormat;
|
|
2262
2267
|
getCurrentTexture(): GPUTexture;
|
|
2263
2268
|
}
|
|
2264
2269
|
|
|
@@ -2271,7 +2276,6 @@ interface GPUCanvasConfiguration extends GPUObjectDescriptorBase {
|
|
|
2271
2276
|
viewFormats?: GPUTextureFormat[] /* default=[] */;
|
|
2272
2277
|
colorSpace?: GPUPredefinedColorSpace /* default="srgb" */;
|
|
2273
2278
|
compositingAlphaMode?: GPUCanvasCompositingAlphaMode /* default="opaque" */;
|
|
2274
|
-
size: GPUExtent3D;
|
|
2275
2279
|
}
|
|
2276
2280
|
|
|
2277
2281
|
type GPUDeviceLostReason = "destroyed";
|
|
@@ -2284,19 +2288,23 @@ class GPUDeviceLostInfo {
|
|
|
2284
2288
|
|
|
2285
2289
|
type GPUErrorFilter = "out-of-memory" | "validation";
|
|
2286
2290
|
|
|
2287
|
-
class
|
|
2291
|
+
class GPUError {
|
|
2292
|
+
private __brand: void;
|
|
2293
|
+
readonly message: string;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
class GPUOutOfMemoryError implements GPUError {
|
|
2288
2297
|
private __brand: void;
|
|
2289
2298
|
constructor();
|
|
2299
|
+
readonly message: string;
|
|
2290
2300
|
}
|
|
2291
2301
|
|
|
2292
|
-
class GPUValidationError {
|
|
2302
|
+
class GPUValidationError implements GPUError {
|
|
2293
2303
|
private __brand: void;
|
|
2294
2304
|
constructor(message: string);
|
|
2295
2305
|
readonly message: string;
|
|
2296
2306
|
}
|
|
2297
2307
|
|
|
2298
|
-
type GPUError = GPUOutOfMemoryError | GPUValidationError;
|
|
2299
|
-
|
|
2300
2308
|
class GPUUncapturedErrorEvent extends Event {
|
|
2301
2309
|
private __brand: void;
|
|
2302
2310
|
constructor(type: string, gpuUncapturedErrorEventInitDict: GPUUncapturedErrorEventInit);
|
|
@@ -351,9 +351,9 @@ export declare class NativeEngine extends Engine {
|
|
|
351
351
|
createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;
|
|
352
352
|
createVideoElement(constraints: MediaTrackConstraints): any;
|
|
353
353
|
updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;
|
|
354
|
-
createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number): InternalTexture;
|
|
354
|
+
createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
|
|
355
355
|
createRawTexture2DArray(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, textureType?: number): InternalTexture;
|
|
356
|
-
updateRawTexture(texture: Nullable<InternalTexture>, bufferView: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number): void;
|
|
356
|
+
updateRawTexture(texture: Nullable<InternalTexture>, bufferView: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number, useSRGBBuffer?: boolean): void;
|
|
357
357
|
/**
|
|
358
358
|
* Usually called from Texture.ts.
|
|
359
359
|
* Passed information to create a WebGLTexture
|
|
@@ -373,8 +373,8 @@ export declare class NativeEngine extends Engine {
|
|
|
373
373
|
* @param forcedExtension defines the extension to use to pick the right loader
|
|
374
374
|
* @param mimeType defines an optional mime type
|
|
375
375
|
* @param loaderOptions options to be passed to the loader
|
|
376
|
-
* @param creationFlags
|
|
377
|
-
* @param useSRGBBuffer
|
|
376
|
+
* @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
|
|
377
|
+
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
378
378
|
* @returns a InternalTexture for assignment back into BABYLON.Texture
|
|
379
379
|
*/
|
|
380
380
|
createTexture(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
|
package/Engines/nativeEngine.js
CHANGED
|
@@ -1756,9 +1756,11 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
1756
1756
|
this._camera.updateVideoTexture(webGLTexture, video, invertY);
|
|
1757
1757
|
}
|
|
1758
1758
|
};
|
|
1759
|
-
NativeEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type) {
|
|
1759
|
+
NativeEngine.prototype.createRawTexture = function (data, width, height, format, generateMipMaps, invertY, samplingMode, compression, type, creationFlags, useSRGBBuffer) {
|
|
1760
1760
|
if (compression === void 0) { compression = null; }
|
|
1761
1761
|
if (type === void 0) { type = 0; }
|
|
1762
|
+
if (creationFlags === void 0) { creationFlags = 0; }
|
|
1763
|
+
if (useSRGBBuffer === void 0) { useSRGBBuffer = false; }
|
|
1762
1764
|
var texture = new InternalTexture(this, InternalTextureSource.Raw);
|
|
1763
1765
|
texture.format = format;
|
|
1764
1766
|
texture.generateMipMaps = generateMipMaps;
|
|
@@ -1770,7 +1772,8 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
1770
1772
|
texture.height = texture.baseHeight;
|
|
1771
1773
|
texture._compression = compression;
|
|
1772
1774
|
texture.type = type;
|
|
1773
|
-
this.
|
|
1775
|
+
texture._useSRGBBuffer = this._getUseSRGBBuffer(useSRGBBuffer, !generateMipMaps);
|
|
1776
|
+
this.updateRawTexture(texture, data, format, invertY, compression, type, texture._useSRGBBuffer);
|
|
1774
1777
|
if (texture._hardwareTexture) {
|
|
1775
1778
|
var webGLTexture = texture._hardwareTexture.underlyingResource;
|
|
1776
1779
|
var filter = this._getNativeSamplingMode(samplingMode);
|
|
@@ -1804,9 +1807,10 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
1804
1807
|
this._internalTexturesCache.push(texture);
|
|
1805
1808
|
return texture;
|
|
1806
1809
|
};
|
|
1807
|
-
NativeEngine.prototype.updateRawTexture = function (texture, bufferView, format, invertY, compression, type) {
|
|
1810
|
+
NativeEngine.prototype.updateRawTexture = function (texture, bufferView, format, invertY, compression, type, useSRGBBuffer) {
|
|
1808
1811
|
if (compression === void 0) { compression = null; }
|
|
1809
1812
|
if (type === void 0) { type = 0; }
|
|
1813
|
+
if (useSRGBBuffer === void 0) { useSRGBBuffer = false; }
|
|
1810
1814
|
if (!texture) {
|
|
1811
1815
|
return;
|
|
1812
1816
|
}
|
|
@@ -1836,8 +1840,8 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
1836
1840
|
* @param forcedExtension defines the extension to use to pick the right loader
|
|
1837
1841
|
* @param mimeType defines an optional mime type
|
|
1838
1842
|
* @param loaderOptions options to be passed to the loader
|
|
1839
|
-
* @param creationFlags
|
|
1840
|
-
* @param useSRGBBuffer
|
|
1843
|
+
* @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)
|
|
1844
|
+
* @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
|
|
1841
1845
|
* @returns a InternalTexture for assignment back into BABYLON.Texture
|
|
1842
1846
|
*/
|
|
1843
1847
|
NativeEngine.prototype.createTexture = function (url, noMipmap, invertY, scene, samplingMode, onLoad, onError, buffer, fallback, format, forcedExtension, mimeType, loaderOptions, creationFlags, useSRGBBuffer) {
|