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:
parent
49965fd79e
commit
9159401b14
@ -315,11 +315,17 @@ namespace dxvk {
|
|||||||
xfbStreamInfo.flags = 0;
|
xfbStreamInfo.flags = 0;
|
||||||
xfbStreamInfo.rasterizationStream = uint32_t(rasterizedStream);
|
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;
|
VkPipelineRasterizationStateCreateInfo rsInfo;
|
||||||
rsInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
rsInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
||||||
rsInfo.pNext = nullptr;
|
rsInfo.pNext = &rsDepthClipInfo;
|
||||||
rsInfo.flags = 0;
|
rsInfo.flags = 0;
|
||||||
rsInfo.depthClampEnable = !state.rsDepthClipEnable;
|
rsInfo.depthClampEnable = VK_TRUE;
|
||||||
rsInfo.rasterizerDiscardEnable = rasterizedStream < 0;
|
rsInfo.rasterizerDiscardEnable = rasterizedStream < 0;
|
||||||
rsInfo.polygonMode = state.rsPolygonMode;
|
rsInfo.polygonMode = state.rsPolygonMode;
|
||||||
rsInfo.cullMode = state.rsCullMode;
|
rsInfo.cullMode = state.rsCullMode;
|
||||||
@ -331,7 +337,12 @@ namespace dxvk {
|
|||||||
rsInfo.lineWidth = 1.0f;
|
rsInfo.lineWidth = 1.0f;
|
||||||
|
|
||||||
if (rasterizedStream > 0)
|
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;
|
VkPipelineMultisampleStateCreateInfo msInfo;
|
||||||
msInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
|
msInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
|
||||||
|
Loading…
Reference in New Issue
Block a user