Program Listing for File pipeline-constant-info.h

Return to documentation for file (include\playback\resource-info\resource-info-ex\pipeline-constant-info.h)

/******************************************************************************

© Intel Corporation.

This software and the related documents are Intel copyrighted materials,
and your use of them is governed by the express license under which they
were provided to you ("License"). Unless the License provides otherwise,
you may not use, modify, copy, publish, distribute, disclose or transmit
this software or the related documents without Intel's prior written
permission.

 This software and the related documents are provided as is, with no express
or implied warranties, other than those that are expressly stated in the
License.

******************************************************************************/
#pragma once

#include "playback/resource-info/detail/span.h"
#include "playback/resource-info/resource-info-ex.h"

#include <vector>

namespace gpa {
namespace playback {

class PipelineInfo;

class PipelineConstantInfo final
    : public ResourceInfo::Ex
{
public:
    TypeId GetTypeId() const override final;

    PipelineInfo const* pPipelineInfo{nullptr};
    uint32_t index{0};
    size_t offset{0};
    size_t dataSize{0};
    uint8_t const* pData{nullptr};

protected:
    void OnRegister() override final;

private:
    class Storage final
    {
    public:
        std::vector<uint8_t> data;
    } mStorage;
};

namespace detail {

template<>
inline auto MakeTuple<PipelineConstantInfo>(const PipelineConstantInfo& pipelineConstantInfo)
{
    return std::make_tuple(
        pipelineConstantInfo.pPipelineInfo,
        pipelineConstantInfo.index,
        pipelineConstantInfo.offset,
        pipelineConstantInfo.dataSize,
        MakeSpan(pipelineConstantInfo.pData, pipelineConstantInfo.dataSize));
}

}  // namespace detail
}  // namespace playback
}  // namespace gpa