Class RtStateObject

Synopsis

#include <Source/Falcor/Raytracing/RtStateObject.h>

class dlldecl RtStateObject : public std::enable_shared_from_this<RtStateObject>

Description

No description yet.

Inheritance

Ancestors: std::enable_shared_from_this< RtStateObject >

Classes

Desc

Methods

create
getApiHandle
getDesc
getGlobalRootSignature
getKernels
getMaxTraceRecursionDepth
getShaderIdentifier

Source

Lines 32-72 in Source/Falcor/Raytracing/RtStateObject.h.

class dlldecl RtStateObject : public std::enable_shared_from_this<RtStateObject>
{
public:
    using SharedPtr = std::shared_ptr<RtStateObject>;
    using SharedConstPtr = std::shared_ptr<const RtStateObject>;
    using ApiHandle = ID3D12StateObjectPtr;
    class dlldecl Desc
    {
    public:
        Desc& setKernels(const ProgramKernels::SharedConstPtr& pKernels) { mpKernels = pKernels; return *this; }
        Desc& setMaxTraceRecursionDepth(uint32_t maxDepth) { mMaxTraceRecursionDepth = maxDepth; return *this; }
        // TODO(tfoley): this is redundant with the kernels
        Desc& setGlobalRootSignature(const RootSignature::SharedPtr& pRootSig) { mpGlobalRootSignature = pRootSig; return *this; }
        bool operator==(const Desc& other) const;
    private:
        ProgramKernels::SharedConstPtr mpKernels;
        RootSignature::SharedPtr mpGlobalRootSignature;
        uint32_t mMaxTraceRecursionDepth = 1;
        friend RtStateObject;
    };
    static SharedPtr create(const Desc& desc);
    const ApiHandle& getApiHandle() const { return mApiHandle; }
    const ProgramKernels::SharedConstPtr& getKernels() const { return mDesc.mpKernels; };
    uint32_t getMaxTraceRecursionDepth() const { return mDesc.mMaxTraceRecursionDepth; }
    const RootSignature::SharedPtr& getGlobalRootSignature() const { return mDesc.mpGlobalRootSignature; }
    void const* getShaderIdentifier(uint32_t index) const { return mShaderIdentifiers[index]; }
    const Desc& getDesc() const { return mDesc; }
private:
    RtStateObject(const Desc& d) : mDesc(d) {}
    ApiHandle mApiHandle;
    std::vector<void const*> mShaderIdentifiers;
    Desc mDesc;
};





Add Discussion as Guest

Log in