Program Listing for File texture-info.h

Return to documentation for file (include\playback\resource-info\texture-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/resource-info.h"

namespace gpa {
namespace playback {

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

    api_types::TextureType type{api_types::GPA_TEXTURE_TYPE_UNKNOWN};
    api_types::Format format{api_types::GPA_FORMAT_UNKNOWN};
    uint64_t width{0};
    uint64_t height{0};
    uint64_t depth{0};
    uint32_t mipLevelCount{0};
    uint32_t arrayLayerCount{0};
    uint32_t sampleCount{0};
    uint32_t sampleQuality{0};
    api_types::Extent3D samplerFeedbackMipRegion{0};
    SwapchainInfo const* pSwapchainInfo{nullptr};

private:
    void OnRegister() override final;
};

api_types::Extent3D GetMipExtent(TextureInfo const& textureInfo, uint32_t mipLevel);

api_types::TextureRegion GetTextureRegion(TextureInfo const& textureInfo);

namespace detail {

template<>
inline auto MakeTuple<TextureInfo>(const TextureInfo& textureInfo)
{
    // NOTE : textureInfo.pSwapchainInfo is not included because we don't want it
    //  to affect TextureInfo registration.
    return std::make_tuple(
        textureInfo.type,
        textureInfo.format,
        textureInfo.width,
        textureInfo.height,
        textureInfo.depth,
        textureInfo.mipLevelCount,
        textureInfo.arrayLayerCount,
        textureInfo.sampleCount,
        textureInfo.sampleQuality,
        textureInfo.samplerFeedbackMipRegion);
}

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