Repository: google/filament
File: filament/include/filament/Material.h (C/C++)

Code before:

    /**
     * Returns the number of parameters declared by this material.
     * The returned value can be 0.
     */
    size_t getParameterCount() const noexcept;

    /**
     * Gets information about this material's parameters.
     *
     * @param parameters A pointer to a list of ParameterInfo.
     *                   The list must be at least "count" large
     * @param count The number of parameters to retrieve. Must be >= 0 and can be > count.
     *
     * @return The number of parameters written to the parameters pointer.
     */
    size_t getParameters(ParameterInfo* UTILS_NONNULL parameters, size_t count) const noexcept;

    //! Indicates whether a parameter of the given name exists on this material.
    bool hasParameter(const char* UTILS_NONNULL name) const noexcept;

    //! Indicates whether an existing parameter is a sampler or not.
    bool isSampler(const char* UTILS_NONNULL name) const noexcept;

    //! Returns the name of the transform name parameter associated with the given parameter, or
    //! nullptr if the given parameter doesn't have a transform name field.
    const char* UTILS_NULLABLE getParameterTransformName(
            const char* UTILS_NONNULL name) const noexcept;

    /**
     * Sets the value of the given parameter on this material's default instance.
     *
     * @param name The name of the material parameter
     * @param value The value of the material parameter
     *
     * @see getDefaultInstance()
     */
    template <typename T>
    void setDefaultParameter(const char* UTILS_NONNULL name, T value) noexcept {
        getDefaultInstance()->setParameter(name, value);
    }

    /**
     * Sets a texture and sampler parameters on this material's default instance.
     *
     * @param name The name of the material texture parameter
     * @param texture The texture to set as parameter
     * @param sampler The sampler to be used with this texture
     *
     * @see getDefaultInstance()
     */

Review comment (suggestion):
use /** */ syntax for multiline doxygen. Make sure to explain what the "parameter" is (it's the name of a sampler right?).

Also maybe document that the returned pointer is valid as long as Material is valid.

Code after:

    /**
     * Returns the number of parameters declared by this material.
     * The returned value can be 0.
     */
    size_t getParameterCount() const noexcept;

    /**
     * Gets information about this material's parameters.
     *
     * @param parameters A pointer to a list of ParameterInfo.
     *                   The list must be at least "count" large
     * @param count The number of parameters to retrieve. Must be >= 0 and can be > count.
     *
     * @return The number of parameters written to the parameters pointer.
     */
    size_t getParameters(ParameterInfo* UTILS_NONNULL parameters, size_t count) const noexcept;

    //! Indicates whether a parameter of the given name exists on this material.
    bool hasParameter(const char* UTILS_NONNULL name) const noexcept;

    //! Indicates whether an existing parameter is a sampler or not.
    bool isSampler(const char* UTILS_NONNULL name) const noexcept;


    /**
     *
     * Gets the name of the transform field associated for the given sampler parameter.
     * In the case where the parameter does not have a transform name field, it will return nullptr.
     *
     * @param samplerName the name of the sampler parameter to query.
     *
     * @return If exists, the transform name value otherwise returns a nullptr.
     */
    const char* UTILS_NULLABLE getParameterTransformName(
            const char* UTILS_NONNULL samplerName) const noexcept;

    /**
     * Sets the value of the given parameter on this material's default instance.
     *
     * @param name The name of the material parameter
     * @param value The value of the material parameter
     *
     * @see getDefaultInstance()
     */
    template <typename T>
    void setDefaultParameter(const char* UTILS_NONNULL name, T value) noexcept {
        getDefaultInstance()->setParameter(name, value);
    }

    /**