mirror of
https://github.com/visgl/luma.gl.git
synced 2025-12-08 17:36:19 +00:00
1.9 KiB
1.9 KiB
GPU Resources
GPU resources come in a few different flavors
- Resources that represent actual memory uploaded to the GPU are
BufferandTexture. - Resources that hold executable GPU code, such as
Shader,RenderpipelineandComputePipeline. - Other GPU resources tend to hold validated settings or state (usually these are GPU driver objects rather)
Creating GPU Resources
The Device class provides methods for creating GPU resources
luma.gl provides a consistent API
| Resource creation method | Description |
|---|---|
| `device.createBuffer(props: BufferProps | ArrayBuffer |
| `device.createTexture(props: TextureProps | Promise |
device.createSampler(props: SamplerProps): Sampler |
Create a Sampler. |
device.createFramebuffer(props: FramebufferProps): Framebuffer |
Create a Framebuffer. |
device.createShader(props: ShaderProps): Shader |
Create a Shader. |
device.createRenderPipeline(props: RenderPipelineProps): RenderPipeline |
Create a RenderPipeline (aka program) |
device.createComputePipeline(props: ComputePipelineProps): ComputePipeline |
Create a ComputePipeline (aka program) |
beginRenderPass(props: RenderPassProps): RenderPass |
Create a RenderPass. |
beginComputePass(props?: ComputePassProps): ComputePass |
Create a ComputePass which can be used to bind data and run compute operations using compute pipelines. |
getDefaultRenderPass(): RenderPass |
A default RenderPass is provided for applications that don't need to create multiple or specially configured render passes. |