1c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu/*
2c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu * Copyright 2015 The Android Open Source Project
3c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu *
4c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu * Licensed under the Apache License, Version 2.0 (the "License");
5c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu * you may not use this file except in compliance with the License.
6c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu * You may obtain a copy of the License at
7c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu *
8c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu *      http://www.apache.org/licenses/LICENSE-2.0
9c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu *
10c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu * Unless required by applicable law or agreed to in writing, software
11c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu * distributed under the License is distributed on an "AS IS" BASIS,
12c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu * See the License for the specific language governing permissions and
14c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu * limitations under the License.
15c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu */
16c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
17c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu#ifndef LIBVULKAN_LAYERS_EXTENSIONS_H
18c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu#define LIBVULKAN_LAYERS_EXTENSIONS_H 1
19c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
20c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu#include <vulkan/vulkan.h>
21c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
22c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wunamespace vulkan {
23c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wunamespace api {
24c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
25c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wustruct Layer;
2625700b452535ce7ae838bfe832392b46ed555ed2Chia-I Wu
27c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wuclass LayerRef {
28c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu   public:
29dab25658fb17ec76569b8e91dfed801855027f08Chia-I Wu    LayerRef(const Layer* layer);
30c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu    LayerRef(LayerRef&& other);
31c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu    ~LayerRef();
32c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu    LayerRef(const LayerRef&) = delete;
33c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu    LayerRef& operator=(const LayerRef&) = delete;
34c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
35c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu    // provides bool-like behavior
36c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu    operator const Layer*() const { return layer_; }
37c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
38c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu    PFN_vkGetInstanceProcAddr GetGetInstanceProcAddr() const;
39c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu    PFN_vkGetDeviceProcAddr GetGetDeviceProcAddr() const;
40c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
41c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu   private:
4283506d84d00bbb35ecebb44261b2139bc40ef3e2Chia-I Wu    const Layer* layer_;
43c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu};
44c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
45c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wuvoid DiscoverLayers();
4625700b452535ce7ae838bfe832392b46ed555ed2Chia-I Wu
4725700b452535ce7ae838bfe832392b46ed555ed2Chia-I Wuuint32_t GetLayerCount();
4825700b452535ce7ae838bfe832392b46ed555ed2Chia-I Wuconst Layer& GetLayer(uint32_t index);
4904c6551eb812a7efe38fa74e6ac67c17aab3df2dChia-I Wuconst Layer* FindLayer(const char* name);
5025700b452535ce7ae838bfe832392b46ed555ed2Chia-I Wu
5125700b452535ce7ae838bfe832392b46ed555ed2Chia-I Wuconst VkLayerProperties& GetLayerProperties(const Layer& layer);
5225700b452535ce7ae838bfe832392b46ed555ed2Chia-I Wubool IsLayerGlobal(const Layer& layer);
5304c6551eb812a7efe38fa74e6ac67c17aab3df2dChia-I Wuconst VkExtensionProperties* GetLayerInstanceExtensions(const Layer& layer,
5404c6551eb812a7efe38fa74e6ac67c17aab3df2dChia-I Wu                                                        uint32_t& count);
5504c6551eb812a7efe38fa74e6ac67c17aab3df2dChia-I Wuconst VkExtensionProperties* GetLayerDeviceExtensions(const Layer& layer,
5604c6551eb812a7efe38fa74e6ac67c17aab3df2dChia-I Wu                                                      uint32_t& count);
5725700b452535ce7ae838bfe832392b46ed555ed2Chia-I Wu
58dab25658fb17ec76569b8e91dfed801855027f08Chia-I Wuconst VkExtensionProperties* FindLayerInstanceExtension(const Layer& layer,
59dab25658fb17ec76569b8e91dfed801855027f08Chia-I Wu                                                        const char* name);
60dab25658fb17ec76569b8e91dfed801855027f08Chia-I Wuconst VkExtensionProperties* FindLayerDeviceExtension(const Layer& layer,
61dab25658fb17ec76569b8e91dfed801855027f08Chia-I Wu                                                      const char* name);
62dab25658fb17ec76569b8e91dfed801855027f08Chia-I Wu
63dab25658fb17ec76569b8e91dfed801855027f08Chia-I WuLayerRef GetLayerRef(const Layer& layer);
64c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
65c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu}  // namespace api
66c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu}  // namespace vulkan
67c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu
68c96880f2cd1d34ffb9e3d10d80f0a3ddcc5579a8Chia-I Wu#endif  // LIBVULKAN_LAYERS_EXTENSIONS_H
69