blob: b1e48bd59c741894821ed6ee20cc61c2ec07109c [file]
/*
* Copyright (C) 2026 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ANDROID_VULKAN_LAYERS_IDENTIFIED_LAYER_H
#define ANDROID_VULKAN_LAYERS_IDENTIFIED_LAYER_H
#include <vulkan/vulkan.h>
#include <memory>
#include <string>
#include <vector>
namespace vulkan {
namespace layers {
class DiscoveredLayerLibrary;
class IdentifiedLayer {
public:
IdentifiedLayer(VkLayerProperties props,
std::shared_ptr<const DiscoveredLayerLibrary> library,
int order)
: properties_(props),
name_(props.layerName),
library_(library),
implicitly_enabled_(false),
visible_to_app_(false),
is_global_(false),
order_(order) {}
const VkLayerProperties& GetProperties() const { return properties_; }
const std::string& GetName() const { return name_; }
const DiscoveredLayerLibrary& GetLibrary() const { return *library_; }
int GetOrder() const { return order_; }
void SetImplicitlyEnabled(bool enabled) { implicitly_enabled_ = enabled; }
bool IsImplicitlyEnabled() const { return implicitly_enabled_; }
void SetVisibleToApp(bool visible) { visible_to_app_ = visible; }
bool IsVisibleToApp() const { return visible_to_app_; }
void SetGlobal(bool global) { is_global_ = global; }
bool IsGlobal() const { return is_global_; }
void AddInstanceExtension(VkExtensionProperties ext) {
instance_extensions_.push_back(ext);
}
const std::vector<VkExtensionProperties>& GetInstanceExtensions() const {
return instance_extensions_;
}
void AddDeviceExtension(VkExtensionProperties ext) {
device_extensions_.push_back(ext);
}
const std::vector<VkExtensionProperties>& GetDeviceExtensions() const {
return device_extensions_;
}
private:
VkLayerProperties properties_;
std::string name_;
std::shared_ptr<const DiscoveredLayerLibrary> library_;
bool implicitly_enabled_;
bool visible_to_app_;
bool is_global_;
int order_;
std::vector<VkExtensionProperties> instance_extensions_;
std::vector<VkExtensionProperties> device_extensions_;
};
} // namespace layers
} // namespace vulkan
#endif // ANDROID_VULKAN_LAYERS_IDENTIFIED_LAYER_H