loader: Add GetName and GetDescription for logs
Handy to have more layer detail for logging.
Change-Id: I6933a8fcb90b9cfb70fc85a358244863aac9d702
(cherry picked from commit cf275f37b4a903b5dcc95b5100db667c906aa33f)
diff --git a/vulkan/libvulkan/layers_extensions.cpp b/vulkan/libvulkan/layers_extensions.cpp
index 287e69b..e77952a 100644
--- a/vulkan/libvulkan/layers_extensions.cpp
+++ b/vulkan/libvulkan/layers_extensions.cpp
@@ -394,6 +394,14 @@
}
}
+const char* LayerRef::GetName() {
+ return layer_->properties.layerName;
+}
+
+uint32_t LayerRef::GetSpecVersion() {
+ return layer_->properties.specVersion;
+}
+
LayerRef::LayerRef(LayerRef&& other) : layer_(std::move(other.layer_)) {
other.layer_ = nullptr;
}
diff --git a/vulkan/libvulkan/loader.h b/vulkan/libvulkan/loader.h
index 3e2d1c4..8d5a758 100644
--- a/vulkan/libvulkan/loader.h
+++ b/vulkan/libvulkan/loader.h
@@ -150,6 +150,9 @@
LayerRef(const LayerRef&) = delete;
LayerRef& operator=(const LayerRef&) = delete;
+ const char* GetName();
+ uint32_t GetSpecVersion();
+
// provides bool-like behavior
operator const Layer*() const { return layer_; }