Program Listing for File introspection/types.h

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

namespace gpa {
namespace introspection {

enum Type {
    kUnknown,
    kHalf,
    kFloat,
    kDouble,
    kInt8,
    kUInt8,
    kBool = kUInt8,
    kInt16,
    kUInt16,
    kInt32,
    kUInt32,
    kInt64,
    kUInt64,
};

unsigned int GetTypeSizeInBytes(Type type);

enum ShaderBlockModifier {
    kNone = 0,
    kIn = 1,
    kOut = 2,
    kUniformBuffer = 3,
    kStorageBuffer = 4,
    kSubpassIn = 5,
    kStorageImage = 6,
    kSampledImage = 7,
    kAtomicCounter = 8,
    kPushConstantBuffer = 9,
    kSeparateImage = 10,
    kSeparateSampler = 11,
    kUnorderedAccessView = 12,
    kShaderResourceView = 13,
    kAccelerationStructure = 14,

    kShaderBlockModifierCount = kAccelerationStructure + 1,

    kConstantBuffer = kUniformBuffer,  // HLSL
    kTexture = kSeparateImage,         // HLSL
    kRWTexture = kStorageImage,        // HLSL
    kUniform = kUniformBuffer          // deprecated
};

enum SourceType {
    kNotFound = 0,
    kGLSL,
    kHLSL,
    kSourceTypeCount,
};

enum Dim {
    kDimUnknown = 0,
    kDimBuffer = 1,
    kDimTexture1D = 2,
    kDimTexture2D = 3,
    kDimTexture2DMS = 4,
    kDimTexture3D = 5,
    kDimTextureCube = 6,
    kDimTexture1DArray = 7,
    kDimTexture2DArray = 8,
    kDimTexture2DMSArray = 9,
    kDimTextureCubeArray = 10,
};

enum Semantic {
    kSemanticUndefined = 0,
    kSemanticPosition = 1,
    kSemanticClipDistance = 2,
    kSemanticCullDistance = 3,
    kSemanticRenderTargetArrayIndex = 4,
    kSemanticViewportArrayIndex = 5,
    kSemanticVertexId = 6,
    kSemanticPrimitiveId = 7,
    kSemanticInstanceId = 8,
    kSemanticIsFrontFace = 9,
    kSemanticSampleIndex = 10,
    kSemanticFinalQuadEdgeTessfactor = 11,
    kSemanticFinalQuadInsideTessfactor = 12,
    kSemanticFinalTriEdgeTessfactor = 13,
    kSemanticFinalTriInsideTessfactor = 14,
    kSemanticFinalLineDetailTessfactor = 15,
    kSemanticFinalLineDensityTessfactor = 16,
    kSemanticBarycentrics = 17,
    kSemanticShadingRate = 18,
    kSemanticCullPrimitive = 19,
    kSemanticTarget = 20,
    kSemanticDepth = 21,
    kSemanticCoverage = 22,
    kSemanticDepthGreaterEqual = 23,
    kSemanticDepthLessEqual = 23,
    kSemanticStencilRef = 24,
    kSemanticInnerCoverage = 25
};

struct ShaderVersion
{
    // Matches DXIL::ShaderKind from DirectXShaderCompiler
    enum ProgramType {
        kPixel = 0,
        kVertex,
        kGeometry,
        kHull,
        kDomain,
        kCompute,
        kLibrary,
        kRayGeneration,
        kIntersection,
        kAnyHit,
        kClosestHit,
        kMiss,
        kCallable,
        kMesh,
        kAmplification,
        kUnknownProgramType,
    };

    ProgramType type = kUnknownProgramType;
    uint16_t major = 0;
    uint16_t minor = 0;
};

}  // namespace introspection
}  // namespace gpa