Hello,
I would like to copy a FTexture2DRHI in another with a different format.
The source texture is back buffer coming from OnBackBufferReadyToPresent delegate.
The following code is called in the delegate.
const FRHIResourceCreateInfo ResourceInfo(TEXT("OptroSharedTexture"));
SharedTexture = RHICreateTexture2D(
BackBufferTexture->GetSizeX(),
BackBufferTexture->GetSizeY(),
EPixelFormat::PF_B8G8R8A8,
BackBufferTexture->GetNumMips(),
BackBufferTexture->GetNumSamples(),
ETextureCreateFlags::Shared,
ERHIAccess::CopyDest,
ResourceInfo);
FRHICommandListImmediate& RHICmdList = GRHICommandList.GetImmediateCommandList();
FRHICopyTextureInfo CopyInfo;
CopyInfo.Size = BackBufferTexture->GetSizeXYZ();
CopyInfo.SourceMipIndex = 0;
CopyInfo.DestMipIndex = 0;
RHICmdList.CopyTexture(BackBufferTexture, SharedTexture, CopyInfo);
But I’ve a kind of crash :
[2023.11.14-15.50.54:955][ 74]LogD3D12RHI: Error: Interfaces.CopyCommandList->Close() failed
at D:\A10_work\25\s\Engine\Source\Runtime\D3D12RHI\Private\D3D12CommandList.cpp:268
with error E_INVALIDARG
[2023.11.14-15.50.54:955][ 74]LogD3D12RHI: Error: [GPUBreadCrumb] Last tracked GPU operations:
[2023.11.14-15.50.54:955][ 74]LogD3D12RHI: Error: [GPUBreadCrumb] 3D Queue 0 - No Data
[2023.11.14-15.50.54:961][ 74]LogD3D12RHI: Error: [GPUBreadCrumb] Copy Queue 0 - No Data
[2023.11.14-15.50.54:973][ 74]LogD3D12RHI: Error: [GPUBreadCrumb] Compute Queue 0 - No Data
[2023.11.14-15.50.54:984][ 74]LogD3D12RHI: Error: DRED: No breadcrumb head found.
[2023.11.14-15.50.54:984][ 74]LogD3D12RHI: Error: DRED: No PageFault data.
[2023.11.14-15.50.54:984][ 74]LogD3D12RHI: Error: Memory Info from frame ID 74:
[2023.11.14-15.50.54:984][ 74]LogD3D12RHI: Error: Budget: 7241.00 MB
[2023.11.14-15.50.54:984][ 74]LogD3D12RHI: Error: Used: 2408.11 MB
[2023.11.14-15.50.54:995][ 74]LogD3D12RHI: Error: GPU Crashed or D3D Device Removed.
Thanks