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

[d3d11] Validate shader module capabilities

Only create a shader module if the device actually supports
the required features. Apparently this is needed for some
Unity Engine games.
This commit is contained in:
Philip Rebohle 2019-10-21 12:10:05 +02:00
parent ddf010479d
commit ee77afb6af
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -2049,6 +2049,16 @@ namespace dxvk {
if (FAILED(hr))
return hr;
auto shader = commonShader.GetShader();
if (shader->hasCapability(spv::CapabilityStencilExportEXT)
&& !m_dxvkDevice->extensions().extShaderStencilExport)
return E_INVALIDARG;
if (shader->hasCapability(spv::CapabilityShaderViewportIndexLayerEXT)
&& !m_dxvkDevice->extensions().extShaderViewportIndexLayer)
return E_INVALIDARG;
*pShaderModule = std::move(commonShader);
return S_OK;
}