Skip to content

handling label #19

Open
Open
@greggman

Description

@greggman

Here's some code that effectively wraps label

const gpuBufferPrototypeDescriptors = Object.getOwnPropertyDescriptors(GPUBuffer.prototype);

Object.defineProperty(GPUBuffer.prototype, 'label', {
  get() {
    const label = gpuBufferPrototypeDescriptors.label.get.call(this);
    console.log('label is:', label);
    return label;
  },
  set(label) {
    gpuBufferPrototypeDescriptors.label.set.call(this, label);
    console.log('label set to:', label);
  }
});

I'm not sure how what should be handled in capture. It's seems like it would be nice if label setting was just another command since I've done stuff like this in native code in the past

buffer.label = `data for frame ${frameNumber}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions