Class Desc

Synopsis

#include <Source/Falcor/Core/API/FBO.h>

class dlldecl Desc

Description

No description yet.

Methods

Desc
getColorTargetFormatGet the resource format of a render target
getDepthStencilFormatGet the depth-stencil resource format.
getSampleCountGet sample count of the targets.
isColorTargetUavGet whether a color target resource can be a UAV.
isDepthStencilUavGet whether depth-stencil resource can be a UAV.
operator==Comparison operator
setColorTargetSet a render target to be a color target.
setDepthStencilTargetSet the format of the depth-stencil target.
setSampleCountSet the resource sample count.

Source

Lines 44-106 in Source/Falcor/Core/API/FBO.h.

class dlldecl Desc
{
public:
    Desc();
    /** Set a render target to be a color target.
        \param[in] rtIndex Index of render target
        \param[in] format Texture resource format
        \param[in] allowUav Whether the resource can be a UAV
    */
    Desc& setColorTarget(uint32_t rtIndex, ResourceFormat format, bool allowUav = false) { mColorTargets[rtIndex] = TargetDesc(format, allowUav); return *this; }
    /** Set the format of the depth-stencil target.
        \param[in] format Texture resource format
        \param[in] allowUav Whether the resource can be a UAV
    */
    Desc& setDepthStencilTarget(ResourceFormat format, bool allowUav = false) { mDepthStencilTarget = TargetDesc(format, allowUav); return *this; }
    /** Set the resource sample count.
    */
    Desc& setSampleCount(uint32_t sampleCount) { mSampleCount = sampleCount ? sampleCount : 1; return *this; }
    /** Get the resource format of a render target
    */
    ResourceFormat getColorTargetFormat(uint32_t rtIndex) const { return mColorTargets[rtIndex].format; }
    /** Get whether a color target resource can be a UAV.
    */
    bool isColorTargetUav(uint32_t rtIndex) const { return mColorTargets[rtIndex].allowUav; }
    /** Get the depth-stencil resource format.
    */
    ResourceFormat getDepthStencilFormat() const { return mDepthStencilTarget.format; }
    /** Get whether depth-stencil resource can be a UAV.
    */
    bool isDepthStencilUav() const { return mDepthStencilTarget.allowUav; }
    /** Get sample count of the targets.
    */
    uint32_t getSampleCount() const { return mSampleCount; }
    /** Comparison operator
    */
    bool operator==(const Desc& other) const;
private:
    struct TargetDesc
    {
        TargetDesc() = default;
        TargetDesc(ResourceFormat f, bool uav) : format(f), allowUav(uav) {}
        ResourceFormat format = ResourceFormat::Unknown;
        bool allowUav = false;

        bool operator==(const TargetDesc& other) const {return (format == other.format) && (allowUav == other.allowUav); }
        bool operator!=(const TargetDesc& other) const { return !(*this == other); }
    };
    std::vector<TargetDesc> mColorTargets;
    TargetDesc mDepthStencilTarget;
    uint32_t mSampleCount = 1;
};





Add Discussion as Guest

Log in