Skip to content

⬅️ Back to Table of Contents

📄 Binding.js

📊 Analysis Summary

Metric Count
🔧 Functions 2
🧱 Classes 1

📚 Table of Contents

🛠️ File Location:

📂 src/renderers/common/Binding.js

Functions

Binding.setVisibility(visibility: number): void

JSDoc:

/**
     * Makes sure binding's resource is visible for the given shader stage.
     *
     * @param {number} visibility - The shader stage.
     */

Parameters:

  • visibility number

Returns: void

Code
setVisibility( visibility ) {

        this.visibility |= visibility;

    }

Binding.clone(): Binding

JSDoc:

/**
     * Clones the binding.
     *
     * @return {Binding} The cloned binding.
     */

Returns: Binding

Calls:

  • Object.assign
Code
clone() {

        return Object.assign( new this.constructor(), this );

    }

Classes

Binding

Class Code
class Binding {

    /**
     * Constructs a new binding.
     *
     * @param {string} [name=''] - The binding's name.
     */
    constructor( name = '' ) {

        /**
         * The binding's name.
         *
         * @type {string}
         */
        this.name = name;

        /**
         * A bitmask that defines in what shader stages the
         * binding's resource is accessible.
         *
         * @type {number}
         */
        this.visibility = 0;

    }

    /**
     * Makes sure binding's resource is visible for the given shader stage.
     *
     * @param {number} visibility - The shader stage.
     */
    setVisibility( visibility ) {

        this.visibility |= visibility;

    }

    /**
     * Clones the binding.
     *
     * @return {Binding} The cloned binding.
     */
    clone() {

        return Object.assign( new this.constructor(), this );

    }

}

Methods

setVisibility(visibility: number): void
Code
setVisibility( visibility ) {

        this.visibility |= visibility;

    }
clone(): Binding
Code
clone() {

        return Object.assign( new this.constructor(), this );

    }