diff --git a/rpcs3/Emu/RSX/VK/VKHelpers.h b/rpcs3/Emu/RSX/VK/VKHelpers.h index 6d35e68ed6..67df171a25 100644 --- a/rpcs3/Emu/RSX/VK/VKHelpers.h +++ b/rpcs3/Emu/RSX/VK/VKHelpers.h @@ -276,6 +276,7 @@ namespace vk struct gpu_shader_types_support { + bool allow_float64; bool allow_float16; bool allow_int8; }; @@ -634,6 +635,7 @@ namespace vk std::unordered_map format_properties; gpu_shader_types_support shader_types_support{}; VkPhysicalDeviceDriverPropertiesKHR driver_properties{}; + bool stencil_export_support = false; bool conditional_render_support = false; bool unrestricted_depth_range_support = false; @@ -680,6 +682,7 @@ private: verify("vkGetInstanceProcAddress failed to find entry point!" HERE), getPhysicalDeviceFeatures2KHR; getPhysicalDeviceFeatures2KHR(dev, &features2); + shader_types_support.allow_float64 = !!features2.features.shaderFloat64; shader_types_support.allow_float16 = !!shader_support_info.shaderFloat16; shader_types_support.allow_int8 = !!shader_support_info.shaderInt8; features = features2.features; @@ -915,6 +918,7 @@ private: enabled_features.depthBounds = VK_TRUE; enabled_features.wideLines = VK_TRUE; enabled_features.largePoints = VK_TRUE; + enabled_features.shaderFloat64 = VK_TRUE; if (g_cfg.video.antialiasing_level != msaa_level::none) { @@ -943,6 +947,12 @@ private: enabled_features.shaderStorageBufferArrayDynamicIndexing = VK_TRUE; // Optionally disable unsupported stuff + if (!pgpu->features.shaderFloat64) + { + rsx_log.error("Your GPU does not support double precision floats in shaders. Graphics may not work correctly."); + enabled_features.shaderFloat64 = VK_FALSE; + } + if (!pgpu->features.depthBounds) { rsx_log.error("Your GPU does not support depth bounds testing. Graphics may not work correctly."); diff --git a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp index d304c3b22c..d1e5547bc7 100644 --- a/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp +++ b/rpcs3/Emu/RSX/VK/VKVertexProgram.cpp @@ -186,7 +186,7 @@ void VKVertexDecompilerThread::insertMainStart(std::stringstream & OS) properties2.domain = glsl::glsl_vertex_program; properties2.require_lit_emulation = properties.has_lit_op; properties2.emulate_zclip_transform = true; - properties2.emulate_depth_clip_only = true; + properties2.emulate_depth_clip_only = vk::get_current_renderer()->get_shader_types_support().allow_float64; glsl::insert_glsl_legacy_function(OS, properties2); glsl::insert_vertex_input_fetch(OS, glsl::glsl_rules_spirv);