summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSander <code@kroket.io>2024-09-22 02:00:53 +0300
committerSander <code@kroket.io>2024-09-22 02:32:37 +0300
commit0ad1820b1a7af28f32773e25a938931f3f8fb5e4 (patch)
tree29475520d8cbe3c1e6548a348120a3826038e178
parente4e024ab88efe74677769395886bc1b09eccbac7 (diff)
downloadredot-engine-0ad1820b1a7af28f32773e25a938931f3f8fb5e4.tar.gz
Metal: implement texture_create_from_extension
Parameters p_type, p_format, p_array_layers, p_depth_stencil are ignored - MTLTexture (and the callee) already have this information and is only relevant when reinterpreting or remaping the texture in different ways.
-rw-r--r--drivers/metal/rendering_device_driver_metal.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/metal/rendering_device_driver_metal.mm b/drivers/metal/rendering_device_driver_metal.mm
index 9d691a0d23..0f7faaddf0 100644
--- a/drivers/metal/rendering_device_driver_metal.mm
+++ b/drivers/metal/rendering_device_driver_metal.mm
@@ -358,7 +358,11 @@ RDD::TextureID RenderingDeviceDriverMetal::texture_create(const TextureFormat &p
}
RDD::TextureID RenderingDeviceDriverMetal::texture_create_from_extension(uint64_t p_native_texture, TextureType p_type, DataFormat p_format, uint32_t p_array_layers, bool p_depth_stencil) {
- ERR_FAIL_V_MSG(RDD::TextureID(), "not implemented");
+ id<MTLTexture> obj = (__bridge id<MTLTexture>)(void *)(uintptr_t)p_native_texture;
+
+ // We only need to create a RDD::TextureID for an existing, natively-provided texture.
+
+ return rid::make(obj);
}
RDD::TextureID RenderingDeviceDriverMetal::texture_create_shared(TextureID p_original_texture, const TextureView &p_view) {