mirror of
https://github.com/visgl/luma.gl.git
synced 2026-02-01 14:33:49 +00:00
21 lines
676 B
TypeScript
21 lines
676 B
TypeScript
// luma.gl
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import test from 'tape-promise/tape';
|
|
import {getWebGLTestDevice} from '@luma.gl/test-utils';
|
|
import {DynamicTexture} from '../../src/index';
|
|
|
|
// Verify that specifying mipLevels: 0 is clamped to at least 1
|
|
// See issue or commit reference for details.
|
|
test('DynamicTexture#mipLevels clamped to minimum 1', async t => {
|
|
const device = await getWebGLTestDevice();
|
|
const texture = new DynamicTexture(device, {
|
|
data: {data: new Uint8Array(4), width: 1, height: 1},
|
|
mipLevels: 0
|
|
});
|
|
await texture.ready;
|
|
t.is(texture.texture.mipLevels, 1, 'mipLevels set to 1 when specified as 0');
|
|
texture.destroy();
|
|
t.end();
|
|
});
|