mirror of
https://github.com/godotengine/godot.git
synced 2025-10-18 23:43:25 +00:00
Merge pull request #111658 from brycehutchings/bryceh_d3d12_native_handle_fixes
Fix D3D12 rendering device driver returning pointers to internal types for get_resource_native_handle instead of proper D3D12 primitives
This commit is contained in:
commit
2edad6860a
2 changed files with 8 additions and 2 deletions
|
@ -1163,6 +1163,7 @@
|
|||
<constant name="DRIVER_RESOURCE_COMMAND_QUEUE" value="3" enum="DriverResource">
|
||||
The main graphics-compute command queue ([code]rid[/code] parameter is ignored).
|
||||
- Vulkan: [code]VkQueue[/code].
|
||||
- D3D12: [code]ID3D12CommandQueue[/code].
|
||||
- Metal: [code]MTLCommandQueue[/code].
|
||||
</constant>
|
||||
<constant name="DRIVER_RESOURCE_QUEUE_FAMILY" value="4" enum="DriverResource">
|
||||
|
@ -1171,6 +1172,7 @@
|
|||
</constant>
|
||||
<constant name="DRIVER_RESOURCE_TEXTURE" value="5" enum="DriverResource">
|
||||
- Vulkan: [code]VkImage[/code].
|
||||
- D3D12: [code]ID3D12Resource[/code].
|
||||
</constant>
|
||||
<constant name="DRIVER_RESOURCE_TEXTURE_VIEW" value="6" enum="DriverResource">
|
||||
The view of an owned or shared texture.
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue