This commit is contained in:
Akko
2025-08-04 18:57:35 +02:00
parent 8cf6e78a79
commit 9495868c2e
5030 changed files with 518594 additions and 17609 deletions

View File

@@ -0,0 +1,33 @@
import type { BindGroup } from './BindGroup';
/**
* an interface that allows a resource to be bound to the gpu in a bind group
* @memberof rendering
*/
export interface BindResource {
/**
* The type of resource this is
* @ignore
*/
_resourceType: string;
/**
* Unique id for this resource this can change and is used to link the gpu
* @ignore
*/
_resourceId: number;
_touched: number;
/**
* a boolean that indicates if the resource has been destroyed.
* If true, the resource should not be used and any bind groups
* that will release any references to this resource.
* @ignore
*/
destroyed: boolean;
/**
* event dispatch whenever the underlying resource needs to change
* this could be a texture or buffer that has been resized.
* This is important as it allows the renderer to know that it needs to rebind the resource
*/
on?(event: 'change', listenerFunction: (resource: BindResource) => void, listener: BindGroup): void;
/** @todo */
off?(event: 'change', listenerFunction: (resource: BindResource) => void, listener: BindGroup): void;
}