1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-13 19:29:14 +01:00

[dxvk] Validate primitive topology in pipeline state

This commit is contained in:
Philip Rebohle 2019-09-23 15:19:46 +02:00
parent f38cfd592e
commit e8055f81df
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -490,7 +490,12 @@ namespace dxvk {
// If there are no tessellation shaders, we
// obviously cannot use tessellation patches.
if ((state.iaPatchVertexCount != 0) && (m_shaders.tcs == nullptr || m_shaders.tes == nullptr))
if ((state.iaPrimitiveTopology == VK_PRIMITIVE_TOPOLOGY_PATCH_LIST)
&& (m_shaders.tcs == nullptr || m_shaders.tes == nullptr))
return false;
// Filter out undefined primitive topologies
if (state.iaPrimitiveTopology == VK_PRIMITIVE_TOPOLOGY_MAX_ENUM)
return false;
// Prevent unintended out-of-bounds access to the IL arrays