MCPcopy Create free account
hub / github.com/crosire/reshade / ClearView

Method ClearView

source/d3d11/d3d11_device_context.cpp:1454–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1452 static_cast<ID3D11DeviceContext1 *>(_orig)->SwapDeviceContextState(pState, ppPreviousState);
1453}
1454void STDMETHODCALLTYPE D3D11DeviceContext::ClearView(ID3D11View *pView, const FLOAT Color[4], const D3D11_RECT *pRect, UINT NumRects)
1455{
1456 assert(_interface_version >= 1);
1457
1458#if RESHADE_ADDON
1459 if (com_ptr<ID3D11RenderTargetView> rtv;
1460 SUCCEEDED(pView->QueryInterface(&rtv)))
1461 {
1462 if (reshade::invoke_addon_event<reshade::addon_event::clear_render_target_view>(this, to_handle(rtv.get()), Color, NumRects, reinterpret_cast<const reshade::api::rect *>(pRect)))
1463 return;
1464 }
1465 else
1466 if (com_ptr<ID3D11DepthStencilView> dsv;
1467 SUCCEEDED(pView->QueryInterface(&dsv)))
1468 {
1469 // The 'ID3D11DeviceContext1::ClearView' API only works on depth-stencil views to depth-only resources (with no stencil component)
1470 if (reshade::invoke_addon_event<reshade::addon_event::clear_depth_stencil_view>(this, to_handle(dsv.get()), Color, nullptr, NumRects, reinterpret_cast<const reshade::api::rect *>(pRect)))
1471 return;
1472 }
1473 else
1474 if (com_ptr<ID3D11UnorderedAccessView> uav;
1475 SUCCEEDED(pView->QueryInterface(&uav)))
1476 {
1477 if (reshade::invoke_addon_event<reshade::addon_event::clear_unordered_access_view_float>(this, to_handle(uav.get()), Color, NumRects, reinterpret_cast<const reshade::api::rect *>(pRect)))
1478 return;
1479 }
1480#endif
1481
1482 static_cast<ID3D11DeviceContext1 *>(_orig)->ClearView(pView, Color, pRect, NumRects);
1483}
1484void STDMETHODCALLTYPE D3D11DeviceContext::DiscardView1(ID3D11View *pResourceView, const D3D11_RECT *pRects, UINT NumRects)
1485{
1486 assert(_interface_version >= 1);

Callers

nothing calls this directly

Calls 3

to_handleFunction · 0.70
QueryInterfaceMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected