@luma.gl/webgpu
Advanced tools
Comparing version 9.0.0-alpha.45 to 9.0.0-alpha.46
@@ -11,3 +11,3 @@ /// <reference types="dist" /> | ||
write(data: ArrayBufferView, byteOffset?: number): void; | ||
readAsync(byteOffset?: number, byteLength?: number): Promise<ArrayBuffer>; | ||
readAsync(byteOffset?: number, byteLength?: number): Promise<Uint8Array>; | ||
_writeMapped<TypedArray>(typedArray: TypedArray): void; | ||
@@ -14,0 +14,0 @@ mapAsync(mode: number, offset?: number, size?: number): Promise<void>; |
@@ -50,3 +50,3 @@ import { Buffer } from '@luma.gl/core'; | ||
tempBuffer.destroy(); | ||
return arrayBuffer; | ||
return new Uint8Array(arrayBuffer); | ||
} | ||
@@ -53,0 +53,0 @@ _writeMapped(typedArray) { |
/// <reference types="dist" /> | ||
import type { DeviceProps, DeviceInfo, DeviceLimits, DeviceFeature, CanvasContextProps, BufferProps, SamplerProps, ShaderProps, Texture, TextureProps, TextureFormat, ExternalTextureProps, FramebufferProps, RenderPipelineProps, ComputePipelineProps, RenderPassProps, ComputePassProps, VertexArrayProps } from '@luma.gl/core'; | ||
import type { DeviceProps, DeviceInfo, DeviceLimits, DeviceFeature, CanvasContextProps, BufferProps, SamplerProps, ShaderProps, Texture, TextureProps, TextureFormat, ExternalTextureProps, FramebufferProps, RenderPipelineProps, ComputePipelineProps, RenderPassProps, ComputePassProps, VertexArrayProps, TransformFeedback, TransformFeedbackProps } from '@luma.gl/core'; | ||
import { Device } from '@luma.gl/core'; | ||
@@ -59,2 +59,3 @@ import { WebGPUBuffer } from './resources/webgpu-buffer'; | ||
beginComputePass(props: ComputePassProps): WebGPUComputePass; | ||
createTransformFeedback(props: TransformFeedbackProps): TransformFeedback; | ||
createCanvasContext(props: CanvasContextProps): WebGPUCanvasContext; | ||
@@ -61,0 +62,0 @@ /** |
@@ -83,3 +83,6 @@ import { Device, CanvasContext, log, uid } from '@luma.gl/core'; | ||
this.canvasContext = new WebGPUCanvasContext(this, this.adapter, { | ||
canvas: props.canvas | ||
canvas: props.canvas, | ||
height: props.height, | ||
width: props.width, | ||
container: props.container | ||
}); | ||
@@ -145,2 +148,5 @@ this.features = this._getFeatures(); | ||
} | ||
createTransformFeedback(props) { | ||
throw new Error('Transform feedback not supported in WebGPU'); | ||
} | ||
createCanvasContext(props) { | ||
@@ -147,0 +153,0 @@ return new WebGPUCanvasContext(this, this.adapter, props); |
{ | ||
"name": "@luma.gl/webgpu", | ||
"version": "9.0.0-alpha.45", | ||
"version": "9.0.0-alpha.46", | ||
"description": "WebGPU adapter for the luma.gl API", | ||
@@ -40,7 +40,7 @@ "type": "module", | ||
"@babel/runtime": "^7.0.0", | ||
"@luma.gl/core": "9.0.0-alpha.45", | ||
"@luma.gl/core": "9.0.0-alpha.46", | ||
"@probe.gl/env": "^4.0.2", | ||
"@webgpu/types": "^0.1.34" | ||
}, | ||
"gitHead": "38b58964a1287a84ac021fa02d4432a5d3f960a0" | ||
"gitHead": "c1e0602fd739f8d08e6532034a02e8cf658e188a" | ||
} |
/* | ||
import {assert} from '@luma.gl/core'; | ||
import {GL} from '@luma.gl/constants'; | ||
@@ -5,0 +4,0 @@ type Accessor = Record<string, any>; |
@@ -57,3 +57,3 @@ // WEBGPU Buffer implementation | ||
override async readAsync(byteOffset: number = 0, byteLength: number = this.byteLength): Promise<ArrayBuffer> { | ||
override async readAsync(byteOffset: number = 0, byteLength: number = this.byteLength): Promise<Uint8Array> { | ||
// We need MAP_READ flag, but only COPY_DST buffers can have MAP_READ flag, so we need to create a temp buffer | ||
@@ -74,3 +74,3 @@ const tempBuffer = new WebGPUBuffer(this.device, {usage: Buffer.MAP_READ | Buffer.COPY_DST, byteLength}); | ||
return arrayBuffer; | ||
return new Uint8Array(arrayBuffer); | ||
} | ||
@@ -77,0 +77,0 @@ |
@@ -23,3 +23,5 @@ // prettier-ignore | ||
// CommandEncoderProps, | ||
VertexArrayProps | ||
VertexArrayProps, | ||
TransformFeedback, | ||
TransformFeedbackProps | ||
} from '@luma.gl/core'; | ||
@@ -121,3 +123,3 @@ import {Device, CanvasContext, log, uid} from '@luma.gl/core'; | ||
// "Context" loss handling | ||
this.lost = new Promise<{reason: 'destroyed'; message: string}>(async (resolve) => { | ||
this.lost = new Promise<{reason: 'destroyed'; message: string}>(async resolve => { | ||
const lostInfo = await this.handle.lost; | ||
@@ -130,3 +132,8 @@ this._isLost = true; | ||
// if (props.canvas) { | ||
this.canvasContext = new WebGPUCanvasContext(this, this.adapter, {canvas: props.canvas}); | ||
this.canvasContext = new WebGPUCanvasContext(this, this.adapter, { | ||
canvas: props.canvas, | ||
height: props.height, | ||
width: props.width, | ||
container: props.container | ||
}); | ||
// } | ||
@@ -231,2 +238,6 @@ | ||
createTransformFeedback(props: TransformFeedbackProps): TransformFeedback { | ||
throw new Error('Transform feedback not supported in WebGPU'); | ||
} | ||
createCanvasContext(props: CanvasContextProps): WebGPUCanvasContext { | ||
@@ -324,3 +335,3 @@ return new WebGPUCanvasContext(this, this.adapter, props); | ||
source: ImageBitmap | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas; | ||
source: ImageBitmap | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas; | ||
sourceX?: number; | ||
@@ -370,9 +381,5 @@ sourceY?: number; | ||
// copySize: GPUExtent3D | ||
[ | ||
width, | ||
height, | ||
depth | ||
] | ||
) | ||
[width, height, depth] | ||
); | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
580360
9407
125
+ Added@luma.gl/core@9.0.0-alpha.46(transitive)
- Removed@luma.gl/core@9.0.0-alpha.45(transitive)
Updated@luma.gl/core@9.0.0-alpha.46