1 // 2 // Copyright 2019 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 // OverlayVk.h: 7 // Defines the OverlayVk class that does the actual rendering of the overlay. 8 // 9 10 #ifndef LIBANGLE_RENDERER_VULKAN_OVERLAYVK_H_ 11 #define LIBANGLE_RENDERER_VULKAN_OVERLAYVK_H_ 12 13 #include "common/angleutils.h" 14 #include "libANGLE/Overlay.h" 15 #include "libANGLE/renderer/OverlayImpl.h" 16 #include "libANGLE/renderer/vulkan/vk_helpers.h" 17 18 namespace rx 19 { 20 class ContextVk; 21 22 class OverlayVk : public OverlayImpl 23 { 24 public: 25 OverlayVk(const gl::OverlayState &state); 26 ~OverlayVk() override; 27 28 angle::Result init(const gl::Context *context) override; 29 void onDestroy(const gl::Context *context) override; 30 31 angle::Result onPresent(ContextVk *contextVk, 32 vk::ImageHelper *imageToPresent, 33 const vk::ImageView *imageToPresentView); 34 getEnabledWidgetCount()35 uint32_t getEnabledWidgetCount() const { return mState.getEnabledWidgetCount(); } 36 37 private: 38 angle::Result createFont(ContextVk *contextVk); 39 angle::Result cullWidgets(ContextVk *contextVk); 40 41 bool mSupportsSubgroupBallot; 42 bool mSupportsSubgroupArithmetic; 43 bool mRefreshCulledWidgets; 44 45 // Cached size of subgroup as accepted by UtilsVk, deduced from hardware subgroup size. 46 uint32_t mSubgroupSize[2]; 47 48 // Cached size of last presented image. If the size changes, culling is repeated. 49 VkExtent2D mPresentImageExtent; 50 51 vk::ImageHelper mFontImage; 52 vk::ImageView mFontImageView; 53 54 vk::ImageHelper mCulledWidgets; 55 vk::ImageView mCulledWidgetsView; 56 }; 57 58 } // namespace rx 59 60 #endif // LIBANGLE_RENDERER_VULKAN_OVERLAYVK_H_ 61