three 基础库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
405 B

2 years ago
class WebGPUProperties {
constructor() {
this.properties = new WeakMap();
}
get( object ) {
let map = this.properties.get( object );
if ( map === undefined ) {
map = {};
this.properties.set( object, map );
}
return map;
}
remove( object ) {
this.properties.delete( object );
}
dispose() {
this.properties = new WeakMap();
}
}
export default WebGPUProperties;