/** * @import { GraphicsDevice } from '../../platform/graphics/graphics-device.js' * @import { MaterialProperty } from './material-property.js' * @import { MaterialTextureDescriptor } from './standard-material-textures.js' */ /** * The layout shared by all materials with the same typed properties and textures: the format of * the uniform buffer, and the format of the bind group holding that buffer and those textures. * Layouts are created per device and cached by their key. * * @ignore */ export class MaterialUniformBufferLayout { /** * @param {GraphicsDevice} device - The graphics device. * @param {string} key - The layout key. * @param {MaterialProperty[]} properties - The properties, in layout order. * @param {MaterialTextureDescriptor[]} textures - The textures, in layout order. */ constructor(device: GraphicsDevice, key: string, properties: MaterialProperty[], textures: MaterialTextureDescriptor[]); /** * The key of the layout, see {@link getMaterialLayoutKey}. * * @type {string} */ key: string; /** * The format of the material uniform buffer. * * @type {UniformBufferFormat} */ uniformBufferFormat: UniformBufferFormat; /** * The textures of the bind group, in the order of its texture slots. * * @type {MaterialTextureDescriptor[]} */ textures: MaterialTextureDescriptor[]; /** * The format of the bind group containing the material uniform buffer and its textures. * * @type {BindGroupFormat} */ bindGroupFormat: BindGroupFormat; destroy(): void; } /** * Returns the key identifying the layout of a set of typed properties and textures. The key does * not depend on the order of the properties, and does depend on the order of the textures, which * is the order of their slots. * * @param {MaterialProperty[]} properties - The properties. * @param {MaterialTextureDescriptor[]} [textures] - The textures. * @returns {string} The layout key. * @ignore */ export function getMaterialLayoutKey(properties: MaterialProperty[], textures?: MaterialTextureDescriptor[]): string; /** * Gets the uniform buffer layout for a set of typed properties on a device, creating it on first * use. Materials with the same properties share one layout, whatever the order of the * properties. * * @param {GraphicsDevice} device - The graphics device. * @param {MaterialProperty[]} properties - The properties. * @param {MaterialTextureDescriptor[]} [textures] - The textures. * @returns {MaterialUniformBufferLayout} The layout. * @ignore */ export function getMaterialLayout(device: GraphicsDevice, properties: MaterialProperty[], textures?: MaterialTextureDescriptor[]): MaterialUniformBufferLayout; import { UniformBufferFormat } from '../../platform/graphics/uniform-buffer-format.js'; import type { MaterialTextureDescriptor } from './standard-material-textures.js'; import { BindGroupFormat } from '../../platform/graphics/bind-group-format.js'; import type { GraphicsDevice } from '../../platform/graphics/graphics-device.js'; import type { MaterialProperty } from './material-property.js';