diff options
Diffstat (limited to 'src/gui/rhi/qrhivulkan.cpp')
| -rw-r--r-- | src/gui/rhi/qrhivulkan.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index b946f8777b6..481ffd57b5d 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -949,6 +949,8 @@ bool QRhiVulkan::create(QRhi::Flags flags) // elsewhere states that the minimum bufferOffset is 4... texbufAlign = qMax<VkDeviceSize>(4, physDevProperties.limits.optimalBufferCopyOffsetAlignment); + caps.depthClamp = physDevFeatures.depthClamp; + caps.wideLines = physDevFeatures.wideLines; caps.texture3DSliceAs2D = caps.apiVersion >= QVersionNumber(1, 1); @@ -8402,6 +8404,8 @@ bool QVkGraphicsPipeline::create() VkPipelineRasterizationStateCreateInfo rastInfo = {}; rastInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; + if (m_depthClamp && rhiD->caps.depthClamp) + rastInfo.depthClampEnable = m_depthClamp; rastInfo.cullMode = toVkCullMode(m_cullMode); rastInfo.frontFace = toVkFrontFace(m_frontFace); if (m_depthBias != 0 || !qFuzzyIsNull(m_slopeScaledDepthBias)) { @@ -8824,6 +8828,18 @@ bool QVkSwapChain::ensureSurface() if (ok) { colorFormat = formats[i].format; colorSpace = formats[i].colorSpace; +#if QT_CONFIG(wayland) + // On Wayland, only one color management surface can be created at a time without + // triggering a protocol error, and we create one ourselves in some situations. + // To avoid this problem, use VK_COLOR_SPACE_PASS_THROUGH_EXT when supported, + // so that the driver doesn't create a color management surface as well. + const bool hasPassThrough = std::any_of(formats.begin(), formats.end(), [this](const VkSurfaceFormatKHR &fmt) { + return fmt.format == colorFormat && fmt.colorSpace == VK_COLOR_SPACE_PASS_THROUGH_EXT; + }); + if (hasPassThrough) { + colorSpace = VK_COLOR_SPACE_PASS_THROUGH_EXT; + } +#endif break; } } |
