mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 07:20:49 +00:00
Error handling fixes
This commit is contained in:
parent
e80a526015
commit
92e1dce2db
@ -1305,8 +1305,8 @@ Framebuffer *D3D11DrawContext::CreateFramebuffer(const FramebufferDesc &desc) {
|
||||
depthViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
|
||||
hr = device_->CreateShaderResourceView(fb->depthStencilTex, &depthViewDesc, &fb->depthSRView);
|
||||
if (FAILED(hr)) {
|
||||
delete fb;
|
||||
return nullptr;
|
||||
WARN_LOG(G3D, "Failed to create SRV for depth buffer.");
|
||||
fb->depthSRView = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1606,7 +1606,9 @@ void D3D11DrawContext::BindFramebufferAsTexture(Framebuffer *fbo, int binding, F
|
||||
context_->PSSetShaderResources(binding, 1, &fb->colorSRView);
|
||||
break;
|
||||
case FBChannel::FB_DEPTH_BIT:
|
||||
context_->PSSetShaderResources(binding, 1, &fb->depthSRView);
|
||||
if (fb->depthSRView) {
|
||||
context_->PSSetShaderResources(binding, 1, &fb->depthSRView);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -121,7 +121,8 @@ TextureCacheD3D11::TextureCacheD3D11(Draw::DrawContext *draw)
|
||||
lastBoundTexture = INVALID_TEX;
|
||||
|
||||
D3D11_BUFFER_DESC desc{ sizeof(DepthPushConstants), D3D11_USAGE_DYNAMIC, D3D11_BIND_CONSTANT_BUFFER, D3D11_CPU_ACCESS_WRITE };
|
||||
_dbg_assert_(SUCCEEDED(device_->CreateBuffer(&desc, nullptr, &depalConstants_)));
|
||||
HRESULT hr = device_->CreateBuffer(&desc, nullptr, &depalConstants_);
|
||||
_dbg_assert_(SUCCEEDED(hr));
|
||||
|
||||
HRESULT result = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user