mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 11:52:12 +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:
parent
e45d502fe4
commit
43b7e84bb5
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user