Hash :
f13689b6
Author :
Date :
2020-04-17T14:43:28
Vulkan: Use renderpass' finalLayout to transit to ImageLayout::Present This detects the last renderpass is actually rendering to the image we are going to present and this is the very last renderpass to that image. We use finalLayout of the renderpass to do layout transition to VK_IMAGE_LAYOUT_PRESENT_SRC_KHR instead of a standalone barrier call. Bug: b/153885625 Change-Id: Ifc17c77a1ba12f22c9d6038775f3e254c35655ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2155250 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
//
// 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/Overlay.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);
uint32_t getEnabledWidgetCount() const { return mState.getEnabledWidgetCount(); }
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_