• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2020 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 // DisplayVkSimple.cpp:
7 //    Implements the class methods for DisplayVkSimple.
8 //
9 
10 #include "DisplayVkSimple.h"
11 #include "WindowSurfaceVkSimple.h"
12 
13 #include "libANGLE/Display.h"
14 #include "libANGLE/renderer/vulkan/RendererVk.h"
15 #include "libANGLE/renderer/vulkan/vk_caps_utils.h"
16 
17 namespace rx
18 {
19 
DisplayVkSimple(const egl::DisplayState & state)20 DisplayVkSimple::DisplayVkSimple(const egl::DisplayState &state) : DisplayVk(state) {}
21 
terminate()22 void DisplayVkSimple::terminate()
23 {
24     DisplayVk::terminate();
25 }
26 
isValidNativeWindow(EGLNativeWindowType window) const27 bool DisplayVkSimple::isValidNativeWindow(EGLNativeWindowType window) const
28 {
29     return true;
30 }
31 
createWindowSurfaceVk(const egl::SurfaceState & state,EGLNativeWindowType window)32 SurfaceImpl *DisplayVkSimple::createWindowSurfaceVk(const egl::SurfaceState &state,
33                                                     EGLNativeWindowType window)
34 {
35     return new WindowSurfaceVkSimple(state, window);
36 }
37 
generateConfigs()38 egl::ConfigSet DisplayVkSimple::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 
45 // TODO: anglebug.com/5214
46 // Detemine if check is needed.
checkConfigSupport(egl::Config * config)47 void DisplayVkSimple::checkConfigSupport(egl::Config *config) {}
48 
getWSIExtension() const49 const char *DisplayVkSimple::getWSIExtension() const
50 {
51     return VK_KHR_DISPLAY_EXTENSION_NAME;
52 }
53 
IsVulkanSimpleDisplayAvailable()54 bool IsVulkanSimpleDisplayAvailable()
55 {
56     return true;
57 }
58 
CreateVulkanSimpleDisplay(const egl::DisplayState & state)59 DisplayImpl *CreateVulkanSimpleDisplay(const egl::DisplayState &state)
60 {
61     return new DisplayVkSimple(state);
62 }
63 
64 }  // namespace rx
65