1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 02:52:10 +01:00

[d3d11] Return fake tessellation shader obejects to the application

Prevents crashes in applications that use domain and hull shaders for
more than just rendering. Allows Fallout 4 tp run.
This commit is contained in:
Philip Rebohle 2018-02-26 17:29:10 +01:00
parent e45d502fe4
commit 43b7e84bb5
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 34 additions and 10 deletions

View File

@ -1246,8 +1246,19 @@ namespace dxvk {
ID3D11HullShader* pHullShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
if (m_state.hs.shader.ptr() != pHullShader)
Logger::err("D3D11DeviceContext::HSSetShader: Not implemented");
auto shader = static_cast<D3D11HullShader*>(pHullShader);
if (NumClassInstances != 0)
Logger::err("D3D11DeviceContext::HSSetShader: Class instances not supported");
if (m_state.hs.shader != shader) {
m_state.hs.shader = shader;
EmitCs([cShader = shader != nullptr ? shader->GetShader() : nullptr]
(DxvkContext* ctx) {
ctx->bindShader(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT, cShader);
});
}
}
@ -1330,8 +1341,19 @@ namespace dxvk {
ID3D11DomainShader* pDomainShader,
ID3D11ClassInstance* const* ppClassInstances,
UINT NumClassInstances) {
if (m_state.ds.shader.ptr() != pDomainShader)
Logger::err("D3D11DeviceContext::DSSetShader: Not implemented");
auto shader = static_cast<D3D11DomainShader*>(pDomainShader);
if (NumClassInstances != 0)
Logger::err("D3D11DeviceContext::DSSetShader: Class instances not supported");
if (m_state.ds.shader != shader) {
m_state.ds.shader = shader;
EmitCs([cShader = shader != nullptr ? shader->GetShader() : nullptr]
(DxvkContext* ctx) {
ctx->bindShader(VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT, cShader);
});
}
}

View File

@ -945,9 +945,10 @@ namespace dxvk {
ID3D11HullShader** ppHullShader) {
D3D11ShaderModule module;
if (FAILED(this->CreateShaderModule(&module,
pShaderBytecode, BytecodeLength, pClassLinkage)))
return E_INVALIDARG;
Logger::warn("D3D11: CreateHullShader: Tessellation shaders not yet supported");
// if (FAILED(this->CreateShaderModule(&module,
// pShaderBytecode, BytecodeLength, pClassLinkage)))
// return E_INVALIDARG;
if (ppHullShader == nullptr)
return S_FALSE;
@ -965,9 +966,10 @@ namespace dxvk {
ID3D11DomainShader** ppDomainShader) {
D3D11ShaderModule module;
if (FAILED(this->CreateShaderModule(&module,
pShaderBytecode, BytecodeLength, pClassLinkage)))
return E_INVALIDARG;
Logger::warn("D3D11: CreateDomainShader: Tessellation shaders not yet supported");
// if (FAILED(this->CreateShaderModule(&module,
// pShaderBytecode, BytecodeLength, pClassLinkage)))
// return E_INVALIDARG;
if (ppDomainShader == nullptr)
return S_FALSE;