Program Listing for File instance.h

Return to documentation for file (include\introspection\instance.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 "introspection/types.h"

#include "introspection/struct.h"

#include <cstdint>
#include <string>
#include <vector>

namespace gpa {
namespace introspection {

class Declaration;
class Struct;

class Instance
{
public:
    Instance();
    Instance(Instance&& other);
    Instance(Instance const& other);

    Instance& operator=(Instance const& other);

    Instance(introspection::Struct&& structDeclaration, char const* instanceName);

    Instance(introspection::Struct&& structDeclaration, char const* instanceName,
             uint64_t cardinality);

    Instance(introspection::Type instanceType, char const* instanceName);

    Instance(introspection::Type instanceType, char const* instanceName, uint64_t cardinality);
    ~Instance();

    void SetShaderBlockModifier(introspection::ShaderBlockModifier modifier);

    void SetBinding(uint64_t location);
    void SetBinding(uint64_t index, uint64_t binding);

    void SetRowCount(uint32_t rows);
    void SetColumnCount(uint32_t columns);
    void SetInputAttachmentIndex(uint32_t inputAttachmentIndex);

    void SetColumnMajorMatrixLayout(bool columnMajor);

    void GetArraySizes(uint64_t* pArraySizeCount, uint32_t* pArraySizes) const;
    void SetArraySizes(uint64_t arraySizeCount, uint32_t const* pArraySizes);

    void SetActivelyUsed(bool activelyUsed);
    void SetDimension(introspection::Dim const dim);
    void SetSemantic(introspection::Semantic semantic);

    void SetStructDeclaration(introspection::Struct&& declaration);

    introspection::Type Type() const;
    char const* Name() const;
    uint64_t Cardinality() const;
    introspection::Struct const* StructDeclaration() const;
    introspection::ShaderBlockModifier ShaderBlockModifier() const;
    uint64_t BindingGroupIndex() const;
    uint64_t BindingWithinIndex() const;
    uint64_t Location() const;
    uint64_t Size() const;
    uint32_t RowCount() const;
    uint32_t ColumnCount() const;
    uint32_t InputAttachmentIndex() const;
    introspection::Dim Dimension() const;
    introspection::Semantic Semantic() const;
    bool IsStruct() const;
    bool ColumnMajor() const;
    bool ActivelyUsed() const;

private:
    introspection::Type mType;
    introspection::Dim mDim;
    introspection::Semantic mSemantic;
    std::string mName;
    uint64_t mCardinality;
    std::vector<uint32_t> mArraySizes;
    introspection::Struct mStructDeclaration;
    introspection::ShaderBlockModifier mShaderBlockModifier;
    uint64_t mBindingGroupIndex;
    uint64_t mBindingWithinIndex;
    uint32_t mRowCount;
    uint32_t mColumnCount;
    uint32_t mInputAttachmentIndex;
    bool mColumnMajor;
    bool mActivelyUsed;
};

}  // namespace introspection
}  // namespace gpa