MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / TextureCopyRect

Method TextureCopyRect

Source/DX11VideoProcessor.cpp:300–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300HRESULT CDX11VideoProcessor::TextureCopyRect(
301 const Tex2D_t& Tex, ID3D11Texture2D* pRenderTarget,
302 const CRect& srcRect, const CRect& destRect,
303 ID3D11PixelShader* pPixelShader, ID3D11Buffer* pConstantBuffer,
304 const int iRotation, const bool bFlip)
305{
306 CComPtr<ID3D11RenderTargetView> pRenderTargetView;
307
308 HRESULT hr = m_pDevice->CreateRenderTargetView(pRenderTarget, nullptr, &pRenderTargetView);
309 if (FAILED(hr)) {
310 DLog(L"TextureCopyRect() : CreateRenderTargetView() failed with error {}", HR2Str(hr));
311 return hr;
312 }
313
314 hr = FillVertexBuffer(m_pDeviceContext, m_pVertexBuffer, Tex.desc.Width, Tex.desc.Height, srcRect, iRotation, bFlip);
315 if (FAILED(hr)) {
316 return hr;
317 }
318
319 D3D11_VIEWPORT VP;
320 VP.TopLeftX = (FLOAT)destRect.left;
321 VP.TopLeftY = (FLOAT)destRect.top;
322 VP.Width = (FLOAT)destRect.Width();
323 VP.Height = (FLOAT)destRect.Height();
324 VP.MinDepth = 0.0f;
325 VP.MaxDepth = 1.0f;
326
327 TextureBlt11(m_pDeviceContext, pRenderTargetView, VP, m_pVSimpleInputLayout, m_pVS_Simple, pPixelShader, Tex.pShaderResource, m_pSamplerPoint, pConstantBuffer, m_pVertexBuffer);
328
329 return hr;
330}
331
332HRESULT CDX11VideoProcessor::TextureResizeShader(
333 const Tex2D_t& Tex, ID3D11Texture2D* pRenderTarget,

Callers

nothing calls this directly

Calls 4

DLogFunction · 0.85
HR2StrFunction · 0.85
FillVertexBufferFunction · 0.85
TextureBlt11Function · 0.85

Tested by

no test coverage detected