1 // 2 // Copyright 2021 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 // DisplayVkNull.cpp: 7 // Implements the class methods for DisplayVkNull. 8 // 9 10 #include "DisplayVkNull.h" 11 12 #include "libANGLE/Display.h" 13 #include "libANGLE/renderer/vulkan/RendererVk.h" 14 #include "libANGLE/renderer/vulkan/SurfaceVk.h" 15 #include "libANGLE/renderer/vulkan/vk_caps_utils.h" 16 17 namespace rx 18 { 19 DisplayVkNull(const egl::DisplayState & state)20DisplayVkNull::DisplayVkNull(const egl::DisplayState &state) : DisplayVk(state) {} 21 isValidNativeWindow(EGLNativeWindowType window) const22bool DisplayVkNull::isValidNativeWindow(EGLNativeWindowType window) const 23 { 24 return false; 25 } 26 createWindowSurfaceVk(const egl::SurfaceState & state,EGLNativeWindowType window)27SurfaceImpl *DisplayVkNull::createWindowSurfaceVk(const egl::SurfaceState &state, 28 EGLNativeWindowType window) 29 { 30 return new OffscreenSurfaceVk(state, mRenderer); 31 } 32 getWSIExtension() const33const char *DisplayVkNull::getWSIExtension() const 34 { 35 return nullptr; 36 } 37 isUsingSwapchain() const38bool DisplayVkNull::isUsingSwapchain() const 39 { 40 return false; 41 } 42 generateConfigs()43egl::ConfigSet DisplayVkNull::generateConfigs() 44 { 45 constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_BGRA8_EXT, GL_RGB565, GL_RGB8}; 46 47 return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this); 48 } 49 checkConfigSupport(egl::Config * config)50void DisplayVkNull::checkConfigSupport(egl::Config *config) {} 51 IsVulkanNullDisplayAvailable()52bool IsVulkanNullDisplayAvailable() 53 { 54 return true; 55 } 56 CreateVulkanNullDisplay(const egl::DisplayState & state)57DisplayImpl *CreateVulkanNullDisplay(const egl::DisplayState &state) 58 { 59 return new DisplayVkNull(state); 60 } 61 62 } // namespace rx 63