Reland "Vulkan: Debug overlay"

This is a reland of e54d0f90d1

This was reverted due to a build failure as a result of a missing
virtual destructor in the widget base class.

Original change's description:
> Vulkan: Debug overlay
>
> A debug overlay system for the Vulkan backend designed with efficiency
> and runtime configurability in mind.  Overlay widgets are of two
> fundamental types:
>
> - Text widgets: A single line of text with small, medium or large font.
> - Graph widgets: A bar graph of data.
>
> Built on these, various overlay widget types are defined that gather
> statistics.  Five such types are defined with one widget per type as
> example:
>
> - Count: A widget that counts something.  VulkanValidationMessageCount
>   is an overlay widget of this type that shows the number of validation
>   messages received from the validation layers.
> - Text: A generic text.  VulkanLastValidationMessage is an overlay
>   widget of this type that shows the last validation message.
> - PerSecond: A value that gets reset every second automatically.  FPS is
>   an overlay widget of this type that simply gets incremented on every
>   swap().
> - RunningGraph: A graph of last N values.  VulkanCommandGraphSize is an
>   overlay of this type.  On every vkQueueSubmit, the number of nodes in
>   the command graph is accumulated.  On every present(), the value is
>   taken as the number of nodes for the whole duration of the frame.
> - RunningHistogram: A histogram of last N values.  Input values are in
>   the [0, 1] range and they are ranked to N buckets for histogram
>   calculation.  VulkanSecondaryCommandBufferPoolWaste is an overlay
>   widget of this type.  On vkQueueSubmit, the memory waste from command
>   buffer pool allocations is recorded in the histogram.
>
> Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py
> processes to create an array of bits, which is processed at runtime to
> create the actual font image (an image with 3 layers).
>
> The overlay widget layout is defined in overlay_widgets.json which
> gen_overlay_widgets.py processes to generate an array of widgetss, each
> of its respective type, and sets their properties, such as color and
> bounding box.  The json file allows widgets to align against other
> widgets as well as against the framebuffer edges.
>
> Two compute shaders are implemented to efficiently render the UI:
>
> - OverlayCull: This shader creates a bitset of Text and Graph widgets
>   whose bounding boxes intersect a corresponding subgroup processed by
>   OverlayDraw.  This is done only when the enabled overlay widgets are
>   changed (a feature that is not yet implemented) or the surface is
>   resized.
> - OverlayDraw: Using the bitsets generated by OverlayCull, values that
>   are uniform for each workgroup (set to be equal to hardware subgroup
>   size), this shader loops over enabled widgets that can possibly
>   intersect the pixel being processed and renders and blends in texts
>   and graphs.  This is done once per frame on present().
>
> Currently, to enable overlay widgets an environment variable is used.
> For example:
>
>     $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste
>     $ ./hello_triangle --use-angle=vulkan
>
> Possible future work:
>
> - On Android, add settings in developer options and enable widgets based
>   on those.
> - Spawn a small server in ANGLE and write an application that sends
>   enable/disable commands remotely.
> - Implement overlay for other backends.
>
> Bug: angleproject:3757
> Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>

Bug: angleproject:3757
Change-Id: I47915d88b37b6f882c686c2de13fca309a10b572
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1780897
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Shahbaz Youssefi 2019-06-30 03:26:18 -04:00 коммит произвёл Commit Bot
Родитель 03f93cf02b
Коммит 050b124d78
68 изменённых файлов: 8253 добавлений и 33 удалений

Просмотреть файл

@ -715,6 +715,10 @@ angle_source_set("libANGLE_base") {
defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
}
if (angle_enable_overlay) {
defines += [ "ANGLE_ENABLE_OVERLAY=1" ]
}
configs += [ ":debug_annotations_config" ]
public_configs += [
":libANGLE_config",

Просмотреть файл

@ -88,6 +88,9 @@ declare_args() {
# Enable custom (cpu-side) secondary command buffers
angle_enable_custom_vulkan_cmd_buffers = true
}
# Disable overlay by default
angle_enable_overlay = false
}
if (is_win) {

Просмотреть файл

@ -1,6 +1,6 @@
{
"src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py":
"76bc7ed183ce82e687b16f0496cc9f09",
"b05fa7c291a7c05d9bb1dd075990275b",
"src/libANGLE/renderer/vulkan/shaders/gen/BlitResolve.frag.00000000.inc":
"31832c377e532cd5ea05aab57154b8f8",
"src/libANGLE/renderer/vulkan/shaders/gen/BlitResolve.frag.00000001.inc":
@ -223,6 +223,22 @@
"5bb2d9e8ee68f8ec2dacd4a056f8eff2",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000015.inc":
"8152303c7825ff73d9972d95520852dd",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000000.inc":
"1dc870604216818c7ca757ebb7cd22bc",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000001.inc":
"cb05ee0936a2235f49994497bd831b20",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000002.inc":
"9c6973f0e4035a411de5425d48a8ded5",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000003.inc":
"93a50e9365cef6be89033df687db44ad",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000004.inc":
"78e697d35c094a750a6cb6689b9d35c4",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000005.inc":
"5c57c4cb2507aee3e7d0d53555ef7471",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayDraw.comp.00000000.inc":
"a341905ac08458eab61199817fe40c7e",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayDraw.comp.00000001.inc":
"25ba613bf71f7c1397bfe2d089d57ac6",
"src/libANGLE/renderer/vulkan/shaders/src/BlitResolve.frag":
"a3ecba7bc86093f90b183605bed82813",
"src/libANGLE/renderer/vulkan/shaders/src/BlitResolveStencilNoExport.comp":
@ -239,10 +255,14 @@
"8889ae8014a657a0efd5607954126945",
"src/libANGLE/renderer/vulkan/shaders/src/ImageCopy.frag":
"f0f3cc82d78198f114b698e1aea31267",
"src/libANGLE/renderer/vulkan/shaders/src/OverlayCull.comp":
"c89a0d185f7723e0c221c135aa4f48a3",
"src/libANGLE/renderer/vulkan/shaders/src/OverlayDraw.comp":
"dcc246b398b2e07a869a264666499362",
"src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp":
"0660e11229f28464a6de11eb07fff7d3",
"9035e5a2674bbab577576d5b704fbe99",
"src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h":
"0532a7219ffa0a5a9ca0cd7a6eb3206e",
"bd3beed76c9069d967cc2946a035e2cc",
"tools/glslang/glslang_validator.exe.sha1":
"289f30598865a987a21b79ae525fc66f",
"tools/glslang/glslang_validator.sha1":

Просмотреть файл

@ -0,0 +1,10 @@
{
"src/libANGLE/Overlay_font_autogen.cpp":
"ff9bf191978e8c9cff6de3e31f3664f2",
"src/libANGLE/Overlay_font_autogen.h":
"2eae247cebb716c4f591de8a251b4a8e",
"src/libANGLE/gen_overlay_fonts.py":
"e257b626441bf057856eb357a1a2ca5c",
"src/libANGLE/overlay/DejaVuSansMono-Bold.ttf":
"f580ed7569a1967ceeb96fa3e1b234d4"
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"src/libANGLE/Overlay_autogen.cpp":
"514b8108f62ef616c296dc511bb2f644",
"src/libANGLE/gen_overlay_widgets.py":
"07252fbde304fd48559ae07f8f920a08",
"src/libANGLE/overlay_widgets.json":
"552b1e2883a12c38d427c7fbd1c2bf22"
}

Просмотреть файл

@ -105,6 +105,10 @@ generators = {
'src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py',
'Vulkan internal shader programs':
'src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py',
'overlay fonts':
'src/libANGLE/gen_overlay_fonts.py',
'overlay widgets':
'src/libANGLE/gen_overlay_widgets.py',
'Emulated HLSL functions':
'src/compiler/translator/gen_emulated_builtin_function_tables.py',
'Static builtins':

Просмотреть файл

@ -315,6 +315,7 @@ Context::Context(egl::Display *display,
: mState(reinterpret_cast<ContextID>(this),
shareContext ? &shareContext->mState : nullptr,
shareTextures,
&mOverlay,
clientType,
GetClientVersion(display, attribs),
GetDebug(attribs),
@ -352,7 +353,8 @@ Context::Context(egl::Display *display,
mScratchBuffer(1000u),
mZeroFilledBuffer(1000u),
mThreadPool(nullptr),
mFrameCapture(new angle::FrameCapture)
mFrameCapture(new angle::FrameCapture),
mOverlay(mImplementation.get())
{
for (angle::SubjectIndex uboIndex = kUniformBuffer0SubjectIndex;
uboIndex < kUniformBufferMaxSubjectIndex; ++uboIndex)
@ -539,6 +541,9 @@ void Context::initialize()
mCopyImageDirtyObjects.set(State::DIRTY_OBJECT_READ_FRAMEBUFFER);
ANGLE_CONTEXT_TRY(mImplementation->initialize());
// Initialize overlay after implementation is initialized.
ANGLE_CONTEXT_TRY(mOverlay.init(this));
}
egl::Error Context::onDestroy(const egl::Display *display)
@ -611,6 +616,8 @@ egl::Error Context::onDestroy(const egl::Display *display)
mImplementation->onDestroy(this);
mOverlay.destroy(this);
return egl::NoError();
}

Просмотреть файл

@ -723,6 +723,8 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
// Note: we use a raw pointer here so we can exclude frame capture sources from the build.
std::unique_ptr<angle::FrameCapture> mFrameCapture;
OverlayType mOverlay;
};
} // namespace gl

109
src/libANGLE/Overlay.cpp Normal file
Просмотреть файл

@ -0,0 +1,109 @@
//
// Copyright 2019 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.cpp:
// Implements the Overlay class.
//
#include "libANGLE/Overlay.h"
#include "common/system_utils.h"
#include "libANGLE/Context.h"
#include "libANGLE/Overlay_font_autogen.h"
#include "libANGLE/renderer/GLImplFactory.h"
#include "libANGLE/renderer/OverlayImpl.h"
#include <numeric>
namespace gl
{
namespace
{
constexpr std::pair<const char *, WidgetId> kWidgetNames[] = {
{"FPS", WidgetId::FPS},
{"VulkanLastValidationMessage", WidgetId::VulkanLastValidationMessage},
{"VulkanValidationMessageCount", WidgetId::VulkanValidationMessageCount},
{"VulkanCommandGraphSize", WidgetId::VulkanCommandGraphSize},
{"VulkanSecondaryCommandBufferPoolWaste", WidgetId::VulkanSecondaryCommandBufferPoolWaste},
};
} // namespace
OverlayState::OverlayState() : mEnabledWidgetCount(0), mOverlayWidgets{} {}
OverlayState::~OverlayState() = default;
Overlay::Overlay(rx::GLImplFactory *factory)
: mLastPerSecondUpdate(0), mImplementation(factory->createOverlay(mState))
{}
Overlay::~Overlay() = default;
angle::Result Overlay::init(const Context *context)
{
initOverlayWidgets();
mLastPerSecondUpdate = angle::GetCurrentTime();
ASSERT(std::all_of(
mState.mOverlayWidgets.begin(), mState.mOverlayWidgets.end(),
[](const std::unique_ptr<overlay::Widget> &widget) { return widget.get() != nullptr; }));
enableOverlayWidgetsFromEnvironment();
return mImplementation->init(context);
}
void Overlay::destroy(const gl::Context *context)
{
ASSERT(mImplementation);
mImplementation->onDestroy(context);
}
void Overlay::enableOverlayWidgetsFromEnvironment()
{
std::istringstream angleOverlayWidgets(angle::GetEnvironmentVar("ANGLE_OVERLAY"));
std::set<std::string> enabledWidgets;
std::string widget;
while (getline(angleOverlayWidgets, widget, ':'))
{
enabledWidgets.insert(widget);
}
for (const std::pair<const char *, WidgetId> &widgetName : kWidgetNames)
{
if (enabledWidgets.count(widgetName.first) > 0)
{
mState.mOverlayWidgets[widgetName.second]->enabled = true;
++mState.mEnabledWidgetCount;
}
}
}
void Overlay::onSwap() const
{
// Increment FPS counter.
getPerSecondWidget(WidgetId::FPS)->add(1);
// Update per second values every second.
double currentTime = angle::GetCurrentTime();
double timeDiff = currentTime - mLastPerSecondUpdate;
if (timeDiff >= 1.0)
{
for (const std::unique_ptr<overlay::Widget> &widget : mState.mOverlayWidgets)
{
if (widget->type == WidgetType::PerSecond)
{
overlay::PerSecond *perSecond =
reinterpret_cast<overlay::PerSecond *>(widget.get());
perSecond->lastPerSecondCount = static_cast<size_t>(perSecond->count / timeDiff);
perSecond->count = 0;
}
}
mLastPerSecondUpdate += 1.0;
}
}
DummyOverlay::DummyOverlay(rx::GLImplFactory *implFactory) {}
DummyOverlay::~DummyOverlay() = default;
} // namespace gl

137
src/libANGLE/Overlay.h Normal file
Просмотреть файл

@ -0,0 +1,137 @@
//
// Copyright 2019 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.h:
// Defines the Overlay class that handles overlay widgets.
//
#ifndef LIBANGLE_OVERLAY_H_
#define LIBANGLE_OVERLAY_H_
#include "common/PackedEnums.h"
#include "common/angleutils.h"
#include "libANGLE/Error.h"
#include "libANGLE/OverlayWidgets.h"
#include "libANGLE/angletypes.h"
namespace rx
{
class OverlayImpl;
class GLImplFactory;
} // namespace rx
namespace gl
{
class Context;
class OverlayState : angle::NonCopyable
{
public:
OverlayState();
~OverlayState();
size_t getWidgetCoordinatesBufferSize() const;
size_t getTextWidgetsBufferSize() const;
size_t getGraphWidgetsBufferSize() const;
void initFontData(uint8_t *fontData) const;
void fillEnabledWidgetCoordinates(const gl::Extents &imageExtents,
uint8_t *enabledWidgetsPtr) const;
void fillWidgetData(const gl::Extents &imageExtents,
uint8_t *textData,
uint8_t *graphData) const;
uint32_t getEnabledWidgetCount() const { return mEnabledWidgetCount; }
private:
friend class Overlay;
uint32_t mEnabledWidgetCount;
angle::PackedEnumMap<WidgetId, std::unique_ptr<overlay::Widget>> mOverlayWidgets;
};
class Overlay : angle::NonCopyable
{
public:
Overlay(rx::GLImplFactory *implFactory);
~Overlay();
angle::Result init(const Context *context);
void destroy(const gl::Context *context);
void onSwap() const;
overlay::Text *getTextWidget(WidgetId id) const
{
return getWidgetAs<overlay::Text, WidgetType::Text>(id);
}
overlay::Count *getCountWidget(WidgetId id) const
{
return getWidgetAs<overlay::Count, WidgetType::Count>(id);
}
overlay::PerSecond *getPerSecondWidget(WidgetId id) const
{
return getWidgetAs<overlay::PerSecond, WidgetType::PerSecond>(id);
}
overlay::RunningGraph *getRunningGraphWidget(WidgetId id) const
{
return getWidgetAs<overlay::RunningGraph, WidgetType::RunningGraph>(id);
}
overlay::RunningHistogram *getRunningHistogramWidget(WidgetId id) const
{
return getWidgetAs<overlay::RunningHistogram, WidgetType::RunningHistogram>(id);
}
rx::OverlayImpl *getImplementation() const { return mImplementation.get(); }
private:
template <typename Widget, WidgetType Type>
Widget *getWidgetAs(WidgetId id) const
{
ASSERT(mState.mOverlayWidgets[id] != nullptr);
ASSERT(mState.mOverlayWidgets[id]->type == Type);
return rx::GetAs<Widget>(mState.mOverlayWidgets[id].get());
}
void initOverlayWidgets();
void enableOverlayWidgetsFromEnvironment();
// Time tracking for PerSecond items.
mutable double mLastPerSecondUpdate;
OverlayState mState;
std::unique_ptr<rx::OverlayImpl> mImplementation;
};
class DummyOverlay
{
public:
DummyOverlay(rx::GLImplFactory *implFactory);
~DummyOverlay();
angle::Result init(const Context *context) { return angle::Result::Continue; }
void destroy(const Context *context) {}
void onSwap() const {}
const overlay::Dummy *getTextWidget(WidgetId id) const { return &mDummy; }
const overlay::Dummy *getCountWidget(WidgetId id) const { return &mDummy; }
const overlay::Dummy *getPerSecondWidget(WidgetId id) const { return &mDummy; }
const overlay::Dummy *getRunningGraphWidget(WidgetId id) const { return &mDummy; }
const overlay::Dummy *getRunningHistogramWidget(WidgetId id) const { return &mDummy; }
private:
overlay::Dummy mDummy;
};
#if ANGLE_ENABLE_OVERLAY
using OverlayType = Overlay;
#else // !ANGLE_ENABLE_OVERLAY
using OverlayType = DummyOverlay;
#endif // ANGLE_ENABLE_OVERLAY
} // namespace gl
#endif // LIBANGLE_OVERLAY_H_

Просмотреть файл

@ -0,0 +1,504 @@
//
// Copyright 2019 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.
//
// OverlayWidgets.cpp:
// Implements functions that interpret widget data. Data formats and limits correspond to the
// Vulkan implementation (as the only implementation). They are generic enough so other backends
// could respect them too, if they implement the overlay.
//
#include "libANGLE/Overlay.h"
#include "libANGLE/Overlay_font_autogen.h"
namespace gl
{
namespace
{
// Internally, every widget is either Text or Graph.
enum class WidgetInternalType
{
Text,
Graph,
InvalidEnum,
EnumCount = InvalidEnum,
};
// A map that says how the API-facing widget types map to internal types.
constexpr angle::PackedEnumMap<WidgetType, WidgetInternalType> kWidgetTypeToInternalMap = {
{WidgetType::Count, WidgetInternalType::Text},
{WidgetType::Text, WidgetInternalType::Text},
{WidgetType::PerSecond, WidgetInternalType::Text},
{WidgetType::RunningGraph, WidgetInternalType::Graph},
{WidgetType::RunningHistogram, WidgetInternalType::Graph},
};
// Structures and limits matching uniform buffers in vulkan/shaders/src/OverlayDraw.comp. The size
// of text and graph widgets is chosen such that they could fit in uniform buffers with minimum
// required Vulkan size.
constexpr size_t kMaxRenderableTextWidgets = 32;
constexpr size_t kMaxRenderableGraphWidgets = 32;
constexpr size_t kMaxTextLength = 256;
constexpr size_t kMaxGraphDataSize = 64;
constexpr angle::PackedEnumMap<WidgetInternalType, size_t> kWidgetInternalTypeMaxWidgets = {
{WidgetInternalType::Text, kMaxRenderableTextWidgets},
{WidgetInternalType::Graph, kMaxRenderableGraphWidgets},
};
constexpr angle::PackedEnumMap<WidgetInternalType, size_t> kWidgetInternalTypeWidgetOffsets = {
{WidgetInternalType::Text, 0},
{WidgetInternalType::Graph, kMaxRenderableTextWidgets},
};
ANGLE_ENABLE_STRUCT_PADDING_WARNINGS
// Structure matching buffer in vulkan/shaders/src/OverlayCull.comp.
struct WidgetCoordinates
{
uint32_t coordinates[kMaxRenderableTextWidgets + kMaxRenderableGraphWidgets][4];
};
// Structures matching buffers in vulkan/shaders/src/OverlayDraw.comp.
struct TextWidgetData
{
uint32_t coordinates[4];
float color[4];
uint32_t fontSize[3];
uint32_t padding;
uint8_t text[kMaxTextLength];
};
struct GraphWidgetData
{
uint32_t coordinates[4];
float color[4];
uint32_t valueWidth;
uint32_t padding[3];
uint32_t values[kMaxGraphDataSize];
};
struct TextWidgets
{
TextWidgetData widgets[kMaxRenderableTextWidgets];
};
struct GraphWidgets
{
GraphWidgetData widgets[kMaxRenderableGraphWidgets];
};
ANGLE_DISABLE_STRUCT_PADDING_WARNINGS
uint32_t GetWidgetCoord(int32_t src, uint32_t extent)
{
int32_t dst = src < 0 ? extent + src : src;
return std::min<uint32_t>(std::max(dst, 0), extent - 1);
}
void GetWidgetCoordinates(const int32_t srcCoords[4],
const gl::Extents &imageExtent,
uint32_t dstCoordsOut[4])
{
dstCoordsOut[0] = GetWidgetCoord(srcCoords[0], imageExtent.width);
dstCoordsOut[1] = GetWidgetCoord(srcCoords[1], imageExtent.height);
dstCoordsOut[2] = GetWidgetCoord(srcCoords[2], imageExtent.width);
dstCoordsOut[3] = GetWidgetCoord(srcCoords[3], imageExtent.height);
}
void GetWidgetColor(const float srcColor[4], float dstColor[4])
{
memcpy(dstColor, srcColor, 4 * sizeof(dstColor[0]));
}
void GetTextFontSize(int srcFontSize, uint32_t dstFontSize[3])
{
// .xy contains the font glyph width/height
dstFontSize[0] = overlay::kFontGlyphWidths[srcFontSize];
dstFontSize[1] = overlay::kFontGlyphHeights[srcFontSize];
// .z contains the layer
dstFontSize[2] = srcFontSize;
}
void GetGraphValueWidth(const int32_t srcCoords[4], size_t valueCount, uint32_t *dstValueWidth)
{
const int32_t graphWidth = std::abs(srcCoords[2] - srcCoords[0]);
// If valueCount doesn't divide graphWidth, the graph bars won't fit well in its frame.
// Fix initOverlayWidgets() in that case.
ASSERT(graphWidth % valueCount == 0);
*dstValueWidth = graphWidth / valueCount;
}
void GetTextString(const std::string &src, uint8_t textOut[kMaxTextLength])
{
for (size_t i = 0; i < src.length() && i < kMaxTextLength; ++i)
{
// The font image has 96 ASCII characters starting from ' '.
textOut[i] = src[i] - ' ';
}
}
void GetGraphValues(const std::vector<size_t> srcValues,
size_t startIndex,
float scale,
uint32_t valuesOut[kMaxGraphDataSize])
{
ASSERT(srcValues.size() <= kMaxGraphDataSize);
for (size_t i = 0; i < srcValues.size(); ++i)
{
size_t index = (startIndex + i) % srcValues.size();
valuesOut[i] = static_cast<uint32_t>(srcValues[index] * scale);
}
}
std::vector<size_t> CreateHistogram(const std::vector<size_t> values)
{
std::vector<size_t> histogram(values.size(), 0);
for (size_t rank : values)
{
++histogram[rank];
}
return histogram;
}
using OverlayWidgetCounts = angle::PackedEnumMap<WidgetInternalType, size_t>;
using AppendWidgetDataFunc = void (*)(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts);
} // namespace
namespace overlay_impl
{
// This class interprets the generic data collected in every element into a human-understandable
// widget. This often means generating text specific to this item and scaling graph data to
// something sensible.
class AppendWidgetDataHelper
{
public:
static void AppendFPS(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts);
static void AppendVulkanLastValidationMessage(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts);
static void AppendVulkanValidationMessageCount(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts);
static void AppendVulkanCommandGraphSize(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts);
static void AppendVulkanSecondaryCommandBufferPoolWaste(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts);
private:
static std::ostream &OutputPerSecond(std::ostream &out, const overlay::PerSecond *perSecond);
static std::ostream &OutputText(std::ostream &out, const overlay::Text *text);
static std::ostream &OutputCount(std::ostream &out, const overlay::Count *count);
static void AppendTextCommon(const overlay::Widget *widget,
const gl::Extents &imageExtent,
const std::string &text,
TextWidgetData *textWidget,
OverlayWidgetCounts *widgetCounts);
static void AppendGraphCommon(const overlay::Widget *widget,
const gl::Extents &imageExtent,
const std::vector<size_t> runningValues,
size_t startIndex,
float scale,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts);
};
void AppendWidgetDataHelper::AppendTextCommon(const overlay::Widget *widget,
const gl::Extents &imageExtent,
const std::string &text,
TextWidgetData *textWidget,
OverlayWidgetCounts *widgetCounts)
{
GetWidgetCoordinates(widget->coords, imageExtent, textWidget->coordinates);
GetWidgetColor(widget->color, textWidget->color);
GetTextFontSize(widget->fontSize, textWidget->fontSize);
GetTextString(text, textWidget->text);
++(*widgetCounts)[WidgetInternalType::Text];
}
void AppendWidgetDataHelper::AppendGraphCommon(const overlay::Widget *widget,
const gl::Extents &imageExtent,
const std::vector<size_t> runningValues,
size_t startIndex,
float scale,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{
const overlay::RunningGraph *widgetAsGraph = static_cast<const overlay::RunningGraph *>(widget);
GetWidgetCoordinates(widget->coords, imageExtent, graphWidget->coordinates);
GetWidgetColor(widget->color, graphWidget->color);
GetGraphValueWidth(widget->coords, widgetAsGraph->runningValues.size(),
&graphWidget->valueWidth);
GetGraphValues(runningValues, startIndex, scale, graphWidget->values);
++(*widgetCounts)[WidgetInternalType::Graph];
}
void AppendWidgetDataHelper::AppendFPS(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{
const overlay::PerSecond *fps = static_cast<const overlay::PerSecond *>(widget);
std::ostringstream text;
text << "FPS: ";
OutputPerSecond(text, fps);
AppendTextCommon(widget, imageExtent, text.str(), textWidget, widgetCounts);
}
void AppendWidgetDataHelper::AppendVulkanLastValidationMessage(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{
const overlay::Text *lastValidationMessage = static_cast<const overlay::Text *>(widget);
std::ostringstream text;
text << "Last VVL Message: ";
OutputText(text, lastValidationMessage);
AppendTextCommon(widget, imageExtent, text.str(), textWidget, widgetCounts);
}
void AppendWidgetDataHelper::AppendVulkanValidationMessageCount(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{
const overlay::Count *validationMessageCount = static_cast<const overlay::Count *>(widget);
std::ostringstream text;
text << "VVL Message Count: ";
OutputCount(text, validationMessageCount);
AppendTextCommon(widget, imageExtent, text.str(), textWidget, widgetCounts);
}
void AppendWidgetDataHelper::AppendVulkanCommandGraphSize(const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{
const overlay::RunningGraph *commandGraphSize =
static_cast<const overlay::RunningGraph *>(widget);
const size_t maxValue = *std::max_element(commandGraphSize->runningValues.begin(),
commandGraphSize->runningValues.end());
const int32_t graphHeight = std::abs(widget->coords[3] - widget->coords[1]);
const float graphScale = static_cast<float>(graphHeight) / maxValue;
AppendGraphCommon(widget, imageExtent, commandGraphSize->runningValues,
commandGraphSize->lastValueIndex + 1, graphScale, graphWidget, widgetCounts);
if ((*widgetCounts)[WidgetInternalType::Text] <
kWidgetInternalTypeMaxWidgets[WidgetInternalType::Text])
{
std::ostringstream text;
text << "Command Graph Size (Max: " << maxValue << ")";
AppendTextCommon(&commandGraphSize->description, imageExtent, text.str(), textWidget,
widgetCounts);
}
}
void AppendWidgetDataHelper::AppendVulkanSecondaryCommandBufferPoolWaste(
const overlay::Widget *widget,
const gl::Extents &imageExtent,
TextWidgetData *textWidget,
GraphWidgetData *graphWidget,
OverlayWidgetCounts *widgetCounts)
{
const overlay::RunningHistogram *secondaryCommandBufferPoolWaste =
static_cast<const overlay::RunningHistogram *>(widget);
std::vector<size_t> histogram = CreateHistogram(secondaryCommandBufferPoolWaste->runningValues);
auto maxValueIter = std::max_element(histogram.rbegin(), histogram.rend());
const size_t maxValue = *maxValueIter;
const int32_t graphHeight = std::abs(widget->coords[3] - widget->coords[1]);
const float graphScale = static_cast<float>(graphHeight) / maxValue;
AppendGraphCommon(widget, imageExtent, histogram, 0, graphScale, graphWidget, widgetCounts);
if ((*widgetCounts)[WidgetInternalType::Text] <
kWidgetInternalTypeMaxWidgets[WidgetInternalType::Text])
{
std::ostringstream text;
size_t peak = std::distance(maxValueIter, histogram.rend() - 1);
size_t peakPercent = (peak * 100 + 50) / histogram.size();
text << "CB Pool Waste (Peak: " << peakPercent << "%)";
AppendTextCommon(&secondaryCommandBufferPoolWaste->description, imageExtent, text.str(),
textWidget, widgetCounts);
}
}
std::ostream &AppendWidgetDataHelper::OutputPerSecond(std::ostream &out,
const overlay::PerSecond *perSecond)
{
return out << perSecond->lastPerSecondCount;
}
std::ostream &AppendWidgetDataHelper::OutputText(std::ostream &out, const overlay::Text *text)
{
return out << text->text;
}
std::ostream &AppendWidgetDataHelper::OutputCount(std::ostream &out, const overlay::Count *count)
{
return out << count->count;
}
} // namespace overlay_impl
namespace
{
constexpr angle::PackedEnumMap<WidgetId, AppendWidgetDataFunc> kWidgetIdToAppendDataFuncMap = {
{WidgetId::FPS, overlay_impl::AppendWidgetDataHelper::AppendFPS},
{WidgetId::VulkanLastValidationMessage,
overlay_impl::AppendWidgetDataHelper::AppendVulkanLastValidationMessage},
{WidgetId::VulkanValidationMessageCount,
overlay_impl::AppendWidgetDataHelper::AppendVulkanValidationMessageCount},
{WidgetId::VulkanCommandGraphSize,
overlay_impl::AppendWidgetDataHelper::AppendVulkanCommandGraphSize},
{WidgetId::VulkanSecondaryCommandBufferPoolWaste,
overlay_impl::AppendWidgetDataHelper::AppendVulkanSecondaryCommandBufferPoolWaste},
};
}
namespace overlay
{
RunningGraph::RunningGraph(size_t n) : runningValues(n, 0) {}
RunningGraph::~RunningGraph() = default;
} // namespace overlay
size_t OverlayState::getWidgetCoordinatesBufferSize() const
{
return sizeof(WidgetCoordinates);
}
size_t OverlayState::getTextWidgetsBufferSize() const
{
return sizeof(TextWidgets);
}
size_t OverlayState::getGraphWidgetsBufferSize() const
{
return sizeof(GraphWidgets);
}
void OverlayState::fillEnabledWidgetCoordinates(const gl::Extents &imageExtents,
uint8_t *enabledWidgetsPtr) const
{
WidgetCoordinates *enabledWidgets = reinterpret_cast<WidgetCoordinates *>(enabledWidgetsPtr);
memset(enabledWidgets, 0, sizeof(*enabledWidgets));
OverlayWidgetCounts widgetCounts = {};
for (const std::unique_ptr<overlay::Widget> &widget : mOverlayWidgets)
{
if (!widget->enabled)
{
continue;
}
WidgetInternalType internalType = kWidgetTypeToInternalMap[widget->type];
ASSERT(internalType != WidgetInternalType::InvalidEnum);
if (widgetCounts[internalType] >= kWidgetInternalTypeMaxWidgets[internalType])
{
continue;
}
size_t writeIndex =
kWidgetInternalTypeWidgetOffsets[internalType] + widgetCounts[internalType]++;
GetWidgetCoordinates(widget->coords, imageExtents, enabledWidgets->coordinates[writeIndex]);
// Graph widgets have a text widget attached as well.
if (internalType == WidgetInternalType::Graph)
{
WidgetInternalType textType = WidgetInternalType::Text;
if (widgetCounts[textType] >= kWidgetInternalTypeMaxWidgets[textType])
{
continue;
}
const overlay::RunningGraph *widgetAsGraph =
static_cast<const overlay::RunningGraph *>(widget.get());
writeIndex = kWidgetInternalTypeWidgetOffsets[textType] + widgetCounts[textType]++;
GetWidgetCoordinates(widgetAsGraph->description.coords, imageExtents,
enabledWidgets->coordinates[writeIndex]);
}
}
}
void OverlayState::fillWidgetData(const gl::Extents &imageExtents,
uint8_t *textData,
uint8_t *graphData) const
{
TextWidgets *textWidgets = reinterpret_cast<TextWidgets *>(textData);
GraphWidgets *graphWidgets = reinterpret_cast<GraphWidgets *>(graphData);
memset(textWidgets, overlay::kFontCharacters, sizeof(*textWidgets));
memset(graphWidgets, 0, sizeof(*graphWidgets));
OverlayWidgetCounts widgetCounts = {};
for (WidgetId id : angle::AllEnums<WidgetId>())
{
const std::unique_ptr<overlay::Widget> &widget = mOverlayWidgets[id];
if (!widget->enabled)
{
continue;
}
WidgetInternalType internalType = kWidgetTypeToInternalMap[widget->type];
ASSERT(internalType != WidgetInternalType::InvalidEnum);
if (widgetCounts[internalType] >= kWidgetInternalTypeMaxWidgets[internalType])
{
continue;
}
AppendWidgetDataFunc appendFunc = kWidgetIdToAppendDataFuncMap[id];
appendFunc(widget.get(), imageExtents,
&textWidgets->widgets[widgetCounts[WidgetInternalType::Text]],
&graphWidgets->widgets[widgetCounts[WidgetInternalType::Graph]], &widgetCounts);
}
}
} // namespace gl

Просмотреть файл

@ -0,0 +1,190 @@
//
// Copyright 2019 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.
//
// OverlayWidgets.h:
// Defines the Overlay* widget classes and corresponding enums.
//
#ifndef LIBANGLE_OVERLAYWIDGETS_H_
#define LIBANGLE_OVERLAYWIDGETS_H_
#include "common/angleutils.h"
namespace gl
{
class Overlay;
class OverlayState;
namespace overlay_impl
{
class AppendWidgetDataHelper;
}
enum class WidgetType
{
// Text types:
// A total count of some event.
Count,
// A single line of ASCII text. Retains content until changed.
Text,
// A per-second value.
PerSecond,
// Graph types:
// A graph of the last N values.
RunningGraph,
// A histogram of the last N values (values between 0 and 1).
RunningHistogram,
InvalidEnum,
EnumCount = InvalidEnum,
};
enum class WidgetId
{
// Front-end widgets:
// Frames per second (PerSecond).
FPS,
// Vulkan backend:
// Last validation error (Text).
VulkanLastValidationMessage,
// Number of validation errors and warnings (Count).
VulkanValidationMessageCount,
// Number of nodes in command graph (RunningGraph).
VulkanCommandGraphSize,
// Secondary Command Buffer pool memory waste (RunningHistogram).
VulkanSecondaryCommandBufferPoolWaste,
InvalidEnum,
EnumCount = InvalidEnum,
};
namespace overlay
{
class Widget
{
public:
virtual ~Widget() {}
protected:
WidgetType type;
// Whether this item should be drawn.
bool enabled = false;
// For text items, size of the font. This is a value in [0, overlay::kFontCount) which
// determines the font size to use.
int fontSize;
// The area covered by the item, predetermined by the overlay class. Negative values
// indicate offset from the left/bottom of the image.
int32_t coords[4];
float color[4];
friend class gl::Overlay;
friend class gl::OverlayState;
friend class overlay_impl::AppendWidgetDataHelper;
};
class Count : public Widget
{
public:
~Count() override {}
void add(size_t n) { count += n; }
void reset() { count = 0; }
protected:
size_t count = 0;
friend class gl::Overlay;
friend class overlay_impl::AppendWidgetDataHelper;
};
class PerSecond : public Count
{
public:
~PerSecond() override {}
protected:
size_t lastPerSecondCount = 0;
friend class gl::Overlay;
friend class overlay_impl::AppendWidgetDataHelper;
};
class Text : public Widget
{
public:
~Text() override {}
void set(std::string &&str) { text = std::move(str); }
protected:
std::string text;
friend class overlay_impl::AppendWidgetDataHelper;
};
class RunningGraph : public Widget
{
public:
// Out of line constructor to satisfy chromium-style.
RunningGraph(size_t n);
~RunningGraph() override;
void add(size_t n) { runningValues[lastValueIndex] += n; }
void next()
{
lastValueIndex = (lastValueIndex + 1) % runningValues.size();
runningValues[lastValueIndex] = 0;
}
protected:
std::vector<size_t> runningValues;
size_t lastValueIndex = 0;
Text description;
friend class gl::Overlay;
friend class gl::OverlayState;
friend class overlay_impl::AppendWidgetDataHelper;
};
class RunningHistogram : public RunningGraph
{
public:
RunningHistogram(size_t n) : RunningGraph(n) {}
~RunningHistogram() override {}
void set(float n)
{
ASSERT(n >= 0.0f && n <= 1.0f);
size_t rank =
n == 1.0f ? runningValues.size() - 1 : static_cast<size_t>(n * runningValues.size());
runningValues[lastValueIndex] = rank;
}
};
// If overlay is disabled, all the above classes would be replaced with Dummy, turning them into
// noop.
class Dummy
{
public:
void reset() const {}
template <typename T>
void set(T) const
{}
template <typename T>
void add(T) const
{}
void next() const {}
};
} // namespace overlay
} // namespace gl
#endif // LIBANGLE_OVERLAYWIDGETS_H_

Просмотреть файл

@ -0,0 +1,193 @@
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_overlay_widgets.py using data from overlay_widgets.json.
//
// Copyright 2019 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.498039215686;
widget->color[1] = 0.749019607843;
widget->color[2] = 1.0;
widget->color[3] = 1.0;
}
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.0;
widget->color[1] = 0.0;
widget->color[2] = 0.0;
widget->color[3] = 1.0;
}
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.0;
widget->color[1] = 0.0;
widget->color[2] = 0.0;
widget->color[3] = 1.0;
}
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.294117647059;
widget->color[1] = 0.78431372549;
widget->color[2] = 0.0;
widget->color[3] = 0.78431372549;
}
mState.mOverlayWidgets[WidgetId::VulkanCommandGraphSize].reset(widget);
{
const int32_t fontSize = GetFontSize(kFontLayerSmall, kLargeFont);
const int32_t offsetX =
mState.mOverlayWidgets[WidgetId::VulkanCommandGraphSize]->coords[0];
const int32_t offsetY =
mState.mOverlayWidgets[WidgetId::VulkanCommandGraphSize]->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.294117647059;
widget->description.color[1] = 0.78431372549;
widget->description.color[2] = 0.0;
widget->description.color[3] = 1.0;
}
}
{
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.0;
widget->color[1] = 0.78431372549;
widget->color[2] = 0.294117647059;
widget->color[3] = 0.78431372549;
}
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.0;
widget->description.color[1] = 0.78431372549;
widget->description.color[2] = 0.294117647059;
widget->description.color[3] = 1.0;
}
}
}
} // namespace gl

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,29 @@
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_overlay_fonts.py using overlay/DejaVuSansMono-Bold.ttf.
//
// Copyright 2019 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_font_autogen.h:
// Autogenerated overlay font data.
#include "libANGLE/Overlay.h"
namespace gl
{
namespace overlay
{
constexpr int kFontCount = 3;
constexpr int kFontGlyphWidths[kFontCount] = {22, 14, 8};
constexpr int kFontGlyphHeights[kFontCount] = {43, 28, 17};
constexpr int kFontCharactersPerRow = 32;
constexpr int kFontCharactersPerCol = 3;
constexpr int kFontCharacters = kFontCharactersPerRow * kFontCharactersPerCol;
constexpr int kFontImageWidth = 22 * kFontCharactersPerRow;
constexpr int kFontImageHeight = 43 * kFontCharactersPerCol;
constexpr int kFontLayerLarge = 0;
constexpr int kFontLayerMedium = 1;
constexpr int kFontLayerSmall = 2;
} // namespace overlay
} // namespace gl

Просмотреть файл

@ -236,6 +236,7 @@ const angle::PackedEnumMap<BufferBinding, State::BufferBindingSetter> State::kBu
State::State(ContextID contextIn,
const State *shareContextState,
TextureManager *shareTextures,
const OverlayType *overlay,
const EGLenum clientType,
const Version &clientVersion,
bool debug,
@ -299,7 +300,8 @@ State::State(ContextID contextIn,
mFramebufferSRGB(true),
mRobustResourceInit(robustResourceInit),
mProgramBinaryCacheEnabled(programBinaryCacheEnabled),
mMaxShaderCompilerThreads(std::numeric_limits<GLuint>::max())
mMaxShaderCompilerThreads(std::numeric_limits<GLuint>::max()),
mOverlay(overlay)
{}
State::~State() {}

Просмотреть файл

@ -17,6 +17,7 @@
#include "common/bitset_utils.h"
#include "libANGLE/Debug.h"
#include "libANGLE/GLES1State.h"
#include "libANGLE/Overlay.h"
#include "libANGLE/Program.h"
#include "libANGLE/ProgramPipeline.h"
#include "libANGLE/RefCountObject.h"
@ -58,6 +59,7 @@ class State : angle::NonCopyable
State(ContextID contextIn,
const State *shareContextState,
TextureManager *shareTextures,
const OverlayType *overlay,
const EGLenum clientType,
const Version &clientVersion,
bool debug,
@ -678,6 +680,8 @@ class State : angle::NonCopyable
mProvokingVertex = val;
}
const OverlayType *getOverlay() const { return mOverlay; }
private:
friend class Context;
@ -891,6 +895,9 @@ class State : angle::NonCopyable
ActiveTextureMask mDirtyTextures;
ActiveTextureMask mDirtySamplers;
ImageUnitMask mDirtyImages;
// The Overlay object, used by the backend to render the overlay.
const OverlayType *mOverlay;
};
ANGLE_INLINE angle::Result State::syncDirtyObjects(const Context *context,

Просмотреть файл

@ -235,6 +235,8 @@ Error Surface::swap(const gl::Context *context)
{
ANGLE_TRACE_EVENT0("gpu.angle", "egl::Surface::swap");
context->getState().getOverlay()->onSwap();
ANGLE_TRY(mImplementation->swap(context));
postSwap(context);
return NoError();
@ -242,6 +244,8 @@ Error Surface::swap(const gl::Context *context)
Error Surface::swapWithDamage(const gl::Context *context, EGLint *rects, EGLint n_rects)
{
context->getState().getOverlay()->onSwap();
ANGLE_TRY(mImplementation->swapWithDamage(context, rects, n_rects));
postSwap(context);
return NoError();
@ -258,6 +262,8 @@ Error Surface::postSubBuffer(const gl::Context *context,
return egl::NoError();
}
context->getState().getOverlay()->onSwap();
ANGLE_TRY(mImplementation->postSubBuffer(context, x, y, width, height));
postSwap(context);
return NoError();

Просмотреть файл

@ -0,0 +1,291 @@
#!/usr/bin/env vpython
#
# [VPYTHON:BEGIN]
# wheel: <
# name: "infra/python/wheels/freetype-py/${vpython_platform}"
# version: "version:2.1.0.post1"
# >
# [VPYTHON:END]
# Copyright 2019 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.
#
# gen_vk_overlay_fonts.py:
# Code generation for overlay fonts. Should be run if the font file under overlay/ is changed,
# or the font sizes declared in this file are modified. The font is assumed to be monospace.
# The output will contain ASCII characters in order from ' ' to '~'. The output will be images
# with 3 rows of 32 characters each.
# NOTE: don't run this script directly. Run scripts/run_code_generation.py.
from datetime import date
import sys
if len(sys.argv) < 2:
from freetype import *
out_file_cpp = 'Overlay_font_autogen.cpp'
out_file_h = 'Overlay_font_autogen.h'
font_file = 'overlay/DejaVuSansMono-Bold.ttf'
template_out_file_h = u"""// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using {font_file}.
//
// Copyright {copyright_year} 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.
//
// {out_file_name}:
// Autogenerated overlay font data.
#include "libANGLE/Overlay.h"
namespace gl
{{
namespace overlay
{{
constexpr int kFontCount = {font_count};
constexpr int kFontGlyphWidths[kFontCount] = {{ {font_glyph_widths} }};
constexpr int kFontGlyphHeights[kFontCount] = {{ {font_glyph_heights} }};
constexpr int kFontCharactersPerRow = 32;
constexpr int kFontCharactersPerCol = 3;
constexpr int kFontCharacters = kFontCharactersPerRow * kFontCharactersPerCol;
constexpr int kFontImageWidth = {max_font_width} * kFontCharactersPerRow;
constexpr int kFontImageHeight = {max_font_height} * kFontCharactersPerCol;
{font_layers}
}} // namespace overlay
}} // namespace gl
"""
template_out_file_cpp = u"""// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using images from {font_file}.
//
// Copyright {copyright_year} 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.
//
// {out_file_name}:
// Autogenerated overlay font data.
#include "libANGLE/Overlay.h"
#include "libANGLE/Overlay_font_autogen.h"
#include <numeric>
namespace gl
{{
using namespace overlay;
// Save binary size if the font images are never to be used.
#if ANGLE_ENABLE_OVERLAY
namespace
{{
constexpr int kFontWidths[kFontCount] = {{ {font_layer_widths} }};
constexpr int kFontHeights[kFontCount] = {{ {font_layer_heights} }};
{font_data}
// Returns a bit with the value of the pixel.
template<int kFontWidth, int kFontHeight>
uint32_t GetFontLayerPixel(const uint32_t fontImage[kFontHeight][kFontWidth / 32], int x, int y)
{{
ASSERT(x >= 0 && x < kFontWidth && y >= 0 && y < kFontHeight);
return fontImage[y][x / 32] >> (x % 32) & 1;
}}
inline uint32_t GetFontPixel(int layer, int x, int y)
{{
switch (layer)
{{
{get_font_layer_pixel}
default:
UNREACHABLE();
return 0;
}}
}}
}} // anonymous namespace
void OverlayState::initFontData(uint8_t *fontData) const
{{
constexpr int kFontDataLayerSize = kFontImageWidth * kFontImageHeight;
// Unpack the font bitmap into R8_UNORM format. Border pixels are given a 0.5 value for better
// font visibility.
for (int layer = 0; layer < kFontCount; ++layer)
{{
memset(fontData, 0, kFontDataLayerSize);
for (int y = 0; y < kFontHeights[layer]; ++y)
{{
for (int x = 0; x < kFontWidths[layer]; ++x)
{{
uint32_t src = GetFontPixel(layer, x, y);
uint8_t dstValue = src ? 255 : 0;
fontData[y * kFontImageWidth + x] = dstValue;
}}
}}
fontData += kFontDataLayerSize;
}}
}}
#else
void OverlayState::initFontData(uint8_t *fontData) const
{{
memset(fontData, 0, kFontCount * kFontImageWidth * kFontImageHeight * sizeof(*fontData));
}}
#endif
}} // namespace gl
"""
template_get_font_layer_pixel = u"""case {layer}:
return GetFontLayerPixel<kFontWidths[{layer}], kFontHeights[{layer}]>({font_image}, x, y);
"""
def main():
if len(sys.argv) == 2 and sys.argv[1] == 'inputs':
print(font_file)
return
if len(sys.argv) == 2 and sys.argv[1] == 'outputs':
print(','.join([out_file_cpp, out_file_h]))
return
font_defs = [('large', 36), ('medium', 23), ('small', 14)]
chars = ' !"#$%&\'()*+,-./0123456789:;<=>?' + \
'@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_' + \
'`abcdefghijklmnopqrstuvwxyz{|}~ '
output_rows = 3
output_cols = 32
assert (len(chars) == output_rows * output_cols)
font_glyph_widths = []
font_glyph_heights = []
font_layers = []
font_data = []
get_font_layer_pixel = []
current_font_layer = 0
# Load the font file.
face = Face(font_file)
assert (face.is_fixed_width)
for font_name, font_size in font_defs:
# Since the font is fixed width, we can retrieve its size right away.
face.set_char_size(font_size << 6)
glyph_width = face.size.max_advance >> 6
glyph_ascender = face.size.ascender >> 6
glyph_descender = face.size.descender >> 6
glyph_height = glyph_ascender - glyph_descender
font_tag = font_name.capitalize()
font_layer = str(current_font_layer)
font_layer_symbol = 'kFontLayer' + font_tag
font_array_name = 'kFontImage' + font_tag
font_width = 'kFontWidths[' + font_layer_symbol + ']'
font_height = 'kFontHeights[' + font_layer_symbol + ']'
# Font pixels are packed in 32-bit values.
font_array_width = output_cols * glyph_width / 32
font_array_height = output_rows * glyph_height
font_array = [[0] * font_array_width for i in range(font_array_height)]
for charIndex in range(len(chars)):
char = chars[charIndex]
base_x = (charIndex % output_cols) * glyph_width
base_y = (charIndex / output_cols) * glyph_height
# Render the character.
face.load_char(char)
bitmap = face.glyph.bitmap
left = face.glyph.bitmap_left
top = face.glyph.bitmap_top
width = bitmap.width
rows = bitmap.rows
pitch = bitmap.pitch
offset_x = left
offset_y = glyph_height - (top - glyph_descender)
# '#' in the smallest font generates a larger glyph than the "fixed" font width.
if offset_x + width > glyph_width:
offset_x = glyph_width - width
if offset_x < 0:
width += offset_x
offset_x = 0
base_x += offset_x
base_y += offset_y
assert (offset_x + width <= glyph_width)
assert (offset_y + rows <= glyph_height)
# Write the character bitmap in the font image.
for y in range(rows):
for x in range(width):
pixel_value = bitmap.buffer[y * pitch + x]
output_bit = 1 if pixel_value >= 122 else 0
font_array_row = base_y + y
font_array_col = (base_x + x) / 32
font_array_bit = (base_x + x) % 32
font_array[font_array_row][font_array_col] |= output_bit << font_array_bit
# Output the image to a C array.
data = 'constexpr uint32_t ' + font_array_name + '[' + font_height + '][' + font_width + '/32] = {\n'
for y in range(font_array_height):
data += '{'
for x in range(font_array_width):
data += '0x{:08X}, '.format(font_array[y][x])
data += '},\n'
data += '};\n'
font_glyph_widths.append(glyph_width)
font_glyph_heights.append(glyph_height)
font_layers.append('constexpr int ' + font_layer_symbol + ' = ' + font_layer + ';')
font_data.append(data)
get_font_layer_pixel.append(
template_get_font_layer_pixel.format(
layer=font_layer_symbol, font_image=font_array_name))
current_font_layer += 1
with open(out_file_h, 'w') as outfile:
outfile.write(
template_out_file_h.format(
script_name=__file__,
font_file=font_file,
copyright_year=date.today().year,
out_file_name=out_file_h,
font_count=len(font_data),
font_glyph_widths=','.join(map(str, font_glyph_widths)),
font_glyph_heights=','.join(map(str, font_glyph_heights)),
max_font_width=max(font_glyph_widths),
max_font_height=max(font_glyph_heights),
font_layers='\n'.join(font_layers)))
outfile.close()
font_layer_widths = [
'kFontGlyphWidths[' + str(layer) + '] * kFontCharactersPerRow'
for layer in range(len(font_data))
]
font_layer_heights = [
'kFontGlyphHeights[' + str(layer) + '] * kFontCharactersPerCol'
for layer in range(len(font_data))
]
with open(out_file_cpp, 'w') as outfile:
outfile.write(
template_out_file_cpp.format(
script_name=__file__,
font_file=font_file,
copyright_year=date.today().year,
out_file_name=out_file_cpp,
font_layer_widths=','.join(font_layer_widths),
font_layer_heights=','.join(font_layer_heights),
font_data='\n'.join(font_data),
get_font_layer_pixel=''.join(get_font_layer_pixel)))
outfile.close()
if __name__ == '__main__':
sys.exit(main())

Просмотреть файл

@ -0,0 +1,320 @@
#! /usr/bin/python
# Copyright 2019 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.
#
# gen_overlay_widgets.py:
# Code generation for overlay widgets. Should be run when the widgets declaration file,
# overlay_widgets.json, is changed.
# NOTE: don't run this script directly. Run scripts/run_code_generation.py.
from datetime import date
import json
import sys
out_file = 'Overlay_autogen.cpp'
in_file = 'overlay_widgets.json'
template_out_file = u"""// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {input_file_name}.
//
// Copyright {copyright_year} 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.
//
// {out_file_name}:
// Autogenerated overlay widget declarations.
#include "libANGLE/renderer/driver_utils.h"
#include "libANGLE/Overlay.h"
#include "libANGLE/OverlayWidgets.h"
#include "libANGLE/Overlay_font_autogen.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();
{init_widgets}
}}
}} // namespace gl
"""
template_init_widget = u"""{{
const int32_t fontSize = GetFontSize({font_size}, kLargeFont);
const int32_t offsetX = {offset_x};
const int32_t offsetY = {offset_y};
const int32_t width = {width};
const int32_t height = {height};
widget->{subwidget}type = WidgetType::{type};
widget->{subwidget}fontSize = fontSize;
widget->{subwidget}coords[0] = {coord0};
widget->{subwidget}coords[1] = {coord1};
widget->{subwidget}coords[2] = {coord2};
widget->{subwidget}coords[3] = {coord3};
widget->{subwidget}color[0] = {color_r};
widget->{subwidget}color[1] = {color_g};
widget->{subwidget}color[2] = {color_b};
widget->{subwidget}color[3] = {color_a};
}}
"""
def extract_type_and_constructor(properties):
constructor = properties['type']
args_separated = constructor.split('(', 1)
if len(args_separated) == 1:
return constructor, constructor
type_no_constructor = args_separated[0]
return type_no_constructor, constructor
def get_font_size_constant(properties):
return 'kFontLayer' + properties['font'].capitalize()
def is_graph_type(type):
return type == 'RunningGraph' or type == 'RunningHistogram'
def is_text_type(type):
return not is_graph_type(type)
class OverlayWidget:
def __init__(self, properties, is_graph_description=False):
if not is_graph_description:
self.name = properties['name']
self.type, self.constructor = extract_type_and_constructor(properties)
self.extract_common(properties)
if is_graph_type(self.type):
description_properties = properties['description']
description_properties['type'] = 'Text'
self.description = OverlayWidget(description_properties, True)
def extract_common(self, properties):
self.color = properties['color']
self.coords = properties['coords']
if is_graph_type(self.type):
self.bar_width = properties['bar_width']
self.height = properties['height']
else:
self.font = get_font_size_constant(properties)
self.length = properties['length']
self.negative_alignment = [False, False]
def is_negative_coord(coords, axis, widgets_so_far):
if isinstance(coords[axis], unicode):
coord_split = coords[axis].split('.')
# The coordinate is in the form other_widget.edge.mode
# We simply need to know if other_widget's coordinate is negative or not.
return widgets_so_far[coord_split[0]].negative_alignment[axis]
return coords[axis] < 0
def set_alignment_flags(overlay_widget, widgets_so_far):
overlay_widget.negative_alignment[0] = is_negative_coord(overlay_widget.coords, 0,
widgets_so_far)
overlay_widget.negative_alignment[1] = is_negative_coord(overlay_widget.coords, 1,
widgets_so_far)
if is_graph_type(overlay_widget.type):
set_alignment_flags(overlay_widget.description, widgets_so_far)
def get_offset_helper(widget, axis, smaller_coord_side):
# Assume axis is X. This function returns two values:
# - An offset where the bounding box is placed at,
# - Whether this offset is for the left or right edge.
#
# The input coordinate (widget.coord[axis]) is either:
#
# - a number: in this case, the offset is that number, and its sign determines whether this refers to the left or right edge of the bounding box.
# - other_widget.edge.mode: this has multiple possibilities:
# * edge=left, mode=align: the offset is other_widget.left, the edge is left.
# * edge=left, mode=adjacent: the offset is other_widget.left, the edge is right.
# * edge=right, mode=align: the offset is other_widget.right, the edge is right.
# * edge=right, mode=adjacent: the offset is other_widget.right, the edge is left.
#
# The case for the Y axis is similar, with the edge values being top or bottom.
coord = widget.coords[axis]
if not isinstance(coord, unicode):
is_left = coord >= 0
return coord, is_left
coord_split = coord.split('.')
is_left = coord_split[1] == smaller_coord_side
is_align = coord_split[2] == 'align'
other_widget_coords = 'mState.mOverlayWidgets[WidgetId::' + coord_split[0] + ']->coords'
other_widget_coord_index = axis + (0 if is_left else 2)
offset = other_widget_coords + '[' + str(other_widget_coord_index) + ']'
return offset, is_left == is_align
def get_offset_x(widget):
return get_offset_helper(widget, 0, 'left')
def get_offset_y(widget):
return get_offset_helper(widget, 1, 'top')
def get_bounding_box_coords(offset, width, offset_is_left, is_left_aligned):
# See comment in generate_widget_init_helper. This function is implementing the following:
#
# - offset_is_left && is_left_aligned: [offset, offset + width]
# - offset_is_left && !is_left_aligned: [offset, std::min(offset + width, -1)]
# - !offset_is_left && is_left_aligned: [std::max(1, offset - width), offset]
# - !offset_is_left && !is_left_aligned: [offset - width, offset]
coord_left = offset if offset_is_left else (offset + ' - ' + width)
coord_right = (offset + ' + ' + width) if offset_is_left else offset
if offset_is_left and not is_left_aligned:
coord_right = 'std::min(' + coord_right + ', -1)'
if not offset_is_left and is_left_aligned:
coord_left = 'std::max(' + coord_left + ', 1)'
return coord_left, coord_right
def generate_widget_init_helper(widget, is_graph_description=False):
font_size = '0'
# Common attributes
color = [channel / 255.0 for channel in widget.color]
offset_x, offset_x_is_left = get_offset_x(widget)
offset_y, offset_y_is_top = get_offset_y(widget)
if is_text_type(widget.type):
# Attributes deriven from text properties
font_size = widget.font
width = str(widget.length) + ' * kFontGlyphWidths[fontSize]'
height = 'kFontGlyphHeights[fontSize]'
else:
# Attributes deriven from graph properties
width = str(widget.bar_width) + ' * static_cast<uint32_t>(widget->runningValues.size())'
height = widget.height
is_left_aligned = not widget.negative_alignment[0]
is_top_aligned = not widget.negative_alignment[1]
# We have offset_x, offset_y, width and height which together determine the bounding box. If
# offset_x_is_left, the bounding box X would be in [offset_x, offset_x + width], otherwise it
# would be in [offset_x - width, offset_x]. Similarly for y. Since we use negative values to
# mean aligned to the right side of the screen, we need to make sure that:
#
# - if left aligned: offset_x - width is at minimum 1
# - if right aligned: offset_x + width is at maximum -1
#
# We therefore have the following combinations for the X axis:
#
# - offset_x_is_left && is_left_aligned: [offset_x, offset_x + width]
# - offset_x_is_left && !is_left_aligned: [offset_x, std::min(offset_x + width, -1)]
# - !offset_x_is_left && is_left_aligned: [std::max(1, offset_x - width), offset_x]
# - !offset_x_is_left && !is_left_aligned: [offset_x - width, offset_x]
#
# Similarly for y.
coord0, coord2 = get_bounding_box_coords('offsetX', 'width', offset_x_is_left, is_left_aligned)
coord1, coord3 = get_bounding_box_coords('offsetY', 'height', offset_y_is_top, is_top_aligned)
return template_init_widget.format(
subwidget='description.' if is_graph_description else '',
offset_x=offset_x,
offset_y=offset_y,
width=width,
height=height,
type=widget.type,
font_size=font_size,
coord0=coord0,
coord1=coord1,
coord2=coord2,
coord3=coord3,
color_r=color[0],
color_g=color[1],
color_b=color[2],
color_a=color[3])
def generate_widget_init(widget):
widget_init = '{\n' + widget.type + ' *widget = new ' + widget.constructor + ';\n'
widget_init += generate_widget_init_helper(widget)
widget_init += 'mState.mOverlayWidgets[WidgetId::' + widget.name + '].reset(widget);\n'
if is_graph_type(widget.type):
widget_init += generate_widget_init_helper(widget.description, True)
widget_init += '}\n'
return widget_init
def main():
if len(sys.argv) == 2 and sys.argv[1] == 'inputs':
print(in_file)
return
if len(sys.argv) == 2 and sys.argv[1] == 'outputs':
print(out_file)
return
with open(in_file) as fin:
layout = json.loads(fin.read())
# Read the layouts from the json file and determine alignment of widgets (as they can refer to
# other widgets.
overlay_widgets = {}
for widget_properties in layout['widgets']:
widget = OverlayWidget(widget_properties)
overlay_widgets[widget.name] = widget
set_alignment_flags(widget, overlay_widgets)
# Go over the widgets again and generate initialization code. Note that we need to iterate over
# the widgets in order, so we can't use the overlay_widgets dictionary for iteration.
init_widgets = []
for widget_properties in layout['widgets']:
init_widgets.append(generate_widget_init(overlay_widgets[widget_properties['name']]))
with open(out_file, 'w') as outfile:
outfile.write(
template_out_file.format(
script_name=__file__,
copyright_year=date.today().year,
input_file_name=in_file,
out_file_name=out_file,
init_widgets='\n'.join(init_widgets)))
outfile.close()
if __name__ == '__main__':
sys.exit(main())

Двоичные данные
src/libANGLE/overlay/DejaVuSansMono-Bold.ttf Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,85 @@
{
"description": [
"Copyright 2019 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_widgets.json: Layout of Overlay widgets.",
"",
"Data for every overlay widget 'Widget' is a map with the following keys:",
"",
" - type: one of WidgetType types (with constructor params), such as 'PerSecond' or",
" 'RunningGraph(64)'",
" - color: in [R,G,B,A] format where every value is in [0,255]",
" - coords: in [X,Y] which is the distance from the edges of the window, with negative",
" values representing distance from the right/bottom edge. If a value is given",
" in the form of 'Widget2.<edge>.<mode>', the calculated value for <edge> in",
" Widget2 is used. <edge> is one of:",
" - 'left', 'right': valid for x",
" - 'top', 'bottom': valid for y",
" <mode> is one of:",
" - 'align': the requested value is used",
" - 'adjacent': the value is calculated such that two widgets become adjacent",
" - font: for Text widgets, one of 'large', 'medium' and 'small'",
" - length: for Text widgets, maximum number of characters for this widget",
" - bar_width: for Graph widgets, size of each graph bar.",
" - height: for Graph widgets, the height of the graph.",
" - text: for Graph widgets, data for the attached Text widget. This is a map with the same",
" Text keys as above except type, which is implicitly Text."
],
"widgets": [
{
"name": "FPS",
"type": "PerSecond",
"color": [127, 191, 255, 255],
"coords": [10, 10],
"font": "medium",
"length": 12
},
{
"name": "VulkanLastValidationMessage",
"type": "Text",
"color": [255, 0, 0, 255],
"coords": [10, -10],
"font": "small",
"length": 150
},
{
"name": "VulkanValidationMessageCount",
"type": "Count",
"color": [255, 0, 0, 255],
"coords": [10, "VulkanLastValidationMessage.top.adjacent"],
"font": "small",
"length": 25
},
{
"name": "VulkanCommandGraphSize",
"type": "RunningGraph(60)",
"color": [75, 200, 0, 200],
"coords": [10, 100],
"bar_width": 5,
"height": 100,
"description": {
"color": [75, 200, 0, 255],
"coords": ["VulkanCommandGraphSize.left.align", "VulkanCommandGraphSize.top.adjacent"],
"font": "small",
"length": 40
}
},
{
"name": "VulkanSecondaryCommandBufferPoolWaste",
"type": "RunningHistogram(50)",
"color": [255, 200, 75, 200],
"coords": [-50, 100],
"bar_width": 6,
"height": 100,
"description": {
"color": [255, 200, 75, 255],
"coords": ["VulkanSecondaryCommandBufferPoolWaste.left.align",
"VulkanSecondaryCommandBufferPoolWaste.top.adjacent"],
"font": "small",
"length": 40
}
}
]
}

Просмотреть файл

@ -14,6 +14,7 @@
#include "angle_gl.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/Overlay.h"
#include "libANGLE/Program.h"
#include "libANGLE/ProgramPipeline.h"
#include "libANGLE/Renderbuffer.h"
@ -36,6 +37,7 @@ class FenceNVImpl;
class SyncImpl;
class FramebufferImpl;
class MemoryObjectImpl;
class OverlayImpl;
class PathImpl;
class ProgramImpl;
class ProgramPipelineImpl;
@ -96,6 +98,9 @@ class GLImplFactory : angle::NonCopyable
// Semaphore creation
virtual SemaphoreImpl *createSemaphore() = 0;
// Overlay creation
virtual OverlayImpl *createOverlay(const gl::OverlayState &state) = 0;
};
} // namespace rx

Просмотреть файл

@ -0,0 +1,49 @@
//
// Copyright 2019 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.
//
// OverlayImpl.h: Defines the abstract rx::OverlayImpl class.
#ifndef LIBANGLE_RENDERER_OVERLAYIMPL_H_
#define LIBANGLE_RENDERER_OVERLAYIMPL_H_
#include "common/PackedEnums.h"
#include "common/angleutils.h"
#include "common/mathutil.h"
#include "libANGLE/Error.h"
#include "libANGLE/Observer.h"
#include <stdint.h>
namespace gl
{
class Context;
class OverlayState;
} // namespace gl
namespace rx
{
class OverlayImpl : angle::NonCopyable
{
public:
OverlayImpl(const gl::OverlayState &state) : mState(state) {}
virtual ~OverlayImpl() {}
virtual void onDestroy(const gl::Context *context) {}
virtual angle::Result init(const gl::Context *context);
protected:
const gl::OverlayState &mState;
};
inline angle::Result OverlayImpl::init(const gl::Context *context)
{
return angle::Result::Continue;
}
} // namespace rx
#endif // LIBANGLE_RENDERER_OVERLAYIMPL_H_

Просмотреть файл

@ -12,6 +12,7 @@
#include "common/string_utils.h"
#include "libANGLE/Context.h"
#include "libANGLE/MemoryProgramCache.h"
#include "libANGLE/renderer/OverlayImpl.h"
#include "libANGLE/renderer/d3d/CompilerD3D.h"
#include "libANGLE/renderer/d3d/RenderbufferD3D.h"
#include "libANGLE/renderer/d3d/SamplerD3D.h"
@ -243,6 +244,12 @@ SemaphoreImpl *Context11::createSemaphore()
return nullptr;
}
OverlayImpl *Context11::createOverlay(const gl::OverlayState &state)
{
// Not implemented.
return new OverlayImpl(state);
}
angle::Result Context11::flush(const gl::Context *context)
{
return mRenderer->flush(this);

Просмотреть файл

@ -71,6 +71,9 @@ class Context11 : public ContextD3D, public MultisampleTextureInitializer
// Semaphore creation.
SemaphoreImpl *createSemaphore() override;
// Overlay creation.
OverlayImpl *createOverlay(const gl::OverlayState &state) override;
// Flush and finish.
angle::Result flush(const gl::Context *context) override;
angle::Result finish(const gl::Context *context) override;

Просмотреть файл

@ -10,6 +10,7 @@
#include "libANGLE/renderer/d3d/d3d9/Context9.h"
#include "common/string_utils.h"
#include "libANGLE/renderer/OverlayImpl.h"
#include "libANGLE/renderer/d3d/CompilerD3D.h"
#include "libANGLE/renderer/d3d/ProgramD3D.h"
#include "libANGLE/renderer/d3d/RenderbufferD3D.h"
@ -145,6 +146,12 @@ SemaphoreImpl *Context9::createSemaphore()
return nullptr;
}
OverlayImpl *Context9::createOverlay(const gl::OverlayState &state)
{
// Not implemented.
return new OverlayImpl(state);
}
angle::Result Context9::flush(const gl::Context *context)
{
return mRenderer->flush(context);

Просмотреть файл

@ -70,6 +70,9 @@ class Context9 : public ContextD3D
// Semaphore creation.
SemaphoreImpl *createSemaphore() override;
// Overlay creation.
OverlayImpl *createOverlay(const gl::OverlayState &state) override;
// Flush and finish.
angle::Result flush(const gl::Context *context) override;
angle::Result finish(const gl::Context *context) override;

Просмотреть файл

@ -10,6 +10,7 @@
#include "libANGLE/renderer/gl/ContextGL.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/OverlayImpl.h"
#include "libANGLE/renderer/gl/BufferGL.h"
#include "libANGLE/renderer/gl/CompilerGL.h"
#include "libANGLE/renderer/gl/FenceNVGL.h"
@ -190,6 +191,12 @@ SemaphoreImpl *ContextGL::createSemaphore()
return new SemaphoreGL(semaphore);
}
OverlayImpl *ContextGL::createOverlay(const gl::OverlayState &state)
{
// Not implemented.
return new OverlayImpl(state);
}
angle::Result ContextGL::flush(const gl::Context *context)
{
return mRenderer->flush();

Просмотреть файл

@ -85,6 +85,9 @@ class ContextGL : public ContextImpl
// Semaphore creation.
SemaphoreImpl *createSemaphore() override;
// Overlay creation.
OverlayImpl *createOverlay(const gl::OverlayState &state) override;
// Flush and finish.
angle::Result flush(const gl::Context *context) override;
angle::Result finish(const gl::Context *context) override;

Просмотреть файл

@ -12,6 +12,7 @@
#include "common/debug.h"
#include "libANGLE/Context.h"
#include "libANGLE/renderer/OverlayImpl.h"
#include "libANGLE/renderer/null/BufferNULL.h"
#include "libANGLE/renderer/null/CompilerNULL.h"
#include "libANGLE/renderer/null/DisplayNULL.h"
@ -427,6 +428,11 @@ SemaphoreImpl *ContextNULL::createSemaphore()
return nullptr;
}
OverlayImpl *ContextNULL::createOverlay(const gl::OverlayState &state)
{
return new OverlayImpl(state);
}
angle::Result ContextNULL::dispatchCompute(const gl::Context *context,
GLuint numGroupsX,
GLuint numGroupsY,

Просмотреть файл

@ -218,6 +218,9 @@ class ContextNULL : public ContextImpl
// Semaphore creation.
SemaphoreImpl *createSemaphore() override;
// Overlay creation.
OverlayImpl *createOverlay(const gl::OverlayState &state) override;
angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX,
GLuint numGroupsY,

Просмотреть файл

@ -11,6 +11,7 @@
#include <iostream>
#include "libANGLE/Overlay.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/RenderTargetVk.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
@ -217,6 +218,24 @@ std::string DumpCommands(const priv::CommandBuffer &commandBuffer, const char *s
return "--blob--";
}
float CalculateSecondaryCommandBufferPoolWaste(const std::vector<CommandGraphNode *> nodes)
{
size_t used = 0;
size_t allocated = 0;
for (const CommandGraphNode *node : nodes)
{
size_t nodeUsed;
size_t nodeAllocated;
node->getMemoryUsageStatsForDiagnostics(&nodeUsed, &nodeAllocated);
used += nodeUsed;
allocated += nodeAllocated;
}
allocated = std::max<size_t>(allocated, 1);
return static_cast<float>(used) / static_cast<float>(allocated);
}
} // anonymous namespace
// CommandGraphResource implementation.
@ -790,6 +809,19 @@ std::string CommandGraphNode::dumpCommandsForDiagnostics(const char *separator)
return result;
}
void CommandGraphNode::getMemoryUsageStatsForDiagnostics(size_t *usedMemoryOut,
size_t *allocatedMemoryOut) const
{
size_t commandBufferUsed;
size_t commandBufferAllocated;
mOutsideRenderPassCommands.getMemoryUsageStats(usedMemoryOut, allocatedMemoryOut);
mInsideRenderPassCommands.getMemoryUsageStats(&commandBufferUsed, &commandBufferAllocated);
*usedMemoryOut += commandBufferUsed;
*allocatedMemoryOut += commandBufferAllocated;
}
// CommandGraph implementation.
CommandGraph::CommandGraph(bool enableGraphDiagnostics, angle::PoolAllocator *poolAllocator)
: mEnableGraphDiagnostics(enableGraphDiagnostics),
@ -852,6 +884,8 @@ angle::Result CommandGraph::submitCommands(ContextVk *context,
// function if there's nothing to do.
ASSERT(!mNodes.empty());
updateOverlay(context);
size_t previousBarrierIndex = 0;
CommandGraphNode *previousBarrier = getLastBarrierNode(&previousBarrierIndex);
@ -1160,6 +1194,17 @@ void CommandGraph::dumpGraphDotFile(std::ostream &out) const
out << "}" << std::endl;
}
void CommandGraph::updateOverlay(ContextVk *contextVk) const
{
const gl::OverlayType *overlay = contextVk->getOverlay();
overlay->getRunningGraphWidget(gl::WidgetId::VulkanCommandGraphSize)->add(mNodes.size());
overlay->getRunningHistogramWidget(gl::WidgetId::VulkanSecondaryCommandBufferPoolWaste)
->set(CalculateSecondaryCommandBufferPoolWaste(mNodes));
overlay->getRunningHistogramWidget(gl::WidgetId::VulkanSecondaryCommandBufferPoolWaste)->next();
}
CommandGraphNode *CommandGraph::getLastBarrierNode(size_t *indexOut)
{
*indexOut = mLastBarrierIndex == kInvalidNodeIndex ? 0 : mLastBarrierIndex;

Просмотреть файл

@ -182,6 +182,7 @@ class CommandGraphNode final : angle::NonCopyable
uintptr_t getResourceIDForDiagnostics() const { return mResourceID; }
bool hasDiagnosticID() const;
std::string dumpCommandsForDiagnostics(const char *separator) const;
void getMemoryUsageStatsForDiagnostics(size_t *usedMemoryOut, size_t *allocatedMemoryOut) const;
const gl::Rectangle &getRenderPassRenderArea() const { return mRenderPassRenderArea; }
@ -514,6 +515,7 @@ class CommandGraph final : angle::NonCopyable
void addDependenciesToNextBarrier(size_t begin, size_t end, CommandGraphNode *nextBarrier);
void dumpGraphDotFile(std::ostream &out) const;
void updateOverlay(ContextVk *contextVk) const;
std::vector<CommandGraphNode *> mNodes;
bool mEnableGraphDiagnostics;

Просмотреть файл

@ -24,6 +24,7 @@
#include "libANGLE/renderer/vulkan/FenceNVVk.h"
#include "libANGLE/renderer/vulkan/FramebufferVk.h"
#include "libANGLE/renderer/vulkan/MemoryObjectVk.h"
#include "libANGLE/renderer/vulkan/OverlayVk.h"
#include "libANGLE/renderer/vulkan/ProgramPipelineVk.h"
#include "libANGLE/renderer/vulkan/ProgramVk.h"
#include "libANGLE/renderer/vulkan/QueryVk.h"
@ -2137,6 +2138,11 @@ SemaphoreImpl *ContextVk::createSemaphore()
return new SemaphoreVk();
}
OverlayImpl *ContextVk::createOverlay(const gl::OverlayState &state)
{
return new OverlayVk(state);
}
void ContextVk::invalidateCurrentTextures()
{
ASSERT(mProgram);

Просмотреть файл

@ -14,6 +14,7 @@
#include "common/PackedEnums.h"
#include "libANGLE/renderer/ContextImpl.h"
#include "libANGLE/renderer/vulkan/OverlayVk.h"
#include "libANGLE/renderer/vulkan/PersistentCommandPool.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
#include "libANGLE/renderer/vulkan/vk_helpers.h"
@ -175,6 +176,9 @@ class ContextVk : public ContextImpl, public vk::Context, public vk::RenderPassO
// Semaphore creation.
SemaphoreImpl *createSemaphore() override;
// Overlay creation.
OverlayImpl *createOverlay(const gl::OverlayState &state) override;
angle::Result dispatchCompute(const gl::Context *context,
GLuint numGroupsX,
GLuint numGroupsY,
@ -335,6 +339,8 @@ class ContextVk : public ContextImpl, public vk::Context, public vk::RenderPassO
bool useOldRewriteStructSamplers() const { return mUseOldRewriteStructSamplers; }
const gl::OverlayType *getOverlay() const { return mState.getOverlay(); }
private:
// Dirty bits.
enum DirtyBitType : size_t

Просмотреть файл

@ -0,0 +1,281 @@
//
// Copyright 2019 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.
//
// OverlayVk.cpp:
// Implements the OverlayVk class.
//
#include "libANGLE/renderer/vulkan/OverlayVk.h"
#include "common/system_utils.h"
#include "libANGLE/Context.h"
#include "libANGLE/Overlay_font_autogen.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include <numeric>
namespace rx
{
OverlayVk::OverlayVk(const gl::OverlayState &state)
: OverlayImpl(state),
mSupportsSubgroupBallot(false),
mSupportsSubgroupArithmetic(false),
mRefreshCulledWidgets(false)
{}
OverlayVk::~OverlayVk() = default;
angle::Result OverlayVk::init(const gl::Context *context)
{
ContextVk *contextVk = vk::GetImpl(context);
RendererVk *rendererVk = contextVk->getRenderer();
const VkPhysicalDeviceSubgroupProperties &subgroupProperties =
rendererVk->getPhysicalDeviceSubgroupProperties();
uint32_t subgroupSize = subgroupProperties.subgroupSize;
// Currently, only subgroup sizes 32 and 64 are supported.
if (subgroupSize != 32 && subgroupSize != 64)
{
return angle::Result::Continue;
}
mSubgroupSize[0] = 8;
mSubgroupSize[1] = subgroupSize / 8;
constexpr VkSubgroupFeatureFlags kSubgroupBallotOperations =
VK_SUBGROUP_FEATURE_BASIC_BIT | VK_SUBGROUP_FEATURE_BALLOT_BIT;
constexpr VkSubgroupFeatureFlags kSubgroupArithmeticOperations =
VK_SUBGROUP_FEATURE_BASIC_BIT | VK_SUBGROUP_FEATURE_ARITHMETIC_BIT;
// If not all operations used in the shaders are supported, disable the overlay.
if ((subgroupProperties.supportedOperations & kSubgroupBallotOperations) ==
kSubgroupBallotOperations)
{
mSupportsSubgroupBallot = true;
}
else if ((subgroupProperties.supportedOperations & kSubgroupArithmeticOperations) ==
kSubgroupArithmeticOperations)
{
mSupportsSubgroupArithmetic = true;
}
ANGLE_TRY(createFont(contextVk));
mRefreshCulledWidgets = true;
return contextVk->flushImpl(nullptr);
}
void OverlayVk::onDestroy(const gl::Context *context)
{
VkDevice device = vk::GetImpl(context)->getDevice();
mCulledWidgets.destroy(device);
mCulledWidgetsView.destroy(device);
mFontImage.destroy(device);
mFontImageView.destroy(device);
}
angle::Result OverlayVk::createFont(ContextVk *contextVk)
{
RendererVk *rendererVk = contextVk->getRenderer();
// Create a buffer to stage font data upload.
VkBufferCreateInfo bufferCreateInfo = {};
bufferCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
bufferCreateInfo.size =
gl::overlay::kFontCount * gl::overlay::kFontImageWidth * gl::overlay::kFontImageHeight;
bufferCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
bufferCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
vk::ContextScoped<vk::BufferHelper> fontDataBuffer(contextVk);
ANGLE_TRY(fontDataBuffer.get().init(contextVk, bufferCreateInfo,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT));
uint8_t *fontData;
ANGLE_TRY(fontDataBuffer.get().map(contextVk, &fontData));
mState.initFontData(fontData);
ANGLE_TRY(fontDataBuffer.get().flush(contextVk, 0, fontDataBuffer.get().getSize()));
fontDataBuffer.get().unmap(contextVk->getDevice());
fontDataBuffer.get().onExternalWrite(VK_ACCESS_HOST_WRITE_BIT);
// Create the font image.
ANGLE_TRY(mFontImage.init(
contextVk, gl::TextureType::_2D,
VkExtent3D{gl::overlay::kFontImageWidth, gl::overlay::kFontImageHeight, 1},
rendererVk->getFormat(angle::FormatID::R8_UNORM), 1,
VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, 1, gl::overlay::kFontCount));
ANGLE_TRY(mFontImage.initMemory(contextVk, rendererVk->getMemoryProperties(),
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT));
ANGLE_TRY(mFontImage.initImageView(contextVk, gl::TextureType::_2DArray,
VK_IMAGE_ASPECT_COLOR_BIT, gl::SwizzleState(),
&mFontImageView, 0, 1));
// Copy font data from staging buffer.
vk::CommandBuffer *fontDataUpload;
ANGLE_TRY(mFontImage.recordCommands(contextVk, &fontDataUpload));
fontDataBuffer.get().onRead(&mFontImage, VK_ACCESS_TRANSFER_READ_BIT);
mFontImage.changeLayout(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::TransferDst,
fontDataUpload);
VkBufferImageCopy copy = {};
copy.bufferRowLength = gl::overlay::kFontImageWidth;
copy.bufferImageHeight = gl::overlay::kFontImageHeight;
copy.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
copy.imageSubresource.layerCount = gl::overlay::kFontCount;
copy.imageExtent.width = gl::overlay::kFontImageWidth;
copy.imageExtent.height = gl::overlay::kFontImageHeight;
copy.imageExtent.depth = 1;
fontDataUpload->copyBufferToImage(fontDataBuffer.get().getBuffer().getHandle(),
mFontImage.getImage(), VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
1, &copy);
mFontImage.changeLayout(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::ComputeShaderReadOnly,
fontDataUpload);
return angle::Result::Continue;
}
angle::Result OverlayVk::cullWidgets(ContextVk *contextVk)
{
RendererVk *rendererVk = contextVk->getRenderer();
// Release old culledWidgets image
Serial currentSerial = contextVk->getCurrentQueueSerial();
contextVk->releaseObject(currentSerial, &mCulledWidgets);
contextVk->releaseObject(currentSerial, &mCulledWidgetsView);
// Create a buffer to contain coordinates of enabled text and graph widgets. This buffer will
// be used to perform tiled culling and can be discarded immediately after.
VkBufferCreateInfo bufferCreateInfo = {};
bufferCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
bufferCreateInfo.size = mState.getWidgetCoordinatesBufferSize();
bufferCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
bufferCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
vk::ContextScoped<vk::BufferHelper> enabledWidgetsBuffer(contextVk);
ANGLE_TRY(enabledWidgetsBuffer.get().init(contextVk, bufferCreateInfo,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT));
// Fill the buffer with coordinate information from enabled widgets.
uint8_t *enabledWidgets;
ANGLE_TRY(enabledWidgetsBuffer.get().map(contextVk, &enabledWidgets));
gl::Extents presentImageExtents(mPresentImageExtent.width, mPresentImageExtent.height, 1);
mState.fillEnabledWidgetCoordinates(presentImageExtents, enabledWidgets);
ANGLE_TRY(enabledWidgetsBuffer.get().flush(contextVk, 0, enabledWidgetsBuffer.get().getSize()));
enabledWidgetsBuffer.get().unmap(contextVk->getDevice());
enabledWidgetsBuffer.get().onExternalWrite(VK_ACCESS_HOST_WRITE_BIT);
// Allocate mCulledWidget and its view.
VkExtent3D culledWidgetsExtent = {
UnsignedCeilDivide(mPresentImageExtent.width, mSubgroupSize[0]),
UnsignedCeilDivide(mPresentImageExtent.height, mSubgroupSize[1]), 1};
ANGLE_TRY(mCulledWidgets.init(contextVk, gl::TextureType::_2D, culledWidgetsExtent,
rendererVk->getFormat(angle::FormatID::R32G32_UINT), 1,
VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, 1, 1));
ANGLE_TRY(mCulledWidgets.initMemory(contextVk, rendererVk->getMemoryProperties(),
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT));
ANGLE_TRY(mCulledWidgets.initImageView(contextVk, gl::TextureType::_2D,
VK_IMAGE_ASPECT_COLOR_BIT, gl::SwizzleState(),
&mCulledWidgetsView, 0, 1));
UtilsVk::OverlayCullParameters params;
params.subgroupSize[0] = mSubgroupSize[0];
params.subgroupSize[1] = mSubgroupSize[1];
params.supportsSubgroupBallot = mSupportsSubgroupBallot;
params.supportsSubgroupArithmetic = mSupportsSubgroupArithmetic;
return contextVk->getUtils().cullOverlayWidgets(contextVk, &enabledWidgetsBuffer.get(),
&mCulledWidgets, &mCulledWidgetsView, params);
}
angle::Result OverlayVk::onPresent(ContextVk *contextVk,
vk::ImageHelper *imageToPresent,
const vk::ImageView *imageToPresentView)
{
if (mState.getEnabledWidgetCount() == 0)
{
return angle::Result::Continue;
}
RendererVk *rendererVk = contextVk->getRenderer();
// If the swapchain image doesn't support storage image, we can't output to it.
VkFormatFeatureFlags featureBits = rendererVk->getImageFormatFeatureBits(
imageToPresent->getFormat().vkImageFormat, VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT);
if ((featureBits & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) == 0)
{
return angle::Result::Continue;
}
const VkExtent3D &imageExtent = imageToPresent->getExtents();
mRefreshCulledWidgets = mRefreshCulledWidgets ||
mPresentImageExtent.width != imageExtent.width ||
mPresentImageExtent.height != imageExtent.height;
if (mRefreshCulledWidgets)
{
mPresentImageExtent.width = imageExtent.width;
mPresentImageExtent.height = imageExtent.height;
ANGLE_TRY(cullWidgets(contextVk));
mRefreshCulledWidgets = false;
}
vk::ContextScoped<vk::BufferHelper> textDataBuffer(contextVk);
vk::ContextScoped<vk::BufferHelper> graphDataBuffer(contextVk);
VkBufferCreateInfo textBufferCreateInfo = {};
textBufferCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
textBufferCreateInfo.size = mState.getTextWidgetsBufferSize();
textBufferCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
textBufferCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
VkBufferCreateInfo graphBufferCreateInfo = textBufferCreateInfo;
graphBufferCreateInfo.size = mState.getGraphWidgetsBufferSize();
ANGLE_TRY(textDataBuffer.get().init(contextVk, textBufferCreateInfo,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT));
ANGLE_TRY(graphDataBuffer.get().init(contextVk, graphBufferCreateInfo,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT));
uint8_t *textData;
uint8_t *graphData;
ANGLE_TRY(textDataBuffer.get().map(contextVk, &textData));
ANGLE_TRY(graphDataBuffer.get().map(contextVk, &graphData));
gl::Extents presentImageExtents(mPresentImageExtent.width, mPresentImageExtent.height, 1);
mState.fillWidgetData(presentImageExtents, textData, graphData);
ANGLE_TRY(textDataBuffer.get().flush(contextVk, 0, textDataBuffer.get().getSize()));
ANGLE_TRY(graphDataBuffer.get().flush(contextVk, 0, graphDataBuffer.get().getSize()));
textDataBuffer.get().unmap(contextVk->getDevice());
graphDataBuffer.get().unmap(contextVk->getDevice());
UtilsVk::OverlayDrawParameters params;
params.subgroupSize[0] = mSubgroupSize[0];
params.subgroupSize[1] = mSubgroupSize[1];
return contextVk->getUtils().drawOverlay(
contextVk, &textDataBuffer.get(), &graphDataBuffer.get(), &mFontImage, &mFontImageView,
&mCulledWidgets, &mCulledWidgetsView, imageToPresent, imageToPresentView, params);
}
} // namespace rx

Просмотреть файл

@ -0,0 +1,57 @@
//
// Copyright 2019 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.
//
// OverlayVk.h:
// Defines the OverlayVk class that does the actual rendering of the overlay.
//
#ifndef LIBANGLE_RENDERER_VULKAN_OVERLAYVK_H_
#define LIBANGLE_RENDERER_VULKAN_OVERLAYVK_H_
#include "common/angleutils.h"
#include "libANGLE/renderer/OverlayImpl.h"
#include "libANGLE/renderer/vulkan/vk_helpers.h"
namespace rx
{
class ContextVk;
class OverlayVk : public OverlayImpl
{
public:
OverlayVk(const gl::OverlayState &state);
~OverlayVk() override;
angle::Result init(const gl::Context *context) override;
void onDestroy(const gl::Context *context) override;
angle::Result onPresent(ContextVk *contextVk,
vk::ImageHelper *imageToPresent,
const vk::ImageView *imageToPresentView);
private:
angle::Result createFont(ContextVk *contextVk);
angle::Result cullWidgets(ContextVk *contextVk);
bool mSupportsSubgroupBallot;
bool mSupportsSubgroupArithmetic;
bool mRefreshCulledWidgets;
// Cached size of subgroup as accepted by UtilsVk, deduced from hardware subgroup size.
uint32_t mSubgroupSize[2];
// Cached size of last presented image. If the size changes, culling is repeated.
VkExtent2D mPresentImageExtent;
vk::ImageHelper mFontImage;
vk::ImageView mFontImageView;
vk::ImageHelper mCulledWidgets;
vk::ImageView mCulledWidgetsView;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_OVERLAYVK_H_

Просмотреть файл

@ -293,6 +293,9 @@ DebugUtilsMessenger(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
bool isError = (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) != 0;
std::string msg = log.str();
RendererVk *rendererVk = static_cast<RendererVk *>(userData);
rendererVk->onNewValidationMessage(msg);
if (isError)
{
ERR() << msg;
@ -1652,4 +1655,17 @@ angle::Result RendererVk::cleanupGarbage(vk::Context *context, bool block)
return angle::Result::Continue;
}
void RendererVk::onNewValidationMessage(const std::string &message)
{
mLastValidationMessage = message;
++mValidationMessageCount;
}
std::string RendererVk::getAndClearLastValidationMessage(uint32_t *countSinceLastClear)
{
*countSinceLastClear = mValidationMessageCount;
mValidationMessageCount = 0;
return std::move(mLastValidationMessage);
}
} // namespace rx

Просмотреть файл

@ -161,6 +161,9 @@ class RendererVk : angle::NonCopyable
angle::Result getPipelineCache(vk::PipelineCache **pipelineCache);
void onNewGraphicsPipeline() { mPipelineCacheDirty = true; }
void onNewValidationMessage(const std::string &message);
std::string getAndClearLastValidationMessage(uint32_t *countSinceLastClear);
private:
angle::Result initializeDevice(DisplayVk *displayVk, uint32_t queueFamilyIndex);
void ensureCapsInitialized() const;
@ -239,6 +242,10 @@ class RendererVk : angle::NonCopyable
// DescriptorSetLayouts are also managed in a cache.
std::mutex mDescriptorSetLayoutCacheMutex;
DescriptorSetLayoutCache mDescriptorSetLayoutCache;
// Latest validation data for debug overlay.
std::string mLastValidationMessage;
uint32_t mValidationMessageCount;
};
} // namespace rx

Просмотреть файл

@ -344,6 +344,27 @@ void SecondaryCommandBuffer::executeCommands(VkCommandBuffer cmdBuffer)
}
}
void SecondaryCommandBuffer::getMemoryUsageStats(size_t *usedMemoryOut,
size_t *allocatedMemoryOut) const
{
*allocatedMemoryOut = kBlockSize * mCommands.size();
*usedMemoryOut = 0;
for (const CommandHeader *command : mCommands)
{
const CommandHeader *commandEnd = command;
while (commandEnd->id != CommandID::Invalid)
{
commandEnd = NextCommand(commandEnd);
}
*usedMemoryOut += reinterpret_cast<const uint8_t *>(commandEnd) -
reinterpret_cast<const uint8_t *>(command) + sizeof(CommandHeader::id);
}
ASSERT(*usedMemoryOut <= *allocatedMemoryOut);
}
std::string SecondaryCommandBuffer::dumpCommands(const char *separator) const
{
std::string result;

Просмотреть файл

@ -542,6 +542,9 @@ class SecondaryCommandBuffer final : angle::NonCopyable
// Parse the cmds in this cmd buffer into given primary cmd buffer for execution
void executeCommands(VkCommandBuffer cmdBuffer);
// Calculate memory usage of this command buffer for diagnostics.
void getMemoryUsageStats(size_t *usedMemoryOut, size_t *allocatedMemoryOut) const;
// Traverse the list of commands and build a summary for diagnostics.
std::string dumpCommands(const char *separator) const;

Просмотреть файл

@ -12,10 +12,12 @@
#include "common/debug.h"
#include "libANGLE/Context.h"
#include "libANGLE/Display.h"
#include "libANGLE/Overlay.h"
#include "libANGLE/Surface.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/DisplayVk.h"
#include "libANGLE/renderer/vulkan/FramebufferVk.h"
#include "libANGLE/renderer/vulkan/OverlayVk.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
#include "libANGLE/renderer/vulkan/vk_format_utils.h"
#include "libANGLE/trace.h"
@ -719,7 +721,15 @@ angle::Result WindowSurfaceVk::createSwapChain(vk::Context *context,
VkFormat nativeFormat = format.vkImageFormat;
// We need transfer src for reading back from the backbuffer.
constexpr VkImageUsageFlags kImageUsageFlags = kSurfaceVKColorImageUsageFlags;
VkImageUsageFlags imageUsageFlags = kSurfaceVKColorImageUsageFlags;
// We need storage image for compute writes (debug overlay output).
VkFormatFeatureFlags featureBits =
renderer->getImageFormatFeatureBits(nativeFormat, VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT);
if ((featureBits & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) != 0)
{
imageUsageFlags |= VK_IMAGE_USAGE_STORAGE_BIT;
}
VkSwapchainCreateInfoKHR swapchainInfo = {};
swapchainInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
@ -732,7 +742,7 @@ angle::Result WindowSurfaceVk::createSwapChain(vk::Context *context,
swapchainInfo.imageExtent.width = std::max(extents.width, 1);
swapchainInfo.imageExtent.height = std::max(extents.height, 1);
swapchainInfo.imageArrayLayers = 1;
swapchainInfo.imageUsage = kImageUsageFlags;
swapchainInfo.imageUsage = imageUsageFlags;
swapchainInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
swapchainInfo.queueFamilyIndexCount = 0;
swapchainInfo.pQueueFamilyIndices = nullptr;
@ -1032,7 +1042,6 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk,
SwapchainImage &image = mSwapchainImages[mCurrentSwapchainImageIndex];
vk::CommandBuffer *swapCommands = nullptr;
if (mColorImageMS.valid())
{
// Transition the multisampled image to TRANSFER_SRC for resolve.
@ -1055,14 +1064,17 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk,
resolveRegion.dstOffset = {};
resolveRegion.extent = image.image.getExtents();
ANGLE_TRY(image.image.recordCommands(contextVk, &swapCommands));
mColorImageMS.resolve(&image.image, resolveRegion, swapCommands);
vk::CommandBuffer *resolveCommands = nullptr;
ANGLE_TRY(image.image.recordCommands(contextVk, &resolveCommands));
mColorImageMS.resolve(&image.image, resolveRegion, resolveCommands);
}
else
{
ANGLE_TRY(image.image.recordCommands(contextVk, &swapCommands));
}
image.image.changeLayout(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::Present, swapCommands);
ANGLE_TRY(updateAndDrawOverlay(contextVk, &image));
vk::CommandBuffer *transitionCommands = nullptr;
ANGLE_TRY(image.image.recordCommands(contextVk, &transitionCommands));
image.image.changeLayout(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::Present,
transitionCommands);
// Knowing that the kSwapHistorySize'th submission ago has finished, we can know that the
// (kSwapHistorySize+1)'th present ago of this image is definitely finished and so its wait
@ -1408,4 +1420,37 @@ angle::Result WindowSurfaceVk::initializeContents(const gl::Context *context,
return angle::Result::Continue;
}
angle::Result WindowSurfaceVk::updateAndDrawOverlay(ContextVk *contextVk,
SwapchainImage *image) const
{
const gl::OverlayType *overlay = contextVk->getOverlay();
OverlayVk *overlayVk = vk::GetImpl(overlay);
// If overlay is disabled, nothing to do.
if (overlayVk == nullptr)
{
return angle::Result::Continue;
}
RendererVk *rendererVk = contextVk->getRenderer();
uint32_t validationMessageCount = 0;
std::string lastValidationMessage =
rendererVk->getAndClearLastValidationMessage(&validationMessageCount);
if (validationMessageCount)
{
overlay->getTextWidget(gl::WidgetId::VulkanLastValidationMessage)
->set(std::move(lastValidationMessage));
overlay->getCountWidget(gl::WidgetId::VulkanValidationMessageCount)
->add(validationMessageCount);
}
// Draw overlay
ANGLE_TRY(overlayVk->onPresent(contextVk, &image->image, &image->imageView));
overlay->getRunningGraphWidget(gl::WidgetId::VulkanCommandGraphSize)->next();
return angle::Result::Continue;
}
} // namespace rx

Просмотреть файл

@ -244,6 +244,8 @@ class WindowSurfaceVk : public SurfaceVk
EGLint n_rects,
bool *presentOutOfDate);
angle::Result updateAndDrawOverlay(ContextVk *contextVk, impl::SwapchainImage *image) const;
angle::Result swapImpl(const gl::Context *context, EGLint *rects, EGLint n_rects);
angle::Result newPresentSemaphore(vk::Context *context, vk::Semaphore *semaphoreOut);

Просмотреть файл

@ -23,6 +23,8 @@ namespace ImageClear_frag = vk::InternalShader::ImageClear_frag;
namespace ImageCopy_frag = vk::InternalShader::ImageCopy_frag;
namespace BlitResolve_frag = vk::InternalShader::BlitResolve_frag;
namespace BlitResolveStencilNoExport_comp = vk::InternalShader::BlitResolveStencilNoExport_comp;
namespace OverlayCull_comp = vk::InternalShader::OverlayCull_comp;
namespace OverlayDraw_comp = vk::InternalShader::OverlayDraw_comp;
namespace
{
@ -40,6 +42,13 @@ constexpr uint32_t kBlitResolveSamplerBinding = 2;
constexpr uint32_t kBlitResolveStencilNoExportDestBinding = 0;
constexpr uint32_t kBlitResolveStencilNoExportSrcBinding = 1;
constexpr uint32_t kBlitResolveStencilNoExportSamplerBinding = 2;
constexpr uint32_t kOverlayCullCulledWidgetsBinding = 0;
constexpr uint32_t kOverlayCullWidgetCoordsBinding = 1;
constexpr uint32_t kOverlayDrawOutputBinding = 0;
constexpr uint32_t kOverlayDrawTextWidgetsBinding = 1;
constexpr uint32_t kOverlayDrawGraphWidgetsBinding = 2;
constexpr uint32_t kOverlayDrawCulledWidgetsBinding = 3;
constexpr uint32_t kOverlayDrawFontBinding = 4;
uint32_t GetBufferUtilsFlags(size_t dispatchSize, const vk::Format &format)
{
@ -343,6 +352,14 @@ void UtilsVk::destroy(VkDevice device)
{
program.destroy(device);
}
for (vk::ShaderProgramHelper &program : mOverlayCullPrograms)
{
program.destroy(device);
}
for (vk::ShaderProgramHelper &program : mOverlayDrawPrograms)
{
program.destroy(device);
}
mPointSampler.destroy(device);
mLinearSampler.destroy(device);
@ -379,8 +396,11 @@ angle::Result UtilsVk::ensureResourcesInitialized(ContextVk *contextVk,
vk::PipelineLayoutDesc pipelineLayoutDesc;
pipelineLayoutDesc.updateDescriptorSetLayout(kSetIndex, descriptorSetDesc);
pipelineLayoutDesc.updatePushConstantRange(pushConstantsShaderStage, 0,
static_cast<uint32_t>(pushConstantsSize));
if (pushConstantsSize)
{
pipelineLayoutDesc.updatePushConstantRange(pushConstantsShaderStage, 0,
static_cast<uint32_t>(pushConstantsSize));
}
ANGLE_TRY(renderer->getPipelineLayout(contextVk, pipelineLayoutDesc,
mDescriptorSetLayouts[function],
@ -483,7 +503,7 @@ angle::Result UtilsVk::ensureBlitResolveResourcesInitialized(ContextVk *contextV
ArraySize(setSizes), sizeof(BlitResolveShaderParams)));
}
return ensureBlitResolveSamplersInitialized(contextVk);
return ensureSamplersInitialized(contextVk);
}
angle::Result UtilsVk::ensureBlitResolveStencilNoExportResourcesInitialized(ContextVk *contextVk)
@ -501,10 +521,43 @@ angle::Result UtilsVk::ensureBlitResolveStencilNoExportResourcesInitialized(Cont
sizeof(BlitResolveStencilNoExportShaderParams)));
}
return ensureBlitResolveSamplersInitialized(contextVk);
return ensureSamplersInitialized(contextVk);
}
angle::Result UtilsVk::ensureBlitResolveSamplersInitialized(ContextVk *contextVk)
angle::Result UtilsVk::ensureOverlayCullResourcesInitialized(ContextVk *contextVk)
{
if (mPipelineLayouts[Function::OverlayCull].valid())
{
return angle::Result::Continue;
}
VkDescriptorPoolSize setSizes[2] = {
{VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1},
{VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1},
};
return ensureResourcesInitialized(contextVk, Function::OverlayCull, setSizes,
ArraySize(setSizes), 0);
}
angle::Result UtilsVk::ensureOverlayDrawResourcesInitialized(ContextVk *contextVk)
{
if (!mPipelineLayouts[Function::OverlayDraw].valid())
{
VkDescriptorPoolSize setSizes[5] = {
{VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1}, {VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1},
{VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1}, {VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1},
{VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1},
};
ANGLE_TRY(ensureResourcesInitialized(contextVk, Function::OverlayDraw, setSizes,
ArraySize(setSizes), sizeof(OverlayDrawShaderParams)));
}
return ensureSamplersInitialized(contextVk);
}
angle::Result UtilsVk::ensureSamplersInitialized(ContextVk *contextVk)
{
VkSamplerCreateInfo samplerInfo = {};
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
@ -603,8 +656,11 @@ angle::Result UtilsVk::setupProgram(ContextVk *contextVk,
&descriptorSet, 0, nullptr);
}
commandBuffer->pushConstants(pipelineLayout.get(), pushConstantsShaderStage, 0,
static_cast<uint32_t>(pushConstantsSize), pushConstants);
if (pushConstants)
{
commandBuffer->pushConstants(pipelineLayout.get(), pushConstantsShaderStage, 0,
static_cast<uint32_t>(pushConstantsSize), pushConstants);
}
return angle::Result::Continue;
}
@ -1446,6 +1502,191 @@ angle::Result UtilsVk::copyImage(ContextVk *contextVk,
return angle::Result::Continue;
}
angle::Result UtilsVk::cullOverlayWidgets(ContextVk *contextVk,
vk::BufferHelper *enabledWidgetsBuffer,
vk::ImageHelper *dest,
const vk::ImageView *destView,
const OverlayCullParameters &params)
{
ANGLE_TRY(ensureOverlayCullResourcesInitialized(contextVk));
ASSERT(params.subgroupSize[0] == 8 &&
(params.subgroupSize[1] == 8 || params.subgroupSize[1] == 4));
uint32_t flags =
params.subgroupSize[1] == 8 ? OverlayCull_comp::kIs8x8 : OverlayCull_comp::kIs8x4;
if (params.supportsSubgroupBallot)
{
flags |= OverlayCull_comp::kSupportsBallot;
}
else if (params.supportsSubgroupBallot)
{
flags |= OverlayCull_comp::kSupportsArithmetic;
}
else
{
flags |= OverlayCull_comp::kSupportsNone;
}
VkDescriptorSet descriptorSet;
vk::RefCountedDescriptorPoolBinding descriptorPoolBinding;
ANGLE_TRY(allocateDescriptorSet(contextVk, Function::OverlayCull, &descriptorPoolBinding,
&descriptorSet));
vk::CommandBuffer *commandBuffer;
ANGLE_TRY(dest->recordCommands(contextVk, &commandBuffer));
dest->changeLayout(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::ComputeShaderWrite,
commandBuffer);
enabledWidgetsBuffer->onRead(dest, VK_ACCESS_SHADER_READ_BIT);
VkDescriptorImageInfo imageInfo = {};
imageInfo.imageView = destView->getHandle();
imageInfo.imageLayout = dest->getCurrentLayout();
VkDescriptorBufferInfo bufferInfo = {};
bufferInfo.buffer = enabledWidgetsBuffer->getBuffer().getHandle();
bufferInfo.offset = 0;
bufferInfo.range = VK_WHOLE_SIZE;
VkWriteDescriptorSet writeInfos[2] = {};
writeInfos[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeInfos[0].dstSet = descriptorSet;
writeInfos[0].dstBinding = kOverlayCullCulledWidgetsBinding;
writeInfos[0].descriptorCount = 1;
writeInfos[0].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
writeInfos[0].pImageInfo = &imageInfo;
writeInfos[1].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeInfos[1].dstSet = descriptorSet;
writeInfos[1].dstBinding = kOverlayCullWidgetCoordsBinding;
writeInfos[1].descriptorCount = 1;
writeInfos[1].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
writeInfos[1].pBufferInfo = &bufferInfo;
vkUpdateDescriptorSets(contextVk->getDevice(), 2, writeInfos, 0, nullptr);
vk::RefCounted<vk::ShaderAndSerial> *shader = nullptr;
ANGLE_TRY(contextVk->getShaderLibrary().getOverlayCull_comp(contextVk, flags, &shader));
ANGLE_TRY(setupProgram(contextVk, Function::OverlayCull, shader, nullptr,
&mOverlayCullPrograms[flags], nullptr, descriptorSet, nullptr, 0,
commandBuffer));
commandBuffer->dispatch(dest->getExtents().width, dest->getExtents().height, 1);
descriptorPoolBinding.reset();
dest->changeLayout(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::ComputeShaderReadOnly,
commandBuffer);
return angle::Result::Continue;
}
angle::Result UtilsVk::drawOverlay(ContextVk *contextVk,
vk::BufferHelper *textWidgetsBuffer,
vk::BufferHelper *graphWidgetsBuffer,
vk::ImageHelper *font,
const vk::ImageView *fontView,
vk::ImageHelper *culledWidgets,
const vk::ImageView *culledWidgetsView,
vk::ImageHelper *dest,
const vk::ImageView *destView,
const OverlayDrawParameters &params)
{
ANGLE_TRY(ensureOverlayDrawResourcesInitialized(contextVk));
OverlayDrawShaderParams shaderParams;
shaderParams.outputSize[0] = dest->getExtents().width;
shaderParams.outputSize[1] = dest->getExtents().height;
ASSERT(params.subgroupSize[0] == 8 &&
(params.subgroupSize[1] == 8 || params.subgroupSize[1] == 4));
uint32_t flags =
params.subgroupSize[1] == 8 ? OverlayDraw_comp::kIs8x8 : OverlayDraw_comp::kIs8x4;
VkDescriptorSet descriptorSet;
vk::RefCountedDescriptorPoolBinding descriptorPoolBinding;
ANGLE_TRY(allocateDescriptorSet(contextVk, Function::OverlayDraw, &descriptorPoolBinding,
&descriptorSet));
vk::CommandBuffer *commandBuffer;
ANGLE_TRY(dest->recordCommands(contextVk, &commandBuffer));
dest->changeLayout(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::ComputeShaderWrite,
commandBuffer);
culledWidgets->addReadDependency(dest);
font->addReadDependency(dest);
textWidgetsBuffer->onRead(dest, VK_ACCESS_SHADER_READ_BIT);
graphWidgetsBuffer->onRead(dest, VK_ACCESS_SHADER_READ_BIT);
VkDescriptorImageInfo imageInfos[3] = {};
imageInfos[0].imageView = destView->getHandle();
imageInfos[0].imageLayout = dest->getCurrentLayout();
imageInfos[1].imageView = culledWidgetsView->getHandle();
imageInfos[1].imageLayout = culledWidgets->getCurrentLayout();
imageInfos[2].imageView = fontView->getHandle();
imageInfos[2].imageLayout = font->getCurrentLayout();
VkDescriptorBufferInfo bufferInfos[2] = {};
bufferInfos[0].buffer = textWidgetsBuffer->getBuffer().getHandle();
bufferInfos[0].offset = 0;
bufferInfos[0].range = VK_WHOLE_SIZE;
bufferInfos[1].buffer = graphWidgetsBuffer->getBuffer().getHandle();
bufferInfos[1].offset = 0;
bufferInfos[1].range = VK_WHOLE_SIZE;
VkWriteDescriptorSet writeInfos[5] = {};
writeInfos[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeInfos[0].dstSet = descriptorSet;
writeInfos[0].dstBinding = kOverlayDrawOutputBinding;
writeInfos[0].descriptorCount = 1;
writeInfos[0].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
writeInfos[0].pImageInfo = &imageInfos[0];
writeInfos[1].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeInfos[1].dstSet = descriptorSet;
writeInfos[1].dstBinding = kOverlayDrawCulledWidgetsBinding;
writeInfos[1].descriptorCount = 1;
writeInfos[1].descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
writeInfos[1].pImageInfo = &imageInfos[1];
writeInfos[2].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeInfos[2].dstSet = descriptorSet;
writeInfos[2].dstBinding = kOverlayDrawFontBinding;
writeInfos[2].descriptorCount = 1;
writeInfos[2].descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
writeInfos[2].pImageInfo = &imageInfos[2];
writeInfos[3].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
writeInfos[3].dstSet = descriptorSet;
writeInfos[3].dstBinding = kOverlayDrawTextWidgetsBinding;
writeInfos[3].descriptorCount = 1;
writeInfos[3].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
writeInfos[3].pBufferInfo = &bufferInfos[0];
writeInfos[4] = writeInfos[3];
writeInfos[4].dstBinding = kOverlayDrawGraphWidgetsBinding;
writeInfos[4].pBufferInfo = &bufferInfos[1];
vkUpdateDescriptorSets(contextVk->getDevice(), 5, writeInfos, 0, nullptr);
vk::RefCounted<vk::ShaderAndSerial> *shader = nullptr;
ANGLE_TRY(contextVk->getShaderLibrary().getOverlayDraw_comp(contextVk, flags, &shader));
ANGLE_TRY(setupProgram(contextVk, Function::OverlayDraw, shader, nullptr,
&mOverlayDrawPrograms[flags], nullptr, descriptorSet, &shaderParams,
sizeof(shaderParams), commandBuffer));
// Every pixel of culledWidgets corresponds to one workgroup, so we can use that as dispatch
// size.
commandBuffer->dispatch(culledWidgets->getExtents().width, culledWidgets->getExtents().height,
1);
descriptorPoolBinding.reset();
return angle::Result::Continue;
}
angle::Result UtilsVk::allocateDescriptorSet(ContextVk *contextVk,
Function function,
vk::RefCountedDescriptorPoolBinding *bindingOut,

Просмотреть файл

@ -19,6 +19,7 @@
// on color images.
// - Depth/Stencil blit/resolve: Used by FramebufferVk::blit() to implement blit or multisample
// resolve on depth/stencil images.
// - Overlay Cull/Draw: Used by OverlayVk to efficiently draw a UI for debugging.
// - Mipmap generation: Not yet implemented
//
@ -117,6 +118,18 @@ class UtilsVk : angle::NonCopyable
bool destFlipY;
};
struct OverlayCullParameters
{
uint32_t subgroupSize[2];
bool supportsSubgroupBallot;
bool supportsSubgroupArithmetic;
};
struct OverlayDrawParameters
{
uint32_t subgroupSize[2];
};
angle::Result clearBuffer(ContextVk *contextVk,
vk::BufferHelper *dest,
const ClearParameters &params);
@ -158,6 +171,24 @@ class UtilsVk : angle::NonCopyable
const vk::ImageView *srcView,
const CopyImageParameters &params);
// Overlay utilities.
angle::Result cullOverlayWidgets(ContextVk *contextVk,
vk::BufferHelper *enabledWidgetsBuffer,
vk::ImageHelper *dest,
const vk::ImageView *destView,
const OverlayCullParameters &params);
angle::Result drawOverlay(ContextVk *contextVk,
vk::BufferHelper *textWidgetsBuffer,
vk::BufferHelper *graphWidgetsBuffer,
vk::ImageHelper *font,
const vk::ImageView *fontView,
vk::ImageHelper *culledWidgets,
const vk::ImageView *culledWidgetsView,
vk::ImageHelper *dest,
const vk::ImageView *destView,
const OverlayDrawParameters &params);
private:
ANGLE_ENABLE_STRUCT_PADDING_WARNINGS
@ -255,6 +286,12 @@ class UtilsVk : angle::NonCopyable
uint32_t flipY = 0;
};
struct OverlayDrawShaderParams
{
// Structure matching PushConstants in OverlayDraw.comp
uint32_t outputSize[2] = {};
};
ANGLE_DISABLE_STRUCT_PADDING_WARNINGS
// Functions implemented by the class:
@ -271,9 +308,11 @@ class UtilsVk : angle::NonCopyable
ConvertIndexBuffer = 4,
ConvertVertexBuffer = 5,
BlitResolveStencilNoExport = 6,
OverlayCull = 7,
OverlayDraw = 8,
InvalidEnum = 7,
EnumCount = 7,
InvalidEnum = 9,
EnumCount = 9,
};
// Common function that creates the pipeline for the specified function, binds it and prepares
@ -312,8 +351,10 @@ class UtilsVk : angle::NonCopyable
angle::Result ensureImageCopyResourcesInitialized(ContextVk *contextVk);
angle::Result ensureBlitResolveResourcesInitialized(ContextVk *contextVk);
angle::Result ensureBlitResolveStencilNoExportResourcesInitialized(ContextVk *contextVk);
angle::Result ensureOverlayCullResourcesInitialized(ContextVk *contextVk);
angle::Result ensureOverlayDrawResourcesInitialized(ContextVk *contextVk);
angle::Result ensureBlitResolveSamplersInitialized(ContextVk *context);
angle::Result ensureSamplersInitialized(ContextVk *context);
angle::Result startRenderPass(ContextVk *contextVk,
vk::ImageHelper *image,
@ -351,6 +392,8 @@ class UtilsVk : angle::NonCopyable
vk::ShaderProgramHelper mBlitResolvePrograms[vk::InternalShader::BlitResolve_frag::kArrayLen];
vk::ShaderProgramHelper mBlitResolveStencilNoExportPrograms
[vk::InternalShader::BlitResolveStencilNoExport_comp::kArrayLen];
vk::ShaderProgramHelper mOverlayCullPrograms[vk::InternalShader::OverlayCull_comp::kArrayLen];
vk::ShaderProgramHelper mOverlayDrawPrograms[vk::InternalShader::OverlayDraw_comp::kArrayLen];
vk::Sampler mPointSampler;
vk::Sampler mLinearSampler;

Просмотреть файл

@ -386,6 +386,17 @@ class CompileQueue:
raise Exception(exception)
# If the option is just a string, that's the name. Otherwise, it could be
# [ name, arg1, ..., argN ]. In that case, name is option[0] and option[1:] are extra arguments
# that need to be passed to glslang_validator for this variation.
def get_variation_name(option):
return option if isinstance(option, unicode) else option[0]
def get_variation_args(option):
return [] if isinstance(option, unicode) else option[1:]
def compile_variation(glslang_path, compile_queue, shader_file, shader_basename, flags, enums,
flags_active, enum_indices, flags_bits, enum_bits, output_shaders):
@ -398,9 +409,12 @@ def compile_variation(glslang_path, compile_queue, shader_file, shader_basename,
# takes up as few bits as needed to count that many enum values.
variation_bits = 0
variation_string = ''
variation_extra_args = []
for f in range(len(flags)):
if flags_active & (1 << f):
flag_name = flags[f]
flag = flags[f]
flag_name = get_variation_name(flag)
variation_extra_args += get_variation_args(flag)
glslang_args.append('-D' + flag_name + '=1')
variation_bits |= 1 << f
@ -409,7 +423,9 @@ def compile_variation(glslang_path, compile_queue, shader_file, shader_basename,
current_bit_start = flags_bits
for e in range(len(enums)):
enum_name = enums[e][1][enum_indices[e]]
enum = enums[e][1][enum_indices[e]]
enum_name = get_variation_name(enum)
variation_extra_args += get_variation_args(enum)
glslang_args.append('-D' + enum_name + '=1')
variation_bits |= enum_indices[e] << current_bit_start
@ -424,6 +440,8 @@ def compile_variation(glslang_path, compile_queue, shader_file, shader_basename,
glslang_preprocessor_output_args = glslang_args + ['-E']
glslang_preprocessor_output_args.append(shader_file) # Input GLSL shader
glslang_args += variation_extra_args
glslang_args += ['-V'] # Output mode is Vulkan
glslang_args += ['--variable-name', get_var_name(output_name)] # C-style variable name
glslang_args += ['-o', output_path] # Output file
@ -463,7 +481,9 @@ def get_variation_definition(shader_and_variation):
definition = 'namespace %s\n{\n' % namespace_name
if len(flags) > 0:
definition += 'enum flags\n{\n'
definition += ''.join(['k%s = 0x%08X,\n' % (flags[f], 1 << f) for f in range(len(flags))])
definition += ''.join([
'k%s = 0x%08X,\n' % (get_variation_name(flags[f]), 1 << f) for f in range(len(flags))
])
definition += '};\n'
current_bit_start = flags_bits
@ -473,7 +493,8 @@ def get_variation_definition(shader_and_variation):
enum_name = enum[0]
definition += 'enum %s\n{\n' % enum_name
definition += ''.join([
'k%s = 0x%08X,\n' % (enum[1][v], v << current_bit_start) for v in range(len(enum[1]))
'k%s = 0x%08X,\n' % (get_variation_name(enum[1][v]), v << current_bit_start)
for v in range(len(enum[1]))
])
definition += '};\n'
current_bit_start += enum_bits[e]

Просмотреть файл

@ -0,0 +1,145 @@
// 7.12.3226
#pragma once
const uint32_t kOverlayCull_comp_00000000[] = {
0x07230203,0x00010300,0x00080007,0x00000070,0x00000000,0x00020011,0x00000001,0x00020011,
0x0000003d,0x00020011,0x00000040,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e,
0x00000000,0x0003000e,0x00000000,0x00000001,0x0007000f,0x00000005,0x00000004,0x6e69616d,
0x00000000,0x00000012,0x00000046,0x00060010,0x00000004,0x00000011,0x00000020,0x00000001,
0x00000001,0x00030003,0x00000002,0x000001c2,0x000b0004,0x455f4c47,0x735f5458,0x6c706d61,
0x656c7265,0x745f7373,0x75747865,0x665f6572,0x74636e75,0x736e6f69,0x00000000,0x00090004,
0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,0x6f726762,0x625f7075,0x6f6c6c61,0x00000074,
0x00090004,0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,0x6f726762,0x625f7075,0x63697361,
0x00000000,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00080005,0x0000000c,0x6c6c7563,
0x67646957,0x28737465,0x763b3175,0x763b3275,0x003b3275,0x00040005,0x00000009,0x7366666f,
0x00007465,0x00060005,0x0000000a,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,0x00060005,
0x0000000b,0x636f6c62,0x6f6f436b,0x69486472,0x00006867,0x00040005,0x0000000f,0x61636f6c,
0x0064496c,0x00080005,0x00000012,0x4c5f6c67,0x6c61636f,0x6f766e49,0x69746163,0x44496e6f,
0x00000000,0x00060005,0x00000019,0x67646977,0x6f437465,0x7364726f,0x00000000,0x00070005,
0x0000001c,0x67646957,0x6f437465,0x6964726f,0x6574616e,0x00000073,0x00060006,0x0000001c,
0x00000000,0x726f6f63,0x616e6964,0x00736574,0x00030005,0x0000001e,0x00000000,0x00050005,
0x00000028,0x65746e69,0x63657372,0x00007374,0x00050005,0x00000045,0x4374756f,0x64726f6f,
0x00000000,0x00060005,0x00000046,0x575f6c67,0x476b726f,0x70756f72,0x00004449,0x00060005,
0x00000049,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,0x00060005,0x0000004f,0x636f6c62,
0x6f6f436b,0x69486472,0x00006867,0x00060005,0x00000052,0x6c6c7563,0x69576465,0x74656764,
0x00000073,0x00070005,0x00000066,0x6c6c7563,0x69576465,0x74656764,0x74754f73,0x00000000,
0x00040047,0x00000012,0x0000000b,0x0000001b,0x00040047,0x0000001b,0x00000006,0x00000010,
0x00050048,0x0000001c,0x00000000,0x00000023,0x00000000,0x00030047,0x0000001c,0x00000002,
0x00040047,0x0000001e,0x00000022,0x00000000,0x00040047,0x0000001e,0x00000021,0x00000001,
0x00040047,0x00000046,0x0000000b,0x0000001a,0x00040047,0x00000066,0x00000022,0x00000000,
0x00040047,0x00000066,0x00000021,0x00000000,0x00030047,0x00000066,0x00000019,0x00040047,
0x0000006f,0x0000000b,0x00000019,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,
0x00040015,0x00000006,0x00000020,0x00000000,0x00040017,0x00000007,0x00000006,0x00000002,
0x00060021,0x00000008,0x00000007,0x00000006,0x00000007,0x00000007,0x00040020,0x0000000e,
0x00000007,0x00000006,0x00040017,0x00000010,0x00000006,0x00000003,0x00040020,0x00000011,
0x00000001,0x00000010,0x0004003b,0x00000011,0x00000012,0x00000001,0x0004002b,0x00000006,
0x00000013,0x00000000,0x00040020,0x00000014,0x00000001,0x00000006,0x00040017,0x00000017,
0x00000006,0x00000004,0x00040020,0x00000018,0x00000007,0x00000017,0x0004002b,0x00000006,
0x0000001a,0x00000040,0x0004001c,0x0000001b,0x00000017,0x0000001a,0x0003001e,0x0000001c,
0x0000001b,0x00040020,0x0000001d,0x00000002,0x0000001c,0x0004003b,0x0000001d,0x0000001e,
0x00000002,0x00040015,0x0000001f,0x00000020,0x00000001,0x0004002b,0x0000001f,0x00000020,
0x00000000,0x00040020,0x00000023,0x00000002,0x00000017,0x00020014,0x00000026,0x00040020,
0x00000027,0x00000007,0x00000026,0x0004002b,0x00000006,0x0000002b,0x00000002,0x00040017,
0x00000033,0x00000026,0x00000002,0x0004002b,0x00000006,0x0000003f,0x00000003,0x00040020,
0x00000044,0x00000007,0x00000007,0x0004003b,0x00000011,0x00000046,0x00000001,0x0004002b,
0x00000006,0x0000004b,0x00000008,0x0004002b,0x00000006,0x0000004c,0x00000004,0x0005002c,
0x00000007,0x0000004d,0x0000004b,0x0000004c,0x0004002b,0x00000006,0x00000058,0x00000020,
0x0004002b,0x00000006,0x0000005d,0x00000001,0x00090019,0x00000064,0x00000006,0x00000001,
0x00000000,0x00000000,0x00000000,0x00000002,0x0000001e,0x00040020,0x00000065,0x00000000,
0x00000064,0x0004003b,0x00000065,0x00000066,0x00000000,0x00040017,0x00000069,0x0000001f,
0x00000002,0x0006002c,0x00000010,0x0000006f,0x00000058,0x0000005d,0x0000005d,0x00050036,
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000044,
0x00000045,0x00000007,0x0004003b,0x00000044,0x00000049,0x00000007,0x0004003b,0x00000044,
0x0000004f,0x00000007,0x0004003b,0x00000044,0x00000052,0x00000007,0x0004003d,0x00000010,
0x00000047,0x00000046,0x0007004f,0x00000007,0x00000048,0x00000047,0x00000047,0x00000000,
0x00000001,0x0003003e,0x00000045,0x00000048,0x0004003d,0x00000007,0x0000004a,0x00000045,
0x00050084,0x00000007,0x0000004e,0x0000004a,0x0000004d,0x0003003e,0x00000049,0x0000004e,
0x0004003d,0x00000007,0x00000050,0x00000049,0x00050080,0x00000007,0x00000051,0x00000050,
0x0000004d,0x0003003e,0x0000004f,0x00000051,0x0004003d,0x00000007,0x00000053,0x00000049,
0x0004003d,0x00000007,0x00000054,0x0000004f,0x00070039,0x00000007,0x00000055,0x0000000c,
0x00000013,0x00000053,0x00000054,0x00050051,0x00000006,0x00000056,0x00000055,0x00000000,
0x00050041,0x0000000e,0x00000057,0x00000052,0x00000013,0x0003003e,0x00000057,0x00000056,
0x0004003d,0x00000007,0x00000059,0x00000049,0x0004003d,0x00000007,0x0000005a,0x0000004f,
0x00070039,0x00000007,0x0000005b,0x0000000c,0x00000058,0x00000059,0x0000005a,0x00050051,
0x00000006,0x0000005c,0x0000005b,0x00000000,0x00050041,0x0000000e,0x0000005e,0x00000052,
0x0000005d,0x0003003e,0x0000005e,0x0000005c,0x00050041,0x00000014,0x0000005f,0x00000012,
0x00000013,0x0004003d,0x00000006,0x00000060,0x0000005f,0x000500aa,0x00000026,0x00000061,
0x00000060,0x00000013,0x000300f7,0x00000063,0x00000000,0x000400fa,0x00000061,0x00000062,
0x00000063,0x000200f8,0x00000062,0x0004003d,0x00000064,0x00000067,0x00000066,0x0004003d,
0x00000007,0x00000068,0x00000045,0x0004007c,0x00000069,0x0000006a,0x00000068,0x0004003d,
0x00000007,0x0000006b,0x00000052,0x00050051,0x00000006,0x0000006c,0x0000006b,0x00000000,
0x00050051,0x00000006,0x0000006d,0x0000006b,0x00000001,0x00070050,0x00000017,0x0000006e,
0x0000006c,0x0000006d,0x00000013,0x00000013,0x00040063,0x00000067,0x0000006a,0x0000006e,
0x000200f9,0x00000063,0x000200f8,0x00000063,0x000100fd,0x00010038,0x00050036,0x00000007,
0x0000000c,0x00000000,0x00000008,0x00030037,0x00000006,0x00000009,0x00030037,0x00000007,
0x0000000a,0x00030037,0x00000007,0x0000000b,0x000200f8,0x0000000d,0x0004003b,0x0000000e,
0x0000000f,0x00000007,0x0004003b,0x00000018,0x00000019,0x00000007,0x0004003b,0x00000027,
0x00000028,0x00000007,0x00050041,0x00000014,0x00000015,0x00000012,0x00000013,0x0004003d,
0x00000006,0x00000016,0x00000015,0x0003003e,0x0000000f,0x00000016,0x0004003d,0x00000006,
0x00000021,0x0000000f,0x00050080,0x00000006,0x00000022,0x00000009,0x00000021,0x00060041,
0x00000023,0x00000024,0x0000001e,0x00000020,0x00000022,0x0004003d,0x00000017,0x00000025,
0x00000024,0x0003003e,0x00000019,0x00000025,0x00050041,0x0000000e,0x00000029,0x00000019,
0x00000013,0x0004003d,0x00000006,0x0000002a,0x00000029,0x00050041,0x0000000e,0x0000002c,
0x00000019,0x0000002b,0x0004003d,0x00000006,0x0000002d,0x0000002c,0x000500b0,0x00000026,
0x0000002e,0x0000002a,0x0000002d,0x000300f7,0x00000030,0x00000000,0x000400fa,0x0000002e,
0x0000002f,0x00000030,0x000200f8,0x0000002f,0x0004003d,0x00000017,0x00000031,0x00000019,
0x0007004f,0x00000007,0x00000032,0x00000031,0x00000031,0x00000000,0x00000001,0x000500b0,
0x00000033,0x00000034,0x00000032,0x0000000b,0x0004009b,0x00000026,0x00000035,0x00000034,
0x000200f9,0x00000030,0x000200f8,0x00000030,0x000700f5,0x00000026,0x00000036,0x0000002e,
0x0000000d,0x00000035,0x0000002f,0x000300f7,0x00000038,0x00000000,0x000400fa,0x00000036,
0x00000037,0x00000038,0x000200f8,0x00000037,0x0004003d,0x00000017,0x00000039,0x00000019,
0x0007004f,0x00000007,0x0000003a,0x00000039,0x00000039,0x00000002,0x00000003,0x000500ae,
0x00000033,0x0000003b,0x0000003a,0x0000000a,0x0004009b,0x00000026,0x0000003c,0x0000003b,
0x000200f9,0x00000038,0x000200f8,0x00000038,0x000700f5,0x00000026,0x0000003d,0x00000036,
0x00000030,0x0000003c,0x00000037,0x0003003e,0x00000028,0x0000003d,0x0004003d,0x00000026,
0x0000003e,0x00000028,0x00050153,0x00000017,0x00000040,0x0000003f,0x0000003e,0x0007004f,
0x00000007,0x00000041,0x00000040,0x00000040,0x00000000,0x00000001,0x000200fe,0x00000041,
0x00010038
};
// Generated from:
//
// #version 450 core
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// #extension GL_KHR_shader_subgroup_ballot : require
//
// layout(local_size_x = 32, local_size_y = 1, local_size_z = 1)in;
//
// layout(set = 0, binding = 0, rgba32ui)uniform writeonly uimage2D culledWidgetsOut;
//
// layout(set = 0, binding = 1)uniform WidgetCoordinates
// {
// uvec4 coordinates[32 + 32];
// };
//
// uvec2 cullWidgets(const uint offset, const uvec2 blockCoordLow, const uvec2 blockCoordHigh)
// {
// const uint localId = gl_LocalInvocationID . x;
// const uvec4 widgetCoords = coordinates[offset + localId];
//
// const bool intersects = widgetCoords . x < widgetCoords . z &&
// all(lessThan(widgetCoords . xy, blockCoordHigh))&&
// all(greaterThanEqual(widgetCoords . zw, blockCoordLow));
//
// return subgroupBallot(intersects). xy;
//
// }
//
// void main()
// {
//
// const uvec2 outCoord = gl_WorkGroupID . xy;
// const uvec2 blockCoordLow = outCoord * uvec2(8, 4);
// const uvec2 blockCoordHigh = blockCoordLow + uvec2(8, 4);
//
// uvec2 culledWidgets;
//
// culledWidgets . x = cullWidgets(0, blockCoordLow, blockCoordHigh). x;
// culledWidgets . y = cullWidgets(32, blockCoordLow, blockCoordHigh). x;
//
// if(gl_LocalInvocationID . x == 0)
// {
// imageStore(culledWidgetsOut, ivec2(outCoord), uvec4(culledWidgets, 0, 0));
// }
// }

Просмотреть файл

@ -0,0 +1,138 @@
// 7.12.3226
#pragma once
const uint32_t kOverlayCull_comp_00000001[] = {
0x07230203,0x00010300,0x00080007,0x00000067,0x00000000,0x00020011,0x00000001,0x00020011,
0x0000003d,0x00020011,0x00000040,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e,
0x00000000,0x0003000e,0x00000000,0x00000001,0x0007000f,0x00000005,0x00000004,0x6e69616d,
0x00000000,0x00000012,0x00000046,0x00060010,0x00000004,0x00000011,0x00000040,0x00000001,
0x00000001,0x00030003,0x00000002,0x000001c2,0x000b0004,0x455f4c47,0x735f5458,0x6c706d61,
0x656c7265,0x745f7373,0x75747865,0x665f6572,0x74636e75,0x736e6f69,0x00000000,0x00090004,
0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,0x6f726762,0x625f7075,0x6f6c6c61,0x00000074,
0x00090004,0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,0x6f726762,0x625f7075,0x63697361,
0x00000000,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00080005,0x0000000c,0x6c6c7563,
0x67646957,0x28737465,0x763b3175,0x763b3275,0x003b3275,0x00040005,0x00000009,0x7366666f,
0x00007465,0x00060005,0x0000000a,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,0x00060005,
0x0000000b,0x636f6c62,0x6f6f436b,0x69486472,0x00006867,0x00040005,0x0000000f,0x61636f6c,
0x0064496c,0x00080005,0x00000012,0x4c5f6c67,0x6c61636f,0x6f766e49,0x69746163,0x44496e6f,
0x00000000,0x00060005,0x00000019,0x67646977,0x6f437465,0x7364726f,0x00000000,0x00070005,
0x0000001c,0x67646957,0x6f437465,0x6964726f,0x6574616e,0x00000073,0x00060006,0x0000001c,
0x00000000,0x726f6f63,0x616e6964,0x00736574,0x00030005,0x0000001e,0x00000000,0x00050005,
0x00000028,0x65746e69,0x63657372,0x00007374,0x00050005,0x00000045,0x4374756f,0x64726f6f,
0x00000000,0x00060005,0x00000046,0x575f6c67,0x476b726f,0x70756f72,0x00004449,0x00060005,
0x00000049,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,0x00060005,0x0000004e,0x636f6c62,
0x6f6f436b,0x69486472,0x00006867,0x00060005,0x00000051,0x6c6c7563,0x69576465,0x74656764,
0x00000073,0x00070005,0x0000005c,0x6c6c7563,0x69576465,0x74656764,0x74754f73,0x00000000,
0x00040047,0x00000012,0x0000000b,0x0000001b,0x00040047,0x0000001b,0x00000006,0x00000010,
0x00050048,0x0000001c,0x00000000,0x00000023,0x00000000,0x00030047,0x0000001c,0x00000002,
0x00040047,0x0000001e,0x00000022,0x00000000,0x00040047,0x0000001e,0x00000021,0x00000001,
0x00040047,0x00000046,0x0000000b,0x0000001a,0x00040047,0x0000005c,0x00000022,0x00000000,
0x00040047,0x0000005c,0x00000021,0x00000000,0x00030047,0x0000005c,0x00000019,0x00040047,
0x00000066,0x0000000b,0x00000019,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,
0x00040015,0x00000006,0x00000020,0x00000000,0x00040017,0x00000007,0x00000006,0x00000002,
0x00060021,0x00000008,0x00000007,0x00000006,0x00000007,0x00000007,0x00040020,0x0000000e,
0x00000007,0x00000006,0x00040017,0x00000010,0x00000006,0x00000003,0x00040020,0x00000011,
0x00000001,0x00000010,0x0004003b,0x00000011,0x00000012,0x00000001,0x0004002b,0x00000006,
0x00000013,0x00000000,0x00040020,0x00000014,0x00000001,0x00000006,0x00040017,0x00000017,
0x00000006,0x00000004,0x00040020,0x00000018,0x00000007,0x00000017,0x0004002b,0x00000006,
0x0000001a,0x00000040,0x0004001c,0x0000001b,0x00000017,0x0000001a,0x0003001e,0x0000001c,
0x0000001b,0x00040020,0x0000001d,0x00000002,0x0000001c,0x0004003b,0x0000001d,0x0000001e,
0x00000002,0x00040015,0x0000001f,0x00000020,0x00000001,0x0004002b,0x0000001f,0x00000020,
0x00000000,0x00040020,0x00000023,0x00000002,0x00000017,0x00020014,0x00000026,0x00040020,
0x00000027,0x00000007,0x00000026,0x0004002b,0x00000006,0x0000002b,0x00000002,0x00040017,
0x00000033,0x00000026,0x00000002,0x0004002b,0x00000006,0x0000003f,0x00000003,0x00040020,
0x00000044,0x00000007,0x00000007,0x0004003b,0x00000011,0x00000046,0x00000001,0x0004002b,
0x00000006,0x0000004b,0x00000008,0x0005002c,0x00000007,0x0000004c,0x0000004b,0x0000004b,
0x00090019,0x0000005a,0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000002,
0x0000001e,0x00040020,0x0000005b,0x00000000,0x0000005a,0x0004003b,0x0000005b,0x0000005c,
0x00000000,0x00040017,0x0000005f,0x0000001f,0x00000002,0x0004002b,0x00000006,0x00000065,
0x00000001,0x0006002c,0x00000010,0x00000066,0x0000001a,0x00000065,0x00000065,0x00050036,
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x00000044,
0x00000045,0x00000007,0x0004003b,0x00000044,0x00000049,0x00000007,0x0004003b,0x00000044,
0x0000004e,0x00000007,0x0004003b,0x00000044,0x00000051,0x00000007,0x0004003d,0x00000010,
0x00000047,0x00000046,0x0007004f,0x00000007,0x00000048,0x00000047,0x00000047,0x00000000,
0x00000001,0x0003003e,0x00000045,0x00000048,0x0004003d,0x00000007,0x0000004a,0x00000045,
0x00050084,0x00000007,0x0000004d,0x0000004a,0x0000004c,0x0003003e,0x00000049,0x0000004d,
0x0004003d,0x00000007,0x0000004f,0x00000049,0x00050080,0x00000007,0x00000050,0x0000004f,
0x0000004c,0x0003003e,0x0000004e,0x00000050,0x0004003d,0x00000007,0x00000052,0x00000049,
0x0004003d,0x00000007,0x00000053,0x0000004e,0x00070039,0x00000007,0x00000054,0x0000000c,
0x00000013,0x00000052,0x00000053,0x0003003e,0x00000051,0x00000054,0x00050041,0x00000014,
0x00000055,0x00000012,0x00000013,0x0004003d,0x00000006,0x00000056,0x00000055,0x000500aa,
0x00000026,0x00000057,0x00000056,0x00000013,0x000300f7,0x00000059,0x00000000,0x000400fa,
0x00000057,0x00000058,0x00000059,0x000200f8,0x00000058,0x0004003d,0x0000005a,0x0000005d,
0x0000005c,0x0004003d,0x00000007,0x0000005e,0x00000045,0x0004007c,0x0000005f,0x00000060,
0x0000005e,0x0004003d,0x00000007,0x00000061,0x00000051,0x00050051,0x00000006,0x00000062,
0x00000061,0x00000000,0x00050051,0x00000006,0x00000063,0x00000061,0x00000001,0x00070050,
0x00000017,0x00000064,0x00000062,0x00000063,0x00000013,0x00000013,0x00040063,0x0000005d,
0x00000060,0x00000064,0x000200f9,0x00000059,0x000200f8,0x00000059,0x000100fd,0x00010038,
0x00050036,0x00000007,0x0000000c,0x00000000,0x00000008,0x00030037,0x00000006,0x00000009,
0x00030037,0x00000007,0x0000000a,0x00030037,0x00000007,0x0000000b,0x000200f8,0x0000000d,
0x0004003b,0x0000000e,0x0000000f,0x00000007,0x0004003b,0x00000018,0x00000019,0x00000007,
0x0004003b,0x00000027,0x00000028,0x00000007,0x00050041,0x00000014,0x00000015,0x00000012,
0x00000013,0x0004003d,0x00000006,0x00000016,0x00000015,0x0003003e,0x0000000f,0x00000016,
0x0004003d,0x00000006,0x00000021,0x0000000f,0x00050080,0x00000006,0x00000022,0x00000009,
0x00000021,0x00060041,0x00000023,0x00000024,0x0000001e,0x00000020,0x00000022,0x0004003d,
0x00000017,0x00000025,0x00000024,0x0003003e,0x00000019,0x00000025,0x00050041,0x0000000e,
0x00000029,0x00000019,0x00000013,0x0004003d,0x00000006,0x0000002a,0x00000029,0x00050041,
0x0000000e,0x0000002c,0x00000019,0x0000002b,0x0004003d,0x00000006,0x0000002d,0x0000002c,
0x000500b0,0x00000026,0x0000002e,0x0000002a,0x0000002d,0x000300f7,0x00000030,0x00000000,
0x000400fa,0x0000002e,0x0000002f,0x00000030,0x000200f8,0x0000002f,0x0004003d,0x00000017,
0x00000031,0x00000019,0x0007004f,0x00000007,0x00000032,0x00000031,0x00000031,0x00000000,
0x00000001,0x000500b0,0x00000033,0x00000034,0x00000032,0x0000000b,0x0004009b,0x00000026,
0x00000035,0x00000034,0x000200f9,0x00000030,0x000200f8,0x00000030,0x000700f5,0x00000026,
0x00000036,0x0000002e,0x0000000d,0x00000035,0x0000002f,0x000300f7,0x00000038,0x00000000,
0x000400fa,0x00000036,0x00000037,0x00000038,0x000200f8,0x00000037,0x0004003d,0x00000017,
0x00000039,0x00000019,0x0007004f,0x00000007,0x0000003a,0x00000039,0x00000039,0x00000002,
0x00000003,0x000500ae,0x00000033,0x0000003b,0x0000003a,0x0000000a,0x0004009b,0x00000026,
0x0000003c,0x0000003b,0x000200f9,0x00000038,0x000200f8,0x00000038,0x000700f5,0x00000026,
0x0000003d,0x00000036,0x00000030,0x0000003c,0x00000037,0x0003003e,0x00000028,0x0000003d,
0x0004003d,0x00000026,0x0000003e,0x00000028,0x00050153,0x00000017,0x00000040,0x0000003f,
0x0000003e,0x0007004f,0x00000007,0x00000041,0x00000040,0x00000040,0x00000000,0x00000001,
0x000200fe,0x00000041,0x00010038
};
// Generated from:
//
// #version 450 core
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// #extension GL_KHR_shader_subgroup_ballot : require
//
// layout(local_size_x = 64, local_size_y = 1, local_size_z = 1)in;
//
// layout(set = 0, binding = 0, rgba32ui)uniform writeonly uimage2D culledWidgetsOut;
//
// layout(set = 0, binding = 1)uniform WidgetCoordinates
// {
// uvec4 coordinates[32 + 32];
// };
//
// uvec2 cullWidgets(const uint offset, const uvec2 blockCoordLow, const uvec2 blockCoordHigh)
// {
// const uint localId = gl_LocalInvocationID . x;
// const uvec4 widgetCoords = coordinates[offset + localId];
//
// const bool intersects = widgetCoords . x < widgetCoords . z &&
// all(lessThan(widgetCoords . xy, blockCoordHigh))&&
// all(greaterThanEqual(widgetCoords . zw, blockCoordLow));
//
// return subgroupBallot(intersects). xy;
//
// }
//
// void main()
// {
//
// const uvec2 outCoord = gl_WorkGroupID . xy;
// const uvec2 blockCoordLow = outCoord * uvec2(8, 8);
// const uvec2 blockCoordHigh = blockCoordLow + uvec2(8, 8);
//
// uvec2 culledWidgets;
//
// culledWidgets = cullWidgets(0, blockCoordLow, blockCoordHigh);
//
// if(gl_LocalInvocationID . x == 0)
// {
// imageStore(culledWidgetsOut, ivec2(outCoord), uvec4(culledWidgets, 0, 0));
// }
// }

Просмотреть файл

@ -0,0 +1,146 @@
// 7.12.3226
#pragma once
const uint32_t kOverlayCull_comp_00000002[] = {
0x07230203,0x00010300,0x00080007,0x00000073,0x00000000,0x00020011,0x00000001,0x00020011,
0x0000003d,0x00020011,0x0000003f,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e,
0x00000000,0x0003000e,0x00000000,0x00000001,0x0007000f,0x00000005,0x00000004,0x6e69616d,
0x00000000,0x00000012,0x0000004a,0x00060010,0x00000004,0x00000011,0x00000020,0x00000001,
0x00000001,0x00030003,0x00000002,0x000001c2,0x000b0004,0x455f4c47,0x735f5458,0x6c706d61,
0x656c7265,0x745f7373,0x75747865,0x665f6572,0x74636e75,0x736e6f69,0x00000000,0x000a0004,
0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,0x6f726762,0x615f7075,0x68746972,0x6974656d,
0x00000063,0x00090004,0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,0x6f726762,0x625f7075,
0x63697361,0x00000000,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00080005,0x0000000c,
0x6c6c7563,0x67646957,0x28737465,0x763b3175,0x763b3275,0x003b3275,0x00040005,0x00000009,
0x7366666f,0x00007465,0x00060005,0x0000000a,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,
0x00060005,0x0000000b,0x636f6c62,0x6f6f436b,0x69486472,0x00006867,0x00040005,0x0000000f,
0x61636f6c,0x0064496c,0x00080005,0x00000012,0x4c5f6c67,0x6c61636f,0x6f766e49,0x69746163,
0x44496e6f,0x00000000,0x00060005,0x00000019,0x67646977,0x6f437465,0x7364726f,0x00000000,
0x00070005,0x0000001c,0x67646957,0x6f437465,0x6964726f,0x6574616e,0x00000073,0x00060006,
0x0000001c,0x00000000,0x726f6f63,0x616e6964,0x00736574,0x00030005,0x0000001e,0x00000000,
0x00050005,0x00000028,0x65746e69,0x63657372,0x00007374,0x00050005,0x00000049,0x4374756f,
0x64726f6f,0x00000000,0x00060005,0x0000004a,0x575f6c67,0x476b726f,0x70756f72,0x00004449,
0x00060005,0x0000004d,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,0x00060005,0x00000053,
0x636f6c62,0x6f6f436b,0x69486472,0x00006867,0x00060005,0x00000056,0x6c6c7563,0x69576465,
0x74656764,0x00000073,0x00070005,0x00000069,0x6c6c7563,0x69576465,0x74656764,0x74754f73,
0x00000000,0x00040047,0x00000012,0x0000000b,0x0000001b,0x00040047,0x0000001b,0x00000006,
0x00000010,0x00050048,0x0000001c,0x00000000,0x00000023,0x00000000,0x00030047,0x0000001c,
0x00000002,0x00040047,0x0000001e,0x00000022,0x00000000,0x00040047,0x0000001e,0x00000021,
0x00000001,0x00040047,0x0000004a,0x0000000b,0x0000001a,0x00040047,0x00000069,0x00000022,
0x00000000,0x00040047,0x00000069,0x00000021,0x00000000,0x00030047,0x00000069,0x00000019,
0x00040047,0x00000072,0x0000000b,0x00000019,0x00020013,0x00000002,0x00030021,0x00000003,
0x00000002,0x00040015,0x00000006,0x00000020,0x00000000,0x00040017,0x00000007,0x00000006,
0x00000002,0x00060021,0x00000008,0x00000007,0x00000006,0x00000007,0x00000007,0x00040020,
0x0000000e,0x00000007,0x00000006,0x00040017,0x00000010,0x00000006,0x00000003,0x00040020,
0x00000011,0x00000001,0x00000010,0x0004003b,0x00000011,0x00000012,0x00000001,0x0004002b,
0x00000006,0x00000013,0x00000000,0x00040020,0x00000014,0x00000001,0x00000006,0x00040017,
0x00000017,0x00000006,0x00000004,0x00040020,0x00000018,0x00000007,0x00000017,0x0004002b,
0x00000006,0x0000001a,0x00000040,0x0004001c,0x0000001b,0x00000017,0x0000001a,0x0003001e,
0x0000001c,0x0000001b,0x00040020,0x0000001d,0x00000002,0x0000001c,0x0004003b,0x0000001d,
0x0000001e,0x00000002,0x00040015,0x0000001f,0x00000020,0x00000001,0x0004002b,0x0000001f,
0x00000020,0x00000000,0x00040020,0x00000023,0x00000002,0x00000017,0x00020014,0x00000026,
0x00040020,0x00000027,0x00000007,0x00000026,0x0004002b,0x00000006,0x0000002b,0x00000002,
0x00040017,0x00000033,0x00000026,0x00000002,0x0004002b,0x00000006,0x0000003f,0x00000001,
0x0004002b,0x00000006,0x00000043,0x00000003,0x00040020,0x00000048,0x00000007,0x00000007,
0x0004003b,0x00000011,0x0000004a,0x00000001,0x0004002b,0x00000006,0x0000004f,0x00000008,
0x0004002b,0x00000006,0x00000050,0x00000004,0x0005002c,0x00000007,0x00000051,0x0000004f,
0x00000050,0x0004002b,0x00000006,0x0000005c,0x00000020,0x00090019,0x00000067,0x00000006,
0x00000001,0x00000000,0x00000000,0x00000000,0x00000002,0x0000001e,0x00040020,0x00000068,
0x00000000,0x00000067,0x0004003b,0x00000068,0x00000069,0x00000000,0x00040017,0x0000006c,
0x0000001f,0x00000002,0x0006002c,0x00000010,0x00000072,0x0000005c,0x0000003f,0x0000003f,
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,
0x00000048,0x00000049,0x00000007,0x0004003b,0x00000048,0x0000004d,0x00000007,0x0004003b,
0x00000048,0x00000053,0x00000007,0x0004003b,0x00000048,0x00000056,0x00000007,0x0004003d,
0x00000010,0x0000004b,0x0000004a,0x0007004f,0x00000007,0x0000004c,0x0000004b,0x0000004b,
0x00000000,0x00000001,0x0003003e,0x00000049,0x0000004c,0x0004003d,0x00000007,0x0000004e,
0x00000049,0x00050084,0x00000007,0x00000052,0x0000004e,0x00000051,0x0003003e,0x0000004d,
0x00000052,0x0004003d,0x00000007,0x00000054,0x0000004d,0x00050080,0x00000007,0x00000055,
0x00000054,0x00000051,0x0003003e,0x00000053,0x00000055,0x0004003d,0x00000007,0x00000057,
0x0000004d,0x0004003d,0x00000007,0x00000058,0x00000053,0x00070039,0x00000007,0x00000059,
0x0000000c,0x00000013,0x00000057,0x00000058,0x00050051,0x00000006,0x0000005a,0x00000059,
0x00000000,0x00050041,0x0000000e,0x0000005b,0x00000056,0x00000013,0x0003003e,0x0000005b,
0x0000005a,0x0004003d,0x00000007,0x0000005d,0x0000004d,0x0004003d,0x00000007,0x0000005e,
0x00000053,0x00070039,0x00000007,0x0000005f,0x0000000c,0x0000005c,0x0000005d,0x0000005e,
0x00050051,0x00000006,0x00000060,0x0000005f,0x00000000,0x00050041,0x0000000e,0x00000061,
0x00000056,0x0000003f,0x0003003e,0x00000061,0x00000060,0x00050041,0x00000014,0x00000062,
0x00000012,0x00000013,0x0004003d,0x00000006,0x00000063,0x00000062,0x000500aa,0x00000026,
0x00000064,0x00000063,0x00000013,0x000300f7,0x00000066,0x00000000,0x000400fa,0x00000064,
0x00000065,0x00000066,0x000200f8,0x00000065,0x0004003d,0x00000067,0x0000006a,0x00000069,
0x0004003d,0x00000007,0x0000006b,0x00000049,0x0004007c,0x0000006c,0x0000006d,0x0000006b,
0x0004003d,0x00000007,0x0000006e,0x00000056,0x00050051,0x00000006,0x0000006f,0x0000006e,
0x00000000,0x00050051,0x00000006,0x00000070,0x0000006e,0x00000001,0x00070050,0x00000017,
0x00000071,0x0000006f,0x00000070,0x00000013,0x00000013,0x00040063,0x0000006a,0x0000006d,
0x00000071,0x000200f9,0x00000066,0x000200f8,0x00000066,0x000100fd,0x00010038,0x00050036,
0x00000007,0x0000000c,0x00000000,0x00000008,0x00030037,0x00000006,0x00000009,0x00030037,
0x00000007,0x0000000a,0x00030037,0x00000007,0x0000000b,0x000200f8,0x0000000d,0x0004003b,
0x0000000e,0x0000000f,0x00000007,0x0004003b,0x00000018,0x00000019,0x00000007,0x0004003b,
0x00000027,0x00000028,0x00000007,0x00050041,0x00000014,0x00000015,0x00000012,0x00000013,
0x0004003d,0x00000006,0x00000016,0x00000015,0x0003003e,0x0000000f,0x00000016,0x0004003d,
0x00000006,0x00000021,0x0000000f,0x00050080,0x00000006,0x00000022,0x00000009,0x00000021,
0x00060041,0x00000023,0x00000024,0x0000001e,0x00000020,0x00000022,0x0004003d,0x00000017,
0x00000025,0x00000024,0x0003003e,0x00000019,0x00000025,0x00050041,0x0000000e,0x00000029,
0x00000019,0x00000013,0x0004003d,0x00000006,0x0000002a,0x00000029,0x00050041,0x0000000e,
0x0000002c,0x00000019,0x0000002b,0x0004003d,0x00000006,0x0000002d,0x0000002c,0x000500b0,
0x00000026,0x0000002e,0x0000002a,0x0000002d,0x000300f7,0x00000030,0x00000000,0x000400fa,
0x0000002e,0x0000002f,0x00000030,0x000200f8,0x0000002f,0x0004003d,0x00000017,0x00000031,
0x00000019,0x0007004f,0x00000007,0x00000032,0x00000031,0x00000031,0x00000000,0x00000001,
0x000500b0,0x00000033,0x00000034,0x00000032,0x0000000b,0x0004009b,0x00000026,0x00000035,
0x00000034,0x000200f9,0x00000030,0x000200f8,0x00000030,0x000700f5,0x00000026,0x00000036,
0x0000002e,0x0000000d,0x00000035,0x0000002f,0x000300f7,0x00000038,0x00000000,0x000400fa,
0x00000036,0x00000037,0x00000038,0x000200f8,0x00000037,0x0004003d,0x00000017,0x00000039,
0x00000019,0x0007004f,0x00000007,0x0000003a,0x00000039,0x00000039,0x00000002,0x00000003,
0x000500ae,0x00000033,0x0000003b,0x0000003a,0x0000000a,0x0004009b,0x00000026,0x0000003c,
0x0000003b,0x000200f9,0x00000038,0x000200f8,0x00000038,0x000700f5,0x00000026,0x0000003d,
0x00000036,0x00000030,0x0000003c,0x00000037,0x0003003e,0x00000028,0x0000003d,0x0004003d,
0x00000026,0x0000003e,0x00000028,0x000600a9,0x00000006,0x00000040,0x0000003e,0x0000003f,
0x00000013,0x0004003d,0x00000006,0x00000041,0x0000000f,0x000500c4,0x00000006,0x00000042,
0x00000040,0x00000041,0x00060168,0x00000006,0x00000044,0x00000043,0x00000000,0x00000042,
0x00050050,0x00000007,0x00000045,0x00000044,0x00000013,0x000200fe,0x00000045,0x00010038
};
// Generated from:
//
// #version 450 core
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// #extension GL_KHR_shader_subgroup_arithmetic : require
//
// layout(local_size_x = 32, local_size_y = 1, local_size_z = 1)in;
//
// layout(set = 0, binding = 0, rgba32ui)uniform writeonly uimage2D culledWidgetsOut;
//
// layout(set = 0, binding = 1)uniform WidgetCoordinates
// {
// uvec4 coordinates[32 + 32];
// };
//
// uvec2 cullWidgets(const uint offset, const uvec2 blockCoordLow, const uvec2 blockCoordHigh)
// {
// const uint localId = gl_LocalInvocationID . x;
// const uvec4 widgetCoords = coordinates[offset + localId];
//
// const bool intersects = widgetCoords . x < widgetCoords . z &&
// all(lessThan(widgetCoords . xy, blockCoordHigh))&&
// all(greaterThanEqual(widgetCoords . zw, blockCoordLow));
//
// return uvec2(subgroupOr(uint(intersects)<< localId), 0);
//
// }
//
// void main()
// {
//
// const uvec2 outCoord = gl_WorkGroupID . xy;
// const uvec2 blockCoordLow = outCoord * uvec2(8, 4);
// const uvec2 blockCoordHigh = blockCoordLow + uvec2(8, 4);
//
// uvec2 culledWidgets;
//
// culledWidgets . x = cullWidgets(0, blockCoordLow, blockCoordHigh). x;
// culledWidgets . y = cullWidgets(32, blockCoordLow, blockCoordHigh). x;
//
// if(gl_LocalInvocationID . x == 0)
// {
// imageStore(culledWidgetsOut, ivec2(outCoord), uvec4(culledWidgets, 0, 0));
// }
// }

Просмотреть файл

@ -0,0 +1,162 @@
// 7.12.3226
#pragma once
const uint32_t kOverlayCull_comp_00000003[] = {
0x07230203,0x00010300,0x00080007,0x00000083,0x00000000,0x00020011,0x00000001,0x00020011,
0x0000003d,0x00020011,0x0000003f,0x0006000b,0x00000001,0x4c534c47,0x6474732e,0x3035342e,
0x00000000,0x0003000e,0x00000000,0x00000001,0x0007000f,0x00000005,0x00000004,0x6e69616d,
0x00000000,0x00000012,0x00000063,0x00060010,0x00000004,0x00000011,0x00000040,0x00000001,
0x00000001,0x00030003,0x00000002,0x000001c2,0x000b0004,0x455f4c47,0x735f5458,0x6c706d61,
0x656c7265,0x745f7373,0x75747865,0x665f6572,0x74636e75,0x736e6f69,0x00000000,0x000a0004,
0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,0x6f726762,0x615f7075,0x68746972,0x6974656d,
0x00000063,0x00090004,0x4b5f4c47,0x735f5248,0x65646168,0x75735f72,0x6f726762,0x625f7075,
0x63697361,0x00000000,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00080005,0x0000000c,
0x6c6c7563,0x67646957,0x28737465,0x763b3175,0x763b3275,0x003b3275,0x00040005,0x00000009,
0x7366666f,0x00007465,0x00060005,0x0000000a,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,
0x00060005,0x0000000b,0x636f6c62,0x6f6f436b,0x69486472,0x00006867,0x00040005,0x0000000f,
0x61636f6c,0x0064496c,0x00080005,0x00000012,0x4c5f6c67,0x6c61636f,0x6f766e49,0x69746163,
0x44496e6f,0x00000000,0x00060005,0x00000019,0x67646977,0x6f437465,0x7364726f,0x00000000,
0x00070005,0x0000001c,0x67646957,0x6f437465,0x6964726f,0x6574616e,0x00000073,0x00060006,
0x0000001c,0x00000000,0x726f6f63,0x616e6964,0x00736574,0x00030005,0x0000001e,0x00000000,
0x00050005,0x00000028,0x65746e69,0x63657372,0x00007374,0x00060005,0x0000003e,0x74786574,
0x67646957,0x69427465,0x00000074,0x00060005,0x0000004c,0x70617267,0x64695768,0x42746567,
0x00007469,0x00050005,0x00000062,0x4374756f,0x64726f6f,0x00000000,0x00060005,0x00000063,
0x575f6c67,0x476b726f,0x70756f72,0x00004449,0x00060005,0x00000066,0x636f6c62,0x6f6f436b,
0x6f4c6472,0x00000077,0x00060005,0x0000006b,0x636f6c62,0x6f6f436b,0x69486472,0x00006867,
0x00060005,0x0000006e,0x6c6c7563,0x69576465,0x74656764,0x00000073,0x00070005,0x00000079,
0x6c6c7563,0x69576465,0x74656764,0x74754f73,0x00000000,0x00040047,0x00000012,0x0000000b,
0x0000001b,0x00040047,0x0000001b,0x00000006,0x00000010,0x00050048,0x0000001c,0x00000000,
0x00000023,0x00000000,0x00030047,0x0000001c,0x00000002,0x00040047,0x0000001e,0x00000022,
0x00000000,0x00040047,0x0000001e,0x00000021,0x00000001,0x00040047,0x00000063,0x0000000b,
0x0000001a,0x00040047,0x00000079,0x00000022,0x00000000,0x00040047,0x00000079,0x00000021,
0x00000000,0x00030047,0x00000079,0x00000019,0x00040047,0x00000082,0x0000000b,0x00000019,
0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00040015,0x00000006,0x00000020,
0x00000000,0x00040017,0x00000007,0x00000006,0x00000002,0x00060021,0x00000008,0x00000007,
0x00000006,0x00000007,0x00000007,0x00040020,0x0000000e,0x00000007,0x00000006,0x00040017,
0x00000010,0x00000006,0x00000003,0x00040020,0x00000011,0x00000001,0x00000010,0x0004003b,
0x00000011,0x00000012,0x00000001,0x0004002b,0x00000006,0x00000013,0x00000000,0x00040020,
0x00000014,0x00000001,0x00000006,0x00040017,0x00000017,0x00000006,0x00000004,0x00040020,
0x00000018,0x00000007,0x00000017,0x0004002b,0x00000006,0x0000001a,0x00000040,0x0004001c,
0x0000001b,0x00000017,0x0000001a,0x0003001e,0x0000001c,0x0000001b,0x00040020,0x0000001d,
0x00000002,0x0000001c,0x0004003b,0x0000001d,0x0000001e,0x00000002,0x00040015,0x0000001f,
0x00000020,0x00000001,0x0004002b,0x0000001f,0x00000020,0x00000000,0x00040020,0x00000023,
0x00000002,0x00000017,0x00020014,0x00000026,0x00040020,0x00000027,0x00000007,0x00000026,
0x0004002b,0x00000006,0x0000002b,0x00000002,0x00040017,0x00000033,0x00000026,0x00000002,
0x0004002b,0x00000006,0x00000040,0x00000020,0x0004002b,0x00000006,0x00000046,0x00000001,
0x0004002b,0x00000006,0x0000005a,0x00000003,0x00040020,0x00000061,0x00000007,0x00000007,
0x0004003b,0x00000011,0x00000063,0x00000001,0x0004002b,0x00000006,0x00000068,0x00000008,
0x0005002c,0x00000007,0x00000069,0x00000068,0x00000068,0x00090019,0x00000077,0x00000006,
0x00000001,0x00000000,0x00000000,0x00000000,0x00000002,0x0000001e,0x00040020,0x00000078,
0x00000000,0x00000077,0x0004003b,0x00000078,0x00000079,0x00000000,0x00040017,0x0000007c,
0x0000001f,0x00000002,0x0006002c,0x00000010,0x00000082,0x0000001a,0x00000046,0x00000046,
0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,
0x00000061,0x00000062,0x00000007,0x0004003b,0x00000061,0x00000066,0x00000007,0x0004003b,
0x00000061,0x0000006b,0x00000007,0x0004003b,0x00000061,0x0000006e,0x00000007,0x0004003d,
0x00000010,0x00000064,0x00000063,0x0007004f,0x00000007,0x00000065,0x00000064,0x00000064,
0x00000000,0x00000001,0x0003003e,0x00000062,0x00000065,0x0004003d,0x00000007,0x00000067,
0x00000062,0x00050084,0x00000007,0x0000006a,0x00000067,0x00000069,0x0003003e,0x00000066,
0x0000006a,0x0004003d,0x00000007,0x0000006c,0x00000066,0x00050080,0x00000007,0x0000006d,
0x0000006c,0x00000069,0x0003003e,0x0000006b,0x0000006d,0x0004003d,0x00000007,0x0000006f,
0x00000066,0x0004003d,0x00000007,0x00000070,0x0000006b,0x00070039,0x00000007,0x00000071,
0x0000000c,0x00000013,0x0000006f,0x00000070,0x0003003e,0x0000006e,0x00000071,0x00050041,
0x00000014,0x00000072,0x00000012,0x00000013,0x0004003d,0x00000006,0x00000073,0x00000072,
0x000500aa,0x00000026,0x00000074,0x00000073,0x00000013,0x000300f7,0x00000076,0x00000000,
0x000400fa,0x00000074,0x00000075,0x00000076,0x000200f8,0x00000075,0x0004003d,0x00000077,
0x0000007a,0x00000079,0x0004003d,0x00000007,0x0000007b,0x00000062,0x0004007c,0x0000007c,
0x0000007d,0x0000007b,0x0004003d,0x00000007,0x0000007e,0x0000006e,0x00050051,0x00000006,
0x0000007f,0x0000007e,0x00000000,0x00050051,0x00000006,0x00000080,0x0000007e,0x00000001,
0x00070050,0x00000017,0x00000081,0x0000007f,0x00000080,0x00000013,0x00000013,0x00040063,
0x0000007a,0x0000007d,0x00000081,0x000200f9,0x00000076,0x000200f8,0x00000076,0x000100fd,
0x00010038,0x00050036,0x00000007,0x0000000c,0x00000000,0x00000008,0x00030037,0x00000006,
0x00000009,0x00030037,0x00000007,0x0000000a,0x00030037,0x00000007,0x0000000b,0x000200f8,
0x0000000d,0x0004003b,0x0000000e,0x0000000f,0x00000007,0x0004003b,0x00000018,0x00000019,
0x00000007,0x0004003b,0x00000027,0x00000028,0x00000007,0x0004003b,0x0000000e,0x0000003e,
0x00000007,0x0004003b,0x0000000e,0x00000042,0x00000007,0x0004003b,0x0000000e,0x0000004c,
0x00000007,0x0004003b,0x0000000e,0x0000004f,0x00000007,0x00050041,0x00000014,0x00000015,
0x00000012,0x00000013,0x0004003d,0x00000006,0x00000016,0x00000015,0x0003003e,0x0000000f,
0x00000016,0x0004003d,0x00000006,0x00000021,0x0000000f,0x00050080,0x00000006,0x00000022,
0x00000009,0x00000021,0x00060041,0x00000023,0x00000024,0x0000001e,0x00000020,0x00000022,
0x0004003d,0x00000017,0x00000025,0x00000024,0x0003003e,0x00000019,0x00000025,0x00050041,
0x0000000e,0x00000029,0x00000019,0x00000013,0x0004003d,0x00000006,0x0000002a,0x00000029,
0x00050041,0x0000000e,0x0000002c,0x00000019,0x0000002b,0x0004003d,0x00000006,0x0000002d,
0x0000002c,0x000500b0,0x00000026,0x0000002e,0x0000002a,0x0000002d,0x000300f7,0x00000030,
0x00000000,0x000400fa,0x0000002e,0x0000002f,0x00000030,0x000200f8,0x0000002f,0x0004003d,
0x00000017,0x00000031,0x00000019,0x0007004f,0x00000007,0x00000032,0x00000031,0x00000031,
0x00000000,0x00000001,0x000500b0,0x00000033,0x00000034,0x00000032,0x0000000b,0x0004009b,
0x00000026,0x00000035,0x00000034,0x000200f9,0x00000030,0x000200f8,0x00000030,0x000700f5,
0x00000026,0x00000036,0x0000002e,0x0000000d,0x00000035,0x0000002f,0x000300f7,0x00000038,
0x00000000,0x000400fa,0x00000036,0x00000037,0x00000038,0x000200f8,0x00000037,0x0004003d,
0x00000017,0x00000039,0x00000019,0x0007004f,0x00000007,0x0000003a,0x00000039,0x00000039,
0x00000002,0x00000003,0x000500ae,0x00000033,0x0000003b,0x0000003a,0x0000000a,0x0004009b,
0x00000026,0x0000003c,0x0000003b,0x000200f9,0x00000038,0x000200f8,0x00000038,0x000700f5,
0x00000026,0x0000003d,0x00000036,0x00000030,0x0000003c,0x00000037,0x0003003e,0x00000028,
0x0000003d,0x0004003d,0x00000006,0x0000003f,0x0000000f,0x000500b0,0x00000026,0x00000041,
0x0000003f,0x00000040,0x000300f7,0x00000044,0x00000000,0x000400fa,0x00000041,0x00000043,
0x0000004a,0x000200f8,0x00000043,0x0004003d,0x00000026,0x00000045,0x00000028,0x000600a9,
0x00000006,0x00000047,0x00000045,0x00000046,0x00000013,0x0004003d,0x00000006,0x00000048,
0x0000000f,0x000500c4,0x00000006,0x00000049,0x00000047,0x00000048,0x0003003e,0x00000042,
0x00000049,0x000200f9,0x00000044,0x000200f8,0x0000004a,0x0003003e,0x00000042,0x00000013,
0x000200f9,0x00000044,0x000200f8,0x00000044,0x0004003d,0x00000006,0x0000004b,0x00000042,
0x0003003e,0x0000003e,0x0000004b,0x0004003d,0x00000006,0x0000004d,0x0000000f,0x000500ae,
0x00000026,0x0000004e,0x0000004d,0x00000040,0x000300f7,0x00000051,0x00000000,0x000400fa,
0x0000004e,0x00000050,0x00000057,0x000200f8,0x00000050,0x0004003d,0x00000026,0x00000052,
0x00000028,0x000600a9,0x00000006,0x00000053,0x00000052,0x00000046,0x00000013,0x0004003d,
0x00000006,0x00000054,0x0000000f,0x00050082,0x00000006,0x00000055,0x00000054,0x00000040,
0x000500c4,0x00000006,0x00000056,0x00000053,0x00000055,0x0003003e,0x0000004f,0x00000056,
0x000200f9,0x00000051,0x000200f8,0x00000057,0x0003003e,0x0000004f,0x00000013,0x000200f9,
0x00000051,0x000200f8,0x00000051,0x0004003d,0x00000006,0x00000058,0x0000004f,0x0003003e,
0x0000004c,0x00000058,0x0004003d,0x00000006,0x00000059,0x0000003e,0x00060168,0x00000006,
0x0000005b,0x0000005a,0x00000000,0x00000059,0x0004003d,0x00000006,0x0000005c,0x0000004c,
0x00060168,0x00000006,0x0000005d,0x0000005a,0x00000000,0x0000005c,0x00050050,0x00000007,
0x0000005e,0x0000005b,0x0000005d,0x000200fe,0x0000005e,0x00010038
};
// Generated from:
//
// #version 450 core
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// #extension GL_KHR_shader_subgroup_arithmetic : require
//
// layout(local_size_x = 64, local_size_y = 1, local_size_z = 1)in;
//
// layout(set = 0, binding = 0, rgba32ui)uniform writeonly uimage2D culledWidgetsOut;
//
// layout(set = 0, binding = 1)uniform WidgetCoordinates
// {
// uvec4 coordinates[32 + 32];
// };
//
// uvec2 cullWidgets(const uint offset, const uvec2 blockCoordLow, const uvec2 blockCoordHigh)
// {
// const uint localId = gl_LocalInvocationID . x;
// const uvec4 widgetCoords = coordinates[offset + localId];
//
// const bool intersects = widgetCoords . x < widgetCoords . z &&
// all(lessThan(widgetCoords . xy, blockCoordHigh))&&
// all(greaterThanEqual(widgetCoords . zw, blockCoordLow));
//
// const uint textWidgetBit =
// localId < 32 ? uint(intersects)<< localId : 0;
// const uint graphWidgetBit =
// localId >= 32 ? uint(intersects)<<(localId - 32): 0;
// return uvec2(subgroupOr(textWidgetBit), subgroupOr(graphWidgetBit));
//
// }
//
// void main()
// {
//
// const uvec2 outCoord = gl_WorkGroupID . xy;
// const uvec2 blockCoordLow = outCoord * uvec2(8, 8);
// const uvec2 blockCoordHigh = blockCoordLow + uvec2(8, 8);
//
// uvec2 culledWidgets;
//
// culledWidgets = cullWidgets(0, blockCoordLow, blockCoordHigh);
//
// if(gl_LocalInvocationID . x == 0)
// {
// imageStore(culledWidgetsOut, ivec2(outCoord), uvec4(culledWidgets, 0, 0));
// }
// }

Просмотреть файл

@ -0,0 +1,226 @@
// 7.12.3226
#pragma once
const uint32_t kOverlayCull_comp_00000004[] = {
0x07230203,0x00010000,0x00080007,0x000000b9,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000005,0x00000004,0x6e69616d,0x00000000,0x00000053,0x00000093,0x00060010,
0x00000004,0x00000011,0x00000020,0x00000001,0x00000001,0x00030003,0x00000002,0x000001c2,
0x000b0004,0x455f4c47,0x735f5458,0x6c706d61,0x656c7265,0x745f7373,0x75747865,0x665f6572,
0x74636e75,0x736e6f69,0x00000000,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00080005,
0x00000009,0x75636361,0x616c756d,0x69576574,0x74656764,0x31752873,0x0000003b,0x00040005,
0x00000008,0x61636f6c,0x0064496c,0x00080005,0x00000010,0x6c6c7563,0x67646957,0x28737465,
0x763b3175,0x763b3275,0x003b3275,0x00040005,0x0000000d,0x7366666f,0x00007465,0x00060005,
0x0000000e,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,0x00060005,0x0000000f,0x636f6c62,
0x6f6f436b,0x69486472,0x00006867,0x00070005,0x0000001a,0x65746e69,0x63657372,0x676e6974,
0x67646957,0x00737465,0x00040005,0x00000050,0x61636f6c,0x0064496c,0x00080005,0x00000053,
0x4c5f6c67,0x6c61636f,0x6f766e49,0x69746163,0x44496e6f,0x00000000,0x00060005,0x0000005a,
0x67646977,0x6f437465,0x7364726f,0x00000000,0x00070005,0x0000005d,0x67646957,0x6f437465,
0x6964726f,0x6574616e,0x00000073,0x00060006,0x0000005d,0x00000000,0x726f6f63,0x616e6964,
0x00736574,0x00030005,0x0000005f,0x00000000,0x00050005,0x00000068,0x65746e69,0x63657372,
0x00007374,0x00040005,0x0000007e,0x6c6c6162,0x0000746f,0x00050005,0x00000092,0x4374756f,
0x64726f6f,0x00000000,0x00060005,0x00000093,0x575f6c67,0x476b726f,0x70756f72,0x00004449,
0x00060005,0x00000096,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,0x00060005,0x0000009a,
0x636f6c62,0x6f6f436b,0x69486472,0x00006867,0x00060005,0x0000009d,0x6c6c7563,0x69576465,
0x74656764,0x00000073,0x00070005,0x000000af,0x6c6c7563,0x69576465,0x74656764,0x74754f73,
0x00000000,0x00040047,0x00000053,0x0000000b,0x0000001b,0x00040047,0x0000005c,0x00000006,
0x00000010,0x00050048,0x0000005d,0x00000000,0x00000023,0x00000000,0x00030047,0x0000005d,
0x00000002,0x00040047,0x0000005f,0x00000022,0x00000000,0x00040047,0x0000005f,0x00000021,
0x00000001,0x00040047,0x00000093,0x0000000b,0x0000001a,0x00040047,0x000000af,0x00000022,
0x00000000,0x00040047,0x000000af,0x00000021,0x00000000,0x00030047,0x000000af,0x00000019,
0x00040047,0x000000b8,0x0000000b,0x00000019,0x00020013,0x00000002,0x00030021,0x00000003,
0x00000002,0x00040015,0x00000006,0x00000020,0x00000000,0x00040021,0x00000007,0x00000002,
0x00000006,0x00040017,0x0000000b,0x00000006,0x00000002,0x00060021,0x0000000c,0x0000000b,
0x00000006,0x0000000b,0x0000000b,0x0004002b,0x00000006,0x00000012,0x00000010,0x00020014,
0x00000013,0x0004002b,0x00000006,0x00000017,0x00000020,0x0004001c,0x00000018,0x00000006,
0x00000017,0x00040020,0x00000019,0x00000004,0x00000018,0x0004003b,0x00000019,0x0000001a,
0x00000004,0x00040020,0x0000001c,0x00000004,0x00000006,0x0004002b,0x00000006,0x00000023,
0x00000008,0x0004002b,0x00000006,0x0000002e,0x00000004,0x0004002b,0x00000006,0x00000039,
0x00000002,0x0004002b,0x00000006,0x00000044,0x00000001,0x00040020,0x0000004f,0x00000007,
0x00000006,0x00040017,0x00000051,0x00000006,0x00000003,0x00040020,0x00000052,0x00000001,
0x00000051,0x0004003b,0x00000052,0x00000053,0x00000001,0x0004002b,0x00000006,0x00000054,
0x00000000,0x00040020,0x00000055,0x00000001,0x00000006,0x00040017,0x00000058,0x00000006,
0x00000004,0x00040020,0x00000059,0x00000007,0x00000058,0x0004002b,0x00000006,0x0000005b,
0x00000040,0x0004001c,0x0000005c,0x00000058,0x0000005b,0x0003001e,0x0000005d,0x0000005c,
0x00040020,0x0000005e,0x00000002,0x0000005d,0x0004003b,0x0000005e,0x0000005f,0x00000002,
0x00040015,0x00000060,0x00000020,0x00000001,0x0004002b,0x00000060,0x00000061,0x00000000,
0x00040020,0x00000064,0x00000002,0x00000058,0x00040020,0x00000067,0x00000007,0x00000013,
0x00040017,0x00000072,0x00000013,0x00000002,0x00040020,0x0000007d,0x00000007,0x0000000b,
0x0005002c,0x0000000b,0x0000007f,0x00000054,0x00000054,0x0004003b,0x00000052,0x00000093,
0x00000001,0x0005002c,0x0000000b,0x00000098,0x00000023,0x0000002e,0x00090019,0x000000ad,
0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000002,0x0000001e,0x00040020,
0x000000ae,0x00000000,0x000000ad,0x0004003b,0x000000ae,0x000000af,0x00000000,0x00040017,
0x000000b2,0x00000060,0x00000002,0x0006002c,0x00000051,0x000000b8,0x00000017,0x00000044,
0x00000044,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,
0x0004003b,0x0000007d,0x00000092,0x00000007,0x0004003b,0x0000007d,0x00000096,0x00000007,
0x0004003b,0x0000007d,0x0000009a,0x00000007,0x0004003b,0x0000007d,0x0000009d,0x00000007,
0x0004003d,0x00000051,0x00000094,0x00000093,0x0007004f,0x0000000b,0x00000095,0x00000094,
0x00000094,0x00000000,0x00000001,0x0003003e,0x00000092,0x00000095,0x0004003d,0x0000000b,
0x00000097,0x00000092,0x00050084,0x0000000b,0x00000099,0x00000097,0x00000098,0x0003003e,
0x00000096,0x00000099,0x0004003d,0x0000000b,0x0000009b,0x00000096,0x00050080,0x0000000b,
0x0000009c,0x0000009b,0x00000098,0x0003003e,0x0000009a,0x0000009c,0x0004003d,0x0000000b,
0x0000009e,0x00000096,0x0004003d,0x0000000b,0x0000009f,0x0000009a,0x00070039,0x0000000b,
0x000000a0,0x00000010,0x00000054,0x0000009e,0x0000009f,0x00050051,0x00000006,0x000000a1,
0x000000a0,0x00000000,0x00050041,0x0000004f,0x000000a2,0x0000009d,0x00000054,0x0003003e,
0x000000a2,0x000000a1,0x0004003d,0x0000000b,0x000000a3,0x00000096,0x0004003d,0x0000000b,
0x000000a4,0x0000009a,0x00070039,0x0000000b,0x000000a5,0x00000010,0x00000017,0x000000a3,
0x000000a4,0x00050051,0x00000006,0x000000a6,0x000000a5,0x00000000,0x00050041,0x0000004f,
0x000000a7,0x0000009d,0x00000044,0x0003003e,0x000000a7,0x000000a6,0x00050041,0x00000055,
0x000000a8,0x00000053,0x00000054,0x0004003d,0x00000006,0x000000a9,0x000000a8,0x000500aa,
0x00000013,0x000000aa,0x000000a9,0x00000054,0x000300f7,0x000000ac,0x00000000,0x000400fa,
0x000000aa,0x000000ab,0x000000ac,0x000200f8,0x000000ab,0x0004003d,0x000000ad,0x000000b0,
0x000000af,0x0004003d,0x0000000b,0x000000b1,0x00000092,0x0004007c,0x000000b2,0x000000b3,
0x000000b1,0x0004003d,0x0000000b,0x000000b4,0x0000009d,0x00050051,0x00000006,0x000000b5,
0x000000b4,0x00000000,0x00050051,0x00000006,0x000000b6,0x000000b4,0x00000001,0x00070050,
0x00000058,0x000000b7,0x000000b5,0x000000b6,0x00000054,0x00000054,0x00040063,0x000000b0,
0x000000b3,0x000000b7,0x000200f9,0x000000ac,0x000200f8,0x000000ac,0x000100fd,0x00010038,
0x00050036,0x00000002,0x00000009,0x00000000,0x00000007,0x00030037,0x00000006,0x00000008,
0x000200f8,0x0000000a,0x000500b0,0x00000013,0x00000014,0x00000008,0x00000012,0x000300f7,
0x00000016,0x00000000,0x000400fa,0x00000014,0x00000015,0x00000016,0x000200f8,0x00000015,
0x00050080,0x00000006,0x0000001b,0x00000008,0x00000012,0x00050041,0x0000001c,0x0000001d,
0x0000001a,0x0000001b,0x0004003d,0x00000006,0x0000001e,0x0000001d,0x00050041,0x0000001c,
0x0000001f,0x0000001a,0x00000008,0x0004003d,0x00000006,0x00000020,0x0000001f,0x000500c5,
0x00000006,0x00000021,0x00000020,0x0000001e,0x00050041,0x0000001c,0x00000022,0x0000001a,
0x00000008,0x0003003e,0x00000022,0x00000021,0x000500b0,0x00000013,0x00000024,0x00000008,
0x00000023,0x000300f7,0x00000026,0x00000000,0x000400fa,0x00000024,0x00000025,0x00000026,
0x000200f8,0x00000025,0x00050080,0x00000006,0x00000027,0x00000008,0x00000023,0x00050041,
0x0000001c,0x00000028,0x0000001a,0x00000027,0x0004003d,0x00000006,0x00000029,0x00000028,
0x00050041,0x0000001c,0x0000002a,0x0000001a,0x00000008,0x0004003d,0x00000006,0x0000002b,
0x0000002a,0x000500c5,0x00000006,0x0000002c,0x0000002b,0x00000029,0x00050041,0x0000001c,
0x0000002d,0x0000001a,0x00000008,0x0003003e,0x0000002d,0x0000002c,0x000500b0,0x00000013,
0x0000002f,0x00000008,0x0000002e,0x000300f7,0x00000031,0x00000000,0x000400fa,0x0000002f,
0x00000030,0x00000031,0x000200f8,0x00000030,0x00050080,0x00000006,0x00000032,0x00000008,
0x0000002e,0x00050041,0x0000001c,0x00000033,0x0000001a,0x00000032,0x0004003d,0x00000006,
0x00000034,0x00000033,0x00050041,0x0000001c,0x00000035,0x0000001a,0x00000008,0x0004003d,
0x00000006,0x00000036,0x00000035,0x000500c5,0x00000006,0x00000037,0x00000036,0x00000034,
0x00050041,0x0000001c,0x00000038,0x0000001a,0x00000008,0x0003003e,0x00000038,0x00000037,
0x000500b0,0x00000013,0x0000003a,0x00000008,0x00000039,0x000300f7,0x0000003c,0x00000000,
0x000400fa,0x0000003a,0x0000003b,0x0000003c,0x000200f8,0x0000003b,0x00050080,0x00000006,
0x0000003d,0x00000008,0x00000039,0x00050041,0x0000001c,0x0000003e,0x0000001a,0x0000003d,
0x0004003d,0x00000006,0x0000003f,0x0000003e,0x00050041,0x0000001c,0x00000040,0x0000001a,
0x00000008,0x0004003d,0x00000006,0x00000041,0x00000040,0x000500c5,0x00000006,0x00000042,
0x00000041,0x0000003f,0x00050041,0x0000001c,0x00000043,0x0000001a,0x00000008,0x0003003e,
0x00000043,0x00000042,0x000500b0,0x00000013,0x00000045,0x00000008,0x00000044,0x000300f7,
0x00000047,0x00000000,0x000400fa,0x00000045,0x00000046,0x00000047,0x000200f8,0x00000046,
0x00050080,0x00000006,0x00000048,0x00000008,0x00000044,0x00050041,0x0000001c,0x00000049,
0x0000001a,0x00000048,0x0004003d,0x00000006,0x0000004a,0x00000049,0x00050041,0x0000001c,
0x0000004b,0x0000001a,0x00000008,0x0004003d,0x00000006,0x0000004c,0x0000004b,0x000500c5,
0x00000006,0x0000004d,0x0000004c,0x0000004a,0x00050041,0x0000001c,0x0000004e,0x0000001a,
0x00000008,0x0003003e,0x0000004e,0x0000004d,0x000200f9,0x00000047,0x000200f8,0x00000047,
0x000200f9,0x0000003c,0x000200f8,0x0000003c,0x000200f9,0x00000031,0x000200f8,0x00000031,
0x000200f9,0x00000026,0x000200f8,0x00000026,0x000200f9,0x00000016,0x000200f8,0x00000016,
0x000100fd,0x00010038,0x00050036,0x0000000b,0x00000010,0x00000000,0x0000000c,0x00030037,
0x00000006,0x0000000d,0x00030037,0x0000000b,0x0000000e,0x00030037,0x0000000b,0x0000000f,
0x000200f8,0x00000011,0x0004003b,0x0000004f,0x00000050,0x00000007,0x0004003b,0x00000059,
0x0000005a,0x00000007,0x0004003b,0x00000067,0x00000068,0x00000007,0x0004003b,0x0000007d,
0x0000007e,0x00000007,0x00050041,0x00000055,0x00000056,0x00000053,0x00000054,0x0004003d,
0x00000006,0x00000057,0x00000056,0x0003003e,0x00000050,0x00000057,0x0004003d,0x00000006,
0x00000062,0x00000050,0x00050080,0x00000006,0x00000063,0x0000000d,0x00000062,0x00060041,
0x00000064,0x00000065,0x0000005f,0x00000061,0x00000063,0x0004003d,0x00000058,0x00000066,
0x00000065,0x0003003e,0x0000005a,0x00000066,0x00050041,0x0000004f,0x00000069,0x0000005a,
0x00000054,0x0004003d,0x00000006,0x0000006a,0x00000069,0x00050041,0x0000004f,0x0000006b,
0x0000005a,0x00000039,0x0004003d,0x00000006,0x0000006c,0x0000006b,0x000500b0,0x00000013,
0x0000006d,0x0000006a,0x0000006c,0x000300f7,0x0000006f,0x00000000,0x000400fa,0x0000006d,
0x0000006e,0x0000006f,0x000200f8,0x0000006e,0x0004003d,0x00000058,0x00000070,0x0000005a,
0x0007004f,0x0000000b,0x00000071,0x00000070,0x00000070,0x00000000,0x00000001,0x000500b0,
0x00000072,0x00000073,0x00000071,0x0000000f,0x0004009b,0x00000013,0x00000074,0x00000073,
0x000200f9,0x0000006f,0x000200f8,0x0000006f,0x000700f5,0x00000013,0x00000075,0x0000006d,
0x00000011,0x00000074,0x0000006e,0x000300f7,0x00000077,0x00000000,0x000400fa,0x00000075,
0x00000076,0x00000077,0x000200f8,0x00000076,0x0004003d,0x00000058,0x00000078,0x0000005a,
0x0007004f,0x0000000b,0x00000079,0x00000078,0x00000078,0x00000002,0x00000003,0x000500ae,
0x00000072,0x0000007a,0x00000079,0x0000000e,0x0004009b,0x00000013,0x0000007b,0x0000007a,
0x000200f9,0x00000077,0x000200f8,0x00000077,0x000700f5,0x00000013,0x0000007c,0x00000075,
0x0000006f,0x0000007b,0x00000076,0x0003003e,0x00000068,0x0000007c,0x0003003e,0x0000007e,
0x0000007f,0x0004003d,0x00000006,0x00000080,0x00000050,0x0004003d,0x00000013,0x00000081,
0x00000068,0x000600a9,0x00000006,0x00000082,0x00000081,0x00000044,0x00000054,0x0004003d,
0x00000006,0x00000083,0x00000050,0x000500c4,0x00000006,0x00000084,0x00000082,0x00000083,
0x00050041,0x0000001c,0x00000085,0x0000001a,0x00000080,0x0003003e,0x00000085,0x00000084,
0x0004003d,0x00000006,0x00000086,0x00000050,0x00050039,0x00000002,0x00000087,0x00000009,
0x00000086,0x0004003d,0x00000006,0x00000088,0x00000050,0x000500aa,0x00000013,0x00000089,
0x00000088,0x00000054,0x000300f7,0x0000008b,0x00000000,0x000400fa,0x00000089,0x0000008a,
0x0000008b,0x000200f8,0x0000008a,0x00050041,0x0000001c,0x0000008c,0x0000001a,0x00000061,
0x0004003d,0x00000006,0x0000008d,0x0000008c,0x00050041,0x0000004f,0x0000008e,0x0000007e,
0x00000054,0x0003003e,0x0000008e,0x0000008d,0x000200f9,0x0000008b,0x000200f8,0x0000008b,
0x0004003d,0x0000000b,0x0000008f,0x0000007e,0x000200fe,0x0000008f,0x00010038
};
// Generated from:
//
// #version 450 core
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// layout(local_size_x = 32, local_size_y = 1, local_size_z = 1)in;
//
// layout(set = 0, binding = 0, rgba32ui)uniform writeonly uimage2D culledWidgetsOut;
//
// layout(set = 0, binding = 1)uniform WidgetCoordinates
// {
// uvec4 coordinates[32 + 32];
// };
//
// shared uint intersectingWidgets[32];
//
// void accumulateWidgets(const uint localId)
// {
//
// if(localId < 16)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 16];
// if(localId < 8)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 8];
// if(localId < 4)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 4];
// if(localId < 2)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 2];
// if(localId < 1)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 1];
// }
// }
// }
// }
// }
// }
//
// uvec2 cullWidgets(const uint offset, const uvec2 blockCoordLow, const uvec2 blockCoordHigh)
// {
// const uint localId = gl_LocalInvocationID . x;
// const uvec4 widgetCoords = coordinates[offset + localId];
//
// const bool intersects = widgetCoords . x < widgetCoords . z &&
// all(lessThan(widgetCoords . xy, blockCoordHigh))&&
// all(greaterThanEqual(widgetCoords . zw, blockCoordLow));
//
// uvec2 ballot = uvec2(0, 0);
//
// intersectingWidgets[localId]= uint(intersects)<< localId;
// accumulateWidgets(localId);
// if(localId == 0)
// {
// ballot . x = intersectingWidgets[0];
// }
//
// return ballot;
//
// }
//
// void main()
// {
//
// const uvec2 outCoord = gl_WorkGroupID . xy;
// const uvec2 blockCoordLow = outCoord * uvec2(8, 4);
// const uvec2 blockCoordHigh = blockCoordLow + uvec2(8, 4);
//
// uvec2 culledWidgets;
//
// culledWidgets . x = cullWidgets(0, blockCoordLow, blockCoordHigh). x;
// culledWidgets . y = cullWidgets(32, blockCoordLow, blockCoordHigh). x;
//
// if(gl_LocalInvocationID . x == 0)
// {
// imageStore(culledWidgetsOut, ivec2(outCoord), uvec4(culledWidgets, 0, 0));
// }
// }

Просмотреть файл

@ -0,0 +1,249 @@
// 7.12.3226
#pragma once
const uint32_t kOverlayCull_comp_00000005[] = {
0x07230203,0x00010000,0x00080007,0x000000c9,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000005,0x00000004,0x6e69616d,0x00000000,0x00000053,0x000000aa,0x00060010,
0x00000004,0x00000011,0x00000040,0x00000001,0x00000001,0x00030003,0x00000002,0x000001c2,
0x000b0004,0x455f4c47,0x735f5458,0x6c706d61,0x656c7265,0x745f7373,0x75747865,0x665f6572,
0x74636e75,0x736e6f69,0x00000000,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00080005,
0x00000009,0x75636361,0x616c756d,0x69576574,0x74656764,0x31752873,0x0000003b,0x00040005,
0x00000008,0x61636f6c,0x0064496c,0x00080005,0x00000010,0x6c6c7563,0x67646957,0x28737465,
0x763b3175,0x763b3275,0x003b3275,0x00040005,0x0000000d,0x7366666f,0x00007465,0x00060005,
0x0000000e,0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,0x00060005,0x0000000f,0x636f6c62,
0x6f6f436b,0x69486472,0x00006867,0x00070005,0x0000001a,0x65746e69,0x63657372,0x676e6974,
0x67646957,0x00737465,0x00040005,0x00000050,0x61636f6c,0x0064496c,0x00080005,0x00000053,
0x4c5f6c67,0x6c61636f,0x6f766e49,0x69746163,0x44496e6f,0x00000000,0x00060005,0x0000005a,
0x67646977,0x6f437465,0x7364726f,0x00000000,0x00070005,0x0000005d,0x67646957,0x6f437465,
0x6964726f,0x6574616e,0x00000073,0x00060006,0x0000005d,0x00000000,0x726f6f63,0x616e6964,
0x00736574,0x00030005,0x0000005f,0x00000000,0x00050005,0x00000068,0x65746e69,0x63657372,
0x00007374,0x00040005,0x0000007e,0x6c6c6162,0x0000746f,0x00060005,0x00000094,0x70617267,
0x636f4c68,0x64496c61,0x00000000,0x00050005,0x000000a9,0x4374756f,0x64726f6f,0x00000000,
0x00060005,0x000000aa,0x575f6c67,0x476b726f,0x70756f72,0x00004449,0x00060005,0x000000ad,
0x636f6c62,0x6f6f436b,0x6f4c6472,0x00000077,0x00060005,0x000000b1,0x636f6c62,0x6f6f436b,
0x69486472,0x00006867,0x00060005,0x000000b4,0x6c6c7563,0x69576465,0x74656764,0x00000073,
0x00070005,0x000000bf,0x6c6c7563,0x69576465,0x74656764,0x74754f73,0x00000000,0x00040047,
0x00000053,0x0000000b,0x0000001b,0x00040047,0x0000005c,0x00000006,0x00000010,0x00050048,
0x0000005d,0x00000000,0x00000023,0x00000000,0x00030047,0x0000005d,0x00000002,0x00040047,
0x0000005f,0x00000022,0x00000000,0x00040047,0x0000005f,0x00000021,0x00000001,0x00040047,
0x000000aa,0x0000000b,0x0000001a,0x00040047,0x000000bf,0x00000022,0x00000000,0x00040047,
0x000000bf,0x00000021,0x00000000,0x00030047,0x000000bf,0x00000019,0x00040047,0x000000c8,
0x0000000b,0x00000019,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00040015,
0x00000006,0x00000020,0x00000000,0x00040021,0x00000007,0x00000002,0x00000006,0x00040017,
0x0000000b,0x00000006,0x00000002,0x00060021,0x0000000c,0x0000000b,0x00000006,0x0000000b,
0x0000000b,0x0004002b,0x00000006,0x00000012,0x00000010,0x00020014,0x00000013,0x0004002b,
0x00000006,0x00000017,0x00000020,0x0004001c,0x00000018,0x00000006,0x00000017,0x00040020,
0x00000019,0x00000004,0x00000018,0x0004003b,0x00000019,0x0000001a,0x00000004,0x00040020,
0x0000001c,0x00000004,0x00000006,0x0004002b,0x00000006,0x00000023,0x00000008,0x0004002b,
0x00000006,0x0000002e,0x00000004,0x0004002b,0x00000006,0x00000039,0x00000002,0x0004002b,
0x00000006,0x00000044,0x00000001,0x00040020,0x0000004f,0x00000007,0x00000006,0x00040017,
0x00000051,0x00000006,0x00000003,0x00040020,0x00000052,0x00000001,0x00000051,0x0004003b,
0x00000052,0x00000053,0x00000001,0x0004002b,0x00000006,0x00000054,0x00000000,0x00040020,
0x00000055,0x00000001,0x00000006,0x00040017,0x00000058,0x00000006,0x00000004,0x00040020,
0x00000059,0x00000007,0x00000058,0x0004002b,0x00000006,0x0000005b,0x00000040,0x0004001c,
0x0000005c,0x00000058,0x0000005b,0x0003001e,0x0000005d,0x0000005c,0x00040020,0x0000005e,
0x00000002,0x0000005d,0x0004003b,0x0000005e,0x0000005f,0x00000002,0x00040015,0x00000060,
0x00000020,0x00000001,0x0004002b,0x00000060,0x00000061,0x00000000,0x00040020,0x00000064,
0x00000002,0x00000058,0x00040020,0x00000067,0x00000007,0x00000013,0x00040017,0x00000072,
0x00000013,0x00000002,0x00040020,0x0000007d,0x00000007,0x0000000b,0x0005002c,0x0000000b,
0x0000007f,0x00000054,0x00000054,0x0004003b,0x00000052,0x000000aa,0x00000001,0x0005002c,
0x0000000b,0x000000af,0x00000023,0x00000023,0x00090019,0x000000bd,0x00000006,0x00000001,
0x00000000,0x00000000,0x00000000,0x00000002,0x0000001e,0x00040020,0x000000be,0x00000000,
0x000000bd,0x0004003b,0x000000be,0x000000bf,0x00000000,0x00040017,0x000000c2,0x00000060,
0x00000002,0x0006002c,0x00000051,0x000000c8,0x0000005b,0x00000044,0x00000044,0x00050036,
0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003b,0x0000007d,
0x000000a9,0x00000007,0x0004003b,0x0000007d,0x000000ad,0x00000007,0x0004003b,0x0000007d,
0x000000b1,0x00000007,0x0004003b,0x0000007d,0x000000b4,0x00000007,0x0004003d,0x00000051,
0x000000ab,0x000000aa,0x0007004f,0x0000000b,0x000000ac,0x000000ab,0x000000ab,0x00000000,
0x00000001,0x0003003e,0x000000a9,0x000000ac,0x0004003d,0x0000000b,0x000000ae,0x000000a9,
0x00050084,0x0000000b,0x000000b0,0x000000ae,0x000000af,0x0003003e,0x000000ad,0x000000b0,
0x0004003d,0x0000000b,0x000000b2,0x000000ad,0x00050080,0x0000000b,0x000000b3,0x000000b2,
0x000000af,0x0003003e,0x000000b1,0x000000b3,0x0004003d,0x0000000b,0x000000b5,0x000000ad,
0x0004003d,0x0000000b,0x000000b6,0x000000b1,0x00070039,0x0000000b,0x000000b7,0x00000010,
0x00000054,0x000000b5,0x000000b6,0x0003003e,0x000000b4,0x000000b7,0x00050041,0x00000055,
0x000000b8,0x00000053,0x00000054,0x0004003d,0x00000006,0x000000b9,0x000000b8,0x000500aa,
0x00000013,0x000000ba,0x000000b9,0x00000054,0x000300f7,0x000000bc,0x00000000,0x000400fa,
0x000000ba,0x000000bb,0x000000bc,0x000200f8,0x000000bb,0x0004003d,0x000000bd,0x000000c0,
0x000000bf,0x0004003d,0x0000000b,0x000000c1,0x000000a9,0x0004007c,0x000000c2,0x000000c3,
0x000000c1,0x0004003d,0x0000000b,0x000000c4,0x000000b4,0x00050051,0x00000006,0x000000c5,
0x000000c4,0x00000000,0x00050051,0x00000006,0x000000c6,0x000000c4,0x00000001,0x00070050,
0x00000058,0x000000c7,0x000000c5,0x000000c6,0x00000054,0x00000054,0x00040063,0x000000c0,
0x000000c3,0x000000c7,0x000200f9,0x000000bc,0x000200f8,0x000000bc,0x000100fd,0x00010038,
0x00050036,0x00000002,0x00000009,0x00000000,0x00000007,0x00030037,0x00000006,0x00000008,
0x000200f8,0x0000000a,0x000500b0,0x00000013,0x00000014,0x00000008,0x00000012,0x000300f7,
0x00000016,0x00000000,0x000400fa,0x00000014,0x00000015,0x00000016,0x000200f8,0x00000015,
0x00050080,0x00000006,0x0000001b,0x00000008,0x00000012,0x00050041,0x0000001c,0x0000001d,
0x0000001a,0x0000001b,0x0004003d,0x00000006,0x0000001e,0x0000001d,0x00050041,0x0000001c,
0x0000001f,0x0000001a,0x00000008,0x0004003d,0x00000006,0x00000020,0x0000001f,0x000500c5,
0x00000006,0x00000021,0x00000020,0x0000001e,0x00050041,0x0000001c,0x00000022,0x0000001a,
0x00000008,0x0003003e,0x00000022,0x00000021,0x000500b0,0x00000013,0x00000024,0x00000008,
0x00000023,0x000300f7,0x00000026,0x00000000,0x000400fa,0x00000024,0x00000025,0x00000026,
0x000200f8,0x00000025,0x00050080,0x00000006,0x00000027,0x00000008,0x00000023,0x00050041,
0x0000001c,0x00000028,0x0000001a,0x00000027,0x0004003d,0x00000006,0x00000029,0x00000028,
0x00050041,0x0000001c,0x0000002a,0x0000001a,0x00000008,0x0004003d,0x00000006,0x0000002b,
0x0000002a,0x000500c5,0x00000006,0x0000002c,0x0000002b,0x00000029,0x00050041,0x0000001c,
0x0000002d,0x0000001a,0x00000008,0x0003003e,0x0000002d,0x0000002c,0x000500b0,0x00000013,
0x0000002f,0x00000008,0x0000002e,0x000300f7,0x00000031,0x00000000,0x000400fa,0x0000002f,
0x00000030,0x00000031,0x000200f8,0x00000030,0x00050080,0x00000006,0x00000032,0x00000008,
0x0000002e,0x00050041,0x0000001c,0x00000033,0x0000001a,0x00000032,0x0004003d,0x00000006,
0x00000034,0x00000033,0x00050041,0x0000001c,0x00000035,0x0000001a,0x00000008,0x0004003d,
0x00000006,0x00000036,0x00000035,0x000500c5,0x00000006,0x00000037,0x00000036,0x00000034,
0x00050041,0x0000001c,0x00000038,0x0000001a,0x00000008,0x0003003e,0x00000038,0x00000037,
0x000500b0,0x00000013,0x0000003a,0x00000008,0x00000039,0x000300f7,0x0000003c,0x00000000,
0x000400fa,0x0000003a,0x0000003b,0x0000003c,0x000200f8,0x0000003b,0x00050080,0x00000006,
0x0000003d,0x00000008,0x00000039,0x00050041,0x0000001c,0x0000003e,0x0000001a,0x0000003d,
0x0004003d,0x00000006,0x0000003f,0x0000003e,0x00050041,0x0000001c,0x00000040,0x0000001a,
0x00000008,0x0004003d,0x00000006,0x00000041,0x00000040,0x000500c5,0x00000006,0x00000042,
0x00000041,0x0000003f,0x00050041,0x0000001c,0x00000043,0x0000001a,0x00000008,0x0003003e,
0x00000043,0x00000042,0x000500b0,0x00000013,0x00000045,0x00000008,0x00000044,0x000300f7,
0x00000047,0x00000000,0x000400fa,0x00000045,0x00000046,0x00000047,0x000200f8,0x00000046,
0x00050080,0x00000006,0x00000048,0x00000008,0x00000044,0x00050041,0x0000001c,0x00000049,
0x0000001a,0x00000048,0x0004003d,0x00000006,0x0000004a,0x00000049,0x00050041,0x0000001c,
0x0000004b,0x0000001a,0x00000008,0x0004003d,0x00000006,0x0000004c,0x0000004b,0x000500c5,
0x00000006,0x0000004d,0x0000004c,0x0000004a,0x00050041,0x0000001c,0x0000004e,0x0000001a,
0x00000008,0x0003003e,0x0000004e,0x0000004d,0x000200f9,0x00000047,0x000200f8,0x00000047,
0x000200f9,0x0000003c,0x000200f8,0x0000003c,0x000200f9,0x00000031,0x000200f8,0x00000031,
0x000200f9,0x00000026,0x000200f8,0x00000026,0x000200f9,0x00000016,0x000200f8,0x00000016,
0x000100fd,0x00010038,0x00050036,0x0000000b,0x00000010,0x00000000,0x0000000c,0x00030037,
0x00000006,0x0000000d,0x00030037,0x0000000b,0x0000000e,0x00030037,0x0000000b,0x0000000f,
0x000200f8,0x00000011,0x0004003b,0x0000004f,0x00000050,0x00000007,0x0004003b,0x00000059,
0x0000005a,0x00000007,0x0004003b,0x00000067,0x00000068,0x00000007,0x0004003b,0x0000007d,
0x0000007e,0x00000007,0x0004003b,0x0000004f,0x00000094,0x00000007,0x00050041,0x00000055,
0x00000056,0x00000053,0x00000054,0x0004003d,0x00000006,0x00000057,0x00000056,0x0003003e,
0x00000050,0x00000057,0x0004003d,0x00000006,0x00000062,0x00000050,0x00050080,0x00000006,
0x00000063,0x0000000d,0x00000062,0x00060041,0x00000064,0x00000065,0x0000005f,0x00000061,
0x00000063,0x0004003d,0x00000058,0x00000066,0x00000065,0x0003003e,0x0000005a,0x00000066,
0x00050041,0x0000004f,0x00000069,0x0000005a,0x00000054,0x0004003d,0x00000006,0x0000006a,
0x00000069,0x00050041,0x0000004f,0x0000006b,0x0000005a,0x00000039,0x0004003d,0x00000006,
0x0000006c,0x0000006b,0x000500b0,0x00000013,0x0000006d,0x0000006a,0x0000006c,0x000300f7,
0x0000006f,0x00000000,0x000400fa,0x0000006d,0x0000006e,0x0000006f,0x000200f8,0x0000006e,
0x0004003d,0x00000058,0x00000070,0x0000005a,0x0007004f,0x0000000b,0x00000071,0x00000070,
0x00000070,0x00000000,0x00000001,0x000500b0,0x00000072,0x00000073,0x00000071,0x0000000f,
0x0004009b,0x00000013,0x00000074,0x00000073,0x000200f9,0x0000006f,0x000200f8,0x0000006f,
0x000700f5,0x00000013,0x00000075,0x0000006d,0x00000011,0x00000074,0x0000006e,0x000300f7,
0x00000077,0x00000000,0x000400fa,0x00000075,0x00000076,0x00000077,0x000200f8,0x00000076,
0x0004003d,0x00000058,0x00000078,0x0000005a,0x0007004f,0x0000000b,0x00000079,0x00000078,
0x00000078,0x00000002,0x00000003,0x000500ae,0x00000072,0x0000007a,0x00000079,0x0000000e,
0x0004009b,0x00000013,0x0000007b,0x0000007a,0x000200f9,0x00000077,0x000200f8,0x00000077,
0x000700f5,0x00000013,0x0000007c,0x00000075,0x0000006f,0x0000007b,0x00000076,0x0003003e,
0x00000068,0x0000007c,0x0003003e,0x0000007e,0x0000007f,0x0004003d,0x00000006,0x00000080,
0x00000050,0x000500b0,0x00000013,0x00000081,0x00000080,0x00000017,0x000300f7,0x00000083,
0x00000000,0x000400fa,0x00000081,0x00000082,0x00000093,0x000200f8,0x00000082,0x0004003d,
0x00000006,0x00000084,0x00000050,0x0004003d,0x00000013,0x00000085,0x00000068,0x000600a9,
0x00000006,0x00000086,0x00000085,0x00000044,0x00000054,0x0004003d,0x00000006,0x00000087,
0x00000050,0x000500c4,0x00000006,0x00000088,0x00000086,0x00000087,0x00050041,0x0000001c,
0x00000089,0x0000001a,0x00000084,0x0003003e,0x00000089,0x00000088,0x0004003d,0x00000006,
0x0000008a,0x00000050,0x00050039,0x00000002,0x0000008b,0x00000009,0x0000008a,0x0004003d,
0x00000006,0x0000008c,0x00000050,0x000500aa,0x00000013,0x0000008d,0x0000008c,0x00000054,
0x000300f7,0x0000008f,0x00000000,0x000400fa,0x0000008d,0x0000008e,0x0000008f,0x000200f8,
0x0000008e,0x00050041,0x0000001c,0x00000090,0x0000001a,0x00000061,0x0004003d,0x00000006,
0x00000091,0x00000090,0x00050041,0x0000004f,0x00000092,0x0000007e,0x00000054,0x0003003e,
0x00000092,0x00000091,0x000200f9,0x0000008f,0x000200f8,0x0000008f,0x000200f9,0x00000083,
0x000200f8,0x00000093,0x0004003d,0x00000006,0x00000095,0x00000050,0x00050082,0x00000006,
0x00000096,0x00000095,0x00000017,0x0003003e,0x00000094,0x00000096,0x0004003d,0x00000006,
0x00000097,0x00000094,0x0004003d,0x00000013,0x00000098,0x00000068,0x000600a9,0x00000006,
0x00000099,0x00000098,0x00000044,0x00000054,0x0004003d,0x00000006,0x0000009a,0x00000094,
0x000500c4,0x00000006,0x0000009b,0x00000099,0x0000009a,0x00050041,0x0000001c,0x0000009c,
0x0000001a,0x00000097,0x0003003e,0x0000009c,0x0000009b,0x0004003d,0x00000006,0x0000009d,
0x00000094,0x00050039,0x00000002,0x0000009e,0x00000009,0x0000009d,0x000200f9,0x00000083,
0x000200f8,0x00000083,0x0004003d,0x00000006,0x0000009f,0x00000050,0x000500aa,0x00000013,
0x000000a0,0x0000009f,0x00000054,0x000300f7,0x000000a2,0x00000000,0x000400fa,0x000000a0,
0x000000a1,0x000000a2,0x000200f8,0x000000a1,0x00050041,0x0000001c,0x000000a3,0x0000001a,
0x00000061,0x0004003d,0x00000006,0x000000a4,0x000000a3,0x00050041,0x0000004f,0x000000a5,
0x0000007e,0x00000044,0x0003003e,0x000000a5,0x000000a4,0x000200f9,0x000000a2,0x000200f8,
0x000000a2,0x0004003d,0x0000000b,0x000000a6,0x0000007e,0x000200fe,0x000000a6,0x00010038
};
// Generated from:
//
// #version 450 core
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// layout(local_size_x = 64, local_size_y = 1, local_size_z = 1)in;
//
// layout(set = 0, binding = 0, rgba32ui)uniform writeonly uimage2D culledWidgetsOut;
//
// layout(set = 0, binding = 1)uniform WidgetCoordinates
// {
// uvec4 coordinates[32 + 32];
// };
//
// shared uint intersectingWidgets[32];
//
// void accumulateWidgets(const uint localId)
// {
//
// if(localId < 16)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 16];
// if(localId < 8)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 8];
// if(localId < 4)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 4];
// if(localId < 2)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 2];
// if(localId < 1)
// {
// intersectingWidgets[localId]|= intersectingWidgets[localId + 1];
// }
// }
// }
// }
// }
// }
//
// uvec2 cullWidgets(const uint offset, const uvec2 blockCoordLow, const uvec2 blockCoordHigh)
// {
// const uint localId = gl_LocalInvocationID . x;
// const uvec4 widgetCoords = coordinates[offset + localId];
//
// const bool intersects = widgetCoords . x < widgetCoords . z &&
// all(lessThan(widgetCoords . xy, blockCoordHigh))&&
// all(greaterThanEqual(widgetCoords . zw, blockCoordLow));
//
// uvec2 ballot = uvec2(0, 0);
//
// if(localId < 32)
// {
// intersectingWidgets[localId]= uint(intersects)<< localId;
// accumulateWidgets(localId);
// if(localId == 0)
// {
// ballot . x = intersectingWidgets[0];
// }
// }
// else
// {
// const uint graphLocalId = localId - 32;
// intersectingWidgets[graphLocalId]= uint(intersects)<< graphLocalId;
// accumulateWidgets(graphLocalId);
// }
// if(localId == 0)
// {
// ballot . y = intersectingWidgets[0];
// }
//
// return ballot;
//
// }
//
// void main()
// {
//
// const uvec2 outCoord = gl_WorkGroupID . xy;
// const uvec2 blockCoordLow = outCoord * uvec2(8, 8);
// const uvec2 blockCoordHigh = blockCoordLow + uvec2(8, 8);
//
// uvec2 culledWidgets;
//
// culledWidgets = cullWidgets(0, blockCoordLow, blockCoordHigh);
//
// if(gl_LocalInvocationID . x == 0)
// {
// imageStore(culledWidgetsOut, ivec2(outCoord), uvec4(culledWidgets, 0, 0));
// }
// }

Просмотреть файл

@ -0,0 +1,526 @@
// 7.12.3226
#pragma once
const uint32_t kOverlayDraw_comp_00000000[] = {
0x07230203,0x00010000,0x00080007,0x000001ba,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000005,0x00000004,0x6e69616d,0x00000000,0x0000009f,0x000000b7,0x00060010,
0x00000004,0x00000011,0x00000008,0x00000004,0x00000001,0x00030003,0x00000002,0x000001c2,
0x000b0004,0x455f4c47,0x735f5458,0x6c706d61,0x656c7265,0x745f7373,0x75747865,0x665f6572,
0x74636e75,0x736e6f69,0x00000000,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00070005,
0x0000000d,0x65746e69,0x63657372,0x76287374,0x763b3275,0x003b3475,0x00050005,0x0000000b,
0x67616d69,0x6f6f4365,0x00736472,0x00060005,0x0000000c,0x67646977,0x6f437465,0x7364726f,
0x00000000,0x00070005,0x00000013,0x43746567,0x28726168,0x763b3175,0x753b3275,0x00003b31,
0x00050005,0x00000010,0x74786574,0x67646957,0x00007465,0x00060005,0x00000011,0x726f6f63,
0x576e4964,0x65676469,0x00000074,0x00060005,0x00000012,0x746e6f66,0x70796c47,0x64695768,
0x00006874,0x00090005,0x0000001b,0x706d6173,0x6f46656c,0x7528746e,0x75763b31,0x75763b32,
0x31753b32,0x0000003b,0x00050005,0x00000017,0x74786574,0x72616843,0x00000000,0x00060005,
0x00000018,0x726f6f63,0x576e4964,0x65676469,0x00000074,0x00060005,0x00000019,0x746e6f66,
0x70796c47,0x7a695368,0x00000065,0x00050005,0x0000001a,0x746e6f66,0x6579614c,0x00000072,
0x00070005,0x00000020,0x56746567,0x65756c61,0x3b317528,0x3b327576,0x003b3175,0x00050005,
0x0000001d,0x70617267,0x64695768,0x00746567,0x00060005,0x0000001e,0x726f6f63,0x576e4964,
0x65676469,0x00000074,0x00050005,0x0000001f,0x756c6176,0x64695765,0x00006874,0x00060005,
0x00000026,0x6e656c62,0x66762864,0x66763b34,0x00003b34,0x00060005,0x00000024,0x6e656c62,
0x53646564,0x7261466f,0x00000000,0x00040005,0x00000025,0x6f6c6f63,0x00000072,0x00050005,
0x00000035,0x72616863,0x65646e49,0x00000078,0x00050005,0x00000039,0x6b636170,0x65646e49,
0x00000078,0x00050005,0x0000003d,0x6b636170,0x68436465,0x00737261,0x00060005,0x00000040,
0x74786554,0x67646957,0x61447465,0x00006174,0x00060006,0x00000040,0x00000000,0x726f6f63,
0x616e6964,0x00736574,0x00050006,0x00000040,0x00000001,0x6f6c6f63,0x00000072,0x00060006,
0x00000040,0x00000002,0x746e6f66,0x657a6953,0x00000000,0x00050006,0x00000040,0x00000003,
0x74786574,0x00000000,0x00050005,0x00000043,0x74786554,0x67646957,0x00737465,0x00070006,
0x00000043,0x00000000,0x74786574,0x67646957,0x44737465,0x00617461,0x00030005,0x00000045,
0x00000000,0x00040005,0x00000050,0x66696873,0x00000074,0x00060005,0x0000005d,0x726f6f63,
0x476e4964,0x6870796c,0x00000000,0x00050005,0x0000005f,0x70796c67,0x66664f68,0x00746573,
0x00040005,0x00000066,0x746e6f66,0x00000000,0x00050005,0x00000076,0x756c6176,0x646e4965,
0x00007865,0x00060005,0x0000007a,0x70617247,0x64695768,0x44746567,0x00617461,0x00060006,
0x0000007a,0x00000000,0x726f6f63,0x616e6964,0x00736574,0x00050006,0x0000007a,0x00000001,
0x6f6c6f63,0x00000072,0x00060006,0x0000007a,0x00000002,0x756c6176,0x64695765,0x00006874,
0x00050006,0x0000007a,0x00000003,0x756c6176,0x00007365,0x00060005,0x0000007c,0x70617247,
0x64695768,0x73746567,0x00000000,0x00080006,0x0000007c,0x00000000,0x70617267,0x64695768,
0x73746567,0x61746144,0x00000000,0x00030005,0x0000007e,0x00000000,0x00050005,0x0000009c,
0x67616d69,0x6f6f4365,0x00736472,0x00080005,0x0000009f,0x475f6c67,0x61626f6c,0x766e496c,
0x7461636f,0x496e6f69,0x00000044,0x00060005,0x000000a3,0x68737550,0x736e6f43,0x746e6174,
0x00000073,0x00060006,0x000000a3,0x00000000,0x7074756f,0x69537475,0x0000657a,0x00040005,
0x000000a5,0x61726170,0x0000736d,0x00060005,0x000000af,0x6e656c62,0x57646564,0x65676469,
0x00007374,0x00060005,0x000000b2,0x67627573,0x70756f72,0x67646957,0x00737465,0x00060005,
0x000000b5,0x6c6c7563,0x69576465,0x74656764,0x00000073,0x00060005,0x000000b7,0x575f6c67,
0x476b726f,0x70756f72,0x00004449,0x00050005,0x000000bd,0x74786574,0x67646957,0x00737465,
0x00060005,0x000000c0,0x70617267,0x64695768,0x73746567,0x00000000,0x00050005,0x000000cb,
0x70617267,0x64695768,0x00746567,0x00060005,0x000000d6,0x67646977,0x6f437465,0x7364726f,
0x00000000,0x00060005,0x00000109,0x726f6f63,0x576e4964,0x65676469,0x00000074,0x00050005,
0x0000010e,0x756c6176,0x64695765,0x00006874,0x00040005,0x00000113,0x756c6176,0x00000065,
0x00040005,0x00000118,0x6f6c6f63,0x00000072,0x00060005,0x00000119,0x67646977,0x65487465,
0x74686769,0x00000000,0x00070005,0x00000120,0x69646e69,0x65746163,0x7265764f,0x776f6c66,
0x00000000,0x00050005,0x0000014f,0x74786574,0x67646957,0x00007465,0x00060005,0x00000158,
0x67646977,0x6f437465,0x7364726f,0x00000000,0x00060005,0x00000163,0x726f6f63,0x576e4964,
0x65676469,0x00000074,0x00060005,0x00000168,0x746e6f66,0x657a6953,0x6b636150,0x00006465,
0x00060005,0x0000016c,0x746e6f66,0x70796c47,0x7a695368,0x00000065,0x00050005,0x0000016f,
0x746e6f66,0x6579614c,0x00000072,0x00050005,0x00000172,0x74786574,0x72616843,0x00000000,
0x00050005,0x0000017e,0x706d6173,0x6156656c,0x0065756c,0x00040005,0x00000184,0x6f6c6f63,
0x00000072,0x00060005,0x00000197,0x6e656c62,0x43646564,0x726f6c6f,0x00000000,0x00040005,
0x0000019f,0x6f6c6f63,0x00000072,0x00050005,0x000001a2,0x6e656c62,0x74754f64,0x00747570,
0x00040047,0x0000003f,0x00000006,0x00000010,0x00050048,0x00000040,0x00000000,0x00000023,
0x00000000,0x00050048,0x00000040,0x00000001,0x00000023,0x00000010,0x00050048,0x00000040,
0x00000002,0x00000023,0x00000020,0x00050048,0x00000040,0x00000003,0x00000023,0x00000030,
0x00040047,0x00000042,0x00000006,0x00000130,0x00050048,0x00000043,0x00000000,0x00000023,
0x00000000,0x00030047,0x00000043,0x00000002,0x00040047,0x00000045,0x00000022,0x00000000,
0x00040047,0x00000045,0x00000021,0x00000001,0x00040047,0x00000066,0x00000022,0x00000000,
0x00040047,0x00000066,0x00000021,0x00000004,0x00040047,0x00000079,0x00000006,0x00000010,
0x00050048,0x0000007a,0x00000000,0x00000023,0x00000000,0x00050048,0x0000007a,0x00000001,
0x00000023,0x00000010,0x00050048,0x0000007a,0x00000002,0x00000023,0x00000020,0x00050048,
0x0000007a,0x00000003,0x00000023,0x00000030,0x00040047,0x0000007b,0x00000006,0x00000130,
0x00050048,0x0000007c,0x00000000,0x00000023,0x00000000,0x00030047,0x0000007c,0x00000002,
0x00040047,0x0000007e,0x00000022,0x00000000,0x00040047,0x0000007e,0x00000021,0x00000002,
0x00040047,0x0000009f,0x0000000b,0x0000001c,0x00050048,0x000000a3,0x00000000,0x00000023,
0x00000000,0x00030047,0x000000a3,0x00000002,0x00040047,0x000000b5,0x00000022,0x00000000,
0x00040047,0x000000b5,0x00000021,0x00000003,0x00040047,0x000000b7,0x0000000b,0x0000001a,
0x00040047,0x000001a2,0x00000022,0x00000000,0x00040047,0x000001a2,0x00000021,0x00000000,
0x00040047,0x000001b9,0x0000000b,0x00000019,0x00020013,0x00000002,0x00030021,0x00000003,
0x00000002,0x00040015,0x00000006,0x00000020,0x00000000,0x00040017,0x00000007,0x00000006,
0x00000002,0x00040017,0x00000008,0x00000006,0x00000004,0x00020014,0x00000009,0x00050021,
0x0000000a,0x00000009,0x00000007,0x00000008,0x00060021,0x0000000f,0x00000006,0x00000006,
0x00000007,0x00000006,0x00030016,0x00000015,0x00000020,0x00070021,0x00000016,0x00000015,
0x00000006,0x00000007,0x00000007,0x00000006,0x00040017,0x00000022,0x00000015,0x00000004,
0x00050021,0x00000023,0x00000022,0x00000022,0x00000022,0x00040017,0x00000029,0x00000009,
0x00000002,0x00040020,0x00000034,0x00000007,0x00000006,0x0004002b,0x00000006,0x00000036,
0x00000000,0x0004002b,0x00000006,0x0000003b,0x00000004,0x0004002b,0x00000006,0x0000003e,
0x00000010,0x0004001c,0x0000003f,0x00000008,0x0000003e,0x0006001e,0x00000040,0x00000008,
0x00000022,0x00000008,0x0000003f,0x0004002b,0x00000006,0x00000041,0x00000020,0x0004001c,
0x00000042,0x00000040,0x00000041,0x0003001e,0x00000043,0x00000042,0x00040020,0x00000044,
0x00000002,0x00000043,0x0004003b,0x00000044,0x00000045,0x00000002,0x00040015,0x00000046,
0x00000020,0x00000001,0x0004002b,0x00000046,0x00000047,0x00000000,0x0004002b,0x00000046,
0x00000048,0x00000003,0x00040020,0x0000004d,0x00000002,0x00000006,0x0004002b,0x00000006,
0x00000053,0x00000008,0x0004002b,0x00000006,0x00000058,0x000000ff,0x00040020,0x0000005c,
0x00000007,0x00000007,0x00090019,0x00000064,0x00000015,0x00000001,0x00000000,0x00000001,
0x00000000,0x00000001,0x00000000,0x00040020,0x00000065,0x00000000,0x00000064,0x0004003b,
0x00000065,0x00000066,0x00000000,0x00040017,0x0000006b,0x00000046,0x00000002,0x00040017,
0x0000006e,0x00000046,0x00000003,0x0004001c,0x00000079,0x00000008,0x0000003e,0x0006001e,
0x0000007a,0x00000008,0x00000022,0x00000008,0x00000079,0x0004001c,0x0000007b,0x0000007a,
0x00000041,0x0003001e,0x0000007c,0x0000007b,0x00040020,0x0000007d,0x00000002,0x0000007c,
0x0004003b,0x0000007d,0x0000007e,0x00000002,0x00040017,0x00000087,0x00000015,0x00000003,
0x0004002b,0x00000015,0x00000089,0x3f800000,0x0004002b,0x00000006,0x0000008a,0x00000003,
0x00040017,0x0000009d,0x00000006,0x00000003,0x00040020,0x0000009e,0x00000001,0x0000009d,
0x0004003b,0x0000009e,0x0000009f,0x00000001,0x0003001e,0x000000a3,0x00000007,0x00040020,
0x000000a4,0x00000009,0x000000a3,0x0004003b,0x000000a4,0x000000a5,0x00000009,0x00040020,
0x000000a6,0x00000009,0x00000007,0x00040020,0x000000ae,0x00000007,0x00000022,0x0004002b,
0x00000015,0x000000b0,0x00000000,0x0007002c,0x00000022,0x000000b1,0x000000b0,0x000000b0,
0x000000b0,0x00000089,0x00090019,0x000000b3,0x00000006,0x00000001,0x00000000,0x00000000,
0x00000000,0x00000001,0x00000000,0x00040020,0x000000b4,0x00000000,0x000000b3,0x0004003b,
0x000000b4,0x000000b5,0x00000000,0x0004003b,0x0000009e,0x000000b7,0x00000001,0x0004002b,
0x00000006,0x000000c1,0x00000001,0x0004002b,0x00000046,0x000000cf,0x00000001,0x00040020,
0x000000d5,0x00000007,0x00000008,0x00040020,0x000000d8,0x00000002,0x00000008,0x0004002b,
0x00000006,0x000000f6,0x00000002,0x0007002c,0x00000022,0x00000107,0x000000b0,0x000000b0,
0x000000b0,0x000000b0,0x0004002b,0x00000046,0x00000110,0x00000002,0x00040020,0x0000011f,
0x00000007,0x00000009,0x00040020,0x00000142,0x00000002,0x00000022,0x0004002b,0x00000006,
0x00000179,0x00000060,0x00040020,0x0000017d,0x00000007,0x00000015,0x0004002b,0x00000015,
0x00000185,0x3ecccccd,0x0007002c,0x00000022,0x00000186,0x000000b0,0x000000b0,0x000000b0,
0x00000185,0x00040020,0x00000196,0x00000007,0x00000087,0x00090019,0x000001a0,0x00000015,
0x00000001,0x00000000,0x00000000,0x00000000,0x00000002,0x00000001,0x00040020,0x000001a1,
0x00000000,0x000001a0,0x0004003b,0x000001a1,0x000001a2,0x00000000,0x0006002c,0x0000009d,
0x000001b9,0x00000053,0x0000003b,0x000000c1,0x00050036,0x00000002,0x00000004,0x00000000,
0x00000003,0x000200f8,0x00000005,0x0004003b,0x0000005c,0x0000009c,0x00000007,0x0004003b,
0x000000ae,0x000000af,0x00000007,0x0004003b,0x0000005c,0x000000b2,0x00000007,0x0004003b,
0x00000034,0x000000bd,0x00000007,0x0004003b,0x00000034,0x000000c0,0x00000007,0x0004003b,
0x00000034,0x000000cb,0x00000007,0x0004003b,0x000000d5,0x000000d6,0x00000007,0x0004003b,
0x0000005c,0x00000109,0x00000007,0x0004003b,0x00000034,0x0000010e,0x00000007,0x0004003b,
0x00000034,0x00000113,0x00000007,0x0004003b,0x000000ae,0x00000118,0x00000007,0x0004003b,
0x00000034,0x00000119,0x00000007,0x0004003b,0x0000011f,0x00000120,0x00000007,0x0004003b,
0x00000034,0x0000014f,0x00000007,0x0004003b,0x000000d5,0x00000158,0x00000007,0x0004003b,
0x0000005c,0x00000163,0x00000007,0x0004003b,0x000000d5,0x00000168,0x00000007,0x0004003b,
0x0000005c,0x0000016c,0x00000007,0x0004003b,0x00000034,0x0000016f,0x00000007,0x0004003b,
0x00000034,0x00000172,0x00000007,0x0004003b,0x0000017d,0x0000017e,0x00000007,0x0004003b,
0x000000ae,0x00000184,0x00000007,0x0004003b,0x00000196,0x00000197,0x00000007,0x0004003b,
0x000000ae,0x0000019f,0x00000007,0x0004003d,0x0000009d,0x000000a0,0x0000009f,0x0007004f,
0x00000007,0x000000a1,0x000000a0,0x000000a0,0x00000000,0x00000001,0x0003003e,0x0000009c,
0x000000a1,0x0004003d,0x00000007,0x000000a2,0x0000009c,0x00050041,0x000000a6,0x000000a7,
0x000000a5,0x00000047,0x0004003d,0x00000007,0x000000a8,0x000000a7,0x000500ae,0x00000029,
0x000000a9,0x000000a2,0x000000a8,0x0004009a,0x00000009,0x000000aa,0x000000a9,0x000300f7,
0x000000ac,0x00000000,0x000400fa,0x000000aa,0x000000ab,0x000000ac,0x000200f8,0x000000ab,
0x000100fd,0x000200f8,0x000000ac,0x0003003e,0x000000af,0x000000b1,0x0004003d,0x000000b3,
0x000000b6,0x000000b5,0x0004003d,0x0000009d,0x000000b8,0x000000b7,0x0007004f,0x00000007,
0x000000b9,0x000000b8,0x000000b8,0x00000000,0x00000001,0x0004007c,0x0000006b,0x000000ba,
0x000000b9,0x0007005f,0x00000008,0x000000bb,0x000000b6,0x000000ba,0x00000002,0x00000047,
0x0007004f,0x00000007,0x000000bc,0x000000bb,0x000000bb,0x00000000,0x00000001,0x0003003e,
0x000000b2,0x000000bc,0x00050041,0x00000034,0x000000be,0x000000b2,0x00000036,0x0004003d,
0x00000006,0x000000bf,0x000000be,0x0003003e,0x000000bd,0x000000bf,0x00050041,0x00000034,
0x000000c2,0x000000b2,0x000000c1,0x0004003d,0x00000006,0x000000c3,0x000000c2,0x0003003e,
0x000000c0,0x000000c3,0x000200f9,0x000000c4,0x000200f8,0x000000c4,0x000400f6,0x000000c6,
0x000000c7,0x00000000,0x000200f9,0x000000c8,0x000200f8,0x000000c8,0x0004003d,0x00000006,
0x000000c9,0x000000c0,0x000500ab,0x00000009,0x000000ca,0x000000c9,0x00000036,0x000400fa,
0x000000ca,0x000000c5,0x000000c6,0x000200f8,0x000000c5,0x0004003d,0x00000006,0x000000cc,
0x000000c0,0x0006000c,0x00000046,0x000000cd,0x00000001,0x00000049,0x000000cc,0x0004007c,
0x00000006,0x000000ce,0x000000cd,0x0003003e,0x000000cb,0x000000ce,0x0004003d,0x00000006,
0x000000d0,0x000000cb,0x000500c4,0x00000046,0x000000d1,0x000000cf,0x000000d0,0x0004007c,
0x00000006,0x000000d2,0x000000d1,0x0004003d,0x00000006,0x000000d3,0x000000c0,0x000500c6,
0x00000006,0x000000d4,0x000000d3,0x000000d2,0x0003003e,0x000000c0,0x000000d4,0x0004003d,
0x00000006,0x000000d7,0x000000cb,0x00070041,0x000000d8,0x000000d9,0x0000007e,0x00000047,
0x000000d7,0x00000047,0x0004003d,0x00000008,0x000000da,0x000000d9,0x0003003e,0x000000d6,
0x000000da,0x0004003d,0x00000007,0x000000db,0x0000009c,0x0004003d,0x00000008,0x000000dc,
0x000000d6,0x00060039,0x00000009,0x000000dd,0x0000000d,0x000000db,0x000000dc,0x000400a8,
0x00000009,0x000000de,0x000000dd,0x000300f7,0x000000e0,0x00000000,0x000400fa,0x000000de,
0x000000df,0x000000e0,0x000200f8,0x000000df,0x000200f9,0x000000c7,0x000200f8,0x000000e0,
0x00050041,0x00000034,0x000000e2,0x0000009c,0x00000036,0x0004003d,0x00000006,0x000000e3,
0x000000e2,0x00050041,0x00000034,0x000000e4,0x000000d6,0x00000036,0x0004003d,0x00000006,
0x000000e5,0x000000e4,0x000500aa,0x00000009,0x000000e6,0x000000e3,0x000000e5,0x000400a8,
0x00000009,0x000000e7,0x000000e6,0x000300f7,0x000000e9,0x00000000,0x000400fa,0x000000e7,
0x000000e8,0x000000e9,0x000200f8,0x000000e8,0x00050041,0x00000034,0x000000ea,0x0000009c,
0x000000c1,0x0004003d,0x00000006,0x000000eb,0x000000ea,0x00050041,0x00000034,0x000000ec,
0x000000d6,0x000000c1,0x0004003d,0x00000006,0x000000ed,0x000000ec,0x000500aa,0x00000009,
0x000000ee,0x000000eb,0x000000ed,0x000200f9,0x000000e9,0x000200f8,0x000000e9,0x000700f5,
0x00000009,0x000000ef,0x000000e6,0x000000e0,0x000000ee,0x000000e8,0x000400a8,0x00000009,
0x000000f0,0x000000ef,0x000300f7,0x000000f2,0x00000000,0x000400fa,0x000000f0,0x000000f1,
0x000000f2,0x000200f8,0x000000f1,0x00050041,0x00000034,0x000000f3,0x0000009c,0x00000036,
0x0004003d,0x00000006,0x000000f4,0x000000f3,0x00050080,0x00000006,0x000000f5,0x000000f4,
0x000000c1,0x00050041,0x00000034,0x000000f7,0x000000d6,0x000000f6,0x0004003d,0x00000006,
0x000000f8,0x000000f7,0x000500aa,0x00000009,0x000000f9,0x000000f5,0x000000f8,0x000200f9,
0x000000f2,0x000200f8,0x000000f2,0x000700f5,0x00000009,0x000000fa,0x000000ef,0x000000e9,
0x000000f9,0x000000f1,0x000400a8,0x00000009,0x000000fb,0x000000fa,0x000300f7,0x000000fd,
0x00000000,0x000400fa,0x000000fb,0x000000fc,0x000000fd,0x000200f8,0x000000fc,0x00050041,
0x00000034,0x000000fe,0x0000009c,0x000000c1,0x0004003d,0x00000006,0x000000ff,0x000000fe,
0x00050080,0x00000006,0x00000100,0x000000ff,0x000000c1,0x00050041,0x00000034,0x00000101,
0x000000d6,0x0000008a,0x0004003d,0x00000006,0x00000102,0x00000101,0x000500aa,0x00000009,
0x00000103,0x00000100,0x00000102,0x000200f9,0x000000fd,0x000200f8,0x000000fd,0x000700f5,
0x00000009,0x00000104,0x000000fa,0x000000f2,0x00000103,0x000000fc,0x000300f7,0x00000106,
0x00000000,0x000400fa,0x00000104,0x00000105,0x00000106,0x000200f8,0x00000105,0x0003003e,
0x000000af,0x00000107,0x000200f9,0x000000c7,0x000200f8,0x00000106,0x0004003d,0x00000007,
0x0000010a,0x0000009c,0x0004003d,0x00000008,0x0000010b,0x000000d6,0x0007004f,0x00000007,
0x0000010c,0x0000010b,0x0000010b,0x00000000,0x00000001,0x00050082,0x00000007,0x0000010d,
0x0000010a,0x0000010c,0x0003003e,0x00000109,0x0000010d,0x0004003d,0x00000006,0x0000010f,
0x000000cb,0x00080041,0x0000004d,0x00000111,0x0000007e,0x00000047,0x0000010f,0x00000110,
0x00000036,0x0004003d,0x00000006,0x00000112,0x00000111,0x0003003e,0x0000010e,0x00000112,
0x0004003d,0x00000006,0x00000114,0x000000cb,0x0004003d,0x00000007,0x00000115,0x00000109,
0x0004003d,0x00000006,0x00000116,0x0000010e,0x00070039,0x00000006,0x00000117,0x00000020,
0x00000114,0x00000115,0x00000116,0x0003003e,0x00000113,0x00000117,0x0003003e,0x00000118,
0x00000107,0x00050041,0x00000034,0x0000011a,0x000000d6,0x0000008a,0x0004003d,0x00000006,
0x0000011b,0x0000011a,0x00050041,0x00000034,0x0000011c,0x000000d6,0x000000c1,0x0004003d,
0x00000006,0x0000011d,0x0000011c,0x00050082,0x00000006,0x0000011e,0x0000011b,0x0000011d,
0x0003003e,0x00000119,0x0000011e,0x0004003d,0x00000006,0x00000121,0x00000113,0x0004003d,
0x00000006,0x00000122,0x00000119,0x000500ac,0x00000009,0x00000123,0x00000121,0x00000122,
0x000300f7,0x00000125,0x00000000,0x000400fa,0x00000123,0x00000124,0x00000125,0x000200f8,
0x00000124,0x00050041,0x00000034,0x00000126,0x00000109,0x000000c1,0x0004003d,0x00000006,
0x00000127,0x00000126,0x00050080,0x00000006,0x00000128,0x00000127,0x0000003b,0x0004003d,
0x00000006,0x00000129,0x00000119,0x000500ae,0x00000009,0x0000012a,0x00000128,0x00000129,
0x000200f9,0x00000125,0x000200f8,0x00000125,0x000700f5,0x00000009,0x0000012b,0x00000123,
0x00000106,0x0000012a,0x00000124,0x000300f7,0x0000012d,0x00000000,0x000400fa,0x0000012b,
0x0000012c,0x0000012d,0x000200f8,0x0000012c,0x00050041,0x00000034,0x0000012e,0x00000109,
0x00000036,0x0004003d,0x00000006,0x0000012f,0x0000012e,0x00050041,0x00000034,0x00000130,
0x00000109,0x000000c1,0x0004003d,0x00000006,0x00000131,0x00000130,0x000500c6,0x00000006,
0x00000132,0x0000012f,0x00000131,0x000500c7,0x00000006,0x00000133,0x00000132,0x000000c1,
0x000500aa,0x00000009,0x00000134,0x00000133,0x00000036,0x000200f9,0x0000012d,0x000200f8,
0x0000012d,0x000700f5,0x00000009,0x00000135,0x0000012b,0x00000125,0x00000134,0x0000012c,
0x0003003e,0x00000120,0x00000135,0x0004003d,0x00000006,0x00000136,0x00000119,0x00050041,
0x00000034,0x00000137,0x00000109,0x000000c1,0x0004003d,0x00000006,0x00000138,0x00000137,
0x00050082,0x00000006,0x00000139,0x00000136,0x00000138,0x0004003d,0x00000006,0x0000013a,
0x00000113,0x000500b0,0x00000009,0x0000013b,0x00000139,0x0000013a,0x0004003d,0x00000009,
0x0000013c,0x00000120,0x000400a8,0x00000009,0x0000013d,0x0000013c,0x000500a7,0x00000009,
0x0000013e,0x0000013b,0x0000013d,0x000300f7,0x00000140,0x00000000,0x000400fa,0x0000013e,
0x0000013f,0x00000140,0x000200f8,0x0000013f,0x0004003d,0x00000006,0x00000141,0x000000cb,
0x00070041,0x00000142,0x00000143,0x0000007e,0x00000047,0x00000141,0x000000cf,0x0004003d,
0x00000022,0x00000144,0x00000143,0x0003003e,0x00000118,0x00000144,0x0004003d,0x00000022,
0x00000145,0x000000af,0x0004003d,0x00000022,0x00000146,0x00000118,0x00060039,0x00000022,
0x00000147,0x00000026,0x00000145,0x00000146,0x0003003e,0x000000af,0x00000147,0x000200f9,
0x00000140,0x000200f8,0x00000140,0x000200f9,0x000000c7,0x000200f8,0x000000c7,0x000200f9,
0x000000c4,0x000200f8,0x000000c6,0x000200f9,0x00000148,0x000200f8,0x00000148,0x000400f6,
0x0000014a,0x0000014b,0x00000000,0x000200f9,0x0000014c,0x000200f8,0x0000014c,0x0004003d,
0x00000006,0x0000014d,0x000000bd,0x000500ab,0x00000009,0x0000014e,0x0000014d,0x00000036,
0x000400fa,0x0000014e,0x00000149,0x0000014a,0x000200f8,0x00000149,0x0004003d,0x00000006,
0x00000150,0x000000bd,0x0006000c,0x00000046,0x00000151,0x00000001,0x00000049,0x00000150,
0x0004007c,0x00000006,0x00000152,0x00000151,0x0003003e,0x0000014f,0x00000152,0x0004003d,
0x00000006,0x00000153,0x0000014f,0x000500c4,0x00000046,0x00000154,0x000000cf,0x00000153,
0x0004007c,0x00000006,0x00000155,0x00000154,0x0004003d,0x00000006,0x00000156,0x000000bd,
0x000500c6,0x00000006,0x00000157,0x00000156,0x00000155,0x0003003e,0x000000bd,0x00000157,
0x0004003d,0x00000006,0x00000159,0x0000014f,0x00070041,0x000000d8,0x0000015a,0x00000045,
0x00000047,0x00000159,0x00000047,0x0004003d,0x00000008,0x0000015b,0x0000015a,0x0003003e,
0x00000158,0x0000015b,0x0004003d,0x00000007,0x0000015c,0x0000009c,0x0004003d,0x00000008,
0x0000015d,0x00000158,0x00060039,0x00000009,0x0000015e,0x0000000d,0x0000015c,0x0000015d,
0x000400a8,0x00000009,0x0000015f,0x0000015e,0x000300f7,0x00000161,0x00000000,0x000400fa,
0x0000015f,0x00000160,0x00000161,0x000200f8,0x00000160,0x000200f9,0x0000014b,0x000200f8,
0x00000161,0x0004003d,0x00000007,0x00000164,0x0000009c,0x0004003d,0x00000008,0x00000165,
0x00000158,0x0007004f,0x00000007,0x00000166,0x00000165,0x00000165,0x00000000,0x00000001,
0x00050082,0x00000007,0x00000167,0x00000164,0x00000166,0x0003003e,0x00000163,0x00000167,
0x0004003d,0x00000006,0x00000169,0x0000014f,0x00070041,0x000000d8,0x0000016a,0x00000045,
0x00000047,0x00000169,0x00000110,0x0004003d,0x00000008,0x0000016b,0x0000016a,0x0003003e,
0x00000168,0x0000016b,0x0004003d,0x00000008,0x0000016d,0x00000168,0x0007004f,0x00000007,
0x0000016e,0x0000016d,0x0000016d,0x00000000,0x00000001,0x0003003e,0x0000016c,0x0000016e,
0x00050041,0x00000034,0x00000170,0x00000168,0x000000f6,0x0004003d,0x00000006,0x00000171,
0x00000170,0x0003003e,0x0000016f,0x00000171,0x0004003d,0x00000006,0x00000173,0x0000014f,
0x0004003d,0x00000007,0x00000174,0x00000163,0x00050041,0x00000034,0x00000175,0x0000016c,
0x00000036,0x0004003d,0x00000006,0x00000176,0x00000175,0x00070039,0x00000006,0x00000177,
0x00000013,0x00000173,0x00000174,0x00000176,0x0003003e,0x00000172,0x00000177,0x0004003d,
0x00000006,0x00000178,0x00000172,0x000500b0,0x00000009,0x0000017a,0x00000178,0x00000179,
0x000300f7,0x0000017c,0x00000000,0x000400fa,0x0000017a,0x0000017b,0x0000017c,0x000200f8,
0x0000017b,0x0004003d,0x00000006,0x0000017f,0x00000172,0x0004003d,0x00000007,0x00000180,
0x00000163,0x0004003d,0x00000007,0x00000181,0x0000016c,0x0004003d,0x00000006,0x00000182,
0x0000016f,0x00080039,0x00000015,0x00000183,0x0000001b,0x0000017f,0x00000180,0x00000181,
0x00000182,0x0003003e,0x0000017e,0x00000183,0x0003003e,0x00000184,0x00000186,0x0004003d,
0x00000022,0x00000187,0x00000184,0x0004003d,0x00000006,0x00000188,0x0000014f,0x00070041,
0x00000142,0x00000189,0x00000045,0x00000047,0x00000188,0x000000cf,0x0004003d,0x00000022,
0x0000018a,0x00000189,0x0004003d,0x00000015,0x0000018b,0x0000017e,0x00070050,0x00000022,
0x0000018c,0x0000018b,0x0000018b,0x0000018b,0x0000018b,0x0008000c,0x00000022,0x0000018d,
0x00000001,0x0000002e,0x00000187,0x0000018a,0x0000018c,0x0003003e,0x00000184,0x0000018d,
0x0004003d,0x00000022,0x0000018e,0x000000af,0x0004003d,0x00000022,0x0000018f,0x00000184,
0x00060039,0x00000022,0x00000190,0x00000026,0x0000018e,0x0000018f,0x0003003e,0x000000af,
0x00000190,0x000200f9,0x0000017c,0x000200f8,0x0000017c,0x000200f9,0x0000014b,0x000200f8,
0x0000014b,0x000200f9,0x00000148,0x000200f8,0x0000014a,0x00050041,0x0000017d,0x00000191,
0x000000af,0x0000008a,0x0004003d,0x00000015,0x00000192,0x00000191,0x000500b8,0x00000009,
0x00000193,0x00000192,0x00000089,0x000300f7,0x00000195,0x00000000,0x000400fa,0x00000193,
0x00000194,0x00000195,0x000200f8,0x00000194,0x0004003d,0x00000022,0x00000198,0x000000af,
0x0008004f,0x00000087,0x00000199,0x00000198,0x00000198,0x00000000,0x00000001,0x00000002,
0x0003003e,0x00000197,0x00000199,0x00050041,0x0000017d,0x0000019a,0x000000af,0x0000008a,
0x0004003d,0x00000015,0x0000019b,0x0000019a,0x000500ba,0x00000009,0x0000019c,0x0000019b,
0x000000b0,0x000300f7,0x0000019e,0x00000000,0x000400fa,0x0000019c,0x0000019d,0x0000019e,
0x000200f8,0x0000019d,0x0004003d,0x000001a0,0x000001a3,0x000001a2,0x0004003d,0x00000007,
0x000001a4,0x0000009c,0x0004007c,0x0000006b,0x000001a5,0x000001a4,0x00050062,0x00000022,
0x000001a6,0x000001a3,0x000001a5,0x0003003e,0x0000019f,0x000001a6,0x0004003d,0x00000022,
0x000001a7,0x0000019f,0x0008004f,0x00000087,0x000001a8,0x000001a7,0x000001a7,0x00000000,
0x00000001,0x00000002,0x00050041,0x0000017d,0x000001a9,0x0000019f,0x0000008a,0x0004003d,
0x00000015,0x000001aa,0x000001a9,0x0005008e,0x00000087,0x000001ab,0x000001a8,0x000001aa,
0x00050041,0x0000017d,0x000001ac,0x000000af,0x0000008a,0x0004003d,0x00000015,0x000001ad,
0x000001ac,0x0005008e,0x00000087,0x000001ae,0x000001ab,0x000001ad,0x0004003d,0x00000087,
0x000001af,0x00000197,0x00050081,0x00000087,0x000001b0,0x000001af,0x000001ae,0x0003003e,
0x00000197,0x000001b0,0x000200f9,0x0000019e,0x000200f8,0x0000019e,0x0004003d,0x000001a0,
0x000001b1,0x000001a2,0x0004003d,0x00000007,0x000001b2,0x0000009c,0x0004007c,0x0000006b,
0x000001b3,0x000001b2,0x0004003d,0x00000087,0x000001b4,0x00000197,0x00050051,0x00000015,
0x000001b5,0x000001b4,0x00000000,0x00050051,0x00000015,0x000001b6,0x000001b4,0x00000001,
0x00050051,0x00000015,0x000001b7,0x000001b4,0x00000002,0x00070050,0x00000022,0x000001b8,
0x000001b5,0x000001b6,0x000001b7,0x00000089,0x00040063,0x000001b1,0x000001b3,0x000001b8,
0x000200f9,0x00000195,0x000200f8,0x00000195,0x000100fd,0x00010038,0x00050036,0x00000009,
0x0000000d,0x00000000,0x0000000a,0x00030037,0x00000007,0x0000000b,0x00030037,0x00000008,
0x0000000c,0x000200f8,0x0000000e,0x0007004f,0x00000007,0x00000028,0x0000000c,0x0000000c,
0x00000000,0x00000001,0x000500ae,0x00000029,0x0000002a,0x0000000b,0x00000028,0x0004009b,
0x00000009,0x0000002b,0x0000002a,0x000300f7,0x0000002d,0x00000000,0x000400fa,0x0000002b,
0x0000002c,0x0000002d,0x000200f8,0x0000002c,0x0007004f,0x00000007,0x0000002e,0x0000000c,
0x0000000c,0x00000002,0x00000003,0x000500b0,0x00000029,0x0000002f,0x0000000b,0x0000002e,
0x0004009b,0x00000009,0x00000030,0x0000002f,0x000200f9,0x0000002d,0x000200f8,0x0000002d,
0x000700f5,0x00000009,0x00000031,0x0000002b,0x0000000e,0x00000030,0x0000002c,0x000200fe,
0x00000031,0x00010038,0x00050036,0x00000006,0x00000013,0x00000000,0x0000000f,0x00030037,
0x00000006,0x00000010,0x00030037,0x00000007,0x00000011,0x00030037,0x00000006,0x00000012,
0x000200f8,0x00000014,0x0004003b,0x00000034,0x00000035,0x00000007,0x0004003b,0x00000034,
0x00000039,0x00000007,0x0004003b,0x00000034,0x0000003d,0x00000007,0x0004003b,0x00000034,
0x00000050,0x00000007,0x00050051,0x00000006,0x00000037,0x00000011,0x00000000,0x00050086,
0x00000006,0x00000038,0x00000037,0x00000012,0x0003003e,0x00000035,0x00000038,0x0004003d,
0x00000006,0x0000003a,0x00000035,0x00050086,0x00000006,0x0000003c,0x0000003a,0x0000003b,
0x0003003e,0x00000039,0x0000003c,0x0004003d,0x00000006,0x00000049,0x00000039,0x00050086,
0x00000006,0x0000004a,0x00000049,0x0000003b,0x0004003d,0x00000006,0x0000004b,0x00000039,
0x00050089,0x00000006,0x0000004c,0x0000004b,0x0000003b,0x00090041,0x0000004d,0x0000004e,
0x00000045,0x00000047,0x00000010,0x00000048,0x0000004a,0x0000004c,0x0004003d,0x00000006,
0x0000004f,0x0000004e,0x0003003e,0x0000003d,0x0000004f,0x0004003d,0x00000006,0x00000051,
0x00000035,0x00050089,0x00000006,0x00000052,0x00000051,0x0000003b,0x00050084,0x00000006,
0x00000054,0x00000052,0x00000053,0x0003003e,0x00000050,0x00000054,0x0004003d,0x00000006,
0x00000055,0x0000003d,0x0004003d,0x00000006,0x00000056,0x00000050,0x000500c2,0x00000006,
0x00000057,0x00000055,0x00000056,0x000500c7,0x00000006,0x00000059,0x00000057,0x00000058,
0x000200fe,0x00000059,0x00010038,0x00050036,0x00000015,0x0000001b,0x00000000,0x00000016,
0x00030037,0x00000006,0x00000017,0x00030037,0x00000007,0x00000018,0x00030037,0x00000007,
0x00000019,0x00030037,0x00000006,0x0000001a,0x000200f8,0x0000001c,0x0004003b,0x0000005c,
0x0000005d,0x00000007,0x0004003b,0x0000005c,0x0000005f,0x00000007,0x00050089,0x00000007,
0x0000005e,0x00000018,0x00000019,0x0003003e,0x0000005d,0x0000005e,0x00050089,0x00000006,
0x00000060,0x00000017,0x00000041,0x00050086,0x00000006,0x00000061,0x00000017,0x00000041,
0x00050050,0x00000007,0x00000062,0x00000060,0x00000061,0x00050084,0x00000007,0x00000063,
0x00000019,0x00000062,0x0003003e,0x0000005f,0x00000063,0x0004003d,0x00000064,0x00000067,
0x00000066,0x0004003d,0x00000007,0x00000068,0x0000005f,0x0004003d,0x00000007,0x00000069,
0x0000005d,0x00050080,0x00000007,0x0000006a,0x00000068,0x00000069,0x0004007c,0x0000006b,
0x0000006c,0x0000006a,0x0004007c,0x00000046,0x0000006d,0x0000001a,0x00050051,0x00000046,
0x0000006f,0x0000006c,0x00000000,0x00050051,0x00000046,0x00000070,0x0000006c,0x00000001,
0x00060050,0x0000006e,0x00000071,0x0000006f,0x00000070,0x0000006d,0x0007005f,0x00000022,
0x00000072,0x00000067,0x00000071,0x00000002,0x00000047,0x00050051,0x00000015,0x00000073,
0x00000072,0x00000000,0x000200fe,0x00000073,0x00010038,0x00050036,0x00000006,0x00000020,
0x00000000,0x0000000f,0x00030037,0x00000006,0x0000001d,0x00030037,0x00000007,0x0000001e,
0x00030037,0x00000006,0x0000001f,0x000200f8,0x00000021,0x0004003b,0x00000034,0x00000076,
0x00000007,0x00050051,0x00000006,0x00000077,0x0000001e,0x00000000,0x00050086,0x00000006,
0x00000078,0x00000077,0x0000001f,0x0003003e,0x00000076,0x00000078,0x0004003d,0x00000006,
0x0000007f,0x00000076,0x00050086,0x00000006,0x00000080,0x0000007f,0x0000003b,0x0004003d,
0x00000006,0x00000081,0x00000076,0x00050089,0x00000006,0x00000082,0x00000081,0x0000003b,
0x00090041,0x0000004d,0x00000083,0x0000007e,0x00000047,0x0000001d,0x00000048,0x00000080,
0x00000082,0x0004003d,0x00000006,0x00000084,0x00000083,0x000200fe,0x00000084,0x00010038,
0x00050036,0x00000022,0x00000026,0x00000000,0x00000023,0x00030037,0x00000022,0x00000024,
0x00030037,0x00000022,0x00000025,0x000200f8,0x00000027,0x0008004f,0x00000087,0x00000088,
0x00000024,0x00000024,0x00000000,0x00000001,0x00000002,0x00050051,0x00000015,0x0000008b,
0x00000025,0x00000003,0x00050083,0x00000015,0x0000008c,0x00000089,0x0000008b,0x0005008e,
0x00000087,0x0000008d,0x00000088,0x0000008c,0x0008004f,0x00000087,0x0000008e,0x00000025,
0x00000025,0x00000000,0x00000001,0x00000002,0x00050051,0x00000015,0x0000008f,0x00000025,
0x00000003,0x0005008e,0x00000087,0x00000090,0x0000008e,0x0000008f,0x00050081,0x00000087,
0x00000091,0x0000008d,0x00000090,0x00050051,0x00000015,0x00000092,0x00000024,0x00000003,
0x00050051,0x00000015,0x00000093,0x00000025,0x00000003,0x00050083,0x00000015,0x00000094,
0x00000089,0x00000093,0x00050085,0x00000015,0x00000095,0x00000092,0x00000094,0x00050051,
0x00000015,0x00000096,0x00000091,0x00000000,0x00050051,0x00000015,0x00000097,0x00000091,
0x00000001,0x00050051,0x00000015,0x00000098,0x00000091,0x00000002,0x00070050,0x00000022,
0x00000099,0x00000096,0x00000097,0x00000098,0x00000095,0x000200fe,0x00000099,0x00010038
};
// Generated from:
//
// #version 450 core
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// layout(local_size_x = 8, local_size_y = 4, local_size_z = 1)in;
//
// struct TextWidgetData
// {
// uvec4 coordinates;
// vec4 color;
// uvec4 fontSize;
// uvec4 text[256 / 16];
// };
//
// struct GraphWidgetData
// {
// uvec4 coordinates;
// vec4 color;
// uvec4 valueWidth;
// uvec4 values[64 / 4];
// };
//
// layout(set = 0, binding = 0, rgba32f)uniform image2D blendOutput;
//
// layout(set = 0, binding = 1)uniform TextWidgets
// {
// TextWidgetData textWidgetsData[32];
// };
//
// layout(set = 0, binding = 2)uniform GraphWidgets
// {
// GraphWidgetData graphWidgetsData[32];
// };
//
// layout(set = 0, binding = 3)uniform utexture2D culledWidgets;
// layout(set = 0, binding = 4)uniform texture2DArray font;
//
// layout(push_constant)uniform PushConstants
// {
// uvec2 outputSize;
// } params;
//
// bool intersects(const uvec2 imageCoords, const uvec4 widgetCoords)
// {
// return all(greaterThanEqual(imageCoords, widgetCoords . xy))&&
// all(lessThan(imageCoords, widgetCoords . zw));
// }
//
// uint getChar(const uint textWidget, const uvec2 coordInWidget, const uint fontGlyphWidth)
// {
// const uint charIndex = coordInWidget . x / fontGlyphWidth;
// const uint packIndex = charIndex / 4;
// const uint packedChars = textWidgetsData[textWidget]. text[packIndex / 4][packIndex % 4];
// const uint shift =(charIndex % 4)* 8;
//
// return(packedChars >> shift)& 0xFF;
//
// }
//
// float sampleFont(const uint textChar,
// const uvec2 coordInWidget,
// const uvec2 fontGlyphSize,
// const uint fontLayer)
// {
// const uvec2 coordInGlyph = coordInWidget % fontGlyphSize;
// const uvec2 glyphOffset = fontGlyphSize *
// uvec2(textChar % 32, textChar / 32);
//
// return texelFetch(font, ivec3(glyphOffset + coordInGlyph, fontLayer), 0). x;
// }
//
// uint getValue(const uint graphWidget, const uvec2 coordInWidget, const uint valueWidth)
// {
// const uint valueIndex = coordInWidget . x / valueWidth . x;
// return graphWidgetsData[graphWidget]. values[valueIndex / 4][valueIndex % 4];
// }
//
// vec4 blend(const vec4 blendedSoFar, const vec4 color)
// {
//
// return vec4(blendedSoFar . rgb *(1 - color . a)+ color . rgb * color . a,
// blendedSoFar . a *(1 - color . a));
// }
//
// void main()
// {
// const uvec2 imageCoords = gl_GlobalInvocationID . xy;
// if(any(greaterThanEqual(imageCoords, params . outputSize)))
// {
// return;
// }
//
// vec4 blendedWidgets = vec4(0, 0, 0, 1);
//
// const uvec2 subgroupWidgets = texelFetch(culledWidgets, ivec2(gl_WorkGroupID . xy), 0). xy;
// uint textWidgets = subgroupWidgets . x;
// uint graphWidgets = subgroupWidgets . y;
//
// while(graphWidgets != 0)
// {
// const uint graphWidget = findLSB(graphWidgets);
// graphWidgets ^= 1 << graphWidget;
//
// const uvec4 widgetCoords = graphWidgetsData[graphWidget]. coordinates;
// if(! intersects(imageCoords, widgetCoords))
// {
// continue;
// }
//
// if(imageCoords . x == widgetCoords . x || imageCoords . y == widgetCoords . y ||
// imageCoords . x + 1 == widgetCoords . z || imageCoords . y + 1 == widgetCoords . w)
// {
//
// blendedWidgets = vec4(0);
// continue;
// }
//
// const uvec2 coordInWidget = imageCoords - widgetCoords . xy;
// const uint valueWidth = graphWidgetsData[graphWidget]. valueWidth . x;
//
// const uint value = getValue(graphWidget, coordInWidget, valueWidth);
//
// vec4 color = vec4(0);
// const uint widgetHeight = widgetCoords . w - widgetCoords . y;
//
// bool indicateOverflow = value > widgetHeight && coordInWidget . y + 4 >= widgetHeight
// &&((coordInWidget . x ^ coordInWidget . y)& 1)== 0;
//
// if((widgetHeight - coordInWidget . y)< value && ! indicateOverflow)
// {
// color = graphWidgetsData[graphWidget]. color;
// blendedWidgets = blend(blendedWidgets, color);
// }
// }
//
// while(textWidgets != 0)
// {
// const uint textWidget = findLSB(textWidgets);
// textWidgets ^= 1 << textWidget;
//
// const uvec4 widgetCoords = textWidgetsData[textWidget]. coordinates;
// if(! intersects(imageCoords, widgetCoords))
// {
// continue;
// }
//
// const uvec2 coordInWidget = imageCoords - widgetCoords . xy;
// const uvec4 fontSizePacked = textWidgetsData[textWidget]. fontSize;
// const uvec2 fontGlyphSize = fontSizePacked . xy;
// const uint fontLayer = fontSizePacked . z;
//
// const uint textChar = getChar(textWidget, coordInWidget, fontGlyphSize . x);
//
// if(textChar <(32 * 3))
// {
//
// const float sampleValue = sampleFont(textChar, coordInWidget, fontGlyphSize, fontLayer);
//
// vec4 color = vec4(0, 0, 0, 0.4);
// color = mix(color, textWidgetsData[textWidget]. color, sampleValue);
//
// blendedWidgets = blend(blendedWidgets, color);
// }
// }
//
// if(blendedWidgets . a < 1)
// {
// vec3 blendedColor = blendedWidgets . rgb;
// if(blendedWidgets . a > 0)
// {
// const vec4 color = imageLoad(blendOutput, ivec2(imageCoords));
// blendedColor += color . rgb * color . a * blendedWidgets . a;
// }
// imageStore(blendOutput, ivec2(imageCoords), vec4(blendedColor, 1));
// }
// }

Просмотреть файл

@ -0,0 +1,526 @@
// 7.12.3226
#pragma once
const uint32_t kOverlayDraw_comp_00000001[] = {
0x07230203,0x00010000,0x00080007,0x000001ba,0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000005,0x00000004,0x6e69616d,0x00000000,0x0000009f,0x000000b7,0x00060010,
0x00000004,0x00000011,0x00000008,0x00000008,0x00000001,0x00030003,0x00000002,0x000001c2,
0x000b0004,0x455f4c47,0x735f5458,0x6c706d61,0x656c7265,0x745f7373,0x75747865,0x665f6572,
0x74636e75,0x736e6f69,0x00000000,0x00040005,0x00000004,0x6e69616d,0x00000000,0x00070005,
0x0000000d,0x65746e69,0x63657372,0x76287374,0x763b3275,0x003b3475,0x00050005,0x0000000b,
0x67616d69,0x6f6f4365,0x00736472,0x00060005,0x0000000c,0x67646977,0x6f437465,0x7364726f,
0x00000000,0x00070005,0x00000013,0x43746567,0x28726168,0x763b3175,0x753b3275,0x00003b31,
0x00050005,0x00000010,0x74786574,0x67646957,0x00007465,0x00060005,0x00000011,0x726f6f63,
0x576e4964,0x65676469,0x00000074,0x00060005,0x00000012,0x746e6f66,0x70796c47,0x64695768,
0x00006874,0x00090005,0x0000001b,0x706d6173,0x6f46656c,0x7528746e,0x75763b31,0x75763b32,
0x31753b32,0x0000003b,0x00050005,0x00000017,0x74786574,0x72616843,0x00000000,0x00060005,
0x00000018,0x726f6f63,0x576e4964,0x65676469,0x00000074,0x00060005,0x00000019,0x746e6f66,
0x70796c47,0x7a695368,0x00000065,0x00050005,0x0000001a,0x746e6f66,0x6579614c,0x00000072,
0x00070005,0x00000020,0x56746567,0x65756c61,0x3b317528,0x3b327576,0x003b3175,0x00050005,
0x0000001d,0x70617267,0x64695768,0x00746567,0x00060005,0x0000001e,0x726f6f63,0x576e4964,
0x65676469,0x00000074,0x00050005,0x0000001f,0x756c6176,0x64695765,0x00006874,0x00060005,
0x00000026,0x6e656c62,0x66762864,0x66763b34,0x00003b34,0x00060005,0x00000024,0x6e656c62,
0x53646564,0x7261466f,0x00000000,0x00040005,0x00000025,0x6f6c6f63,0x00000072,0x00050005,
0x00000035,0x72616863,0x65646e49,0x00000078,0x00050005,0x00000039,0x6b636170,0x65646e49,
0x00000078,0x00050005,0x0000003d,0x6b636170,0x68436465,0x00737261,0x00060005,0x00000040,
0x74786554,0x67646957,0x61447465,0x00006174,0x00060006,0x00000040,0x00000000,0x726f6f63,
0x616e6964,0x00736574,0x00050006,0x00000040,0x00000001,0x6f6c6f63,0x00000072,0x00060006,
0x00000040,0x00000002,0x746e6f66,0x657a6953,0x00000000,0x00050006,0x00000040,0x00000003,
0x74786574,0x00000000,0x00050005,0x00000043,0x74786554,0x67646957,0x00737465,0x00070006,
0x00000043,0x00000000,0x74786574,0x67646957,0x44737465,0x00617461,0x00030005,0x00000045,
0x00000000,0x00040005,0x00000050,0x66696873,0x00000074,0x00060005,0x0000005d,0x726f6f63,
0x476e4964,0x6870796c,0x00000000,0x00050005,0x0000005f,0x70796c67,0x66664f68,0x00746573,
0x00040005,0x00000066,0x746e6f66,0x00000000,0x00050005,0x00000076,0x756c6176,0x646e4965,
0x00007865,0x00060005,0x0000007a,0x70617247,0x64695768,0x44746567,0x00617461,0x00060006,
0x0000007a,0x00000000,0x726f6f63,0x616e6964,0x00736574,0x00050006,0x0000007a,0x00000001,
0x6f6c6f63,0x00000072,0x00060006,0x0000007a,0x00000002,0x756c6176,0x64695765,0x00006874,
0x00050006,0x0000007a,0x00000003,0x756c6176,0x00007365,0x00060005,0x0000007c,0x70617247,
0x64695768,0x73746567,0x00000000,0x00080006,0x0000007c,0x00000000,0x70617267,0x64695768,
0x73746567,0x61746144,0x00000000,0x00030005,0x0000007e,0x00000000,0x00050005,0x0000009c,
0x67616d69,0x6f6f4365,0x00736472,0x00080005,0x0000009f,0x475f6c67,0x61626f6c,0x766e496c,
0x7461636f,0x496e6f69,0x00000044,0x00060005,0x000000a3,0x68737550,0x736e6f43,0x746e6174,
0x00000073,0x00060006,0x000000a3,0x00000000,0x7074756f,0x69537475,0x0000657a,0x00040005,
0x000000a5,0x61726170,0x0000736d,0x00060005,0x000000af,0x6e656c62,0x57646564,0x65676469,
0x00007374,0x00060005,0x000000b2,0x67627573,0x70756f72,0x67646957,0x00737465,0x00060005,
0x000000b5,0x6c6c7563,0x69576465,0x74656764,0x00000073,0x00060005,0x000000b7,0x575f6c67,
0x476b726f,0x70756f72,0x00004449,0x00050005,0x000000bd,0x74786574,0x67646957,0x00737465,
0x00060005,0x000000c0,0x70617267,0x64695768,0x73746567,0x00000000,0x00050005,0x000000cb,
0x70617267,0x64695768,0x00746567,0x00060005,0x000000d6,0x67646977,0x6f437465,0x7364726f,
0x00000000,0x00060005,0x00000109,0x726f6f63,0x576e4964,0x65676469,0x00000074,0x00050005,
0x0000010e,0x756c6176,0x64695765,0x00006874,0x00040005,0x00000113,0x756c6176,0x00000065,
0x00040005,0x00000118,0x6f6c6f63,0x00000072,0x00060005,0x00000119,0x67646977,0x65487465,
0x74686769,0x00000000,0x00070005,0x00000120,0x69646e69,0x65746163,0x7265764f,0x776f6c66,
0x00000000,0x00050005,0x0000014f,0x74786574,0x67646957,0x00007465,0x00060005,0x00000158,
0x67646977,0x6f437465,0x7364726f,0x00000000,0x00060005,0x00000163,0x726f6f63,0x576e4964,
0x65676469,0x00000074,0x00060005,0x00000168,0x746e6f66,0x657a6953,0x6b636150,0x00006465,
0x00060005,0x0000016c,0x746e6f66,0x70796c47,0x7a695368,0x00000065,0x00050005,0x0000016f,
0x746e6f66,0x6579614c,0x00000072,0x00050005,0x00000172,0x74786574,0x72616843,0x00000000,
0x00050005,0x0000017e,0x706d6173,0x6156656c,0x0065756c,0x00040005,0x00000184,0x6f6c6f63,
0x00000072,0x00060005,0x00000197,0x6e656c62,0x43646564,0x726f6c6f,0x00000000,0x00040005,
0x0000019f,0x6f6c6f63,0x00000072,0x00050005,0x000001a2,0x6e656c62,0x74754f64,0x00747570,
0x00040047,0x0000003f,0x00000006,0x00000010,0x00050048,0x00000040,0x00000000,0x00000023,
0x00000000,0x00050048,0x00000040,0x00000001,0x00000023,0x00000010,0x00050048,0x00000040,
0x00000002,0x00000023,0x00000020,0x00050048,0x00000040,0x00000003,0x00000023,0x00000030,
0x00040047,0x00000042,0x00000006,0x00000130,0x00050048,0x00000043,0x00000000,0x00000023,
0x00000000,0x00030047,0x00000043,0x00000002,0x00040047,0x00000045,0x00000022,0x00000000,
0x00040047,0x00000045,0x00000021,0x00000001,0x00040047,0x00000066,0x00000022,0x00000000,
0x00040047,0x00000066,0x00000021,0x00000004,0x00040047,0x00000079,0x00000006,0x00000010,
0x00050048,0x0000007a,0x00000000,0x00000023,0x00000000,0x00050048,0x0000007a,0x00000001,
0x00000023,0x00000010,0x00050048,0x0000007a,0x00000002,0x00000023,0x00000020,0x00050048,
0x0000007a,0x00000003,0x00000023,0x00000030,0x00040047,0x0000007b,0x00000006,0x00000130,
0x00050048,0x0000007c,0x00000000,0x00000023,0x00000000,0x00030047,0x0000007c,0x00000002,
0x00040047,0x0000007e,0x00000022,0x00000000,0x00040047,0x0000007e,0x00000021,0x00000002,
0x00040047,0x0000009f,0x0000000b,0x0000001c,0x00050048,0x000000a3,0x00000000,0x00000023,
0x00000000,0x00030047,0x000000a3,0x00000002,0x00040047,0x000000b5,0x00000022,0x00000000,
0x00040047,0x000000b5,0x00000021,0x00000003,0x00040047,0x000000b7,0x0000000b,0x0000001a,
0x00040047,0x000001a2,0x00000022,0x00000000,0x00040047,0x000001a2,0x00000021,0x00000000,
0x00040047,0x000001b9,0x0000000b,0x00000019,0x00020013,0x00000002,0x00030021,0x00000003,
0x00000002,0x00040015,0x00000006,0x00000020,0x00000000,0x00040017,0x00000007,0x00000006,
0x00000002,0x00040017,0x00000008,0x00000006,0x00000004,0x00020014,0x00000009,0x00050021,
0x0000000a,0x00000009,0x00000007,0x00000008,0x00060021,0x0000000f,0x00000006,0x00000006,
0x00000007,0x00000006,0x00030016,0x00000015,0x00000020,0x00070021,0x00000016,0x00000015,
0x00000006,0x00000007,0x00000007,0x00000006,0x00040017,0x00000022,0x00000015,0x00000004,
0x00050021,0x00000023,0x00000022,0x00000022,0x00000022,0x00040017,0x00000029,0x00000009,
0x00000002,0x00040020,0x00000034,0x00000007,0x00000006,0x0004002b,0x00000006,0x00000036,
0x00000000,0x0004002b,0x00000006,0x0000003b,0x00000004,0x0004002b,0x00000006,0x0000003e,
0x00000010,0x0004001c,0x0000003f,0x00000008,0x0000003e,0x0006001e,0x00000040,0x00000008,
0x00000022,0x00000008,0x0000003f,0x0004002b,0x00000006,0x00000041,0x00000020,0x0004001c,
0x00000042,0x00000040,0x00000041,0x0003001e,0x00000043,0x00000042,0x00040020,0x00000044,
0x00000002,0x00000043,0x0004003b,0x00000044,0x00000045,0x00000002,0x00040015,0x00000046,
0x00000020,0x00000001,0x0004002b,0x00000046,0x00000047,0x00000000,0x0004002b,0x00000046,
0x00000048,0x00000003,0x00040020,0x0000004d,0x00000002,0x00000006,0x0004002b,0x00000006,
0x00000053,0x00000008,0x0004002b,0x00000006,0x00000058,0x000000ff,0x00040020,0x0000005c,
0x00000007,0x00000007,0x00090019,0x00000064,0x00000015,0x00000001,0x00000000,0x00000001,
0x00000000,0x00000001,0x00000000,0x00040020,0x00000065,0x00000000,0x00000064,0x0004003b,
0x00000065,0x00000066,0x00000000,0x00040017,0x0000006b,0x00000046,0x00000002,0x00040017,
0x0000006e,0x00000046,0x00000003,0x0004001c,0x00000079,0x00000008,0x0000003e,0x0006001e,
0x0000007a,0x00000008,0x00000022,0x00000008,0x00000079,0x0004001c,0x0000007b,0x0000007a,
0x00000041,0x0003001e,0x0000007c,0x0000007b,0x00040020,0x0000007d,0x00000002,0x0000007c,
0x0004003b,0x0000007d,0x0000007e,0x00000002,0x00040017,0x00000087,0x00000015,0x00000003,
0x0004002b,0x00000015,0x00000089,0x3f800000,0x0004002b,0x00000006,0x0000008a,0x00000003,
0x00040017,0x0000009d,0x00000006,0x00000003,0x00040020,0x0000009e,0x00000001,0x0000009d,
0x0004003b,0x0000009e,0x0000009f,0x00000001,0x0003001e,0x000000a3,0x00000007,0x00040020,
0x000000a4,0x00000009,0x000000a3,0x0004003b,0x000000a4,0x000000a5,0x00000009,0x00040020,
0x000000a6,0x00000009,0x00000007,0x00040020,0x000000ae,0x00000007,0x00000022,0x0004002b,
0x00000015,0x000000b0,0x00000000,0x0007002c,0x00000022,0x000000b1,0x000000b0,0x000000b0,
0x000000b0,0x00000089,0x00090019,0x000000b3,0x00000006,0x00000001,0x00000000,0x00000000,
0x00000000,0x00000001,0x00000000,0x00040020,0x000000b4,0x00000000,0x000000b3,0x0004003b,
0x000000b4,0x000000b5,0x00000000,0x0004003b,0x0000009e,0x000000b7,0x00000001,0x0004002b,
0x00000006,0x000000c1,0x00000001,0x0004002b,0x00000046,0x000000cf,0x00000001,0x00040020,
0x000000d5,0x00000007,0x00000008,0x00040020,0x000000d8,0x00000002,0x00000008,0x0004002b,
0x00000006,0x000000f6,0x00000002,0x0007002c,0x00000022,0x00000107,0x000000b0,0x000000b0,
0x000000b0,0x000000b0,0x0004002b,0x00000046,0x00000110,0x00000002,0x00040020,0x0000011f,
0x00000007,0x00000009,0x00040020,0x00000142,0x00000002,0x00000022,0x0004002b,0x00000006,
0x00000179,0x00000060,0x00040020,0x0000017d,0x00000007,0x00000015,0x0004002b,0x00000015,
0x00000185,0x3ecccccd,0x0007002c,0x00000022,0x00000186,0x000000b0,0x000000b0,0x000000b0,
0x00000185,0x00040020,0x00000196,0x00000007,0x00000087,0x00090019,0x000001a0,0x00000015,
0x00000001,0x00000000,0x00000000,0x00000000,0x00000002,0x00000001,0x00040020,0x000001a1,
0x00000000,0x000001a0,0x0004003b,0x000001a1,0x000001a2,0x00000000,0x0006002c,0x0000009d,
0x000001b9,0x00000053,0x00000053,0x000000c1,0x00050036,0x00000002,0x00000004,0x00000000,
0x00000003,0x000200f8,0x00000005,0x0004003b,0x0000005c,0x0000009c,0x00000007,0x0004003b,
0x000000ae,0x000000af,0x00000007,0x0004003b,0x0000005c,0x000000b2,0x00000007,0x0004003b,
0x00000034,0x000000bd,0x00000007,0x0004003b,0x00000034,0x000000c0,0x00000007,0x0004003b,
0x00000034,0x000000cb,0x00000007,0x0004003b,0x000000d5,0x000000d6,0x00000007,0x0004003b,
0x0000005c,0x00000109,0x00000007,0x0004003b,0x00000034,0x0000010e,0x00000007,0x0004003b,
0x00000034,0x00000113,0x00000007,0x0004003b,0x000000ae,0x00000118,0x00000007,0x0004003b,
0x00000034,0x00000119,0x00000007,0x0004003b,0x0000011f,0x00000120,0x00000007,0x0004003b,
0x00000034,0x0000014f,0x00000007,0x0004003b,0x000000d5,0x00000158,0x00000007,0x0004003b,
0x0000005c,0x00000163,0x00000007,0x0004003b,0x000000d5,0x00000168,0x00000007,0x0004003b,
0x0000005c,0x0000016c,0x00000007,0x0004003b,0x00000034,0x0000016f,0x00000007,0x0004003b,
0x00000034,0x00000172,0x00000007,0x0004003b,0x0000017d,0x0000017e,0x00000007,0x0004003b,
0x000000ae,0x00000184,0x00000007,0x0004003b,0x00000196,0x00000197,0x00000007,0x0004003b,
0x000000ae,0x0000019f,0x00000007,0x0004003d,0x0000009d,0x000000a0,0x0000009f,0x0007004f,
0x00000007,0x000000a1,0x000000a0,0x000000a0,0x00000000,0x00000001,0x0003003e,0x0000009c,
0x000000a1,0x0004003d,0x00000007,0x000000a2,0x0000009c,0x00050041,0x000000a6,0x000000a7,
0x000000a5,0x00000047,0x0004003d,0x00000007,0x000000a8,0x000000a7,0x000500ae,0x00000029,
0x000000a9,0x000000a2,0x000000a8,0x0004009a,0x00000009,0x000000aa,0x000000a9,0x000300f7,
0x000000ac,0x00000000,0x000400fa,0x000000aa,0x000000ab,0x000000ac,0x000200f8,0x000000ab,
0x000100fd,0x000200f8,0x000000ac,0x0003003e,0x000000af,0x000000b1,0x0004003d,0x000000b3,
0x000000b6,0x000000b5,0x0004003d,0x0000009d,0x000000b8,0x000000b7,0x0007004f,0x00000007,
0x000000b9,0x000000b8,0x000000b8,0x00000000,0x00000001,0x0004007c,0x0000006b,0x000000ba,
0x000000b9,0x0007005f,0x00000008,0x000000bb,0x000000b6,0x000000ba,0x00000002,0x00000047,
0x0007004f,0x00000007,0x000000bc,0x000000bb,0x000000bb,0x00000000,0x00000001,0x0003003e,
0x000000b2,0x000000bc,0x00050041,0x00000034,0x000000be,0x000000b2,0x00000036,0x0004003d,
0x00000006,0x000000bf,0x000000be,0x0003003e,0x000000bd,0x000000bf,0x00050041,0x00000034,
0x000000c2,0x000000b2,0x000000c1,0x0004003d,0x00000006,0x000000c3,0x000000c2,0x0003003e,
0x000000c0,0x000000c3,0x000200f9,0x000000c4,0x000200f8,0x000000c4,0x000400f6,0x000000c6,
0x000000c7,0x00000000,0x000200f9,0x000000c8,0x000200f8,0x000000c8,0x0004003d,0x00000006,
0x000000c9,0x000000c0,0x000500ab,0x00000009,0x000000ca,0x000000c9,0x00000036,0x000400fa,
0x000000ca,0x000000c5,0x000000c6,0x000200f8,0x000000c5,0x0004003d,0x00000006,0x000000cc,
0x000000c0,0x0006000c,0x00000046,0x000000cd,0x00000001,0x00000049,0x000000cc,0x0004007c,
0x00000006,0x000000ce,0x000000cd,0x0003003e,0x000000cb,0x000000ce,0x0004003d,0x00000006,
0x000000d0,0x000000cb,0x000500c4,0x00000046,0x000000d1,0x000000cf,0x000000d0,0x0004007c,
0x00000006,0x000000d2,0x000000d1,0x0004003d,0x00000006,0x000000d3,0x000000c0,0x000500c6,
0x00000006,0x000000d4,0x000000d3,0x000000d2,0x0003003e,0x000000c0,0x000000d4,0x0004003d,
0x00000006,0x000000d7,0x000000cb,0x00070041,0x000000d8,0x000000d9,0x0000007e,0x00000047,
0x000000d7,0x00000047,0x0004003d,0x00000008,0x000000da,0x000000d9,0x0003003e,0x000000d6,
0x000000da,0x0004003d,0x00000007,0x000000db,0x0000009c,0x0004003d,0x00000008,0x000000dc,
0x000000d6,0x00060039,0x00000009,0x000000dd,0x0000000d,0x000000db,0x000000dc,0x000400a8,
0x00000009,0x000000de,0x000000dd,0x000300f7,0x000000e0,0x00000000,0x000400fa,0x000000de,
0x000000df,0x000000e0,0x000200f8,0x000000df,0x000200f9,0x000000c7,0x000200f8,0x000000e0,
0x00050041,0x00000034,0x000000e2,0x0000009c,0x00000036,0x0004003d,0x00000006,0x000000e3,
0x000000e2,0x00050041,0x00000034,0x000000e4,0x000000d6,0x00000036,0x0004003d,0x00000006,
0x000000e5,0x000000e4,0x000500aa,0x00000009,0x000000e6,0x000000e3,0x000000e5,0x000400a8,
0x00000009,0x000000e7,0x000000e6,0x000300f7,0x000000e9,0x00000000,0x000400fa,0x000000e7,
0x000000e8,0x000000e9,0x000200f8,0x000000e8,0x00050041,0x00000034,0x000000ea,0x0000009c,
0x000000c1,0x0004003d,0x00000006,0x000000eb,0x000000ea,0x00050041,0x00000034,0x000000ec,
0x000000d6,0x000000c1,0x0004003d,0x00000006,0x000000ed,0x000000ec,0x000500aa,0x00000009,
0x000000ee,0x000000eb,0x000000ed,0x000200f9,0x000000e9,0x000200f8,0x000000e9,0x000700f5,
0x00000009,0x000000ef,0x000000e6,0x000000e0,0x000000ee,0x000000e8,0x000400a8,0x00000009,
0x000000f0,0x000000ef,0x000300f7,0x000000f2,0x00000000,0x000400fa,0x000000f0,0x000000f1,
0x000000f2,0x000200f8,0x000000f1,0x00050041,0x00000034,0x000000f3,0x0000009c,0x00000036,
0x0004003d,0x00000006,0x000000f4,0x000000f3,0x00050080,0x00000006,0x000000f5,0x000000f4,
0x000000c1,0x00050041,0x00000034,0x000000f7,0x000000d6,0x000000f6,0x0004003d,0x00000006,
0x000000f8,0x000000f7,0x000500aa,0x00000009,0x000000f9,0x000000f5,0x000000f8,0x000200f9,
0x000000f2,0x000200f8,0x000000f2,0x000700f5,0x00000009,0x000000fa,0x000000ef,0x000000e9,
0x000000f9,0x000000f1,0x000400a8,0x00000009,0x000000fb,0x000000fa,0x000300f7,0x000000fd,
0x00000000,0x000400fa,0x000000fb,0x000000fc,0x000000fd,0x000200f8,0x000000fc,0x00050041,
0x00000034,0x000000fe,0x0000009c,0x000000c1,0x0004003d,0x00000006,0x000000ff,0x000000fe,
0x00050080,0x00000006,0x00000100,0x000000ff,0x000000c1,0x00050041,0x00000034,0x00000101,
0x000000d6,0x0000008a,0x0004003d,0x00000006,0x00000102,0x00000101,0x000500aa,0x00000009,
0x00000103,0x00000100,0x00000102,0x000200f9,0x000000fd,0x000200f8,0x000000fd,0x000700f5,
0x00000009,0x00000104,0x000000fa,0x000000f2,0x00000103,0x000000fc,0x000300f7,0x00000106,
0x00000000,0x000400fa,0x00000104,0x00000105,0x00000106,0x000200f8,0x00000105,0x0003003e,
0x000000af,0x00000107,0x000200f9,0x000000c7,0x000200f8,0x00000106,0x0004003d,0x00000007,
0x0000010a,0x0000009c,0x0004003d,0x00000008,0x0000010b,0x000000d6,0x0007004f,0x00000007,
0x0000010c,0x0000010b,0x0000010b,0x00000000,0x00000001,0x00050082,0x00000007,0x0000010d,
0x0000010a,0x0000010c,0x0003003e,0x00000109,0x0000010d,0x0004003d,0x00000006,0x0000010f,
0x000000cb,0x00080041,0x0000004d,0x00000111,0x0000007e,0x00000047,0x0000010f,0x00000110,
0x00000036,0x0004003d,0x00000006,0x00000112,0x00000111,0x0003003e,0x0000010e,0x00000112,
0x0004003d,0x00000006,0x00000114,0x000000cb,0x0004003d,0x00000007,0x00000115,0x00000109,
0x0004003d,0x00000006,0x00000116,0x0000010e,0x00070039,0x00000006,0x00000117,0x00000020,
0x00000114,0x00000115,0x00000116,0x0003003e,0x00000113,0x00000117,0x0003003e,0x00000118,
0x00000107,0x00050041,0x00000034,0x0000011a,0x000000d6,0x0000008a,0x0004003d,0x00000006,
0x0000011b,0x0000011a,0x00050041,0x00000034,0x0000011c,0x000000d6,0x000000c1,0x0004003d,
0x00000006,0x0000011d,0x0000011c,0x00050082,0x00000006,0x0000011e,0x0000011b,0x0000011d,
0x0003003e,0x00000119,0x0000011e,0x0004003d,0x00000006,0x00000121,0x00000113,0x0004003d,
0x00000006,0x00000122,0x00000119,0x000500ac,0x00000009,0x00000123,0x00000121,0x00000122,
0x000300f7,0x00000125,0x00000000,0x000400fa,0x00000123,0x00000124,0x00000125,0x000200f8,
0x00000124,0x00050041,0x00000034,0x00000126,0x00000109,0x000000c1,0x0004003d,0x00000006,
0x00000127,0x00000126,0x00050080,0x00000006,0x00000128,0x00000127,0x0000003b,0x0004003d,
0x00000006,0x00000129,0x00000119,0x000500ae,0x00000009,0x0000012a,0x00000128,0x00000129,
0x000200f9,0x00000125,0x000200f8,0x00000125,0x000700f5,0x00000009,0x0000012b,0x00000123,
0x00000106,0x0000012a,0x00000124,0x000300f7,0x0000012d,0x00000000,0x000400fa,0x0000012b,
0x0000012c,0x0000012d,0x000200f8,0x0000012c,0x00050041,0x00000034,0x0000012e,0x00000109,
0x00000036,0x0004003d,0x00000006,0x0000012f,0x0000012e,0x00050041,0x00000034,0x00000130,
0x00000109,0x000000c1,0x0004003d,0x00000006,0x00000131,0x00000130,0x000500c6,0x00000006,
0x00000132,0x0000012f,0x00000131,0x000500c7,0x00000006,0x00000133,0x00000132,0x000000c1,
0x000500aa,0x00000009,0x00000134,0x00000133,0x00000036,0x000200f9,0x0000012d,0x000200f8,
0x0000012d,0x000700f5,0x00000009,0x00000135,0x0000012b,0x00000125,0x00000134,0x0000012c,
0x0003003e,0x00000120,0x00000135,0x0004003d,0x00000006,0x00000136,0x00000119,0x00050041,
0x00000034,0x00000137,0x00000109,0x000000c1,0x0004003d,0x00000006,0x00000138,0x00000137,
0x00050082,0x00000006,0x00000139,0x00000136,0x00000138,0x0004003d,0x00000006,0x0000013a,
0x00000113,0x000500b0,0x00000009,0x0000013b,0x00000139,0x0000013a,0x0004003d,0x00000009,
0x0000013c,0x00000120,0x000400a8,0x00000009,0x0000013d,0x0000013c,0x000500a7,0x00000009,
0x0000013e,0x0000013b,0x0000013d,0x000300f7,0x00000140,0x00000000,0x000400fa,0x0000013e,
0x0000013f,0x00000140,0x000200f8,0x0000013f,0x0004003d,0x00000006,0x00000141,0x000000cb,
0x00070041,0x00000142,0x00000143,0x0000007e,0x00000047,0x00000141,0x000000cf,0x0004003d,
0x00000022,0x00000144,0x00000143,0x0003003e,0x00000118,0x00000144,0x0004003d,0x00000022,
0x00000145,0x000000af,0x0004003d,0x00000022,0x00000146,0x00000118,0x00060039,0x00000022,
0x00000147,0x00000026,0x00000145,0x00000146,0x0003003e,0x000000af,0x00000147,0x000200f9,
0x00000140,0x000200f8,0x00000140,0x000200f9,0x000000c7,0x000200f8,0x000000c7,0x000200f9,
0x000000c4,0x000200f8,0x000000c6,0x000200f9,0x00000148,0x000200f8,0x00000148,0x000400f6,
0x0000014a,0x0000014b,0x00000000,0x000200f9,0x0000014c,0x000200f8,0x0000014c,0x0004003d,
0x00000006,0x0000014d,0x000000bd,0x000500ab,0x00000009,0x0000014e,0x0000014d,0x00000036,
0x000400fa,0x0000014e,0x00000149,0x0000014a,0x000200f8,0x00000149,0x0004003d,0x00000006,
0x00000150,0x000000bd,0x0006000c,0x00000046,0x00000151,0x00000001,0x00000049,0x00000150,
0x0004007c,0x00000006,0x00000152,0x00000151,0x0003003e,0x0000014f,0x00000152,0x0004003d,
0x00000006,0x00000153,0x0000014f,0x000500c4,0x00000046,0x00000154,0x000000cf,0x00000153,
0x0004007c,0x00000006,0x00000155,0x00000154,0x0004003d,0x00000006,0x00000156,0x000000bd,
0x000500c6,0x00000006,0x00000157,0x00000156,0x00000155,0x0003003e,0x000000bd,0x00000157,
0x0004003d,0x00000006,0x00000159,0x0000014f,0x00070041,0x000000d8,0x0000015a,0x00000045,
0x00000047,0x00000159,0x00000047,0x0004003d,0x00000008,0x0000015b,0x0000015a,0x0003003e,
0x00000158,0x0000015b,0x0004003d,0x00000007,0x0000015c,0x0000009c,0x0004003d,0x00000008,
0x0000015d,0x00000158,0x00060039,0x00000009,0x0000015e,0x0000000d,0x0000015c,0x0000015d,
0x000400a8,0x00000009,0x0000015f,0x0000015e,0x000300f7,0x00000161,0x00000000,0x000400fa,
0x0000015f,0x00000160,0x00000161,0x000200f8,0x00000160,0x000200f9,0x0000014b,0x000200f8,
0x00000161,0x0004003d,0x00000007,0x00000164,0x0000009c,0x0004003d,0x00000008,0x00000165,
0x00000158,0x0007004f,0x00000007,0x00000166,0x00000165,0x00000165,0x00000000,0x00000001,
0x00050082,0x00000007,0x00000167,0x00000164,0x00000166,0x0003003e,0x00000163,0x00000167,
0x0004003d,0x00000006,0x00000169,0x0000014f,0x00070041,0x000000d8,0x0000016a,0x00000045,
0x00000047,0x00000169,0x00000110,0x0004003d,0x00000008,0x0000016b,0x0000016a,0x0003003e,
0x00000168,0x0000016b,0x0004003d,0x00000008,0x0000016d,0x00000168,0x0007004f,0x00000007,
0x0000016e,0x0000016d,0x0000016d,0x00000000,0x00000001,0x0003003e,0x0000016c,0x0000016e,
0x00050041,0x00000034,0x00000170,0x00000168,0x000000f6,0x0004003d,0x00000006,0x00000171,
0x00000170,0x0003003e,0x0000016f,0x00000171,0x0004003d,0x00000006,0x00000173,0x0000014f,
0x0004003d,0x00000007,0x00000174,0x00000163,0x00050041,0x00000034,0x00000175,0x0000016c,
0x00000036,0x0004003d,0x00000006,0x00000176,0x00000175,0x00070039,0x00000006,0x00000177,
0x00000013,0x00000173,0x00000174,0x00000176,0x0003003e,0x00000172,0x00000177,0x0004003d,
0x00000006,0x00000178,0x00000172,0x000500b0,0x00000009,0x0000017a,0x00000178,0x00000179,
0x000300f7,0x0000017c,0x00000000,0x000400fa,0x0000017a,0x0000017b,0x0000017c,0x000200f8,
0x0000017b,0x0004003d,0x00000006,0x0000017f,0x00000172,0x0004003d,0x00000007,0x00000180,
0x00000163,0x0004003d,0x00000007,0x00000181,0x0000016c,0x0004003d,0x00000006,0x00000182,
0x0000016f,0x00080039,0x00000015,0x00000183,0x0000001b,0x0000017f,0x00000180,0x00000181,
0x00000182,0x0003003e,0x0000017e,0x00000183,0x0003003e,0x00000184,0x00000186,0x0004003d,
0x00000022,0x00000187,0x00000184,0x0004003d,0x00000006,0x00000188,0x0000014f,0x00070041,
0x00000142,0x00000189,0x00000045,0x00000047,0x00000188,0x000000cf,0x0004003d,0x00000022,
0x0000018a,0x00000189,0x0004003d,0x00000015,0x0000018b,0x0000017e,0x00070050,0x00000022,
0x0000018c,0x0000018b,0x0000018b,0x0000018b,0x0000018b,0x0008000c,0x00000022,0x0000018d,
0x00000001,0x0000002e,0x00000187,0x0000018a,0x0000018c,0x0003003e,0x00000184,0x0000018d,
0x0004003d,0x00000022,0x0000018e,0x000000af,0x0004003d,0x00000022,0x0000018f,0x00000184,
0x00060039,0x00000022,0x00000190,0x00000026,0x0000018e,0x0000018f,0x0003003e,0x000000af,
0x00000190,0x000200f9,0x0000017c,0x000200f8,0x0000017c,0x000200f9,0x0000014b,0x000200f8,
0x0000014b,0x000200f9,0x00000148,0x000200f8,0x0000014a,0x00050041,0x0000017d,0x00000191,
0x000000af,0x0000008a,0x0004003d,0x00000015,0x00000192,0x00000191,0x000500b8,0x00000009,
0x00000193,0x00000192,0x00000089,0x000300f7,0x00000195,0x00000000,0x000400fa,0x00000193,
0x00000194,0x00000195,0x000200f8,0x00000194,0x0004003d,0x00000022,0x00000198,0x000000af,
0x0008004f,0x00000087,0x00000199,0x00000198,0x00000198,0x00000000,0x00000001,0x00000002,
0x0003003e,0x00000197,0x00000199,0x00050041,0x0000017d,0x0000019a,0x000000af,0x0000008a,
0x0004003d,0x00000015,0x0000019b,0x0000019a,0x000500ba,0x00000009,0x0000019c,0x0000019b,
0x000000b0,0x000300f7,0x0000019e,0x00000000,0x000400fa,0x0000019c,0x0000019d,0x0000019e,
0x000200f8,0x0000019d,0x0004003d,0x000001a0,0x000001a3,0x000001a2,0x0004003d,0x00000007,
0x000001a4,0x0000009c,0x0004007c,0x0000006b,0x000001a5,0x000001a4,0x00050062,0x00000022,
0x000001a6,0x000001a3,0x000001a5,0x0003003e,0x0000019f,0x000001a6,0x0004003d,0x00000022,
0x000001a7,0x0000019f,0x0008004f,0x00000087,0x000001a8,0x000001a7,0x000001a7,0x00000000,
0x00000001,0x00000002,0x00050041,0x0000017d,0x000001a9,0x0000019f,0x0000008a,0x0004003d,
0x00000015,0x000001aa,0x000001a9,0x0005008e,0x00000087,0x000001ab,0x000001a8,0x000001aa,
0x00050041,0x0000017d,0x000001ac,0x000000af,0x0000008a,0x0004003d,0x00000015,0x000001ad,
0x000001ac,0x0005008e,0x00000087,0x000001ae,0x000001ab,0x000001ad,0x0004003d,0x00000087,
0x000001af,0x00000197,0x00050081,0x00000087,0x000001b0,0x000001af,0x000001ae,0x0003003e,
0x00000197,0x000001b0,0x000200f9,0x0000019e,0x000200f8,0x0000019e,0x0004003d,0x000001a0,
0x000001b1,0x000001a2,0x0004003d,0x00000007,0x000001b2,0x0000009c,0x0004007c,0x0000006b,
0x000001b3,0x000001b2,0x0004003d,0x00000087,0x000001b4,0x00000197,0x00050051,0x00000015,
0x000001b5,0x000001b4,0x00000000,0x00050051,0x00000015,0x000001b6,0x000001b4,0x00000001,
0x00050051,0x00000015,0x000001b7,0x000001b4,0x00000002,0x00070050,0x00000022,0x000001b8,
0x000001b5,0x000001b6,0x000001b7,0x00000089,0x00040063,0x000001b1,0x000001b3,0x000001b8,
0x000200f9,0x00000195,0x000200f8,0x00000195,0x000100fd,0x00010038,0x00050036,0x00000009,
0x0000000d,0x00000000,0x0000000a,0x00030037,0x00000007,0x0000000b,0x00030037,0x00000008,
0x0000000c,0x000200f8,0x0000000e,0x0007004f,0x00000007,0x00000028,0x0000000c,0x0000000c,
0x00000000,0x00000001,0x000500ae,0x00000029,0x0000002a,0x0000000b,0x00000028,0x0004009b,
0x00000009,0x0000002b,0x0000002a,0x000300f7,0x0000002d,0x00000000,0x000400fa,0x0000002b,
0x0000002c,0x0000002d,0x000200f8,0x0000002c,0x0007004f,0x00000007,0x0000002e,0x0000000c,
0x0000000c,0x00000002,0x00000003,0x000500b0,0x00000029,0x0000002f,0x0000000b,0x0000002e,
0x0004009b,0x00000009,0x00000030,0x0000002f,0x000200f9,0x0000002d,0x000200f8,0x0000002d,
0x000700f5,0x00000009,0x00000031,0x0000002b,0x0000000e,0x00000030,0x0000002c,0x000200fe,
0x00000031,0x00010038,0x00050036,0x00000006,0x00000013,0x00000000,0x0000000f,0x00030037,
0x00000006,0x00000010,0x00030037,0x00000007,0x00000011,0x00030037,0x00000006,0x00000012,
0x000200f8,0x00000014,0x0004003b,0x00000034,0x00000035,0x00000007,0x0004003b,0x00000034,
0x00000039,0x00000007,0x0004003b,0x00000034,0x0000003d,0x00000007,0x0004003b,0x00000034,
0x00000050,0x00000007,0x00050051,0x00000006,0x00000037,0x00000011,0x00000000,0x00050086,
0x00000006,0x00000038,0x00000037,0x00000012,0x0003003e,0x00000035,0x00000038,0x0004003d,
0x00000006,0x0000003a,0x00000035,0x00050086,0x00000006,0x0000003c,0x0000003a,0x0000003b,
0x0003003e,0x00000039,0x0000003c,0x0004003d,0x00000006,0x00000049,0x00000039,0x00050086,
0x00000006,0x0000004a,0x00000049,0x0000003b,0x0004003d,0x00000006,0x0000004b,0x00000039,
0x00050089,0x00000006,0x0000004c,0x0000004b,0x0000003b,0x00090041,0x0000004d,0x0000004e,
0x00000045,0x00000047,0x00000010,0x00000048,0x0000004a,0x0000004c,0x0004003d,0x00000006,
0x0000004f,0x0000004e,0x0003003e,0x0000003d,0x0000004f,0x0004003d,0x00000006,0x00000051,
0x00000035,0x00050089,0x00000006,0x00000052,0x00000051,0x0000003b,0x00050084,0x00000006,
0x00000054,0x00000052,0x00000053,0x0003003e,0x00000050,0x00000054,0x0004003d,0x00000006,
0x00000055,0x0000003d,0x0004003d,0x00000006,0x00000056,0x00000050,0x000500c2,0x00000006,
0x00000057,0x00000055,0x00000056,0x000500c7,0x00000006,0x00000059,0x00000057,0x00000058,
0x000200fe,0x00000059,0x00010038,0x00050036,0x00000015,0x0000001b,0x00000000,0x00000016,
0x00030037,0x00000006,0x00000017,0x00030037,0x00000007,0x00000018,0x00030037,0x00000007,
0x00000019,0x00030037,0x00000006,0x0000001a,0x000200f8,0x0000001c,0x0004003b,0x0000005c,
0x0000005d,0x00000007,0x0004003b,0x0000005c,0x0000005f,0x00000007,0x00050089,0x00000007,
0x0000005e,0x00000018,0x00000019,0x0003003e,0x0000005d,0x0000005e,0x00050089,0x00000006,
0x00000060,0x00000017,0x00000041,0x00050086,0x00000006,0x00000061,0x00000017,0x00000041,
0x00050050,0x00000007,0x00000062,0x00000060,0x00000061,0x00050084,0x00000007,0x00000063,
0x00000019,0x00000062,0x0003003e,0x0000005f,0x00000063,0x0004003d,0x00000064,0x00000067,
0x00000066,0x0004003d,0x00000007,0x00000068,0x0000005f,0x0004003d,0x00000007,0x00000069,
0x0000005d,0x00050080,0x00000007,0x0000006a,0x00000068,0x00000069,0x0004007c,0x0000006b,
0x0000006c,0x0000006a,0x0004007c,0x00000046,0x0000006d,0x0000001a,0x00050051,0x00000046,
0x0000006f,0x0000006c,0x00000000,0x00050051,0x00000046,0x00000070,0x0000006c,0x00000001,
0x00060050,0x0000006e,0x00000071,0x0000006f,0x00000070,0x0000006d,0x0007005f,0x00000022,
0x00000072,0x00000067,0x00000071,0x00000002,0x00000047,0x00050051,0x00000015,0x00000073,
0x00000072,0x00000000,0x000200fe,0x00000073,0x00010038,0x00050036,0x00000006,0x00000020,
0x00000000,0x0000000f,0x00030037,0x00000006,0x0000001d,0x00030037,0x00000007,0x0000001e,
0x00030037,0x00000006,0x0000001f,0x000200f8,0x00000021,0x0004003b,0x00000034,0x00000076,
0x00000007,0x00050051,0x00000006,0x00000077,0x0000001e,0x00000000,0x00050086,0x00000006,
0x00000078,0x00000077,0x0000001f,0x0003003e,0x00000076,0x00000078,0x0004003d,0x00000006,
0x0000007f,0x00000076,0x00050086,0x00000006,0x00000080,0x0000007f,0x0000003b,0x0004003d,
0x00000006,0x00000081,0x00000076,0x00050089,0x00000006,0x00000082,0x00000081,0x0000003b,
0x00090041,0x0000004d,0x00000083,0x0000007e,0x00000047,0x0000001d,0x00000048,0x00000080,
0x00000082,0x0004003d,0x00000006,0x00000084,0x00000083,0x000200fe,0x00000084,0x00010038,
0x00050036,0x00000022,0x00000026,0x00000000,0x00000023,0x00030037,0x00000022,0x00000024,
0x00030037,0x00000022,0x00000025,0x000200f8,0x00000027,0x0008004f,0x00000087,0x00000088,
0x00000024,0x00000024,0x00000000,0x00000001,0x00000002,0x00050051,0x00000015,0x0000008b,
0x00000025,0x00000003,0x00050083,0x00000015,0x0000008c,0x00000089,0x0000008b,0x0005008e,
0x00000087,0x0000008d,0x00000088,0x0000008c,0x0008004f,0x00000087,0x0000008e,0x00000025,
0x00000025,0x00000000,0x00000001,0x00000002,0x00050051,0x00000015,0x0000008f,0x00000025,
0x00000003,0x0005008e,0x00000087,0x00000090,0x0000008e,0x0000008f,0x00050081,0x00000087,
0x00000091,0x0000008d,0x00000090,0x00050051,0x00000015,0x00000092,0x00000024,0x00000003,
0x00050051,0x00000015,0x00000093,0x00000025,0x00000003,0x00050083,0x00000015,0x00000094,
0x00000089,0x00000093,0x00050085,0x00000015,0x00000095,0x00000092,0x00000094,0x00050051,
0x00000015,0x00000096,0x00000091,0x00000000,0x00050051,0x00000015,0x00000097,0x00000091,
0x00000001,0x00050051,0x00000015,0x00000098,0x00000091,0x00000002,0x00070050,0x00000022,
0x00000099,0x00000096,0x00000097,0x00000098,0x00000095,0x000200fe,0x00000099,0x00010038
};
// Generated from:
//
// #version 450 core
//
// #extension GL_EXT_samplerless_texture_functions : require
//
// layout(local_size_x = 8, local_size_y = 8, local_size_z = 1)in;
//
// struct TextWidgetData
// {
// uvec4 coordinates;
// vec4 color;
// uvec4 fontSize;
// uvec4 text[256 / 16];
// };
//
// struct GraphWidgetData
// {
// uvec4 coordinates;
// vec4 color;
// uvec4 valueWidth;
// uvec4 values[64 / 4];
// };
//
// layout(set = 0, binding = 0, rgba32f)uniform image2D blendOutput;
//
// layout(set = 0, binding = 1)uniform TextWidgets
// {
// TextWidgetData textWidgetsData[32];
// };
//
// layout(set = 0, binding = 2)uniform GraphWidgets
// {
// GraphWidgetData graphWidgetsData[32];
// };
//
// layout(set = 0, binding = 3)uniform utexture2D culledWidgets;
// layout(set = 0, binding = 4)uniform texture2DArray font;
//
// layout(push_constant)uniform PushConstants
// {
// uvec2 outputSize;
// } params;
//
// bool intersects(const uvec2 imageCoords, const uvec4 widgetCoords)
// {
// return all(greaterThanEqual(imageCoords, widgetCoords . xy))&&
// all(lessThan(imageCoords, widgetCoords . zw));
// }
//
// uint getChar(const uint textWidget, const uvec2 coordInWidget, const uint fontGlyphWidth)
// {
// const uint charIndex = coordInWidget . x / fontGlyphWidth;
// const uint packIndex = charIndex / 4;
// const uint packedChars = textWidgetsData[textWidget]. text[packIndex / 4][packIndex % 4];
// const uint shift =(charIndex % 4)* 8;
//
// return(packedChars >> shift)& 0xFF;
//
// }
//
// float sampleFont(const uint textChar,
// const uvec2 coordInWidget,
// const uvec2 fontGlyphSize,
// const uint fontLayer)
// {
// const uvec2 coordInGlyph = coordInWidget % fontGlyphSize;
// const uvec2 glyphOffset = fontGlyphSize *
// uvec2(textChar % 32, textChar / 32);
//
// return texelFetch(font, ivec3(glyphOffset + coordInGlyph, fontLayer), 0). x;
// }
//
// uint getValue(const uint graphWidget, const uvec2 coordInWidget, const uint valueWidth)
// {
// const uint valueIndex = coordInWidget . x / valueWidth . x;
// return graphWidgetsData[graphWidget]. values[valueIndex / 4][valueIndex % 4];
// }
//
// vec4 blend(const vec4 blendedSoFar, const vec4 color)
// {
//
// return vec4(blendedSoFar . rgb *(1 - color . a)+ color . rgb * color . a,
// blendedSoFar . a *(1 - color . a));
// }
//
// void main()
// {
// const uvec2 imageCoords = gl_GlobalInvocationID . xy;
// if(any(greaterThanEqual(imageCoords, params . outputSize)))
// {
// return;
// }
//
// vec4 blendedWidgets = vec4(0, 0, 0, 1);
//
// const uvec2 subgroupWidgets = texelFetch(culledWidgets, ivec2(gl_WorkGroupID . xy), 0). xy;
// uint textWidgets = subgroupWidgets . x;
// uint graphWidgets = subgroupWidgets . y;
//
// while(graphWidgets != 0)
// {
// const uint graphWidget = findLSB(graphWidgets);
// graphWidgets ^= 1 << graphWidget;
//
// const uvec4 widgetCoords = graphWidgetsData[graphWidget]. coordinates;
// if(! intersects(imageCoords, widgetCoords))
// {
// continue;
// }
//
// if(imageCoords . x == widgetCoords . x || imageCoords . y == widgetCoords . y ||
// imageCoords . x + 1 == widgetCoords . z || imageCoords . y + 1 == widgetCoords . w)
// {
//
// blendedWidgets = vec4(0);
// continue;
// }
//
// const uvec2 coordInWidget = imageCoords - widgetCoords . xy;
// const uint valueWidth = graphWidgetsData[graphWidget]. valueWidth . x;
//
// const uint value = getValue(graphWidget, coordInWidget, valueWidth);
//
// vec4 color = vec4(0);
// const uint widgetHeight = widgetCoords . w - widgetCoords . y;
//
// bool indicateOverflow = value > widgetHeight && coordInWidget . y + 4 >= widgetHeight
// &&((coordInWidget . x ^ coordInWidget . y)& 1)== 0;
//
// if((widgetHeight - coordInWidget . y)< value && ! indicateOverflow)
// {
// color = graphWidgetsData[graphWidget]. color;
// blendedWidgets = blend(blendedWidgets, color);
// }
// }
//
// while(textWidgets != 0)
// {
// const uint textWidget = findLSB(textWidgets);
// textWidgets ^= 1 << textWidget;
//
// const uvec4 widgetCoords = textWidgetsData[textWidget]. coordinates;
// if(! intersects(imageCoords, widgetCoords))
// {
// continue;
// }
//
// const uvec2 coordInWidget = imageCoords - widgetCoords . xy;
// const uvec4 fontSizePacked = textWidgetsData[textWidget]. fontSize;
// const uvec2 fontGlyphSize = fontSizePacked . xy;
// const uint fontLayer = fontSizePacked . z;
//
// const uint textChar = getChar(textWidget, coordInWidget, fontGlyphSize . x);
//
// if(textChar <(32 * 3))
// {
//
// const float sampleValue = sampleFont(textChar, coordInWidget, fontGlyphSize, fontLayer);
//
// vec4 color = vec4(0, 0, 0, 0.4);
// color = mix(color, textWidgetsData[textWidget]. color, sampleValue);
//
// blendedWidgets = blend(blendedWidgets, color);
// }
// }
//
// if(blendedWidgets . a < 1)
// {
// vec3 blendedColor = blendedWidgets . rgb;
// if(blendedWidgets . a > 0)
// {
// const vec4 color = imageLoad(blendOutput, ivec2(imageCoords));
// blendedColor += color . rgb * color . a * blendedWidgets . a;
// }
// imageStore(blendOutput, ivec2(imageCoords), vec4(blendedColor, 1));
// }
// }

Просмотреть файл

@ -0,0 +1,164 @@
//
// Copyright 2019 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.
//
// OverlayCull.comp: Cull overlay widgets. A maximum of 32 text widgets and 32 graph widgets is
// supported simultaneously.
#version 450 core
#extension GL_EXT_samplerless_texture_functions : require
#if SupportsBallot
#extension GL_KHR_shader_subgroup_ballot: require
#elif SupportsArithmetic
#extension GL_KHR_shader_subgroup_arithmetic: require
#endif
#if Is8x4
#define WORKGROUP_WIDTH 32
#define BLOCK_WIDTH 8
#define BLOCK_HEIGHT 4
#elif Is8x8
#define WORKGROUP_WIDTH 64
#define BLOCK_WIDTH 8
#define BLOCK_HEIGHT 8
#else
#error "Not all subgroup sizes are accounted for"
#endif
// Limits:
#define MAX_TEXT_WIDGETS 32
#define MAX_GRAPH_WIDGETS 32
layout (local_size_x = WORKGROUP_WIDTH, local_size_y = 1, local_size_z = 1) in;
layout(set = 0, binding = 0, rgba32ui) uniform writeonly uimage2D culledWidgetsOut;
layout (set = 0, binding = 1) uniform WidgetCoordinates
{
uvec4 coordinates[MAX_TEXT_WIDGETS + MAX_GRAPH_WIDGETS];
};
#if SupportsNone
shared uint intersectingWidgets[32];
void accumulateWidgets(const uint localId)
{
// Note: no barriers needed as the workgroup size is the same as hardware subgroup size.
if (localId < 16)
{
intersectingWidgets[localId] |= intersectingWidgets[localId + 16];
if (localId < 8)
{
intersectingWidgets[localId] |= intersectingWidgets[localId + 8];
if (localId < 4)
{
intersectingWidgets[localId] |= intersectingWidgets[localId + 4];
if (localId < 2)
{
intersectingWidgets[localId] |= intersectingWidgets[localId + 2];
if (localId < 1)
{
intersectingWidgets[localId] |= intersectingWidgets[localId + 1];
}
}
}
}
}
}
#endif
uvec2 cullWidgets(const uint offset, const uvec2 blockCoordLow, const uvec2 blockCoordHigh)
{
const uint localId = gl_LocalInvocationID.x;
const uvec4 widgetCoords = coordinates[offset + localId];
const bool intersects = widgetCoords.x < widgetCoords.z &&
all(lessThan(widgetCoords.xy, blockCoordHigh)) &&
all(greaterThanEqual(widgetCoords.zw, blockCoordLow));
#if SupportsBallot
return subgroupBallot(intersects).xy;
#elif SupportsArithmetic
#if Is8x8
const uint textWidgetBit =
localId < MAX_TEXT_WIDGETS ? uint(intersects) << localId : 0;
const uint graphWidgetBit =
localId >= MAX_TEXT_WIDGETS ? uint(intersects) << (localId - MAX_TEXT_WIDGETS) : 0;
return uvec2(subgroupOr(textWidgetBit), subgroupOr(graphWidgetBit));
#elif Is8x4
return uvec2(subgroupOr(uint(intersects) << localId), 0);
#else
#error "Not all subgroup sizes are accounted for"
#endif
#elif SupportsNone
uvec2 ballot = uvec2(0, 0);
#if Is8x8
if (localId < MAX_TEXT_WIDGETS)
{
intersectingWidgets[localId] = uint(intersects) << localId;
accumulateWidgets(localId);
if (localId == 0)
{
ballot.x = intersectingWidgets[0];
}
}
else
{
const uint graphLocalId = localId - MAX_TEXT_WIDGETS;
intersectingWidgets[graphLocalId] = uint(intersects) << graphLocalId;
accumulateWidgets(graphLocalId);
}
if (localId == 0)
{
ballot.y = intersectingWidgets[0];
}
#elif Is8x4
intersectingWidgets[localId] = uint(intersects) << localId;
accumulateWidgets(localId);
if (localId == 0)
{
ballot.x = intersectingWidgets[0];
}
#else
#error "Not all subgroup sizes are accounted for"
#endif
return ballot;
#else
#error "Not all subgroup operations are accounted for"
#endif
}
void main()
{
// There is one workgroup invocation per pixel in culledWidgetsOut. Depending on the subgroup
// size, either all widgets and graphs are processed simultaneously (subgroup size 64) or
// separately (subgroup size 32).
const uvec2 outCoord = gl_WorkGroupID.xy;
const uvec2 blockCoordLow = outCoord * uvec2(BLOCK_WIDTH, BLOCK_HEIGHT);
const uvec2 blockCoordHigh = blockCoordLow + uvec2(BLOCK_WIDTH, BLOCK_HEIGHT);
uvec2 culledWidgets;
#if Is8x8
culledWidgets = cullWidgets(0, blockCoordLow, blockCoordHigh);
#elif Is8x4
culledWidgets.x = cullWidgets(0, blockCoordLow, blockCoordHigh).x;
culledWidgets.y = cullWidgets(MAX_TEXT_WIDGETS, blockCoordLow, blockCoordHigh).x;
#else
#error "Not all subgroup sizes are accounted for"
#endif
if (gl_LocalInvocationID.x == 0)
{
imageStore(culledWidgetsOut, ivec2(outCoord), uvec4(culledWidgets, 0, 0));
}
}

Просмотреть файл

@ -0,0 +1,19 @@
{
"Description": [
"Copyright 2019 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.",
"",
"OverlayCull.comp.json: Build parameters for OverlayCull.comp."
],
"SubgroupSize": [
"Is8x4",
"Is8x8"
],
"SubgroupOp": [
[ "SupportsBallot", "--target-env", "vulkan1.1" ],
[ "SupportsArithmetic", "--target-env", "vulkan1.1" ],
"SupportsNone"
]
}

Просмотреть файл

@ -0,0 +1,230 @@
//
// Copyright 2019 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.
//
// OverlayDraw.comp: Draw overlay widgets. A maximum of 32 text widgets and 32 graph widgets is
// supported simultaneously.
#version 450 core
#extension GL_EXT_samplerless_texture_functions : require
#if Is8x4
#define BLOCK_WIDTH 8
#define BLOCK_HEIGHT 4
#elif Is8x8
#define BLOCK_WIDTH 8
#define BLOCK_HEIGHT 8
#else
#error "Not all subgroup sizes are accounted for"
#endif
// Limits:
// Note that max length and size is defined such that each buffer length is below 16KB, the minimum
// guaranteed supported size for uniform buffers.
#define MAX_TEXT_WIDGETS 32
#define MAX_GRAPH_WIDGETS 32
#define MAX_TEXT_LENGTH 256
#define MAX_GRAPH_SIZE 64
// Font information:
#define FONT_GLYPHS_PER_ROW 32
#define FONT_GLYPHS_ROWS 3
#define FONT_CHARACTERS (FONT_GLYPHS_PER_ROW * FONT_GLYPHS_ROWS)
layout (local_size_x = BLOCK_WIDTH, local_size_y = BLOCK_HEIGHT, local_size_z = 1) in;
struct TextWidgetData
{
uvec4 coordinates;
vec4 color;
uvec4 fontSize; // w unused. xy has the font glyph width/height. z has the layer.
uvec4 text[MAX_TEXT_LENGTH / 16];
};
struct GraphWidgetData
{
uvec4 coordinates;
vec4 color;
uvec4 valueWidth; // yzw unused. x should necessarily divide coordinate's z-x
uvec4 values[MAX_GRAPH_SIZE / 4];
};
layout(set = 0, binding = 0, rgba32f) uniform image2D blendOutput;
layout (set = 0, binding = 1) uniform TextWidgets
{
TextWidgetData textWidgetsData[MAX_TEXT_WIDGETS];
};
layout (set = 0, binding = 2) uniform GraphWidgets
{
GraphWidgetData graphWidgetsData[MAX_GRAPH_WIDGETS];
};
layout(set = 0, binding = 3) uniform utexture2D culledWidgets;
layout(set = 0, binding = 4) uniform texture2DArray font;
layout (push_constant) uniform PushConstants
{
uvec2 outputSize;
} params;
bool intersects(const uvec2 imageCoords, const uvec4 widgetCoords)
{
return all(greaterThanEqual(imageCoords, widgetCoords.xy)) &&
all(lessThan(imageCoords, widgetCoords.zw));
}
uint getChar(const uint textWidget, const uvec2 coordInWidget, const uint fontGlyphWidth)
{
const uint charIndex = coordInWidget.x / fontGlyphWidth;
const uint packIndex = charIndex / 4;
const uint packedChars = textWidgetsData[textWidget].text[packIndex / 4][packIndex % 4];
const uint shift = (charIndex % 4) * 8;
#if IsBigEndian
return (packedChars >> (24 - shift)) & 0xFF;
#else
return (packedChars >> shift) & 0xFF;
#endif
}
float sampleFont(const uint textChar,
const uvec2 coordInWidget,
const uvec2 fontGlyphSize,
const uint fontLayer)
{
const uvec2 coordInGlyph = coordInWidget % fontGlyphSize;
const uvec2 glyphOffset = fontGlyphSize *
uvec2(textChar % FONT_GLYPHS_PER_ROW, textChar / FONT_GLYPHS_PER_ROW);
return texelFetch(font, ivec3(glyphOffset + coordInGlyph, fontLayer), 0).x;
}
uint getValue(const uint graphWidget, const uvec2 coordInWidget, const uint valueWidth)
{
const uint valueIndex = coordInWidget.x / valueWidth.x;
return graphWidgetsData[graphWidget].values[valueIndex / 4][valueIndex % 4];
}
vec4 blend(const vec4 blendedSoFar, const vec4 color)
{
// Assuming colors (C1, a1), (C2, a2) ... (Cn, an) have been so far blended, blendedSoFar will
// contain:
//
// .rgb = Cn*an + ... + C2*a2*(1-a3)*...*(1-an) + C1*a1*(1-a2)*...*(1-an)
// .a = (1-a1)*(1-a2)*...*(1-an)
//
// Blending with (Cn+1, an+1) is simply:
//
// .rgb = Cn+1*an+1 + .rgb*(1-an+1)
// .a = .a*(1-an+1)
//
// Note that finally, the background color will be multipled by .a and added with .rgb.
return vec4(blendedSoFar.rgb * (1 - color.a) + color.rgb * color.a,
blendedSoFar.a * (1 - color.a));
}
void main()
{
const uvec2 imageCoords = gl_GlobalInvocationID.xy;
if (any(greaterThanEqual(imageCoords, params.outputSize)))
{
return;
}
vec4 blendedWidgets = vec4(0, 0, 0, 1);
const uvec2 subgroupWidgets = texelFetch(culledWidgets, ivec2(gl_WorkGroupID.xy), 0).xy;
uint textWidgets = subgroupWidgets.x;
uint graphWidgets = subgroupWidgets.y;
// Loop through possible graph widgets that can intersect with this block.
while (graphWidgets != 0)
{
const uint graphWidget = findLSB(graphWidgets);
graphWidgets ^= 1 << graphWidget;
const uvec4 widgetCoords = graphWidgetsData[graphWidget].coordinates;
if (!intersects(imageCoords, widgetCoords))
{
continue;
}
if (imageCoords.x == widgetCoords.x || imageCoords.y == widgetCoords.y ||
imageCoords.x + 1 == widgetCoords.z || imageCoords.y + 1 == widgetCoords.w)
{
// Use a black border around the graph to mark the area.
blendedWidgets = vec4(0);
continue;
}
const uvec2 coordInWidget = imageCoords - widgetCoords.xy;
const uint valueWidth = graphWidgetsData[graphWidget].valueWidth.x;
// Find the value corresponding to this pixel.
const uint value = getValue(graphWidget, coordInWidget, valueWidth);
vec4 color = vec4(0);
const uint widgetHeight = widgetCoords.w - widgetCoords.y;
// If the graph value overflows the designated area, have the last four rows show a
// checkerboard pattern to signify that there is an overflow.
bool indicateOverflow = value > widgetHeight && coordInWidget.y + 4 >= widgetHeight
&& ((coordInWidget.x ^ coordInWidget.y) & 1) == 0;
if ((widgetHeight - coordInWidget.y) < value && !indicateOverflow)
{
color = graphWidgetsData[graphWidget].color;
blendedWidgets = blend(blendedWidgets, color);
}
}
// Loop through possible text widgets that can intersect with this block.
while (textWidgets != 0)
{
const uint textWidget = findLSB(textWidgets);
textWidgets ^= 1 << textWidget;
const uvec4 widgetCoords = textWidgetsData[textWidget].coordinates;
if (!intersects(imageCoords, widgetCoords))
{
continue;
}
const uvec2 coordInWidget = imageCoords - widgetCoords.xy;
const uvec4 fontSizePacked = textWidgetsData[textWidget].fontSize;
const uvec2 fontGlyphSize = fontSizePacked.xy;
const uint fontLayer = fontSizePacked.z;
// Find the character corresponding to this pixel.
const uint textChar = getChar(textWidget, coordInWidget, fontGlyphSize.x);
// The FONT_CHARACTERS value is a value filled where there is no character, so we don't add
// a background to it.
if (textChar < FONT_CHARACTERS)
{
// Sample the font based on this character.
const float sampleValue = sampleFont(textChar, coordInWidget, fontGlyphSize, fontLayer);
vec4 color = vec4(0, 0, 0, 0.4);
color = mix(color, textWidgetsData[textWidget].color, sampleValue);
blendedWidgets = blend(blendedWidgets, color);
}
}
if (blendedWidgets.a < 1)
{
vec3 blendedColor = blendedWidgets.rgb;
if (blendedWidgets.a > 0)
{
const vec4 color = imageLoad(blendOutput, ivec2(imageCoords));
blendedColor += color.rgb * color.a * blendedWidgets.a;
}
imageStore(blendOutput, ivec2(imageCoords), vec4(blendedColor, 1));
}
}

Просмотреть файл

@ -0,0 +1,14 @@
{
"Description": [
"Copyright 2019 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.",
"",
"OverlayDraw.comp.json: Build parameters for OverlayDraw.comp."
],
"SubgroupSize": [
"Is8x4",
"Is8x8"
]
}

Просмотреть файл

@ -1425,7 +1425,7 @@ void BufferHelper::unmap(VkDevice device)
}
}
angle::Result BufferHelper::flush(ContextVk *contextVk, size_t offset, size_t size)
angle::Result BufferHelper::flush(ContextVk *contextVk, VkDeviceSize offset, VkDeviceSize size)
{
bool hostVisible = mMemoryPropertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
bool hostCoherent = mMemoryPropertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
@ -1441,7 +1441,7 @@ angle::Result BufferHelper::flush(ContextVk *contextVk, size_t offset, size_t si
return angle::Result::Continue;
}
angle::Result BufferHelper::invalidate(ContextVk *contextVk, size_t offset, size_t size)
angle::Result BufferHelper::invalidate(ContextVk *contextVk, VkDeviceSize offset, VkDeviceSize size)
{
bool hostVisible = mMemoryPropertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
bool hostCoherent = mMemoryPropertyFlags & VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;

Просмотреть файл

@ -535,10 +535,10 @@ class BufferHelper final : public CommandGraphResource
void unmap(VkDevice device);
// After a sequence of writes, call flush to ensure the data is visible to the device.
angle::Result flush(ContextVk *contextVk, size_t offset, size_t size);
angle::Result flush(ContextVk *contextVk, VkDeviceSize offset, VkDeviceSize size);
// After a sequence of writes, call invalidate to ensure the data is visible to the host.
angle::Result invalidate(ContextVk *contextVk, size_t offset, size_t size);
angle::Result invalidate(ContextVk *contextVk, VkDeviceSize offset, VkDeviceSize size);
private:
angle::Result mapImpl(ContextVk *contextVk);

Просмотреть файл

@ -127,6 +127,14 @@ namespace
#include "libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000013.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000014.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000015.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000000.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000001.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000002.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000003.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000004.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000005.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/OverlayDraw.comp.00000000.inc"
#include "libANGLE/renderer/vulkan/shaders/gen/OverlayDraw.comp.00000001.inc"
// This is SPIR-V binary blob and the size.
struct ShaderBlob
@ -266,6 +274,18 @@ constexpr ShaderBlob kImageCopy_frag_shaders[] = {
{kImageCopy_frag_00000014, sizeof(kImageCopy_frag_00000014)},
{kImageCopy_frag_00000015, sizeof(kImageCopy_frag_00000015)},
};
constexpr ShaderBlob kOverlayCull_comp_shaders[] = {
{kOverlayCull_comp_00000000, sizeof(kOverlayCull_comp_00000000)},
{kOverlayCull_comp_00000001, sizeof(kOverlayCull_comp_00000001)},
{kOverlayCull_comp_00000002, sizeof(kOverlayCull_comp_00000002)},
{kOverlayCull_comp_00000003, sizeof(kOverlayCull_comp_00000003)},
{kOverlayCull_comp_00000004, sizeof(kOverlayCull_comp_00000004)},
{kOverlayCull_comp_00000005, sizeof(kOverlayCull_comp_00000005)},
};
constexpr ShaderBlob kOverlayDraw_comp_shaders[] = {
{kOverlayDraw_comp_00000000, sizeof(kOverlayDraw_comp_00000000)},
{kOverlayDraw_comp_00000001, sizeof(kOverlayDraw_comp_00000001)},
};
angle::Result GetShader(Context *context,
RefCounted<ShaderAndSerial> *shaders,
@ -329,6 +349,14 @@ void ShaderLibrary::destroy(VkDevice device)
{
shader.get().destroy(device);
}
for (RefCounted<ShaderAndSerial> &shader : mOverlayCull_comp_shaders)
{
shader.get().destroy(device);
}
for (RefCounted<ShaderAndSerial> &shader : mOverlayDraw_comp_shaders)
{
shader.get().destroy(device);
}
}
angle::Result ShaderLibrary::getBlitResolve_frag(Context *context,
@ -397,5 +425,21 @@ angle::Result ShaderLibrary::getImageCopy_frag(Context *context,
ArraySize(kImageCopy_frag_shaders), shaderFlags, shaderOut);
}
angle::Result ShaderLibrary::getOverlayCull_comp(Context *context,
uint32_t shaderFlags,
RefCounted<ShaderAndSerial> **shaderOut)
{
return GetShader(context, mOverlayCull_comp_shaders, kOverlayCull_comp_shaders,
ArraySize(kOverlayCull_comp_shaders), shaderFlags, shaderOut);
}
angle::Result ShaderLibrary::getOverlayDraw_comp(Context *context,
uint32_t shaderFlags,
RefCounted<ShaderAndSerial> **shaderOut)
{
return GetShader(context, mOverlayDraw_comp_shaders, kOverlayDraw_comp_shaders,
ArraySize(kOverlayDraw_comp_shaders), shaderFlags, shaderOut);
}
} // namespace vk
} // namespace rx

Просмотреть файл

@ -120,4 +120,12 @@ angle_vulkan_internal_shaders = [
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000013.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000014.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/ImageCopy.frag.00000015.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000000.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000001.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000002.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000003.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000004.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayCull.comp.00000005.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayDraw.comp.00000000.inc",
"src/libANGLE/renderer/vulkan/shaders/gen/OverlayDraw.comp.00000001.inc",
]

Просмотреть файл

@ -150,6 +150,32 @@ enum DestFormat
constexpr size_t kArrayLen = 0x00000016;
} // namespace ImageCopy_frag
namespace OverlayCull_comp
{
enum SubgroupSize
{
kIs8x4 = 0x00000000,
kIs8x8 = 0x00000001,
};
enum SubgroupOp
{
kSupportsBallot = 0x00000000,
kSupportsArithmetic = 0x00000002,
kSupportsNone = 0x00000004,
};
constexpr size_t kArrayLen = 0x00000006;
} // namespace OverlayCull_comp
namespace OverlayDraw_comp
{
enum SubgroupSize
{
kIs8x4 = 0x00000000,
kIs8x8 = 0x00000001,
};
constexpr size_t kArrayLen = 0x00000002;
} // namespace OverlayDraw_comp
} // namespace InternalShader
class ShaderLibrary final : angle::NonCopyable
@ -184,6 +210,12 @@ class ShaderLibrary final : angle::NonCopyable
angle::Result getImageCopy_frag(Context *context,
uint32_t shaderFlags,
RefCounted<ShaderAndSerial> **shaderOut);
angle::Result getOverlayCull_comp(Context *context,
uint32_t shaderFlags,
RefCounted<ShaderAndSerial> **shaderOut);
angle::Result getOverlayDraw_comp(Context *context,
uint32_t shaderFlags,
RefCounted<ShaderAndSerial> **shaderOut);
private:
RefCounted<ShaderAndSerial>
@ -201,6 +233,10 @@ class ShaderLibrary final : angle::NonCopyable
RefCounted<ShaderAndSerial>
mImageClear_frag_shaders[InternalShader::ImageClear_frag::kArrayLen];
RefCounted<ShaderAndSerial> mImageCopy_frag_shaders[InternalShader::ImageCopy_frag::kArrayLen];
RefCounted<ShaderAndSerial>
mOverlayCull_comp_shaders[InternalShader::OverlayCull_comp::kArrayLen];
RefCounted<ShaderAndSerial>
mOverlayDraw_comp_shaders[InternalShader::OverlayDraw_comp::kArrayLen];
};
} // namespace vk
} // namespace rx

Просмотреть файл

@ -27,6 +27,7 @@
PROC(Framebuffer) \
PROC(MemoryObject) \
PROC(Query) \
PROC(Overlay) \
PROC(Program) \
PROC(Sampler) \
PROC(Semaphore) \
@ -45,6 +46,7 @@ class Image;
namespace gl
{
struct Box;
class DummyOverlay;
struct Extents;
struct RasterizerState;
struct Rectangle;
@ -151,6 +153,12 @@ struct ImplTypeHelper<gl::OBJ> \
ANGLE_GL_OBJECTS_X(ANGLE_IMPL_TYPE_HELPER_GL)
template <>
struct ImplTypeHelper<gl::DummyOverlay>
{
using ImplType = OverlayVk;
};
template <>
struct ImplTypeHelper<egl::Display>
{
@ -172,6 +180,12 @@ GetImplType<T> *GetImpl(const T *glObject)
return GetImplAs<GetImplType<T>>(glObject);
}
template <>
inline OverlayVk *GetImpl(const gl::DummyOverlay *glObject)
{
return nullptr;
}
class GarbageObjectBase
{
public:

Просмотреть файл

@ -296,6 +296,8 @@ class CommandBuffer : public WrappedObject<CommandBuffer, VkCommandBuffer>
void endRenderPass();
void executeCommands(uint32_t commandBufferCount, const CommandBuffer *commandBuffers);
void getMemoryUsageStats(size_t *usedMemoryOut, size_t *allocatedMemoryOut);
void executionBarrier(VkPipelineStageFlags stageMask);
void fillBuffer(const Buffer &dstBuffer,
@ -814,6 +816,14 @@ ANGLE_INLINE void CommandBuffer::executeCommands(uint32_t commandBufferCount,
vkCmdExecuteCommands(mHandle, commandBufferCount, commandBuffers[0].ptr());
}
ANGLE_INLINE void CommandBuffer::getMemoryUsageStats(size_t *usedMemoryOut,
size_t *allocatedMemoryOut)
{
// No data available.
*usedMemoryOut = 0;
*allocatedMemoryOut = 1;
}
ANGLE_INLINE void CommandBuffer::fillBuffer(const Buffer &dstBuffer,
VkDeviceSize dstOffset,
VkDeviceSize size,

Просмотреть файл

@ -243,6 +243,13 @@ libangle_sources = [
"src/libANGLE/MemoryProgramCache.h",
"src/libANGLE/Observer.cpp",
"src/libANGLE/Observer.h",
"src/libANGLE/Overlay.cpp",
"src/libANGLE/Overlay.h",
"src/libANGLE/OverlayWidgets.cpp",
"src/libANGLE/OverlayWidgets.h",
"src/libANGLE/Overlay_autogen.cpp",
"src/libANGLE/Overlay_font_autogen.cpp",
"src/libANGLE/Overlay_font_autogen.h",
"src/libANGLE/Path.h",
"src/libANGLE/Path.cpp",
"src/libANGLE/Platform.cpp",
@ -331,6 +338,7 @@ libangle_sources = [
"src/libANGLE/renderer/GLImplFactory.h",
"src/libANGLE/renderer/ImageImpl.h",
"src/libANGLE/renderer/MemoryObjectImpl.h",
"src/libANGLE/renderer/OverlayImpl.h",
"src/libANGLE/renderer/PathImpl.h",
"src/libANGLE/renderer/ProgramImpl.h",
"src/libANGLE/renderer/ProgramPipelineImpl.h",
@ -863,6 +871,8 @@ libangle_vulkan_sources = [
"src/libANGLE/renderer/vulkan/ImageVk.h",
"src/libANGLE/renderer/vulkan/MemoryObjectVk.cpp",
"src/libANGLE/renderer/vulkan/MemoryObjectVk.h",
"src/libANGLE/renderer/vulkan/OverlayVk.cpp",
"src/libANGLE/renderer/vulkan/OverlayVk.h",
"src/libANGLE/renderer/vulkan/PersistentCommandPool.cpp",
"src/libANGLE/renderer/vulkan/PersistentCommandPool.h",
"src/libANGLE/renderer/vulkan/ProgramVk.cpp",

Просмотреть файл

@ -76,6 +76,10 @@ class NullFactory : public GLImplFactory
{
return std::vector<PathImpl *>();
}
SemaphoreImpl *createSemaphore() override { return nullptr; }
OverlayImpl *createOverlay(const gl::OverlayState &state) override { return nullptr; }
};
// A class with all the factory methods mocked.
@ -101,6 +105,7 @@ class MockGLFactory : public GLImplFactory
MOCK_METHOD1(createSampler, SamplerImpl *(const gl::SamplerState &));
MOCK_METHOD1(createPaths, std::vector<PathImpl *>(GLsizei));
MOCK_METHOD0(createSemaphore, SemaphoreImpl *());
MOCK_METHOD1(createOverlay, OverlayImpl *(const gl::OverlayState &));
};
class MockEGLFactory : public EGLImplFactory