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.
38 lines
405 B
38 lines
405 B
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;
|
|
|