Auparavant, le paramètre swapchain
était le format RGB32
, ce qui a fonctionné correctement.comment créer un format swapchain DXGI_FORMAT_420_OPAQUE?
Je souhaite recevoir les données yv12 et le restituer. J'ai donc changé le format swapChain
en DXGI_FORMAT_420_OPAQUE
.
DXGI_SWAP_CHAIN_DESC1 swapChainDesc = { 0 };
swapChainDesc.Width = 0;
swapChainDesc.Height = 0;
swapChainDesc.Format = DXGI_FORMAT_420_OPAQUE;// DXGI_FORMAT_B8G8R8A8_UNORM
swapChainDesc.Stereo = false;
swapChainDesc.SampleDesc.Count = 1;
swapChainDesc.SampleDesc.Quality = 0;
swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
swapChainDesc.BufferCount = 2;
swapChainDesc.Scaling = DXGI_SCALING_STRETCH;
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD;
swapChainDesc.Flags = 0;
dxgiFactory->CreateSwapChainForHwnd(_direct3DDevice, _hwnd, &swapChainDesc, nullptr, nullptr, &_DXGISwapChain);
IDXGISurface *dxgiBackBuffer;
_DXGISwapChain->GetBuffer(0, IID_PPV_ARGS(&dxgiBackBuffer));
Puis, en dxgiBackBuffer
je reçois un NullReferenceException
.
Je pense que vous ne pouvez pas créer de tampon arrière selon yv12 format
.
Savez-vous si je me trompe?