@luma.gl/core
Advanced tools
Comparing version 9.0.0-alpha.43 to 9.0.0-alpha.44
@@ -42,7 +42,10 @@ import type { ShaderUniformType } from '../../adapter/types/shader-types'; | ||
getUniformBufferData(uniformBufferName: keyof TUniformGroups): Uint8Array; | ||
/** Create an unmanaged uniform buffer, initialized with current / supplied values */ | ||
/** | ||
* Creates an unmanaged uniform buffer (umnanaged means that application is responsible for destroying it) | ||
* The new buffer is initialized with current / supplied values | ||
*/ | ||
createUniformBuffer(device: Device, uniformBufferName: keyof TUniformGroups, uniforms?: Partial<{ | ||
[group in keyof TUniformGroups]: Partial<TUniformGroups[group]>; | ||
}>): Buffer; | ||
/** Get the managed uniform buffer */ | ||
/** Get the managed uniform buffer. "managed" resources are destroyed when the uniformStore is destroyed. */ | ||
getManagedUniformBuffer(device: Device, uniformBufferName: keyof TUniformGroups): Buffer; | ||
@@ -49,0 +52,0 @@ /** Update one uniform buffer. Only updates if values have changed */ |
@@ -43,2 +43,5 @@ import { Buffer } from "../../adapter/resources/buffer.js"; | ||
createUniformBuffer(device, uniformBufferName, uniforms) { | ||
if (uniforms) { | ||
this.setUniforms(uniforms); | ||
} | ||
const byteLength = this.getUniformBufferByteLength(uniformBufferName); | ||
@@ -49,5 +52,2 @@ const uniformBuffer = device.createBuffer({ | ||
}); | ||
if (uniforms) { | ||
this.setUniforms(uniforms); | ||
} | ||
const uniformBufferData = this.getUniformBufferData(uniformBufferName); | ||
@@ -54,0 +54,0 @@ uniformBuffer.write(uniformBufferData); |
{ | ||
"name": "@luma.gl/core", | ||
"version": "9.0.0-alpha.43", | ||
"version": "9.0.0-alpha.44", | ||
"description": "luma.gl API", | ||
@@ -45,3 +45,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "1527d42e56ce203938534bf0d3318d303ebde066" | ||
"gitHead": "195bed39c8587a68686cf28c0ae0e8dbd9c963f5" | ||
} |
@@ -93,3 +93,6 @@ // luma.gl, MIT license | ||
/** Create an unmanaged uniform buffer, initialized with current / supplied values */ | ||
/** | ||
* Creates an unmanaged uniform buffer (umnanaged means that application is responsible for destroying it) | ||
* The new buffer is initialized with current / supplied values | ||
*/ | ||
createUniformBuffer( | ||
@@ -100,8 +103,8 @@ device: Device, | ||
): Buffer { | ||
const byteLength = this.getUniformBufferByteLength(uniformBufferName); | ||
const uniformBuffer = device.createBuffer({usage: Buffer.UNIFORM, byteLength}); | ||
if (uniforms) { | ||
this.setUniforms(uniforms); | ||
} | ||
// This clears the needs redraw flag | ||
const byteLength = this.getUniformBufferByteLength(uniformBufferName); | ||
const uniformBuffer = device.createBuffer({usage: Buffer.UNIFORM, byteLength}); | ||
// Note that this clears the needs redraw flag | ||
const uniformBufferData = this.getUniformBufferData(uniformBufferName); | ||
@@ -112,3 +115,3 @@ uniformBuffer.write(uniformBufferData); | ||
/** Get the managed uniform buffer */ | ||
/** Get the managed uniform buffer. "managed" resources are destroyed when the uniformStore is destroyed. */ | ||
getManagedUniformBuffer(device: Device, uniformBufferName: keyof TUniformGroups): Buffer { | ||
@@ -115,0 +118,0 @@ if (!this.uniformBuffers[uniformBufferName]) { |
Sorry, the diff of this file is too big to display
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
921231
225162
14071