mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 11:52:12 +01:00
[d3d11] Add exception handling to CreateTexture* methods
This commit is contained in:
parent
43b7e84bb5
commit
dc67cf730e
@ -75,15 +75,20 @@ namespace dxvk {
|
||||
const D3D11_BUFFER_DESC* pDesc,
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData,
|
||||
ID3D11Buffer** ppBuffer) {
|
||||
if (ppBuffer != nullptr) {
|
||||
if (ppBuffer == nullptr)
|
||||
return S_FALSE;
|
||||
|
||||
try {
|
||||
const Com<D3D11Buffer> buffer
|
||||
= new D3D11Buffer(this, pDesc);
|
||||
|
||||
this->InitBuffer(buffer.ptr(), pInitialData);
|
||||
*ppBuffer = buffer.ref();
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
Logger::err(e.message());
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -91,15 +96,20 @@ namespace dxvk {
|
||||
const D3D11_TEXTURE1D_DESC* pDesc,
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData,
|
||||
ID3D11Texture1D** ppTexture1D) {
|
||||
if (ppTexture1D != nullptr) {
|
||||
if (ppTexture1D == nullptr)
|
||||
return S_FALSE;
|
||||
|
||||
try {
|
||||
const Com<D3D11Texture1D> texture
|
||||
= new D3D11Texture1D(this, pDesc);
|
||||
|
||||
this->InitTexture(texture->GetTextureInfo()->image, pInitialData);
|
||||
*ppTexture1D = texture.ref();
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
Logger::err(e.message());
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -107,15 +117,20 @@ namespace dxvk {
|
||||
const D3D11_TEXTURE2D_DESC* pDesc,
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData,
|
||||
ID3D11Texture2D** ppTexture2D) {
|
||||
if (ppTexture2D != nullptr) {
|
||||
if (ppTexture2D == nullptr)
|
||||
return S_FALSE;
|
||||
|
||||
try {
|
||||
const Com<D3D11Texture2D> texture
|
||||
= new D3D11Texture2D(this, pDesc);
|
||||
|
||||
this->InitTexture(texture->GetTextureInfo()->image, pInitialData);
|
||||
*ppTexture2D = texture.ref();
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
Logger::err(e.message());
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -123,15 +138,20 @@ namespace dxvk {
|
||||
const D3D11_TEXTURE3D_DESC* pDesc,
|
||||
const D3D11_SUBRESOURCE_DATA* pInitialData,
|
||||
ID3D11Texture3D** ppTexture3D) {
|
||||
if (ppTexture3D != nullptr) {
|
||||
if (ppTexture3D == nullptr)
|
||||
return S_FALSE;
|
||||
|
||||
try {
|
||||
const Com<D3D11Texture3D> texture
|
||||
= new D3D11Texture3D(this, pDesc);
|
||||
|
||||
this->InitTexture(texture->GetTextureInfo()->image, pInitialData);
|
||||
*ppTexture3D = texture.ref();
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
Logger::err(e.message());
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user