diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml
index f325733998c..7b4fb65ac93 100644
--- a/doc/classes/RenderingDevice.xml
+++ b/doc/classes/RenderingDevice.xml
@@ -1163,6 +1163,7 @@
The main graphics-compute command queue ([code]rid[/code] parameter is ignored).
- Vulkan: [code]VkQueue[/code].
+ - D3D12: [code]ID3D12CommandQueue[/code].
- Metal: [code]MTLCommandQueue[/code].
@@ -1171,6 +1172,7 @@
- Vulkan: [code]VkImage[/code].
+ - D3D12: [code]ID3D12Resource[/code].
The view of an owned or shared texture.
diff --git a/drivers/d3d12/rendering_device_driver_d3d12.cpp b/drivers/d3d12/rendering_device_driver_d3d12.cpp
index 3828ec93cd8..6865ae0bc97 100644
--- a/drivers/d3d12/rendering_device_driver_d3d12.cpp
+++ b/drivers/d3d12/rendering_device_driver_d3d12.cpp
@@ -5751,14 +5751,18 @@ uint64_t RenderingDeviceDriverD3D12::get_resource_native_handle(DriverResource p
return 0;
}
case DRIVER_RESOURCE_COMMAND_QUEUE: {
- return (uint64_t)p_driver_id.id;
+ const CommandQueueInfo *cmd_queue_info = (const CommandQueueInfo *)p_driver_id.id;
+ return (uint64_t)cmd_queue_info->d3d_queue.Get();
}
case DRIVER_RESOURCE_QUEUE_FAMILY: {
return 0;
}
case DRIVER_RESOURCE_TEXTURE: {
const TextureInfo *tex_info = (const TextureInfo *)p_driver_id.id;
- return (uint64_t)tex_info->main_texture;
+ if (tex_info->main_texture) {
+ tex_info = tex_info->main_texture;
+ }
+ return (uint64_t)tex_info->resource;
} break;
case DRIVER_RESOURCE_TEXTURE_VIEW: {
const TextureInfo *tex_info = (const TextureInfo *)p_driver_id.id;