vk_graphics_pipeline: Move warning to pipeline

This commit is contained in:
IndecisiveTurtle 2025-07-14 18:12:04 +03:00
parent 38efe453e8
commit 37fe4f96a5
2 changed files with 6 additions and 5 deletions

View File

@ -158,6 +158,12 @@ GraphicsPipeline::GraphicsPipeline(
}; };
if (!instance.IsDepthClampControlSupported()) { if (!instance.IsDepthClampControlSupported()) {
if (key.depth_clamp_user_defined_range) {
LOG_WARNING(Render_Vulkan,
"Viewport uses custom clamp range zmin={}, zmax={} which cannot be "
"accurately emulated",
key.min_depth_clamp, key.max_depth_clamp);
}
viewport_chain.unlink<vk::PipelineViewportDepthClampControlCreateInfoEXT>(); viewport_chain.unlink<vk::PipelineViewportDepthClampControlCreateInfoEXT>();
} }
if (!instance.IsDepthClipControlSupported()) { if (!instance.IsDepthClipControlSupported()) {

View File

@ -535,11 +535,6 @@ void PipelineCache::RefreshDepthClampRange() {
if (!depth_clamp_can_use_viewport_range && !depth_clamp_is_same_on_all_viewports) { if (!depth_clamp_can_use_viewport_range && !depth_clamp_is_same_on_all_viewports) {
LOG_ERROR(Render_Vulkan, LOG_ERROR(Render_Vulkan,
"Viewport depth clamping configuration cannot be accurately emulated"); "Viewport depth clamping configuration cannot be accurately emulated");
} else if (!depth_clamp_can_use_viewport_range && !instance.IsDepthClampControlSupported()) {
LOG_WARNING(
Render_Vulkan,
"Viewport uses custom clamp range zmin={}, zmax={} which cannot be accurately emulated",
zmin, zmax);
} }
key.depth_clamp_user_defined_range = !depth_clamp_can_use_viewport_range; key.depth_clamp_user_defined_range = !depth_clamp_can_use_viewport_range;