mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[d3d11] Implement DiscardView1
Basically just behave like DiscardView if no rects are passed to the function, otherwise ignore the call since we can't discard individual rectangles in any meaningful way.
This commit is contained in:
parent
0338b70596
commit
48417c7d19
@ -101,8 +101,20 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11DeviceContext::DiscardView(ID3D11View* pResourceView) {
|
void STDMETHODCALLTYPE D3D11DeviceContext::DiscardView(ID3D11View* pResourceView) {
|
||||||
|
DiscardView1(pResourceView, nullptr, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void STDMETHODCALLTYPE D3D11DeviceContext::DiscardView1(
|
||||||
|
ID3D11View* pResourceView,
|
||||||
|
const D3D11_RECT* pRects,
|
||||||
|
UINT NumRects) {
|
||||||
D3D10DeviceLock lock = LockContext();
|
D3D10DeviceLock lock = LockContext();
|
||||||
|
|
||||||
|
// We don't support discarding individual rectangles
|
||||||
|
if (!pResourceView || (NumRects && pRects))
|
||||||
|
return;
|
||||||
|
|
||||||
// ID3D11View has no methods to query the exact type of
|
// ID3D11View has no methods to query the exact type of
|
||||||
// the view, so we'll have to check each possible class
|
// the view, so we'll have to check each possible class
|
||||||
auto dsv = dynamic_cast<D3D11DepthStencilView*>(pResourceView);
|
auto dsv = dynamic_cast<D3D11DepthStencilView*>(pResourceView);
|
||||||
@ -114,7 +126,9 @@ namespace dxvk {
|
|||||||
if (rtv) view = rtv->GetImageView();
|
if (rtv) view = rtv->GetImageView();
|
||||||
if (uav) view = uav->GetImageView();
|
if (uav) view = uav->GetImageView();
|
||||||
|
|
||||||
if (view != nullptr) {
|
if (view == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
EmitCs([cView = std::move(view)]
|
EmitCs([cView = std::move(view)]
|
||||||
(DxvkContext* ctx) {
|
(DxvkContext* ctx) {
|
||||||
ctx->discardImage(
|
ctx->discardImage(
|
||||||
@ -122,18 +136,6 @@ namespace dxvk {
|
|||||||
cView->subresources());
|
cView->subresources());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11DeviceContext::DiscardView1(
|
|
||||||
ID3D11View* pResourceView,
|
|
||||||
const D3D11_RECT* pRects,
|
|
||||||
UINT NumRects) {
|
|
||||||
static bool s_errorShown = false;
|
|
||||||
|
|
||||||
if (!std::exchange(s_errorShown, true))
|
|
||||||
Logger::err("D3D11DeviceContext::DiscardView1: Not implemented");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D11DeviceContext::GetDevice(ID3D11Device **ppDevice) {
|
void STDMETHODCALLTYPE D3D11DeviceContext::GetDevice(ID3D11Device **ppDevice) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user