Class ComputeContext

Synopsis

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

class dlldecl ComputeContext : public CopyContext

Description

No description yet.

Inheritance

Ancestors: CopyContext

Decsendents: RenderContext

Methods

ComputeContext
~ComputeContext
applyComputeVars
clearUAVClear an unordered-access view
clearUAVCounterClear a structured buffer's UAV counter
createCreate a new compute context.
dispatchDispatch a compute task
dispatchIndirectExecutes a dispatch call
flushSubmit the command list
prepareForDispatch

Source

Lines 35-86 in Source/Falcor/Core/API/ComputeContext.h.

class dlldecl ComputeContext : public CopyContext
{
public:
    using SharedPtr = std::shared_ptr<ComputeContext>;
    using SharedConstPtr = std::shared_ptr<const ComputeContext>;
    ~ComputeContext();
    /** Create a new compute context.
        \param[in] queue Command queue handle.
        \return A new object, or throws an exception if creation failed.
    */
    static SharedPtr create(CommandQueueHandle queue);
    /** Dispatch a compute task
        \param[in] dispatchSize 3D dispatch group size
    */
    void dispatch(ComputeState* pState, ComputeVars* pVars, const uint3& dispatchSize);
    /** Executes a dispatch call. Args to the dispatch call are contained in pArgBuffer
    */
    void dispatchIndirect(ComputeState* pState, ComputeVars* pVars, const Buffer* pArgBuffer, uint64_t argBufferOffset);
    /** Clear an unordered-access view
        \param[in] pUav The UAV to clear
        \param[in] value The clear value
    */
    void clearUAV(const UnorderedAccessView* pUav, const float4& value);
    /** Clear an unordered-access view
        \param[in] pUav The UAV to clear
        \param[in] value The clear value
    */
    void clearUAV(const UnorderedAccessView* pUav, const uint4& value);
    /** Clear a structured buffer's UAV counter
        \param[in] pBuffer Structured Buffer containing UAV counter
        \param[in] value Value to clear counter to
    */
    void clearUAVCounter(const Buffer::SharedPtr& pBuffer, uint32_t value);
    /** Submit the command list
    */
    virtual void flush(bool wait = false) override;
protected:
    ComputeContext(LowLevelContextData::CommandQueueType type, CommandQueueHandle queue);
    bool prepareForDispatch(ComputeState* pState, ComputeVars* pVars);
    bool applyComputeVars(ComputeVars* pVars, RootSignature* pRootSignature);
    const ComputeVars* mpLastBoundComputeVars = nullptr;
};





Add Discussion as Guest

Log in to DocsForge