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/SurfaceVk.h" 14 #include "libANGLE/renderer/vulkan/vk_caps_utils.h" 15 #include "libANGLE/renderer/vulkan/vk_renderer.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 generateConfigs()38egl::ConfigSet DisplayVkNull::generateConfigs() 39 { 40 constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_BGRA8_EXT, GL_RGB565, GL_RGB8}; 41 42 return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this); 43 } 44 checkConfigSupport(egl::Config * config)45void DisplayVkNull::checkConfigSupport(egl::Config *config) {} 46 IsVulkanNullDisplayAvailable()47bool IsVulkanNullDisplayAvailable() 48 { 49 return true; 50 } 51 CreateVulkanNullDisplay(const egl::DisplayState & state)52DisplayImpl *CreateVulkanNullDisplay(const egl::DisplayState &state) 53 { 54 return new DisplayVkNull(state); 55 } 56 57 } // namespace rx 58