From 893bd2006530f38364bc688f4b4268a518778226 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 27 Dec 2024 11:38:11 +0200 Subject: [PATCH] Make it possible to query API handles of textures This is necessary for some integrations. --- source/backends/opengl/texture_backend.h | 1 + source/backends/vulkan/texture_backend.h | 1 + source/core/texture.h | 1 + 3 files changed, 3 insertions(+) diff --git a/source/backends/opengl/texture_backend.h b/source/backends/opengl/texture_backend.h index ed9000b2..794bd29d 100644 --- a/source/backends/opengl/texture_backend.h +++ b/source/backends/opengl/texture_backend.h @@ -29,6 +29,7 @@ protected: void generate_mipmap(); + unsigned get_api_handle() const { return id; } void set_debug_name(const std::string &); void bind_scratch(); diff --git a/source/backends/vulkan/texture_backend.h b/source/backends/vulkan/texture_backend.h index 2152331c..2fce1c7d 100644 --- a/source/backends/vulkan/texture_backend.h +++ b/source/backends/vulkan/texture_backend.h @@ -43,6 +43,7 @@ protected: void refresh_mip_views() const { if(mip_view_handles.empty()) create_mip_views(); } + VkImage get_api_handle() const { return handle; } void set_debug_name(const std::string &); void set_vulkan_object_names() const; }; diff --git a/source/core/texture.h b/source/core/texture.h index c567f4cc..42346cf1 100644 --- a/source/core/texture.h +++ b/source/core/texture.h @@ -105,6 +105,7 @@ public: std::size_t get_data_size() const override { return 0; } + using TextureBackend::get_api_handle; using TextureBackend::set_debug_name; private: -- 2.45.2