doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
12.79k stars 823 forks source link

Mono game hangs on minimize #3233

Closed Csimbi closed 1 year ago

Csimbi commented 1 year ago

Please describe your issue as accurately as possible. I start the game and it works fine. I minimize it - to read emails or something. Clicking on the task bar on the app brings it back up with a pitch black window and the game seems to be hung up.

If you use Windows, please check the following page: https://github.com/doitsujin/dxvk/wiki/Windows

Software information

Bloons TD 6 (on Steam). Running as Windowed on Windows 10.

System information

Apitrace file(s)

Does not run, it says:

Failed to initialize graphics.
Make sure you have DirectX 11 installed, have up to date drivers for your graphics card and have not disabled
3D acceleration in display settings.
InitializeEngineGraphics failed

Log files

K0bin commented 1 year ago

warn: D3D11: Failed to write shared resource info for a texture warn: D3D11Device::OpenSharedResourceGeneric: Handle not found: 0xc0000a02

Shared resources are not supported on Windows.

Csimbi commented 1 year ago

@K0bin Thanks! Would that go away if the game were running in full screen? (I am not sure what a shared resource info is, why that happens and how to avoid.)

Blisto91 commented 1 year ago

Shared resources is if a game need to "share resources" between two different graphics API devices or processes. E.g. a game might be using both Direct3D 9 and Direct3D 11 and want to share some information between the two. This explanation might not be entirely correct in the details.

But anyway, the shared resources implementation requires some Proton patches and aren't supported on Windows. If that is even what causes the issue. Haven't tested this yet.

K0bin commented 1 year ago

Go to the Nvidia control panel and set the presentation mode to native and see if that helps.

Csimbi commented 1 year ago

@Blisto91 Thanks for the explanation - seems there is nothing I can do there.

@K0bin Changed it the 'prefer native' - no change, still hangs.

Blisto91 commented 1 year ago

Mkay i did a quick test of this on Windows with AMD. I'm not reproducing the issue with either dxvk 2.0 or 2.2

Csimbi commented 1 year ago

I have an i4790K CPU. Not sure whether that matters or not. Bloons TD6 hangs every time I minimize it, not matter what configuration I use.

Blisto91 commented 1 year ago

@Csimbi Could i get you to retest this with dxvk 2.3?

Csimbi commented 1 year ago

@Csimbi Could i get you to retest this with dxvk 2.3?

Tested DXVK 2.3 vs. Bloons TD 6 v38.3 with default config (no specific config file). It works, minimizing to task bar and bringing it back up no longer causes a hang. Great stuff, thank you!

There are two warning messages though. Are those normal? BloonsTD6_d3d11.log

info:  D3D11InternalCreateDevice: Maximum supported feature level: D3D_FEATURE_LEVEL_12_1
info:  D3D11InternalCreateDevice: Using feature level D3D_FEATURE_LEVEL_11_1
info:  Device properties:
info:    Device : NVIDIA GeForce RTX 3060 Ti
info:    Driver : NVIDIA 537.13.0
info:  Enabled device extensions:
info:    VK_EXT_attachment_feedback_loop_layout
info:    VK_EXT_conservative_rasterization
info:    VK_EXT_custom_border_color
info:    VK_EXT_depth_clip_enable
info:    VK_EXT_extended_dynamic_state3
info:    VK_EXT_fragment_shader_interlock
info:    VK_EXT_full_screen_exclusive
info:    VK_EXT_graphics_pipeline_library
info:    VK_EXT_hdr_metadata
info:    VK_EXT_memory_priority
info:    VK_EXT_non_seamless_cube_map
info:    VK_EXT_robustness2
info:    VK_EXT_shader_module_identifier
info:    VK_EXT_transform_feedback
info:    VK_EXT_vertex_attribute_divisor
info:    VK_KHR_external_memory_win32
info:    VK_KHR_external_semaphore_win32
info:    VK_KHR_pipeline_library
info:    VK_KHR_present_id
info:    VK_KHR_present_wait
info:    VK_KHR_swapchain
info:    VK_KHR_win32_keyed_mutex
info:    VK_NVX_binary_import
info:    VK_NVX_image_view_handle
info:  Device features:
info:    robustBufferAccess                     : 1
info:    fullDrawIndexUint32                    : 1
info:    imageCubeArray                         : 1
info:    independentBlend                       : 1
info:    geometryShader                         : 1
info:    tessellationShader                     : 1
info:    sampleRateShading                      : 1
info:    dualSrcBlend                           : 1
info:    logicOp                                : 1
info:    multiDrawIndirect                      : 1
info:    drawIndirectFirstInstance              : 1
info:    depthClamp                             : 1
info:    depthBiasClamp                         : 1
info:    fillModeNonSolid                       : 1
info:    depthBounds                            : 1
info:    wideLines                              : 1
info:    multiViewport                          : 1
info:    samplerAnisotropy                      : 1
info:    textureCompressionBC                   : 1
info:    occlusionQueryPrecise                  : 1
info:    pipelineStatisticsQuery                : 1
info:    vertexPipelineStoresAndAtomics         : 1
info:    fragmentStoresAndAtomics               : 1
info:    shaderImageGatherExtended              : 1
info:    shaderClipDistance                     : 1
info:    shaderCullDistance                     : 1
info:    shaderFloat64                          : 1
info:    shaderInt64                            : 1
info:    variableMultisampleRate                : 1
info:    shaderResourceResidency                : 1
info:    shaderResourceMinLod                   : 1
info:    sparseBinding                          : 1
info:    sparseResidencyBuffer                  : 1
info:    sparseResidencyImage2D                 : 1
info:    sparseResidencyImage3D                 : 1
info:    sparseResidency2Samples                : 1
info:    sparseResidency4Samples                : 1
info:    sparseResidency8Samples                : 1
info:    sparseResidency16Samples               : 1
info:    sparseResidencyAliased                 : 1
info:  Vulkan 1.1
info:    shaderDrawParameters                   : 1
info:  Vulkan 1.2
info:    samplerMirrorClampToEdge               : 1
info:    drawIndirectCount                      : 1
info:    samplerFilterMinmax                    : 1
info:    hostQueryReset                         : 1
info:    timelineSemaphore                      : 1
info:    bufferDeviceAddress                    : 1
info:    shaderOutputViewportIndex              : 1
info:    shaderOutputLayer                      : 1
info:    vulkanMemoryModel                      : 1
info:  Vulkan 1.3
info:    robustImageAccess                      : 0
info:    pipelineCreationCacheControl           : 1
info:    shaderDemoteToHelperInvocation         : 1
info:    shaderZeroInitializeWorkgroupMemory    : 0
info:    synchronization2                       : 1
info:    dynamicRendering                       : 1
info:  VK_AMD_shader_fragment_mask
info:    extension supported                    : 0
info:  VK_EXT_attachment_feedback_loop_layout
info:    attachmentFeedbackLoopLayout           : 0
info:  VK_EXT_conservative_rasterization
info:    extension supported                    : 1
info:  VK_EXT_custom_border_color
info:    customBorderColors                     : 1
info:    customBorderColorWithoutFormat         : 1
info:  VK_EXT_depth_clip_enable
info:    depthClipEnable                        : 1
info:  VK_EXT_depth_bias_control
info:    depthBiasControl                       : 0
info:    leastRepresentableValueForceUnormRepresentation : 0
info:    floatRepresentation                    : 0
info:    depthBiasExact                         : 0
info:  VK_EXT_extended_dynamic_state3
info:    extDynamicState3AlphaToCoverageEnable  : 1
info:    extDynamicState3DepthClipEnable        : 1
info:    extDynamicState3RasterizationSamples   : 1
info:    extDynamicState3SampleMask             : 1
info:    extDynamicState3LineRasterizationMode  : 1
info:  VK_EXT_fragment_shader_interlock
info:    fragmentShaderSampleInterlock          : 1
info:    fragmentShaderPixelInterlock           : 1
info:  VK_EXT_full_screen_exclusive
info:    extension supported                    : 1
info:  VK_EXT_graphics_pipeline_library
info:    graphicsPipelineLibrary                : 1
info:  VK_EXT_line_rasterization
info:    rectangularLines                       : 1
info:    smoothLines                            : 1
info:  VK_EXT_memory_budget
info:    extension supported                    : 1
info:  VK_EXT_memory_priority
info:    memoryPriority                         : 1
info:  VK_EXT_non_seamless_cube_map
info:    nonSeamlessCubeMap                     : 0
info:  VK_EXT_robustness2
info:    robustBufferAccess2                    : 1
info:    robustImageAccess2                     : 1
info:    nullDescriptor                         : 1
info:  VK_EXT_shader_module_identifier
info:    shaderModuleIdentifier                 : 1
info:  VK_EXT_shader_stencil_export
info:    extension supported                    : 0
info:  VK_EXT_swapchain_colorspace
info:    extension supported                    : 0
info:  VK_EXT_swapchain_maintenance1
info:    swapchainMaintenance1                  : 0
info:  VK_EXT_hdr_metadata
info:    extension supported                    : 1
info:  VK_EXT_transform_feedback
info:    transformFeedback                      : 1
info:    geometryStreams                        : 1
info:  VK_EXT_vertex_attribute_divisor
info:    vertexAttributeInstanceRateDivisor     : 1
info:    vertexAttributeInstanceRateZeroDivisor : 1
info:  VK_KHR_external_memory_win32
info:    extension supported                    : 1
info:  VK_KHR_external_semaphore_win32
info:    extension supported                    : 1
info:  VK_KHR_maintenance5
info:    maintenance5                           : 0
info:  VK_KHR_present_id
info:    presentId                              : 1
info:  VK_KHR_present_wait
info:    presentWait                            : 1
info:  VK_NVX_binary_import
info:    extension supported                    : 1
info:  VK_NVX_image_view_handle
info:    extension supported                    : 1
info:  VK_KHR_win32_keyed_mutex
info:    extension supported                    : 1
info:  Queue families:
info:    Graphics : 0
info:    Transfer : 1
info:    Sparse   : 0
info:  Memory type mask for sparse resources: 0x2
warn:  DXVK: Updating state cache version to v17
info:  DXVK: Read 181 valid state cache entries
warn:  DXVK: Creating new state cache file
info:  DXVK: Graphics pipeline libraries supported
info:  D3D11InternalCreateDevice: Maximum supported feature level: D3D_FEATURE_LEVEL_12_1
info:  D3D11InternalCreateDevice: Using feature level D3D_FEATURE_LEVEL_11_0
info:  Device properties:
info:    Device : NVIDIA GeForce RTX 3060 Ti
info:    Driver : NVIDIA 537.13.0
info:  Enabled device extensions:
info:    VK_EXT_attachment_feedback_loop_layout
info:    VK_EXT_conservative_rasterization
info:    VK_EXT_custom_border_color
info:    VK_EXT_depth_clip_enable
info:    VK_EXT_extended_dynamic_state3
info:    VK_EXT_fragment_shader_interlock
info:    VK_EXT_full_screen_exclusive
info:    VK_EXT_graphics_pipeline_library
info:    VK_EXT_hdr_metadata
info:    VK_EXT_memory_priority
info:    VK_EXT_non_seamless_cube_map
info:    VK_EXT_robustness2
info:    VK_EXT_shader_module_identifier
info:    VK_EXT_transform_feedback
info:    VK_EXT_vertex_attribute_divisor
info:    VK_KHR_external_memory_win32
info:    VK_KHR_external_semaphore_win32
info:    VK_KHR_pipeline_library
info:    VK_KHR_present_id
info:    VK_KHR_present_wait
info:    VK_KHR_swapchain
info:    VK_KHR_win32_keyed_mutex
info:    VK_NVX_binary_import
info:    VK_NVX_image_view_handle
info:  Device features:
info:    robustBufferAccess                     : 1
info:    fullDrawIndexUint32                    : 1
info:    imageCubeArray                         : 1
info:    independentBlend                       : 1
info:    geometryShader                         : 1
info:    tessellationShader                     : 1
info:    sampleRateShading                      : 1
info:    dualSrcBlend                           : 1
info:    logicOp                                : 1
info:    multiDrawIndirect                      : 1
info:    drawIndirectFirstInstance              : 1
info:    depthClamp                             : 1
info:    depthBiasClamp                         : 1
info:    fillModeNonSolid                       : 1
info:    depthBounds                            : 1
info:    wideLines                              : 1
info:    multiViewport                          : 1
info:    samplerAnisotropy                      : 1
info:    textureCompressionBC                   : 1
info:    occlusionQueryPrecise                  : 1
info:    pipelineStatisticsQuery                : 1
info:    vertexPipelineStoresAndAtomics         : 1
info:    fragmentStoresAndAtomics               : 1
info:    shaderImageGatherExtended              : 1
info:    shaderClipDistance                     : 1
info:    shaderCullDistance                     : 1
info:    shaderFloat64                          : 1
info:    shaderInt64                            : 1
info:    variableMultisampleRate                : 1
info:    shaderResourceResidency                : 1
info:    shaderResourceMinLod                   : 1
info:    sparseBinding                          : 1
info:    sparseResidencyBuffer                  : 1
info:    sparseResidencyImage2D                 : 1
info:    sparseResidencyImage3D                 : 1
info:    sparseResidency2Samples                : 1
info:    sparseResidency4Samples                : 1
info:    sparseResidency8Samples                : 1
info:    sparseResidency16Samples               : 1
info:    sparseResidencyAliased                 : 1
info:  Vulkan 1.1
info:    shaderDrawParameters                   : 1
info:  Vulkan 1.2
info:    samplerMirrorClampToEdge               : 1
info:    drawIndirectCount                      : 1
info:    samplerFilterMinmax                    : 1
info:    hostQueryReset                         : 1
info:    timelineSemaphore                      : 1
info:    bufferDeviceAddress                    : 1
info:    shaderOutputViewportIndex              : 1
info:    shaderOutputLayer                      : 1
info:    vulkanMemoryModel                      : 1
info:  Vulkan 1.3
info:    robustImageAccess                      : 0
info:    pipelineCreationCacheControl           : 1
info:    shaderDemoteToHelperInvocation         : 1
info:    shaderZeroInitializeWorkgroupMemory    : 0
info:    synchronization2                       : 1
info:    dynamicRendering                       : 1
info:  VK_AMD_shader_fragment_mask
info:    extension supported                    : 0
info:  VK_EXT_attachment_feedback_loop_layout
info:    attachmentFeedbackLoopLayout           : 0
info:  VK_EXT_conservative_rasterization
info:    extension supported                    : 1
info:  VK_EXT_custom_border_color
info:    customBorderColors                     : 1
info:    customBorderColorWithoutFormat         : 1
info:  VK_EXT_depth_clip_enable
info:    depthClipEnable                        : 1
info:  VK_EXT_depth_bias_control
info:    depthBiasControl                       : 0
info:    leastRepresentableValueForceUnormRepresentation : 0
info:    floatRepresentation                    : 0
info:    depthBiasExact                         : 0
info:  VK_EXT_extended_dynamic_state3
info:    extDynamicState3AlphaToCoverageEnable  : 1
info:    extDynamicState3DepthClipEnable        : 1
info:    extDynamicState3RasterizationSamples   : 1
info:    extDynamicState3SampleMask             : 1
info:    extDynamicState3LineRasterizationMode  : 1
info:  VK_EXT_fragment_shader_interlock
info:    fragmentShaderSampleInterlock          : 1
info:    fragmentShaderPixelInterlock           : 1
info:  VK_EXT_full_screen_exclusive
info:    extension supported                    : 1
info:  VK_EXT_graphics_pipeline_library
info:    graphicsPipelineLibrary                : 1
info:  VK_EXT_line_rasterization
info:    rectangularLines                       : 1
info:    smoothLines                            : 1
info:  VK_EXT_memory_budget
info:    extension supported                    : 1
info:  VK_EXT_memory_priority
info:    memoryPriority                         : 1
info:  VK_EXT_non_seamless_cube_map
info:    nonSeamlessCubeMap                     : 0
info:  VK_EXT_robustness2
info:    robustBufferAccess2                    : 1
info:    robustImageAccess2                     : 1
info:    nullDescriptor                         : 1
info:  VK_EXT_shader_module_identifier
info:    shaderModuleIdentifier                 : 1
info:  VK_EXT_shader_stencil_export
info:    extension supported                    : 0
info:  VK_EXT_swapchain_colorspace
info:    extension supported                    : 0
info:  VK_EXT_swapchain_maintenance1
info:    swapchainMaintenance1                  : 0
info:  VK_EXT_hdr_metadata
info:    extension supported                    : 1
info:  VK_EXT_transform_feedback
info:    transformFeedback                      : 1
info:    geometryStreams                        : 1
info:  VK_EXT_vertex_attribute_divisor
info:    vertexAttributeInstanceRateDivisor     : 1
info:    vertexAttributeInstanceRateZeroDivisor : 1
info:  VK_KHR_external_memory_win32
info:    extension supported                    : 1
info:  VK_KHR_external_semaphore_win32
info:    extension supported                    : 1
info:  VK_KHR_maintenance5
info:    maintenance5                           : 0
info:  VK_KHR_present_id
info:    presentId                              : 1
info:  VK_KHR_present_wait
info:    presentWait                            : 1
info:  VK_NVX_binary_import
info:    extension supported                    : 1
info:  VK_NVX_image_view_handle
info:    extension supported                    : 1
info:  VK_KHR_win32_keyed_mutex
info:    extension supported                    : 1
info:  Queue families:
info:    Graphics : 0
info:    Transfer : 1
info:    Sparse   : 0
info:  Memory type mask for sparse resources: 0x2
info:  DXVK: Read 181 valid state cache entries
info:  DXVK: Graphics pipeline libraries supported
warn:  D3D11: Failed to write shared resource info for a texture
warn:  D3D11Device::OpenSharedResourceGeneric: Handle not found: 0x80000702
info:  Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Color space:  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
info:    Present mode: VK_PRESENT_MODE_IMMEDIATE_KHR (dynamic: no)
info:    Buffer size:  1920x1080
info:    Image count:  3
info:    Exclusive FS: 1
info:  DXVK: Using 8 compiler threads
info:  Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Color space:  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
info:    Present mode: VK_PRESENT_MODE_FIFO_KHR (dynamic: no)
info:    Buffer size:  1920x1080
info:    Image count:  3
info:    Exclusive FS: 1
info:  Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Color space:  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
Blisto91 commented 1 year ago

The cache warnings are fine. The shared resources ones is a feature that isn't supported on Windows and can cause issues in some games, though also in some not much of note. But you seem to be able to play fine so I assume they arent much notable here.