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 // DisplayVkFuchsia.cpp: 7 // Implements methods from DisplayVkFuchsia 8 // 9 10 #include "libANGLE/renderer/vulkan/fuchsia/DisplayVkFuchsia.h" 11 12 #include "libANGLE/renderer/vulkan/fuchsia/WindowSurfaceVkFuchsia.h" 13 #include "libANGLE/renderer/vulkan/vk_caps_utils.h" 14 15 namespace rx 16 { 17 DisplayVkFuchsia(const egl::DisplayState & state)18DisplayVkFuchsia::DisplayVkFuchsia(const egl::DisplayState &state) : DisplayVk(state) {} 19 isValidNativeWindow(EGLNativeWindowType window) const20bool DisplayVkFuchsia::isValidNativeWindow(EGLNativeWindowType window) const 21 { 22 return WindowSurfaceVkFuchsia::isValidNativeWindow(window); 23 } 24 createWindowSurfaceVk(const egl::SurfaceState & state,EGLNativeWindowType window)25SurfaceImpl *DisplayVkFuchsia::createWindowSurfaceVk(const egl::SurfaceState &state, 26 EGLNativeWindowType window) 27 { 28 ASSERT(isValidNativeWindow(window)); 29 return new WindowSurfaceVkFuchsia(state, window); 30 } 31 generateConfigs()32egl::ConfigSet DisplayVkFuchsia::generateConfigs() 33 { 34 constexpr GLenum kColorFormats[] = {GL_BGRA8_EXT, GL_BGRX8_ANGLEX}; 35 return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this); 36 } 37 checkConfigSupport(egl::Config * config)38void DisplayVkFuchsia::checkConfigSupport(egl::Config *config) 39 { 40 // TODO(geofflang): Test for native support and modify the config accordingly. 41 // anglebug.com/2692 42 } 43 getWSIExtension() const44const char *DisplayVkFuchsia::getWSIExtension() const 45 { 46 return VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME; 47 } 48 getWSILayer() const49const char *DisplayVkFuchsia::getWSILayer() const 50 { 51 return "VK_LAYER_FUCHSIA_imagepipe_swapchain"; 52 } 53 IsVulkanFuchsiaDisplayAvailable()54bool IsVulkanFuchsiaDisplayAvailable() 55 { 56 return true; 57 } 58 CreateVulkanFuchsiaDisplay(const egl::DisplayState & state)59DisplayImpl *CreateVulkanFuchsiaDisplay(const egl::DisplayState &state) 60 { 61 return new DisplayVkFuchsia(state); 62 } 63 } // namespace rx 64