blob: 64fe5ef2281b0a36fbab6c4754b4864e94bb948b [file] [log] [blame]
Chia-I Wuc96880f2016-03-26 06:56:45 +08001/*
2 * Copyright 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef LIBVULKAN_LAYERS_EXTENSIONS_H
18#define LIBVULKAN_LAYERS_EXTENSIONS_H 1
19
20#include <vulkan/vulkan.h>
21
22namespace vulkan {
23namespace api {
24
25struct Layer;
26class LayerRef {
27 public:
Chia-I Wu83506d82016-04-19 11:45:57 +080028 LayerRef(const Layer* layer);
Chia-I Wuc96880f2016-03-26 06:56:45 +080029 LayerRef(LayerRef&& other);
30 ~LayerRef();
31 LayerRef(const LayerRef&) = delete;
32 LayerRef& operator=(const LayerRef&) = delete;
33
34 const char* GetName() const;
Chia-I Wu83506d82016-04-19 11:45:57 +080035 uint32_t GetSpecVersion() const;
Chia-I Wuc96880f2016-03-26 06:56:45 +080036
37 // provides bool-like behavior
38 operator const Layer*() const { return layer_; }
39
40 PFN_vkGetInstanceProcAddr GetGetInstanceProcAddr() const;
41 PFN_vkGetDeviceProcAddr GetGetDeviceProcAddr() const;
42
43 bool SupportsExtension(const char* name) const;
44
45 private:
Chia-I Wu83506d82016-04-19 11:45:57 +080046 const Layer* layer_;
Chia-I Wuc96880f2016-03-26 06:56:45 +080047};
48
49void DiscoverLayers();
50uint32_t EnumerateInstanceLayers(uint32_t count, VkLayerProperties* properties);
51uint32_t EnumerateDeviceLayers(uint32_t count, VkLayerProperties* properties);
52void GetInstanceLayerExtensions(const char* name,
53 const VkExtensionProperties** properties,
54 uint32_t* count);
55void GetDeviceLayerExtensions(const char* name,
56 const VkExtensionProperties** properties,
57 uint32_t* count);
58LayerRef GetInstanceLayerRef(const char* name);
59LayerRef GetDeviceLayerRef(const char* name);
60
61} // namespace api
62} // namespace vulkan
63
64#endif // LIBVULKAN_LAYERS_EXTENSIONS_H