2020-02-10 22:57:49 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
namespace NEO {
|
|
|
|
struct HardwareInfo;
|
2020-07-27 23:37:51 +08:00
|
|
|
class CommandContainer;
|
2020-07-23 16:56:08 +08:00
|
|
|
class IndirectHeap;
|
2020-10-17 06:52:18 +08:00
|
|
|
struct DebugData;
|
|
|
|
class GraphicsAllocation;
|
2020-07-27 23:37:51 +08:00
|
|
|
|
2020-02-10 22:57:49 +08:00
|
|
|
class Debugger {
|
|
|
|
public:
|
2020-08-24 15:27:30 +08:00
|
|
|
struct SbaAddresses {
|
|
|
|
uint64_t GeneralStateBaseAddress = 0;
|
|
|
|
uint64_t SurfaceStateBaseAddress = 0;
|
|
|
|
uint64_t DynamicStateBaseAddress = 0;
|
|
|
|
uint64_t IndirectObjectBaseAddress = 0;
|
|
|
|
uint64_t InstructionBaseAddress = 0;
|
|
|
|
uint64_t BindlessSurfaceStateBaseAddress = 0;
|
|
|
|
uint64_t BindlessSamplerStateBaseAddress = 0;
|
|
|
|
};
|
|
|
|
|
2020-02-10 22:57:49 +08:00
|
|
|
static std::unique_ptr<Debugger> create(HardwareInfo *hwInfo);
|
|
|
|
virtual ~Debugger() = default;
|
2020-06-18 23:08:55 +08:00
|
|
|
bool isLegacy() const { return isLegacyMode; }
|
2020-08-24 15:27:30 +08:00
|
|
|
virtual void captureStateBaseAddress(CommandContainer &container, SbaAddresses sba) = 0;
|
2020-07-23 16:56:08 +08:00
|
|
|
void *getDebugSurfaceReservedSurfaceState(IndirectHeap &ssh);
|
|
|
|
|
2020-11-16 23:24:54 +08:00
|
|
|
inline static bool isDebugEnabled(bool internalUsage) {
|
|
|
|
return !internalUsage;
|
|
|
|
}
|
|
|
|
|
2020-06-18 23:08:55 +08:00
|
|
|
protected:
|
|
|
|
bool isLegacyMode = true;
|
2020-02-10 22:57:49 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|