-
Notifications
You must be signed in to change notification settings - Fork 69
refactor buffer storage 4 #179
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
base: 12-17-refactor_buffer_storage_split_split
Are you sure you want to change the base?
refactor buffer storage 4 #179
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
private regl: Regl; | ||
public renderer: ReglRenderer; | ||
private bufferMap: WeakMap<ArrayBufferView, DS.BufferLocation> = new Map(); | ||
private bufferMap: WeakMap<ArrayBufferView, DS.BufferLocation<Buffer>> = new Map(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code initializes a WeakMap
but incorrectly uses the Map
constructor. To fix the type mismatch, replace new Map()
with new WeakMap()
. This will ensure the implementation matches the declared type and maintains the intended weak reference behavior.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
byte_size?: number; // in bytes; | ||
}; | ||
|
||
export type WebGPUBufferLocation = BufferLocation<GPUBuffer> & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might have to wait if we don't do the webGPU imports.
stride: 4, // meaningless here. | ||
byte_size: this.buffer_size - this.pointer, | ||
}); | ||
console.log("YOOO") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log("YOOO") |
01d31db
to
75c61cc
Compare
7237d17
to
4bb8cf9
Compare
75c61cc
to
bd9f1be
Compare
4bb8cf9
to
61337d0
Compare
bd9f1be
to
c1c0448
Compare
61337d0
to
eef33f1
Compare
c1c0448
to
e631b9a
Compare
eef33f1
to
38c301d
Compare
e631b9a
to
e10a35d
Compare
38c301d
to
169b197
Compare
This takes the memory management class used to hold webGL buffers and breaks it into an abstract type and a webGL specific type so that we can re-use the same code later to hold webGPU memory as well.