1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-11 01:24:12 +01:00

[dxvk] Validate tessellation state for graphics pipeline

This should help with freezes as long as Tessellation is
not properly implemented.
This commit is contained in:
Philip Rebohle 2018-02-23 12:55:23 +01:00
parent 8813ff979a
commit e4dae74865
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
4 changed files with 12 additions and 0 deletions

View File

@ -807,6 +807,11 @@ namespace dxvk {
} }
} }
std::sort(bindings.begin(), bindings.end(),
[] (const DxvkVertexBinding& a, const DxvkVertexBinding& b) {
return a.binding < b.binding;
});
// Create the actual input layout object // Create the actual input layout object
// if the application requests it. // if the application requests it.
if (ppInputLayout != nullptr) { if (ppInputLayout != nullptr) {

View File

@ -50,6 +50,7 @@ namespace dxvk {
DxvkInputAssemblyState iaState; DxvkInputAssemblyState iaState;
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP; iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP;
iaState.primitiveRestart = VK_FALSE; iaState.primitiveRestart = VK_FALSE;
iaState.patchVertexCount = 0;
m_context->setInputAssemblyState(iaState); m_context->setInputAssemblyState(iaState);
m_context->setInputLayout( m_context->setInputLayout(

View File

@ -247,6 +247,11 @@ namespace dxvk {
if (tsInfo.patchControlPoints == 0) if (tsInfo.patchControlPoints == 0)
info.pTessellationState = nullptr; info.pTessellationState = nullptr;
if ((tsInfo.patchControlPoints != 0) && (m_tcs == nullptr || m_tes == nullptr)) {
Logger::err("DxvkGraphicsPipeline: Cannot use tessellation patches without tessellation shaders");
return VK_NULL_HANDLE;
}
VkPipeline pipeline = VK_NULL_HANDLE; VkPipeline pipeline = VK_NULL_HANDLE;
if (m_vkd->vkCreateGraphicsPipelines(m_vkd->device(), if (m_vkd->vkCreateGraphicsPipelines(m_vkd->device(),
m_cache->handle(), 1, &info, nullptr, &pipeline) != VK_SUCCESS) { m_cache->handle(), 1, &info, nullptr, &pipeline) != VK_SUCCESS) {

View File

@ -31,6 +31,7 @@ namespace dxvk::hud {
DxvkInputAssemblyState iaState; DxvkInputAssemblyState iaState;
iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; iaState.primitiveTopology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
iaState.primitiveRestart = VK_FALSE; iaState.primitiveRestart = VK_FALSE;
iaState.patchVertexCount = 0;
context->setInputAssemblyState(iaState); context->setInputAssemblyState(iaState);
const std::array<DxvkVertexAttribute, 3> ilAttributes = {{ const std::array<DxvkVertexAttribute, 3> ilAttributes = {{