mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 22:54:16 +01:00
[d3d10] Fix and cleanup S_FALSE handling
This commit is contained in:
parent
62a833b528
commit
995949a9f9
@ -110,13 +110,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_SUBRESOURCE_DATA*>(pInitialData),
|
reinterpret_cast<const D3D11_SUBRESOURCE_DATA*>(pInitialData),
|
||||||
ppBuffer != nullptr ? &d3d11Buffer : nullptr);
|
ppBuffer != nullptr ? &d3d11Buffer : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppBuffer != nullptr) {
|
*ppBuffer = static_cast<D3D11Buffer*>(d3d11Buffer)->GetD3D10Iface();
|
||||||
*ppBuffer = static_cast<D3D11Buffer*>(d3d11Buffer)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -144,13 +143,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_SUBRESOURCE_DATA*>(pInitialData),
|
reinterpret_cast<const D3D11_SUBRESOURCE_DATA*>(pInitialData),
|
||||||
ppTexture1D != nullptr ? &d3d11Texture1D : nullptr);
|
ppTexture1D != nullptr ? &d3d11Texture1D : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppTexture1D != nullptr) {
|
*ppTexture1D = static_cast<D3D11Texture1D*>(d3d11Texture1D)->GetD3D10Iface();
|
||||||
*ppTexture1D = static_cast<D3D11Texture1D*>(d3d11Texture1D)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -180,13 +178,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_SUBRESOURCE_DATA*>(pInitialData),
|
reinterpret_cast<const D3D11_SUBRESOURCE_DATA*>(pInitialData),
|
||||||
ppTexture2D != nullptr ? &d3d11Texture2D : nullptr);
|
ppTexture2D != nullptr ? &d3d11Texture2D : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppTexture2D != nullptr) {
|
*ppTexture2D = static_cast<D3D11Texture2D*>(d3d11Texture2D)->GetD3D10Iface();
|
||||||
*ppTexture2D = static_cast<D3D11Texture2D*>(d3d11Texture2D)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -215,13 +212,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_SUBRESOURCE_DATA*>(pInitialData),
|
reinterpret_cast<const D3D11_SUBRESOURCE_DATA*>(pInitialData),
|
||||||
ppTexture3D != nullptr ? &d3d11Texture3D : nullptr);
|
ppTexture3D != nullptr ? &d3d11Texture3D : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppTexture3D != nullptr) {
|
*ppTexture3D = static_cast<D3D11Texture3D*>(d3d11Texture3D)->GetD3D10Iface();
|
||||||
*ppTexture3D = static_cast<D3D11Texture3D*>(d3d11Texture3D)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -242,13 +238,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_SHADER_RESOURCE_VIEW_DESC*>(pDesc),
|
reinterpret_cast<const D3D11_SHADER_RESOURCE_VIEW_DESC*>(pDesc),
|
||||||
ppSRView ? &d3d11Srv : nullptr);
|
ppSRView ? &d3d11Srv : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppSRView != nullptr) {
|
*ppSRView = static_cast<D3D11ShaderResourceView*>(d3d11Srv)->GetD3D10Iface();
|
||||||
*ppSRView = static_cast<D3D11ShaderResourceView*>(d3d11Srv)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -269,13 +264,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_SHADER_RESOURCE_VIEW_DESC*>(pDesc),
|
reinterpret_cast<const D3D11_SHADER_RESOURCE_VIEW_DESC*>(pDesc),
|
||||||
ppSRView ? &d3d11View : nullptr);
|
ppSRView ? &d3d11View : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppSRView != nullptr) {
|
*ppSRView = static_cast<D3D11ShaderResourceView*>(d3d11View)->GetD3D10Iface();
|
||||||
*ppSRView = static_cast<D3D11ShaderResourceView*>(d3d11View)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -296,13 +290,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_RENDER_TARGET_VIEW_DESC*>(pDesc),
|
reinterpret_cast<const D3D11_RENDER_TARGET_VIEW_DESC*>(pDesc),
|
||||||
ppRTView ? &d3d11View : nullptr);
|
ppRTView ? &d3d11View : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppRTView != nullptr) {
|
*ppRTView = static_cast<D3D11RenderTargetView*>(d3d11View)->GetD3D10Iface();
|
||||||
*ppRTView = static_cast<D3D11RenderTargetView*>(d3d11View)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -366,13 +359,12 @@ namespace dxvk {
|
|||||||
d3d11Resource.ptr(), pDesc ? &d3d11Desc : nullptr,
|
d3d11Resource.ptr(), pDesc ? &d3d11Desc : nullptr,
|
||||||
ppDepthStencilView ? &d3d11View : nullptr);
|
ppDepthStencilView ? &d3d11View : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppDepthStencilView != nullptr) {
|
*ppDepthStencilView = static_cast<D3D11DepthStencilView*>(d3d11View)->GetD3D10Iface();
|
||||||
*ppDepthStencilView = static_cast<D3D11DepthStencilView*>(d3d11View)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -396,8 +388,7 @@ namespace dxvk {
|
|||||||
if (FAILED(hr) || hr == S_FALSE)
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppInputLayout)
|
*ppInputLayout = static_cast<D3D11InputLayout*>(d3d11InputLayout)->GetD3D10Iface();
|
||||||
*ppInputLayout = static_cast<D3D11InputLayout*>(d3d11InputLayout)->GetD3D10Iface();
|
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
@ -415,13 +406,12 @@ namespace dxvk {
|
|||||||
pShaderBytecode, BytecodeLength, nullptr,
|
pShaderBytecode, BytecodeLength, nullptr,
|
||||||
ppVertexShader ? &d3d11Shader : nullptr);
|
ppVertexShader ? &d3d11Shader : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppVertexShader != nullptr) {
|
*ppVertexShader = static_cast<D3D11VertexShader*>(d3d11Shader)->GetD3D10Iface();
|
||||||
*ppVertexShader = static_cast<D3D11VertexShader*>(d3d11Shader)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -437,13 +427,12 @@ namespace dxvk {
|
|||||||
pShaderBytecode, BytecodeLength, nullptr,
|
pShaderBytecode, BytecodeLength, nullptr,
|
||||||
ppGeometryShader ? &d3d11Shader : nullptr);
|
ppGeometryShader ? &d3d11Shader : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppGeometryShader != nullptr) {
|
*ppGeometryShader = static_cast<D3D11GeometryShader*>(d3d11Shader)->GetD3D10Iface();
|
||||||
*ppGeometryShader = static_cast<D3D11GeometryShader*>(d3d11Shader)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -477,13 +466,12 @@ namespace dxvk {
|
|||||||
D3D11_SO_NO_RASTERIZED_STREAM, nullptr,
|
D3D11_SO_NO_RASTERIZED_STREAM, nullptr,
|
||||||
ppGeometryShader ? &d3d11Shader : nullptr);
|
ppGeometryShader ? &d3d11Shader : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppGeometryShader != nullptr) {
|
*ppGeometryShader = static_cast<D3D11GeometryShader*>(d3d11Shader)->GetD3D10Iface();
|
||||||
*ppGeometryShader = static_cast<D3D11GeometryShader*>(d3d11Shader)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -499,13 +487,12 @@ namespace dxvk {
|
|||||||
pShaderBytecode, BytecodeLength, nullptr,
|
pShaderBytecode, BytecodeLength, nullptr,
|
||||||
ppPixelShader ? &d3d11Shader : nullptr);
|
ppPixelShader ? &d3d11Shader : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppPixelShader != nullptr) {
|
*ppPixelShader = static_cast<D3D11PixelShader*>(d3d11Shader)->GetD3D10Iface();
|
||||||
*ppPixelShader = static_cast<D3D11PixelShader*>(d3d11Shader)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -536,13 +523,12 @@ namespace dxvk {
|
|||||||
HRESULT hr = m_device->CreateBlendState(&d3d11Desc,
|
HRESULT hr = m_device->CreateBlendState(&d3d11Desc,
|
||||||
ppBlendState ? &d3d11BlendState : nullptr);
|
ppBlendState ? &d3d11BlendState : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppBlendState != nullptr) {
|
*ppBlendState = static_cast<D3D11BlendState*>(d3d11BlendState)->GetD3D10Iface();
|
||||||
*ppBlendState = static_cast<D3D11BlendState*>(d3d11BlendState)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -556,13 +542,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_BLEND_DESC*>(pBlendStateDesc),
|
reinterpret_cast<const D3D11_BLEND_DESC*>(pBlendStateDesc),
|
||||||
ppBlendState ? &d3d11BlendState : nullptr);
|
ppBlendState ? &d3d11BlendState : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppBlendState != nullptr) {
|
*ppBlendState = static_cast<D3D11BlendState*>(d3d11BlendState)->GetD3D10Iface();
|
||||||
*ppBlendState = static_cast<D3D11BlendState*>(d3d11BlendState)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -576,13 +561,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_DEPTH_STENCIL_DESC*>(pDepthStencilDesc),
|
reinterpret_cast<const D3D11_DEPTH_STENCIL_DESC*>(pDepthStencilDesc),
|
||||||
ppDepthStencilState ? &d3d11DepthStencilState : nullptr);
|
ppDepthStencilState ? &d3d11DepthStencilState : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppDepthStencilState != nullptr) {
|
*ppDepthStencilState = static_cast<D3D11DepthStencilState*>(d3d11DepthStencilState)->GetD3D10Iface();
|
||||||
*ppDepthStencilState = static_cast<D3D11DepthStencilState*>(d3d11DepthStencilState)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -596,13 +580,12 @@ namespace dxvk {
|
|||||||
reinterpret_cast<const D3D11_RASTERIZER_DESC*>(pRasterizerDesc),
|
reinterpret_cast<const D3D11_RASTERIZER_DESC*>(pRasterizerDesc),
|
||||||
ppRasterizerState ? &d3d11RasterizerState : nullptr);
|
ppRasterizerState ? &d3d11RasterizerState : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppRasterizerState != nullptr) {
|
*ppRasterizerState = static_cast<D3D11RasterizerState*>(d3d11RasterizerState)->GetD3D10Iface();
|
||||||
*ppRasterizerState = static_cast<D3D11RasterizerState*>(d3d11RasterizerState)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -632,13 +615,12 @@ namespace dxvk {
|
|||||||
HRESULT hr = m_device->CreateSamplerState(&d3d11Desc,
|
HRESULT hr = m_device->CreateSamplerState(&d3d11Desc,
|
||||||
ppSamplerState ? &d3d11SamplerState : nullptr);
|
ppSamplerState ? &d3d11SamplerState : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppSamplerState) {
|
*ppSamplerState = static_cast<D3D11SamplerState*>(d3d11SamplerState)->GetD3D10Iface();
|
||||||
*ppSamplerState = static_cast<D3D11SamplerState*>(d3d11SamplerState)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -658,13 +640,12 @@ namespace dxvk {
|
|||||||
HRESULT hr = m_device->CreateQuery(&d3d11Desc,
|
HRESULT hr = m_device->CreateQuery(&d3d11Desc,
|
||||||
ppQuery ? &d3d11Query : nullptr);
|
ppQuery ? &d3d11Query : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppQuery != nullptr) {
|
*ppQuery = static_cast<D3D11Query*>(d3d11Query)->GetD3D10Iface();
|
||||||
*ppQuery = static_cast<D3D11Query*>(d3d11Query)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -681,13 +662,12 @@ namespace dxvk {
|
|||||||
HRESULT hr = m_device->CreatePredicate(&d3d11Desc,
|
HRESULT hr = m_device->CreatePredicate(&d3d11Desc,
|
||||||
ppPredicate ? &d3d11Predicate : nullptr);
|
ppPredicate ? &d3d11Predicate : nullptr);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr) || hr == S_FALSE)
|
||||||
return hr;
|
return hr;
|
||||||
|
|
||||||
if (ppPredicate != nullptr) {
|
*ppPredicate = static_cast<D3D11Query*>(d3d11Predicate)->GetD3D10Iface();
|
||||||
*ppPredicate = static_cast<D3D11Query*>(d3d11Predicate)->GetD3D10Iface();
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
} return S_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user