@luma.gl/core
Advanced tools
Comparing version 9.0.0-alpha.45 to 9.0.0-alpha.46
@@ -17,2 +17,3 @@ import { StatsManager } from '../lib/utils/stats-manager'; | ||
import type { VertexArray, VertexArrayProps } from './resources/vertex-array'; | ||
import type { TransformFeedback, TransformFeedbackProps } from './resources/transform-feedback'; | ||
/** Device properties */ | ||
@@ -81,3 +82,3 @@ export type DeviceProps = { | ||
export type WebGPUDeviceFeature = 'depth-clip-control' | 'depth24unorm-stencil8' | 'depth32float-stencil8' | 'timestamp-query' | 'indirect-first-instance' | 'texture-compression-bc' | 'texture-compression-etc2' | 'texture-compression-astc'; | ||
export type WebGLDeviceFeature = 'webgpu' | 'webgl2' | 'webgl' | 'timer-query-webgl' | 'uniform-buffers-webgl' | 'uniforms-webgl' | 'texture-filter-linear-float32-webgl' | 'texture-filter-linear-float16-webgl' | 'texture-filter-anisotropic-webgl' | 'texture-renderable-float32-webgl' | 'texture-renderable-float16-webgl' | 'texture-renderable-rgba32float-webgl' | 'texture-blend-float-webgl1' | 'texture-formats-norm16-webgl' | 'texture-formats-srgb-webgl1' | 'texture-formats-depth-webgl1' | 'texture-formats-float32-webgl1' | 'texture-formats-float16-webgl1' | 'vertex-array-object-webgl1' | 'instanced-rendering-webgl1' | 'multiple-render-targets-webgl1' | 'index-uint32-webgl1' | 'blend-minmax-webgl1' | 'glsl-frag-data' | 'glsl-frag-depth' | 'glsl-derivatives' | 'glsl-texture-lod'; | ||
export type WebGLDeviceFeature = 'webgpu' | 'webgl2' | 'webgl' | 'timer-query-webgl' | 'uniform-buffers-webgl' | 'uniforms-webgl' | 'texture-filter-linear-float32-webgl' | 'texture-filter-linear-float16-webgl' | 'texture-filter-anisotropic-webgl' | 'texture-renderable-float32-webgl' | 'texture-renderable-float16-webgl' | 'texture-renderable-rgba32float-webgl' | 'texture-blend-float-webgl1' | 'texture-formats-norm16-webgl' | 'texture-formats-srgb-webgl1' | 'texture-formats-depth-webgl1' | 'texture-formats-float32-webgl1' | 'texture-formats-float16-webgl1' | 'vertex-array-object-webgl1' | 'instanced-rendering-webgl1' | 'multiple-render-targets-webgl1' | 'index-uint32-webgl1' | 'blend-minmax-webgl1' | 'transform-feedback-webgl2' | 'glsl-frag-data' | 'glsl-frag-depth' | 'glsl-derivatives' | 'glsl-texture-lod'; | ||
type WebGLCompressedTextureFeatures = 'texture-compression-bc5-webgl' | 'texture-compression-etc1-webgl' | 'texture-compression-pvrtc-webgl' | 'texture-compression-atc-webgl'; | ||
@@ -151,2 +152,3 @@ /** Valid feature strings */ | ||
abstract createSampler(props: SamplerProps): Sampler; | ||
/** Create a Framebuffer. Must have at least one attachment. */ | ||
abstract createFramebuffer(props: FramebufferProps): Framebuffer; | ||
@@ -157,3 +159,3 @@ /** Create a shader */ | ||
abstract createRenderPipeline(props: RenderPipelineProps): RenderPipeline; | ||
/** Create a compute pipeline (aka program) */ | ||
/** Create a compute pipeline (aka program). WebGPU only. */ | ||
abstract createComputePipeline(props: ComputePipelineProps): ComputePipeline; | ||
@@ -169,2 +171,4 @@ createCommandEncoder(props?: CommandEncoderProps): CommandEncoder; | ||
abstract getDefaultRenderPass(): RenderPass; | ||
/** Create a transform feedback (immutable set of output buffer bindings). WebGL 2 only. */ | ||
abstract createTransformFeedback(props: TransformFeedbackProps): TransformFeedback; | ||
protected _getBufferProps(props: BufferProps | ArrayBuffer | ArrayBufferView): BufferProps; | ||
@@ -171,0 +175,0 @@ } |
@@ -45,5 +45,5 @@ import { TypedArray } from '../..'; | ||
write(data: ArrayBufferView, byteOffset?: number): void; | ||
readAsync(byteOffset?: number, byteLength?: number): Promise<ArrayBuffer>; | ||
readAsync(byteOffset?: number, byteLength?: number): Promise<Uint8Array>; | ||
getData(): TypedArray; | ||
} | ||
//# sourceMappingURL=buffer.d.ts.map |
@@ -0,1 +1,2 @@ | ||
import { Device } from '../device'; | ||
import { Resource, ResourceProps } from './resource'; | ||
@@ -9,4 +10,4 @@ export type CommandBufferProps = ResourceProps & {}; | ||
get [Symbol.toStringTag](): string; | ||
constructor(props: CommandBufferProps); | ||
constructor(device: Device, props: CommandBufferProps); | ||
} | ||
//# sourceMappingURL=command-buffer.d.ts.map |
@@ -8,4 +8,4 @@ let _Symbol$toStringTag; | ||
} | ||
constructor(props) { | ||
super(props, CommandBuffer.defaultProps); | ||
constructor(device, props) { | ||
super(device, props, CommandBuffer.defaultProps); | ||
} | ||
@@ -12,0 +12,0 @@ } |
@@ -10,2 +10,3 @@ import type { Device } from '../device'; | ||
import { VertexArray } from './vertex-array'; | ||
import { TransformFeedback } from './transform-feedback'; | ||
export type RenderPipelineProps = ResourceProps & { | ||
@@ -83,4 +84,6 @@ /** Compiled vertex shader */ | ||
baseVertex?: number; | ||
/** Transform feedback. WebGL 2 only. */ | ||
transformFeedback?: TransformFeedback; | ||
}): void; | ||
} | ||
//# sourceMappingURL=render-pipeline.d.ts.map |
@@ -37,3 +37,3 @@ import type { TextureFormat } from '../types/texture-formats'; | ||
/** WebGL2 only (WebGPU use compute shaders) */ | ||
varyings?: any[]; | ||
varyings?: VaryingBinding[]; | ||
}; | ||
@@ -40,0 +40,0 @@ /** |
@@ -38,2 +38,4 @@ export { VERSION } from './init'; | ||
export { VertexArray } from './adapter/resources/vertex-array'; | ||
export type { TransformFeedbackProps } from './adapter/resources/transform-feedback'; | ||
export { TransformFeedback } from './adapter/resources/transform-feedback'; | ||
export type { AccessorObject } from './adapter/types/accessor'; | ||
@@ -40,0 +42,0 @@ export type { Parameters, PrimitiveTopology, IndexFormat, CullMode, FrontFace, RasterizationParameters, CompareFunction, StencilOperation, DepthStencilParameters, BlendFactor, BlendOperation, ColorParameters, MultisampleParameters, RenderPassParameters, RenderPipelineParameters } from './adapter/types/parameters'; |
@@ -20,2 +20,3 @@ export { VERSION } from "./init.js"; | ||
export { VertexArray } from "./adapter/resources/vertex-array.js"; | ||
export { TransformFeedback } from "./adapter/resources/transform-feedback.js"; | ||
export { UniformBufferLayout } from "./lib/uniforms/uniform-buffer-layout.js"; | ||
@@ -22,0 +23,0 @@ export { UniformBlock } from "./lib/uniforms/uniform-block.js"; |
{ | ||
"name": "@luma.gl/core", | ||
"version": "9.0.0-alpha.45", | ||
"version": "9.0.0-alpha.46", | ||
"description": "luma.gl API", | ||
@@ -45,3 +45,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "38b58964a1287a84ac021fa02d4432a5d3f960a0" | ||
"gitHead": "c1e0602fd739f8d08e6532034a02e8cf658e188a" | ||
} |
@@ -21,2 +21,3 @@ // luma.gl, MIT license | ||
import type {VertexArray, VertexArrayProps} from './resources/vertex-array'; | ||
import type {TransformFeedback, TransformFeedbackProps} from './resources/transform-feedback'; | ||
@@ -184,2 +185,3 @@ /** Device properties */ | ||
| 'blend-minmax-webgl1' | ||
| 'transform-feedback-webgl2' | ||
@@ -258,6 +260,6 @@ // glsl extensions | ||
/** | ||
* Trigger device loss. | ||
* @returns `true` if context loss could actually be triggered. | ||
* @note primarily intended for testing how application reacts to device loss | ||
/** | ||
* Trigger device loss. | ||
* @returns `true` if context loss could actually be triggered. | ||
* @note primarily intended for testing how application reacts to device loss | ||
*/ | ||
@@ -278,3 +280,3 @@ loseDevice(): boolean { | ||
} | ||
return this.canvasContext | ||
return this.canvasContext; | ||
} | ||
@@ -313,2 +315,3 @@ | ||
/** Create a Framebuffer. Must have at least one attachment. */ | ||
abstract createFramebuffer(props: FramebufferProps): Framebuffer; | ||
@@ -322,3 +325,3 @@ | ||
/** Create a compute pipeline (aka program) */ | ||
/** Create a compute pipeline (aka program). WebGPU only. */ | ||
abstract createComputePipeline(props: ComputePipelineProps): ComputePipeline; | ||
@@ -342,6 +345,8 @@ | ||
// Resource creation helpers | ||
/** Create a transform feedback (immutable set of output buffer bindings). WebGL 2 only. */ | ||
abstract createTransformFeedback(props: TransformFeedbackProps): TransformFeedback; | ||
// Implementation | ||
protected _getBufferProps(props: BufferProps | ArrayBuffer | ArrayBufferView): BufferProps { | ||
if (props instanceof ArrayBuffer || ArrayBuffer.isView(props)) { | ||
@@ -365,4 +370,4 @@ props = {data: props}; | ||
} | ||
return newProps; | ||
return newProps; | ||
} | ||
} |
@@ -80,3 +80,3 @@ // luma.gl, MIT license | ||
write(data: ArrayBufferView, byteOffset?: number): void { throw new Error('not implemented'); } | ||
readAsync(byteOffset?: number, byteLength?: number): Promise<ArrayBuffer> { throw new Error('not implemented'); } | ||
readAsync(byteOffset?: number, byteLength?: number): Promise<Uint8Array> { throw new Error('not implemented'); } | ||
// TODO - can sync read be supported in WebGPU? | ||
@@ -83,0 +83,0 @@ getData(): TypedArray { throw new Error('not implemented'); } |
// luma.gl, MIT license | ||
import { Device } from '../device'; | ||
import {Resource, ResourceProps} from './resource'; | ||
@@ -34,6 +35,5 @@ | ||
constructor(props: CommandBufferProps) { | ||
// @ts-expect-error | ||
super(props, CommandBuffer.defaultProps); | ||
constructor(device: Device, props: CommandBufferProps) { | ||
super(device, props, CommandBuffer.defaultProps); | ||
} | ||
} |
@@ -12,2 +12,3 @@ // luma.gl, MIT license | ||
import {VertexArray} from './vertex-array'; | ||
import {TransformFeedback} from './transform-feedback'; | ||
@@ -36,3 +37,3 @@ export type RenderPipelineProps = ResourceProps & { | ||
*/ | ||
bufferLayout?: BufferLayout[], // Record<string, Omit<BufferLayout, 'name'> | ||
bufferLayout?: BufferLayout[]; // Record<string, Omit<BufferLayout, 'name'> | ||
@@ -45,3 +46,3 @@ /** Determines how vertices are read from the 'vertex' attributes */ | ||
// Can be changed after creation | ||
// TODO make pipeline immutable? these could be supplied to draw as parameters, in WebGPU they are set on the render pass | ||
// TODO make pipeline immutable? these could be supplied to draw as parameters, in WebGPU they are set on the render pass | ||
@@ -65,11 +66,11 @@ /** Number of vertices */ | ||
...Resource.defaultProps, | ||
vs: null, | ||
vsEntryPoint: '', // main | ||
vsConstants: {}, | ||
fs: null, | ||
fsEntryPoint: '', // main | ||
fsConstants: {}, | ||
shaderLayout: null, | ||
@@ -79,11 +80,13 @@ bufferLayout: [], | ||
parameters: {}, | ||
vertexCount: 0, | ||
instanceCount: 0, | ||
bindings: {}, | ||
uniforms: {} | ||
}; | ||
}; | ||
override get [Symbol.toStringTag](): string { return 'RenderPipeline'; } | ||
override get [Symbol.toStringTag](): string { | ||
return 'RenderPipeline'; | ||
} | ||
@@ -106,10 +109,10 @@ hash: string = ''; | ||
abstract setBindings(bindings: Record<string, Binding>): void; | ||
/** Uniforms | ||
/** Uniforms | ||
* @deprecated Only supported on WebGL devices. | ||
* @note textures, samplers and uniform buffers should be set via `setBindings()`, these are not considered uniforms. | ||
* @note In WebGL uniforms have a performance penalty, they are reset before each call to enable pipeline sharing. | ||
* @note In WebGL uniforms have a performance penalty, they are reset before each call to enable pipeline sharing. | ||
*/ | ||
abstract setUniforms(bindings: Record<string, UniformValue>): void; | ||
/** Draw call */ | ||
/** Draw call */ | ||
abstract draw(options: { | ||
@@ -131,3 +134,5 @@ /** Render pass to draw into (targeting screen or framebuffer) */ | ||
baseVertex?: number; | ||
/** Transform feedback. WebGL 2 only. */ | ||
transformFeedback?: TransformFeedback; | ||
}): void; | ||
} |
@@ -39,7 +39,7 @@ // luma.gl, MIT license | ||
/** WebGL2 only (WebGPU use compute shaders) */ | ||
varyings?: any[]; | ||
varyings?: VaryingBinding[]; | ||
}; | ||
/** | ||
* Declares one for attributes | ||
/** | ||
* Declares one for attributes | ||
*/ | ||
@@ -87,3 +87,3 @@ export type AttributeDeclaration = { | ||
export type BindingDeclaration = | ||
| UniformBufferBindingLayout | ||
| UniformBufferBindingLayout | ||
| BufferBindingLayout | ||
@@ -157,4 +157,4 @@ | TextureBindingLayout | ||
/** | ||
* Describes a varying binding for a program | ||
/** | ||
* Describes a varying binding for a program | ||
* @deprecated Varyings are WebGL-only | ||
@@ -161,0 +161,0 @@ */ |
@@ -10,8 +10,3 @@ // luma.gl, MIT license | ||
// NUMERIC TYPES - TODO: could be imported from @math.gl/types | ||
export type { | ||
TypedArray, | ||
TypedArrayConstructor, | ||
NumberArray, | ||
BigIntOrNumberArray | ||
} from './types'; | ||
export type {TypedArray, TypedArrayConstructor, NumberArray, BigIntOrNumberArray} from './types'; | ||
@@ -61,2 +56,5 @@ export {isTypedArray, isNumberArray} from './lib/utils/is-array'; | ||
export type {TransformFeedbackProps} from './adapter/resources/transform-feedback'; | ||
export {TransformFeedback} from './adapter/resources/transform-feedback'; | ||
// API TYPES | ||
@@ -63,0 +61,0 @@ export type {AccessorObject} from './adapter/types/accessor'; |
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 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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
292
14199
931608