Program Listing for File playback-common.h

Return to documentation for file (include\utility\playback-common.h)

/******************************************************************************
(c) 2023 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 "enum-mask.h"
#include <cstdint>
#include <functional>

namespace gpa {
namespace playback_common {

enum CallableType {
    Other = 0,
    Clear = 1 << 1,
    Draw = 1 << 2,
    Dispatch = 1 << 3,
    ExecuteIndirect = 1 << 4,
    CopyResource = 1 << 5,
    BlitWrite = 1 << 6,
    GpuSync = 1 << 7,
    Present = 1 << 8,
    ExecuteCommandList = 1 << 9,
    Marker = 1 << 10,
    BeginUserRegion = 1 << 11,
    EndUserRegion = 1 << 12,
    CloseCommandList = 1 << 13,
    GpuEvent = 1 << 14,
    GpuCall = 1 << 15,
    DispatchRays = 1 << 16,
    AccelerationStructureCall = 1 << 17,
    DebugMarker = 1 << 18,
    Create = 1 << 19,
    Destroy = 1 << 20,

    // uninitialized type value
    Unknown = 1 << 31,

    AllTypes =
        Other | Clear | Draw | Dispatch | ExecuteIndirect | CopyResource | BlitWrite | GpuSync | Present | ExecuteCommandList | Marker | BeginUserRegion | EndUserRegion | CloseCommandList | GpuEvent | GpuCall | DispatchRays | AccelerationStructureCall | DebugMarker | Create | Destroy | Unknown,
};
ENUM_AS_BITSET(CallableType)

char const* CallableTypeToString(CallableType type);

struct CallableKey
{
    uint64_t storageId;
    uint64_t storageOffset;

    CallableKey();
    CallableKey(uint64_t id, uint64_t offset);
    bool operator<(const CallableKey other) const;
    bool operator!=(const CallableKey other) const;
    bool operator==(const CallableKey other) const;
    static const CallableKey sNullKey;
};

class ICallable
{
public:
    virtual CallableKey GetCallableKey() = 0;
    virtual CallableType GetCallableType() = 0;
    virtual void* GetFunctionCallPointer() = 0;
};

}  // namespace playback_common
}  // namespace gpa