D3D12-CUDA RGB Pipeline

This commit is contained in:
2025-10-06 02:36:33 +09:00
parent 6b04396772
commit b4efc1be82
17 changed files with 1751 additions and 52 deletions

View File

@@ -208,6 +208,42 @@ ID3D12Resource* D3D12Manager::CreateNV12Texture(uint32_t width, uint32_t height)
return nullptr;
}
printf("[D3D12Manager] NV12 texture created: %ux%u\n", width, height);
return texture;
}
ID3D12Resource* D3D12Manager::CreateRGBATexture(uint32_t width, uint32_t height)
{
D3D12_RESOURCE_DESC desc = {};
desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
desc.Width = width;
desc.Height = height;
desc.DepthOrArraySize = 1;
desc.MipLevels = 1;
desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
desc.SampleDesc.Count = 1;
desc.SampleDesc.Quality = 0;
desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN; // Use default layout for RGBA
desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
D3D12_HEAP_PROPERTIES heap_props = {};
heap_props.Type = D3D12_HEAP_TYPE_DEFAULT;
ID3D12Resource* texture = nullptr;
HRESULT hr = m_device->CreateCommittedResource(
&heap_props,
D3D12_HEAP_FLAG_SHARED,
&desc,
D3D12_RESOURCE_STATE_COMMON,
nullptr,
IID_PPV_ARGS(&texture));
if (FAILED(hr)) {
printf("[D3D12Manager] Failed to create RGBA texture: 0x%08X\n", hr);
return nullptr;
}
printf("[D3D12Manager] RGBA texture created: %ux%u\n", width, height);
return texture;
}