xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/vulkan/linux/DisplayVkOffscreen.cpp (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2023 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 // DisplayVkOffscreen.cpp:
7 //    Implements the class methods for DisplayVkOffscreen.
8 //
9 
10 #include "DisplayVkOffscreen.h"
11 
12 #include "common/debug.h"
13 #include "libANGLE/renderer/vulkan/vk_caps_utils.h"
14 
15 namespace rx
16 {
17 
DisplayVkOffscreen(const egl::DisplayState & state)18 DisplayVkOffscreen::DisplayVkOffscreen(const egl::DisplayState &state) : DisplayVkLinux(state) {}
19 
isValidNativeWindow(EGLNativeWindowType window) const20 bool DisplayVkOffscreen::isValidNativeWindow(EGLNativeWindowType window) const
21 {
22     return false;
23 }
24 
createWindowSurfaceVk(const egl::SurfaceState & state,EGLNativeWindowType window)25 SurfaceImpl *DisplayVkOffscreen::createWindowSurfaceVk(const egl::SurfaceState &state,
26                                                        EGLNativeWindowType window)
27 {
28     UNREACHABLE();
29     return nullptr;
30 }
31 
generateConfigs()32 egl::ConfigSet DisplayVkOffscreen::generateConfigs()
33 {
34     constexpr GLenum kColorFormats[] = {GL_RGBA8, GL_BGRA8_EXT, GL_RGB565, GL_RGB8};
35 
36     return egl_vk::GenerateConfigs(kColorFormats, egl_vk::kConfigDepthStencilFormats, this);
37 }
38 
checkConfigSupport(egl::Config * config)39 void DisplayVkOffscreen::checkConfigSupport(egl::Config *config) {}
40 
getWSIExtension() const41 const char *DisplayVkOffscreen::getWSIExtension() const
42 {
43     return nullptr;
44 }
45 
IsVulkanOffscreenDisplayAvailable()46 bool IsVulkanOffscreenDisplayAvailable()
47 {
48     return true;
49 }
50 
CreateVulkanOffscreenDisplay(const egl::DisplayState & state)51 DisplayImpl *CreateVulkanOffscreenDisplay(const egl::DisplayState &state)
52 {
53     return new DisplayVkOffscreen(state);
54 }
55 
56 }  // namespace rx
57