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

[dxvk] Use depthClipEnable during graphics pipeline creation

Fall back to previous behaviour if the feature is not available.
This commit is contained in:
Philip Rebohle 2019-02-19 14:22:36 +01:00
parent 49965fd79e
commit 9159401b14
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -315,11 +315,17 @@ namespace dxvk {
xfbStreamInfo.flags = 0;
xfbStreamInfo.rasterizationStream = uint32_t(rasterizedStream);
VkPipelineRasterizationDepthClipStateCreateInfoEXT rsDepthClipInfo;
rsDepthClipInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT;
rsDepthClipInfo.pNext = nullptr;
rsDepthClipInfo.flags = 0;
rsDepthClipInfo.depthClipEnable = state.rsDepthClipEnable;
VkPipelineRasterizationStateCreateInfo rsInfo;
rsInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
rsInfo.pNext = nullptr;
rsInfo.pNext = &rsDepthClipInfo;
rsInfo.flags = 0;
rsInfo.depthClampEnable = !state.rsDepthClipEnable;
rsInfo.depthClampEnable = VK_TRUE;
rsInfo.rasterizerDiscardEnable = rasterizedStream < 0;
rsInfo.polygonMode = state.rsPolygonMode;
rsInfo.cullMode = state.rsCullMode;
@ -331,7 +337,12 @@ namespace dxvk {
rsInfo.lineWidth = 1.0f;
if (rasterizedStream > 0)
rsInfo.pNext = &xfbStreamInfo;
rsDepthClipInfo.pNext = &xfbStreamInfo;
if (!m_pipeMgr->m_device->features().extDepthClipEnable.depthClipEnable) {
rsInfo.pNext = rsDepthClipInfo.pNext;
rsInfo.depthClampEnable = !state.rsDepthClipEnable;
}
VkPipelineMultisampleStateCreateInfo msInfo;
msInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;