Skip to content

Commit

Permalink
d3d11: Check if CreateTexture2D would succeed, but don't actually create
Browse files Browse the repository at this point in the history
  • Loading branch information
kasper93 authored and Nevcairiel committed Feb 19, 2022
1 parent 5397a0c commit 8bf1469
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions decoder/LAVVideo/decoders/d3d11va.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,20 +483,18 @@ STDMETHODIMP CDecD3D11::PostConnect(IPin *pPin)
texDesc.Width = m_pAVCtx->coded_width;
texDesc.Height = m_pAVCtx->coded_height;
texDesc.MipLevels = 1;
texDesc.ArraySize = 10;
texDesc.ArraySize = GetBufferCount();
texDesc.Format = m_SurfaceFormat;
texDesc.SampleDesc.Count = 1;
texDesc.Usage = D3D11_USAGE_DEFAULT;
texDesc.BindFlags = D3D11_BIND_DECODER | D3D11_BIND_SHADER_RESOURCE;
texDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED;

ID3D11Texture2D *pTexture2D = nullptr;
hr = pD3D11Device->CreateTexture2D(&texDesc, nullptr, &pTexture2D);
hr = pD3D11Device->CreateTexture2D(&texDesc, nullptr, nullptr);
if (FAILED(hr))
{
goto fail;
}
SafeRelease(&pTexture2D);
}

// Notice the connected pin that we're sending D3D11 textures
Expand Down

0 comments on commit 8bf1469

Please sign in to comment.