#include "libANGLE/Overlay.h"
#include "libANGLE/Overlay_font_autogen.h"
#include <functional>
namespace gl
{
namespace
{
enum class WidgetInternalType
{ … };
constexpr angle::PackedEnumMap<WidgetType, WidgetInternalType> kWidgetTypeToInternalMap = …;
constexpr size_t kMaxRenderableTextWidgets = …;
constexpr size_t kMaxRenderableGraphWidgets = …;
constexpr size_t kMaxTextLength = …;
constexpr size_t kMaxGraphDataSize = …;
constexpr angle::PackedEnumMap<WidgetInternalType, size_t> kWidgetInternalTypeMaxWidgets = …;
ANGLE_ENABLE_STRUCT_PADDING_WARNINGS
struct WidgetCoordinates
{ … };
struct TextWidgetData
{ … };
struct GraphWidgetData
{ … };
struct TextWidgets
{ … };
struct GraphWidgets
{ … };
ANGLE_DISABLE_STRUCT_PADDING_WARNINGS
uint32_t GetWidgetCoord(int32_t src, uint32_t extent)
{ … }
void GetWidgetCoordinates(const int32_t srcCoords[4],
const gl::Extents &imageExtent,
uint32_t dstCoordsOut[4])
{ … }
void GetWidgetColor(const float srcColor[4], float dstColor[4])
{ … }
void GetTextFontSize(int srcFontSize, uint32_t dstFontSize[3])
{ … }
void GetGraphValueWidth(const int32_t srcCoords[4], size_t valueCount, uint32_t *dstValueWidth)
{ … }
void GetTextString(const std::string &src, uint8_t textOut[kMaxTextLength])
{ … }
void GetGraphValues(const std::vector<uint64_t> srcValues,
size_t startIndex,
float scale,
uint32_t valuesOut[kMaxGraphDataSize])
{ … }
std::vector<uint64_t> CreateHistogram(const std::vector<uint64_t> values)
{ … }
OverlayWidgetCounts;
AppendWidgetDataFunc;
}
namespace overlay_impl
{
#define ANGLE_DECLARE_APPEND_WIDGET_PROC(WIDGET_ID) …
class AppendWidgetDataHelper
{ … };
void AppendWidgetDataHelper::AppendTextCommon(const overlay::Widget *widget,
const gl::Extents &imageExtent,
const std::string &text,
TextWidgetData *textWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendGraphCommon(const overlay::Widget *widget,
const gl::Extents &imageExtent,
const std::vector<uint64_t> runningValues,
size_t startIndex,
float scale,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendRunningGraphCommon(
const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts,
AppendWidgetDataHelper::FormatGraphTitleFunc formatFunc)
{ … }
void AppendWidgetDataHelper::AppendRunningHistogramCommon(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts,
FormatHistogramTitleFunc formatFunc)
{ … }
void AppendWidgetDataHelper::AppendFPS(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanLastValidationMessage(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanValidationMessageCount(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanRenderPassCount(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanSecondaryCommandBufferPoolWaste(
const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanWriteDescriptorSetCount(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanDescriptorSetAllocations(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanShaderResourceDSHitRate(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanDynamicBufferAllocations(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanTextureDescriptorCacheSize(
const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanUniformDescriptorCacheSize(
const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanDescriptorCacheSize(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanDescriptorCacheKeySize(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanAttemptedSubmissions(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanActualSubmissions(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanPipelineCacheLookups(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanPipelineCacheMisses(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanTotalPipelineCacheHitTimeMs(
const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
void AppendWidgetDataHelper::AppendVulkanTotalPipelineCacheMissTimeMs(
const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{ … }
std::ostream &AppendWidgetDataHelper::OutputPerSecond(std::ostream &out,
const overlay::PerSecond *perSecond)
{ … }
std::ostream &AppendWidgetDataHelper::OutputText(std::ostream &out, const overlay::Text *text)
{ … }
std::ostream &AppendWidgetDataHelper::OutputCount(std::ostream &out, const overlay::Count *count)
{ … }
}
namespace
{
#define ANGLE_APPEND_WIDGET_MAP_PROC(WIDGET_ID) …
constexpr angle::PackedEnumMap<WidgetId, AppendWidgetDataFunc> kWidgetIdToAppendDataFuncMap = …;
}
namespace overlay
{
const Text *Widget::getDescriptionWidget() const
{ … }
RunningGraph::RunningGraph(size_t n) : … { … }
RunningGraph::~RunningGraph() = default;
const Text *RunningGraph::getDescriptionWidget() const
{ … }
}
size_t OverlayState::getWidgetCoordinatesBufferSize() const
{ … }
size_t OverlayState::getTextWidgetsBufferSize() const
{ … }
size_t OverlayState::getGraphWidgetsBufferSize() const
{ … }
void OverlayState::fillWidgetData(const gl::Extents &imageExtents,
uint8_t *textData,
uint8_t *graphData,
uint32_t *activeTextWidgetCountOut,
uint32_t *activeGraphWidgetCountOut) const
{ … }
}