PVRUtilsTypes.h#

Contains structures, classes and enums used throughout PVRUtils.

Includes#

  • PVRCore/types/Types.h

Included By#

Namespaces#

Classes#

Source Code#

#pragma once
#include "PVRCore/types/Types.h"

namespace pvr {
namespace utils {
struct VertexAttributeInfo
{
    uint16_t index;
    DataType format;
    uint8_t width;
    uint32_t offsetInBytes;
    std::string attribName;

    VertexAttributeInfo() : index(0), format(DataType::None), width(0), offsetInBytes(0), attribName("") {}

    VertexAttributeInfo(uint16_t index, DataType format, uint8_t width, uint32_t offsetInBytes, const char* attribName = "")
        : index(index), format(format), width(width), offsetInBytes(offsetInBytes), attribName(attribName)
    {}

    bool operator==(VertexAttributeInfo const& rhs) const
    {
        return ((index == rhs.index) && (format == rhs.format) && (width == rhs.width) && (offsetInBytes == rhs.offsetInBytes));
    }

    bool operator!=(VertexAttributeInfo const& rhs) const { return !((*this) == rhs); }
};

struct VertexInputBindingInfo
{
    uint16_t bindingId;
    uint32_t strideInBytes;
    StepRate stepRate;

    VertexInputBindingInfo() : bindingId(static_cast<uint16_t>(-1)), strideInBytes(static_cast<uint32_t>(-1)), stepRate(StepRate::Default) {}

    VertexInputBindingInfo(uint16_t bindId, uint32_t strideInBytes, StepRate stepRate = StepRate::Vertex) : bindingId(bindId), strideInBytes(strideInBytes), stepRate(stepRate) {}
};

struct VertexAttributeInfoWithBinding : public VertexAttributeInfo
{
    uint16_t binding;

    VertexAttributeInfoWithBinding() : binding(static_cast<uint16_t>(-1)) {}

    VertexAttributeInfoWithBinding(const VertexAttributeInfo& nfo, uint16_t binding) : VertexAttributeInfo(nfo), binding(binding) {}

    VertexAttributeInfoWithBinding(uint16_t index, DataType format, uint8_t width, uint32_t offsetInBytes, uint16_t binding, const char* attribName = "")
        : VertexAttributeInfo(index, format, width, offsetInBytes, attribName), binding(binding)
    {}
};
} // namespace utils
} // namespace pvr