upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/shims/d3d12_com.cpp
diff options
context:
space:
mode:
authorItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 16:59:09 -0500
committerItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 16:59:09 -0500
commitb69e3a4898f6c09d499ef3d250af407035bd8ffa (patch)
tree8e125d5f21addfa416f8ed08360dcf08e1e037f6 /runtime/shims/d3d12_com.cpp
parentafd1ead77e6e92bafd1390eceeb86d5b3f5e4fa3 (diff)
parent8eb151724a1251234ba425ed4921fa9a25b24d70 (diff)
Merge pull request #2297 from Ewann
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
-rw-r--r--runtime/shims/d3d12_com.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp
index d9b1a009c..81f2970c6 100644
--- a/runtime/shims/d3d12_com.cpp
+++ b/runtime/shims/d3d12_com.cpp
@@ -1542,8 +1542,11 @@ HRESULT create_command_queue(leonida::VulkanContext& context, VkQueue queue, std
1542} 1542}
1543 1543
1544HRESULT create_command_allocator(D3D12_COMMAND_LIST_TYPE type, REFIID riid, void** out, IUnknown* device) { 1544HRESULT create_command_allocator(D3D12_COMMAND_LIST_TYPE type, REFIID riid, void** out, IUnknown* device) {
1545 if (!out) return E_POINTER; 1545 // The host runtime's order (d3d12_vulkan_device_test, compare_invalid_arguments "command allocator:"): a type
1546 *out = nullptr; 1546 // past VIDEO_ENCODE is E_INVALIDARG, then a null output is E_UNEXPECTED.
1547 if (out) *out = nullptr;
1548 if (UINT(type) > UINT(D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE)) return E_INVALIDARG;
1549 if (!out) return E_UNEXPECTED;
1547 auto* object = new CommandAllocator(type); 1550 auto* object = new CommandAllocator(type);
1548 object->attach_device(device); 1551 object->attach_device(device);
1549 return hand_out(object, riid, out); 1552 return hand_out(object, riid, out);
@@ -1551,12 +1554,13 @@ HRESULT create_command_allocator(D3D12_COMMAND_LIST_TYPE type, REFIID riid, void
1551 1554
1552HRESULT create_command_list(D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator* allocator, REFIID riid, 1555HRESULT create_command_list(D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator* allocator, REFIID riid,
1553 void** out, IUnknown* device, ID3D12PipelineState* initial_state) { 1556 void** out, IUnknown* device, ID3D12PipelineState* initial_state) {
1554 if (!out) return E_POINTER; 1557 if (out) *out = nullptr;
1555 *out = nullptr;
1556 CommandAllocator* command_allocator = CommandAllocator::from(allocator); 1558 CommandAllocator* command_allocator = CommandAllocator::from(allocator);
1557 if (!command_allocator || command_allocator->type() != type) return E_INVALIDARG; 1559 if (!command_allocator || command_allocator->type() != type) return E_INVALIDARG;
1558 // A list is created open, so the allocator must be free: E_INVALIDARG as on the PC runtime (D3D-51). 1560 // A list is created open, so the allocator must be free: E_INVALIDARG as on the PC runtime (D3D-51).
1559 if (command_allocator->recording()) return E_INVALIDARG; 1561 if (command_allocator->recording()) return E_INVALIDARG;
1562 // A null output only after the arguments, as the host runtime answers ("command list:" cases).
1563 if (!out) return E_UNEXPECTED;
1560 if (type != D3D12_COMMAND_LIST_TYPE_DIRECT && type != D3D12_COMMAND_LIST_TYPE_BUNDLE && 1564 if (type != D3D12_COMMAND_LIST_TYPE_DIRECT && type != D3D12_COMMAND_LIST_TYPE_BUNDLE &&
1561 type != D3D12_COMMAND_LIST_TYPE_COMPUTE && type != D3D12_COMMAND_LIST_TYPE_COPY) 1565 type != D3D12_COMMAND_LIST_TYPE_COMPUTE && type != D3D12_COMMAND_LIST_TYPE_COPY)
1562 stub("create_command_list(non-direct type)"); 1566 stub("create_command_list(non-direct type)");