Edit

kc3-lang/angle/src/libANGLE/Overlay_autogen.cpp

Branch :

  • Show log

    Commit

  • Author : Tim Van Patten
    Date : 2020-09-24 11:39:49
    Hash : ee4e0866
    Message : Vulkan: Add descriptor set allocation counters Add descriptor set allocation counters for the following: - ContextVk - Driver uniform allocations for graphics and compute pipelines. - ProgramExecutableVk - ANGLE driver uniforms - Uniforms - Textures - Other shader resources - UtilsVk - All of the UtilsVk::Function types increment the same counter Each object's counters live within the object itself and the cumulative total is output as part of that object's destruction. On Present, all of the descriptor set counts are collected into a single total which is used to update the overlay each frame. In order to see the cumulative total output for each object, the following GN args must be enabled: is_debug = true angle_enable_perf_counter_output = true To see the descriptor set allocation overlay: ANGLE_OVERLAY=VulkanDescriptorSetAllocations Bug: angleproject:5067 Test: Manual verification with angle_perftests Change-Id: Ie45fda56ade3e68bfba7bf6da9554eb05a02c6b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2429487 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>

  • src/libANGLE/Overlay_autogen.cpp
  • // GENERATED FILE - DO NOT EDIT.
    // Generated by gen_overlay_widgets.py using data from overlay_widgets.json.
    //
    // Copyright 2020 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    // Overlay_autogen.cpp:
    //   Autogenerated overlay widget declarations.
    
    #include "libANGLE/Overlay.h"
    #include "libANGLE/OverlayWidgets.h"
    #include "libANGLE/Overlay_font_autogen.h"
    #include "libANGLE/renderer/driver_utils.h"
    
    namespace gl
    {
    using namespace overlay;
    
    namespace
    {
    int GetFontSize(int fontSize, bool largeFont)
    {
        if (largeFont && fontSize > 0)
        {
            return fontSize - 1;
        }
        return fontSize;
    }
    }  // anonymous namespace
    
    void Overlay::initOverlayWidgets()
    {
        const bool kLargeFont = rx::IsAndroid();
    
        {
            PerSecond *widget = new PerSecond;
            {
                const int32_t fontSize = GetFontSize(kFontLayerMedium, kLargeFont);
                const int32_t offsetX  = 10;
                const int32_t offsetY  = 10;
                const int32_t width    = 12 * kFontGlyphWidths[fontSize];
                const int32_t height   = kFontGlyphHeights[fontSize];
    
                widget->type      = WidgetType::PerSecond;
                widget->fontSize  = fontSize;
                widget->coords[0] = offsetX;
                widget->coords[1] = offsetY;
                widget->coords[2] = offsetX + width;
                widget->coords[3] = offsetY + height;
                widget->color[0]  = 0.498039215686f;
                widget->color[1]  = 0.749019607843f;
                widget->color[2]  = 1.0f;
                widget->color[3]  = 1.0f;
            }
            mState.mOverlayWidgets[WidgetId::FPS].reset(widget);
        }
    
        {
            Text *widget = new Text;
            {
                const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
                const int32_t offsetX  = 10;
                const int32_t offsetY  = -10;
                const int32_t width    = 150 * kFontGlyphWidths[fontSize];
                const int32_t height   = kFontGlyphHeights[fontSize];
    
                widget->type      = WidgetType::Text;
                widget->fontSize  = fontSize;
                widget->coords[0] = offsetX;
                widget->coords[1] = offsetY - height;
                widget->coords[2] = offsetX + width;
                widget->coords[3] = offsetY;
                widget->color[0]  = 1.0f;
                widget->color[1]  = 0.0f;
                widget->color[2]  = 0.0f;
                widget->color[3]  = 1.0f;
            }
            mState.mOverlayWidgets[WidgetId::VulkanLastValidationMessage].reset(widget);
        }
    
        {
            Count *widget = new Count;
            {
                const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
                const int32_t offsetX  = 10;
                const int32_t offsetY =
                    mState.mOverlayWidgets[WidgetId::VulkanLastValidationMessage]->coords[1];
                const int32_t width  = 25 * kFontGlyphWidths[fontSize];
                const int32_t height = kFontGlyphHeights[fontSize];
    
                widget->type      = WidgetType::Count;
                widget->fontSize  = fontSize;
                widget->coords[0] = offsetX;
                widget->coords[1] = offsetY - height;
                widget->coords[2] = offsetX + width;
                widget->coords[3] = offsetY;
                widget->color[0]  = 1.0f;
                widget->color[1]  = 0.0f;
                widget->color[2]  = 0.0f;
                widget->color[3]  = 1.0f;
            }
            mState.mOverlayWidgets[WidgetId::VulkanValidationMessageCount].reset(widget);
        }
    
        {
            RunningGraph *widget = new RunningGraph(60);
            {
                const int32_t fontSize = GetFontSize(0, kLargeFont);
                const int32_t offsetX  = 10;
                const int32_t offsetY  = 100;
                const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
                const int32_t height   = 100;
    
                widget->type      = WidgetType::RunningGraph;
                widget->fontSize  = fontSize;
                widget->coords[0] = offsetX;
                widget->coords[1] = offsetY;
                widget->coords[2] = offsetX + width;
                widget->coords[3] = offsetY + height;
                widget->color[0]  = 0.294117647059f;
                widget->color[1]  = 0.78431372549f;
                widget->color[2]  = 0.0f;
                widget->color[3]  = 0.78431372549f;
            }
            mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount].reset(widget);
            {
                const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
                const int32_t offsetX =
                    mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount]->coords[0];
                const int32_t offsetY =
                    mState.mOverlayWidgets[WidgetId::VulkanRenderPassCount]->coords[1];
                const int32_t width  = 40 * kFontGlyphWidths[fontSize];
                const int32_t height = kFontGlyphHeights[fontSize];
    
                widget->description.type      = WidgetType::Text;
                widget->description.fontSize  = fontSize;
                widget->description.coords[0] = offsetX;
                widget->description.coords[1] = std::max(offsetY - height, 1);
                widget->description.coords[2] = offsetX + width;
                widget->description.coords[3] = offsetY;
                widget->description.color[0]  = 0.294117647059f;
                widget->description.color[1]  = 0.78431372549f;
                widget->description.color[2]  = 0.0f;
                widget->description.color[3]  = 1.0f;
            }
        }
    
        {
            RunningHistogram *widget = new RunningHistogram(100);
            {
                const int32_t fontSize = GetFontSize(0, kLargeFont);
                const int32_t offsetX  = -50;
                const int32_t offsetY  = 100;
                const int32_t width    = 6 * static_cast<uint32_t>(widget->runningValues.size());
                const int32_t height   = 100;
    
                widget->type      = WidgetType::RunningHistogram;
                widget->fontSize  = fontSize;
                widget->coords[0] = offsetX - width;
                widget->coords[1] = offsetY;
                widget->coords[2] = offsetX;
                widget->coords[3] = offsetY + height;
                widget->color[0]  = 1.0f;
                widget->color[1]  = 0.78431372549f;
                widget->color[2]  = 0.294117647059f;
                widget->color[3]  = 0.78431372549f;
            }
            mState.mOverlayWidgets[WidgetId::VulkanRenderPassBufferCount].reset(widget);
            {
                const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
                const int32_t offsetX =
                    mState.mOverlayWidgets[WidgetId::VulkanRenderPassBufferCount]->coords[0];
                const int32_t offsetY =
                    mState.mOverlayWidgets[WidgetId::VulkanRenderPassBufferCount]->coords[1];
                const int32_t width  = 40 * kFontGlyphWidths[fontSize];
                const int32_t height = kFontGlyphHeights[fontSize];
    
                widget->description.type      = WidgetType::Text;
                widget->description.fontSize  = fontSize;
                widget->description.coords[0] = offsetX;
                widget->description.coords[1] = std::max(offsetY - height, 1);
                widget->description.coords[2] = std::min(offsetX + width, -1);
                widget->description.coords[3] = offsetY;
                widget->description.color[0]  = 1.0f;
                widget->description.color[1]  = 0.78431372549f;
                widget->description.color[2]  = 0.294117647059f;
                widget->description.color[3]  = 1.0f;
            }
        }
    
        {
            RunningHistogram *widget = new RunningHistogram(50);
            {
                const int32_t fontSize = GetFontSize(0, kLargeFont);
                const int32_t offsetX  = -50;
                const int32_t offsetY  = 100;
                const int32_t width    = 6 * static_cast<uint32_t>(widget->runningValues.size());
                const int32_t height   = 100;
    
                widget->type      = WidgetType::RunningHistogram;
                widget->fontSize  = fontSize;
                widget->coords[0] = offsetX - width;
                widget->coords[1] = offsetY;
                widget->coords[2] = offsetX;
                widget->coords[3] = offsetY + height;
                widget->color[0]  = 1.0f;
                widget->color[1]  = 0.78431372549f;
                widget->color[2]  = 0.294117647059f;
                widget->color[3]  = 0.78431372549f;
            }
            mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste].reset(widget);
            {
                const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
                const int32_t offsetX =
                    mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste]->coords[0];
                const int32_t offsetY =
                    mState.mOverlayWidgets[WidgetId::VulkanSecondaryCommandBufferPoolWaste]->coords[1];
                const int32_t width  = 40 * kFontGlyphWidths[fontSize];
                const int32_t height = kFontGlyphHeights[fontSize];
    
                widget->description.type      = WidgetType::Text;
                widget->description.fontSize  = fontSize;
                widget->description.coords[0] = offsetX;
                widget->description.coords[1] = std::max(offsetY - height, 1);
                widget->description.coords[2] = std::min(offsetX + width, -1);
                widget->description.coords[3] = offsetY;
                widget->description.color[0]  = 1.0f;
                widget->description.color[1]  = 0.78431372549f;
                widget->description.color[2]  = 0.294117647059f;
                widget->description.color[3]  = 1.0f;
            }
        }
    
        {
            RunningGraph *widget = new RunningGraph(60);
            {
                const int32_t fontSize = GetFontSize(0, kLargeFont);
                const int32_t offsetX  = 10;
                const int32_t offsetY  = 220;
                const int32_t width    = 5 * static_cast<uint32_t>(widget->runningValues.size());
                const int32_t height   = 100;
    
                widget->type      = WidgetType::RunningGraph;
                widget->fontSize  = fontSize;
                widget->coords[0] = offsetX;
                widget->coords[1] = offsetY;
                widget->coords[2] = offsetX + width;
                widget->coords[3] = offsetY + height;
                widget->color[0]  = 0.294117647059f;
                widget->color[1]  = 0.78431372549f;
                widget->color[2]  = 0.0f;
                widget->color[3]  = 0.78431372549f;
            }
            mState.mOverlayWidgets[WidgetId::VulkanWriteDescriptorSetCount].reset(widget);
            {
                const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
                const int32_t offsetX =
                    mState.mOverlayWidgets[WidgetId::VulkanWriteDescriptorSetCount]->coords[0];
                const int32_t offsetY =
                    mState.mOverlayWidgets[WidgetId::VulkanWriteDescriptorSetCount]->coords[1];
                const int32_t width  = 40 * kFontGlyphWidths[fontSize];
                const int32_t height = kFontGlyphHeights[fontSize];
    
                widget->description.type      = WidgetType::Text;
                widget->description.fontSize  = fontSize;
                widget->description.coords[0] = offsetX;
                widget->description.coords[1] = std::max(offsetY - height, 1);
                widget->description.coords[2] = offsetX + width;
                widget->description.coords[3] = offsetY;
                widget->description.color[0]  = 0.294117647059f;
                widget->description.color[1]  = 0.78431372549f;
                widget->description.color[2]  = 0.0f;
                widget->description.color[3]  = 1.0f;
            }
        }
    
        {
            RunningGraph *widget = new RunningGraph(60);
            {
                const int32_t fontSize = GetFontSize(0, kLargeFont);
                const int32_t offsetX  = -50;
                const int32_t offsetY  = 250;
                const int32_t width    = 6 * static_cast<uint32_t>(widget->runningValues.size());
                const int32_t height   = 100;
    
                widget->type      = WidgetType::RunningGraph;
                widget->fontSize  = fontSize;
                widget->coords[0] = offsetX - width;
                widget->coords[1] = offsetY;
                widget->coords[2] = offsetX;
                widget->coords[3] = offsetY + height;
                widget->color[0]  = 1.0f;
                widget->color[1]  = 0.0f;
                widget->color[2]  = 0.294117647059f;
                widget->color[3]  = 0.78431372549f;
            }
            mState.mOverlayWidgets[WidgetId::VulkanDescriptorSetAllocations].reset(widget);
            {
                const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
                const int32_t offsetX =
                    mState.mOverlayWidgets[WidgetId::VulkanDescriptorSetAllocations]->coords[0];
                const int32_t offsetY =
                    mState.mOverlayWidgets[WidgetId::VulkanDescriptorSetAllocations]->coords[1];
                const int32_t width  = 40 * kFontGlyphWidths[fontSize];
                const int32_t height = kFontGlyphHeights[fontSize];
    
                widget->description.type      = WidgetType::Text;
                widget->description.fontSize  = fontSize;
                widget->description.coords[0] = offsetX;
                widget->description.coords[1] = std::max(offsetY - height, 1);
                widget->description.coords[2] = std::min(offsetX + width, -1);
                widget->description.coords[3] = offsetY;
                widget->description.color[0]  = 1.0f;
                widget->description.color[1]  = 0.0f;
                widget->description.color[2]  = 0.294117647059f;
                widget->description.color[3]  = 1.0f;
            }
        }
    }
    
    }  // namespace gl