mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 01:24:11 +01:00
[dxvk] Fix tessellation validation
Prevents crashes in case an app tries to use tessellation with an incorrect primitive topology.
This commit is contained in:
parent
2c974cbe1e
commit
e615416b31
@ -457,10 +457,13 @@ namespace dxvk {
|
||||
if ((providedVertexInputs & m_vsIn) != m_vsIn)
|
||||
return false;
|
||||
|
||||
// If there are no tessellation shaders, we
|
||||
// obviously cannot use tessellation patches.
|
||||
if ((state.ia.primitiveTopology() == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST)
|
||||
&& (m_shaders.tcs == nullptr || m_shaders.tes == nullptr))
|
||||
// Tessellation shaders and patches must be used together
|
||||
bool hasPatches = state.ia.primitiveTopology() == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST;
|
||||
|
||||
bool hasTcs = m_shaders.tcs != nullptr;
|
||||
bool hasTes = m_shaders.tes != nullptr;
|
||||
|
||||
if (hasPatches != hasTcs || hasPatches != hasTes)
|
||||
return false;
|
||||
|
||||
// Filter out undefined primitive topologies
|
||||
|
Loading…
Reference in New Issue
Block a user