Program Listing for File structures.h

Return to documentation for file (include\api-types\structures.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 "api-types/color.h"
#include "api-types/enumerations.h"
#include "api-types/format.h"

#include <cstdint>

namespace gpa {
namespace api_types {

// BufferRegion
struct BufferRegion
{
    uint64_t offset{0};
    uint64_t size{0};
    uint64_t stride{0};
    static const BufferRegion WholeRegion;
};

bool operator==(BufferRegion const& lhs, BufferRegion const& rhs);

bool operator!=(BufferRegion const& lhs, BufferRegion const& rhs);

bool operator<(BufferRegion const& lhs, BufferRegion const& rhs);

// Extent2D
struct Extent2D
{
    uint64_t width{0};
    uint64_t height{0};
};

bool operator==(Extent2D const& lhs, Extent2D const& rhs);

bool operator!=(Extent2D const& lhs, Extent2D const& rhs);

bool operator<(Extent2D const& lhs, Extent2D const& rhs);

// Extent3D
struct Extent3D
{
    uint64_t width{0};
    uint64_t height{0};
    uint64_t depth{0};
};

bool operator==(Extent3D const& lhs, Extent3D const& rhs);

bool operator!=(Extent3D const& lhs, Extent3D const& rhs);

bool operator<(Extent3D const& lhs, Extent3D const& rhs);

// Offset2D
struct Offset2D
{
    int64_t x{0};
    int64_t y{0};
};

bool operator==(Offset2D const& lhs, Offset2D const& rhs);

bool operator!=(Offset2D const& lhs, Offset2D const& rhs);

bool operator<(Offset2D const& lhs, Offset2D const& rhs);

// Offset3D
struct Offset3D
{
    int64_t x{0};
    int64_t y{0};
    int64_t z{0};
};

bool operator==(Offset3D const& lhs, Offset3D const& rhs);

bool operator!=(Offset3D const& lhs, Offset3D const& rhs);

bool operator<(Offset3D const& lhs, Offset3D const& rhs);

// Rect2D
struct Rect2D
{
    Offset2D offset{};
    Extent2D extent{};
};

bool operator==(Rect2D const& lhs, Rect2D const& rhs);

bool operator!=(Rect2D const& lhs, Rect2D const& rhs);

bool operator<(Rect2D const& lhs, Rect2D const& rhs);

// TextureSubresource
struct TextureSubresource
{
    uint32_t baseMipLevel{0};
    uint32_t mipLevelCount{0};
    uint32_t baseArrayLayer{0};
    uint32_t arrayLayerCount{0};
    TextureAspectFlags aspect{GPA_TEXTURE_ASPECT_UNKNOWN};
};

bool operator==(TextureSubresource const& lhs, TextureSubresource const& rhs);

bool operator!=(TextureSubresource const& lhs, TextureSubresource const& rhs);

bool operator<(TextureSubresource const& lhs, TextureSubresource const& rhs);

// TextureRegion
struct TextureRegion final
{
    TextureSubresource subresource{};
    Offset3D offset{};
    Extent3D extent{};
    static const TextureRegion WholeRegion;
};

bool operator==(TextureRegion const& lhs, TextureRegion const& rhs);

bool operator!=(TextureRegion const& lhs, TextureRegion const& rhs);

bool operator<(TextureRegion const& lhs, TextureRegion const& rhs);

// VertexInputAttribute
struct VertexInputAttribute
{
    uint32_t binding{0};
    uint32_t location{0};
    Format format{GPA_FORMAT_UNKNOWN};
    uint32_t offset{0};
};

bool operator==(VertexInputAttribute const& lhs, VertexInputAttribute const& rhs);

bool operator!=(VertexInputAttribute const& lhs, VertexInputAttribute const& rhs);

bool operator<(VertexInputAttribute const& lhs, VertexInputAttribute const& rhs);

// VertexInputBinding
struct VertexInputBinding
{
    uint32_t binding{0};
    uint32_t stride{0};
    VertexInputRate inputRate{GPA_VERTEX_INPUT_RATE_UNKNOWN};
};

bool operator==(VertexInputBinding const& lhs, VertexInputBinding const& rhs);

bool operator!=(VertexInputBinding const& lhs, VertexInputBinding const& rhs);

bool operator<(VertexInputBinding const& lhs, VertexInputBinding const& rhs);

// VertexInputElement
struct VertexInputElement
{
    uint32_t location{0};
    Format format{GPA_FORMAT_UNKNOWN};
    uint64_t offset{0};
};

bool operator==(VertexInputElement const& lhs, VertexInputElement const& rhs);

bool operator!=(VertexInputElement const& lhs, VertexInputElement const& rhs);

bool operator<(VertexInputElement const& lhs, VertexInputElement const& rhs);

// VertexInputElementExtended
struct VertexInputElementExtended : public VertexInputElement
{
    char const* semanticName{nullptr};
    uint32_t binding{0};
    api_types::VertexInputRate inputRate{api_types::GPA_VERTEX_INPUT_RATE_UNKNOWN};
    uint32_t instanceDataStepRate{0};
};

bool operator==(VertexInputElementExtended const& lhs, VertexInputElementExtended const& rhs);

bool operator!=(VertexInputElementExtended const& lhs, VertexInputElementExtended const& rhs);

bool operator<(VertexInputElementExtended const& lhs, VertexInputElementExtended const& rhs);

// Viewport
struct Viewport
{
    float x{0};
    float y{0};
    float width{0};
    float height{0};
    float minDepth{0};
    float maxDepth{0};
};

bool operator==(Viewport const& lhs, Viewport const& rhs);

bool operator!=(Viewport const& lhs, Viewport const& rhs);

bool operator<(Viewport const& lhs, Viewport const& rhs);

// SourceFile
struct SourceFile
{
    char const* pContent{nullptr};
    char const* pFilename{nullptr};
};

// ShaderMacro
struct ShaderMacro
{
    char const* pName{nullptr};
    char const* pDefinition{nullptr};
};

// EntryPoint
struct EntryPoint
{
    char const* pName{nullptr};
    ShaderStageFlagBits kind{GPA_SHADER_STAGE_UNKNOWN};
};

bool operator==(EntryPoint const& lhs, EntryPoint const& rhs);

bool operator!=(EntryPoint const& lhs, EntryPoint const& rhs);

bool operator<(EntryPoint const& lhs, EntryPoint const& rhs);

// ShaderSources
struct ShaderSource
{
    api_types::ShaderLanguage language{GPA_SHADER_LANGUAGE_UNKNOWN};
    size_t fileCount{0};
    SourceFile const* pFiles{nullptr};
    size_t macroCount{0};
    ShaderMacro const* pMacros{nullptr};
    size_t entryPointCount{0};
    EntryPoint const* pEntryPoints{nullptr};
    uint32_t flags{0};
};

// BlendStateAttachment
struct BlendStateAttachment
{
    bool blendEnable{false};
    BlendFactor srcBlend{GPA_BLEND_ONE};
    BlendFactor destBlend{GPA_BLEND_ONE};
    BlendOp blendOp{GPA_BLEND_OP_ADD};
    BlendFactor srcBlendAlpha{GPA_BLEND_ONE};
    BlendFactor destBlendAlpha{GPA_BLEND_ONE};
    BlendOp blendOpAlpha{GPA_BLEND_OP_ADD};
    uint8_t colorWriteMask{0};
};

bool operator==(BlendStateAttachment const& lhs, BlendStateAttachment const& rhs);

bool operator!=(BlendStateAttachment const& lhs, BlendStateAttachment const& rhs);

bool operator<(BlendStateAttachment const& lhs, BlendStateAttachment const& rhs);

// DepthStencilOp
struct DepthStencilOp
{
    StencilOp stencilFailOp{api_types::GPA_STENCIL_OP_KEEP};
    StencilOp stencilDepthFailOp{api_types::GPA_STENCIL_OP_KEEP};
    StencilOp stencilPassOp{api_types::GPA_STENCIL_OP_KEEP};
    ComparisonFunc stencilFunc{api_types::GPA_COMPARISON_NEVER};
};

bool operator==(DepthStencilOp const& lhs, DepthStencilOp const& rhs);

bool operator!=(DepthStencilOp const& lhs, DepthStencilOp const& rhs);

bool operator<(DepthStencilOp const& lhs, DepthStencilOp const& rhs);

}  // namespace api_types
}  // namespace gpa