Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: Use string constants for buffer types #8634

Merged
merged 2 commits into from Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,7 +19,6 @@
// THE SOFTWARE.

import {Layer, fp64LowPart, picking} from '@deck.gl/core';
import GL from '@luma.gl/constants';
import {Model, Geometry} from '@luma.gl/core';

import vs from './bezier-curve-layer-vertex.glsl';
Expand Down Expand Up @@ -63,7 +62,7 @@ export default class BezierCurveLayer extends Layer {
},
instanceColors: {
size: 4,
type: GL.UNSIGNED_BYTE,
type: 'uint8',
transition: true,
accessor: 'getColor',
defaultValue: [0, 0, 0, 255]
Expand Down
5 changes: 2 additions & 3 deletions examples/experimental/interleaved-buffer/app.js
@@ -1,6 +1,5 @@
import {Deck, OrthographicView} from '@deck.gl/core';
import {ScatterplotLayer, PathLayer, SolidPolygonLayer} from '@deck.gl/layers';
import {GL} from '@luma.gl/constants';

import data from './data';

Expand All @@ -19,8 +18,8 @@ const deck = new Deck({
function onDeviceInitialized(device) {
const buffer = device.createBuffer({data});

const positions = {buffer, type: GL.FLOAT, size: 3, offset: 4, stride: 16};
const colors = {buffer, type: GL.UNSIGNED_BYTE, size: 4, offset: 0, stride: 16};
const positions = {buffer, type: 'float32', size: 3, offset: 4, stride: 16};
const colors = {buffer, type: 'uint8', size: 4, offset: 0, stride: 16};
const indices = new Uint16Array([0, 1, 2, 3, 4, 5, 4, 5, 6]);

const layers = [
Expand Down
4 changes: 2 additions & 2 deletions examples/website/plot/plot-layer/surface-layer.ts
Expand Up @@ -82,11 +82,11 @@ export default class SurfaceLayer<
colors: {
size: 4,
accessor: ['getPosition', 'getColor'],
type: WebGL2RenderingContext.UNSIGNED_BYTE,
type: 'uint8',
update: this.calculateColors,
noAlloc
},
pickingColors: {size: 3, type: WebGL2RenderingContext.UNSIGNED_BYTE, update: this.calculatePickingColors, noAlloc}
pickingColors: {size: 3, type: 'uint8', update: this.calculatePickingColors, noAlloc}
});
/* eslint-enable max-len */

Expand Down