Skip to content

Commit

Permalink
examples: Use string constants for buffer types (#8634)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixpalmer committed Mar 12, 2024
1 parent 09cca5e commit 4e22377
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
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

0 comments on commit 4e22377

Please sign in to comment.