• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // DisplayVkGGP.cpp:
7 //    Implements the class methods for DisplayVkGGP.
8 //
9 
10 #include "libANGLE/renderer/vulkan/ggp/DisplayVkGGP.h"
11 
12 #include "libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.h"
13 #include "libANGLE/renderer/vulkan/vk_caps_utils.h"
14 
15 namespace rx
16 {
DisplayVkGGP(const egl::DisplayState & state)17 DisplayVkGGP::DisplayVkGGP(const egl::DisplayState &state) : DisplayVk(state) {}
18 
isValidNativeWindow(EGLNativeWindowType window) const19 bool DisplayVkGGP::isValidNativeWindow(EGLNativeWindowType window) const
20 {
21     // GGP doesn't use window handles.
22     return true;
23 }
24 
createWindowSurfaceVk(const egl::SurfaceState & state,EGLNativeWindowType window)25 SurfaceImpl *DisplayVkGGP::createWindowSurfaceVk(const egl::SurfaceState &state,
26                                                  EGLNativeWindowType window)
27 {
28     return new WindowSurfaceVkGGP(state, window);
29 }
30 
generateConfigs()31 egl::ConfigSet DisplayVkGGP::generateConfigs()
32 {
33     // Not entirely sure what backbuffer formats GGP supports.
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)38 bool DisplayVkGGP::checkConfigSupport(egl::Config *config)
39 {
40     return true;
41 }
42 
getWSIExtension() const43 const char *DisplayVkGGP::getWSIExtension() const
44 {
45     return VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME;
46 }
47 
IsVulkanGGPDisplayAvailable()48 bool IsVulkanGGPDisplayAvailable()
49 {
50     return true;
51 }
52 
CreateVulkanGGPDisplay(const egl::DisplayState & state)53 DisplayImpl *CreateVulkanGGPDisplay(const egl::DisplayState &state)
54 {
55     return new DisplayVkGGP(state);
56 }
57 }  // namespace rx
58