-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e9dfa8
commit 0709cfa
Showing
7 changed files
with
138 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* ... | ||
* | ||
* @ignore | ||
*/ | ||
class Buffer { | ||
/** | ||
* @type {import('./webgpu/webgpu-buffer.js').WebgpuBuffer|null} | ||
* @private | ||
*/ | ||
impl = null; | ||
|
||
destroy(device) { | ||
this.impl?.destroy(device); | ||
} | ||
|
||
/** | ||
* Returns a mapped range of the underlying buffer. | ||
* On WebGPU this will wait for the buffer to be copied to the CPU. | ||
* | ||
* @returns {Promise<Uint8Array|undefined>} The mapped range. | ||
*/ | ||
async getMappedRange() { | ||
return await this.impl?.getMappedRange?.(); | ||
} | ||
} | ||
|
||
export { Buffer }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters