wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

DX12 backend no longer works after #5956

Open xiaopengli89 opened this issue 1 year ago • 11 comments

Description DX12 backend no longer works after #5956

Extra materials img_v3_02e4_81d7d4ed-580e-4c46-b5f5-f40baafd21ag

xiaopengli89 avatar Aug 26 '24 10:08 xiaopengli89

Works fine here:

image

(Except that the water looks like a glitch when simulating waves at 16ms/frame while running 240Hz)

[2024-08-26T18:53:03Z INFO  wgpu_examples::framework] Initializing wgpu...
[2024-08-26T18:53:03Z INFO  wgpu_core::instance] Adapter AdapterInfo { name: "Intel(R) Graphics XXXX", vendor: 32902, device: 22176, device_type: DiscreteGpu, driver: "XXX", driver_info: "", backend: Dx12 }
[2024-08-26T18:53:03Z INFO  wgpu_examples::framework] Using Intel(R) Graphics XXXX (Dx12)
[2024-08-26T18:53:03Z WARN  wgpu_core::instance] Missing downlevel flags: DownlevelFlags(VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW)
    The underlying API or device in use does not support enough features to be a fully compliant implementation of WebGPU. A subset of the features can still be used. If you are running this program on native and not in a browser and wish to limit the features you use to the supported subset, call Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current platform supports.
[2024-08-26T18:53:03Z WARN  wgpu_core::instance] DownlevelCapabilities {
        flags: DownlevelFlags(
            COMPUTE_SHADERS | FRAGMENT_WRITABLE_STORAGE | INDIRECT_EXECUTION | BASE_VERTEX | READ_ONLY_DEPTH_STENCIL | NON_POWER_OF_TWO_MIPMAPPED_TEXTURES | CUBE_ARRAY_TEXTURES | COMPARISON_SAMPLERS | INDEPENDENT_BLEND | VERTEX_STORAGE | ANISOTROPIC_FILTERING | FRAGMENT_STORAGE | MULTISAMPLED_SHADING | DEPTH_TEXTURE_AND_BUFFER_COPIES | WEBGPU_TEXTURE_FORMAT_SUPPORT | BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED | UNRESTRICTED_INDEX_BUFFER | FULL_DRAW_INDEX_UINT32 | DEPTH_BIAS_CLAMP | VIEW_FORMATS | UNRESTRICTED_EXTERNAL_TEXTURE_COPIES | SURFACE_VIEW_FORMATS | NONBLOCKING_QUERY_RESOLVE,
        ),
        limits: DownlevelLimits,
        shader_model: Sm5,
    }
[2024-08-26T18:53:03Z INFO  wgpu_examples::framework] Entering event loop...
[2024-08-26T18:53:03Z INFO  wgpu_examples::framework] Surface resume PhysicalSize { width: 800, height: 600 }
[2024-08-26T18:53:03Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 3824, height: 984 }
[2024-08-26T18:53:03Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 800, height: 600 }
[2024-08-26T18:53:03Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 800, height: 600 }
[2024-08-26T18:53:04Z INFO  wgpu_examples::framework] Frame time 3.51ms (284.9 FPS)
[2024-08-26T18:53:05Z INFO  wgpu_examples::framework] Frame time 2.52ms (397.3 FPS)
[2024-08-26T18:53:06Z INFO  wgpu_examples::framework] Frame time 3.43ms (291.9 FPS)
[2024-08-26T18:53:07Z INFO  wgpu_examples::framework] Frame time 2.08ms (480.0 FPS)

MarijnS95 avatar Aug 26 '24 18:08 MarijnS95

Note that there were a lot of unclean broken hacks introduced by https://github.com/gfx-rs/wgpu/pull/3668 for Intel Iris: I may have removed some.

EDIT: Just in case I forced suballocation_supported: false on my machine to take the fallback committed texture/buffer path, and everything still works fine :)

MarijnS95 avatar Aug 26 '24 18:08 MarijnS95

Works on my desktop (though for some reason capped to 240 while my display is 120fps) image

[2024-08-26T19:24:48Z INFO  wgpu_examples::framework] Initializing wgpu...
[2024-08-26T19:24:48Z INFO  wgpu_core::instance] Adapter AdapterInfo { name: "NVIDIA GeForce RTX 3050", vendor: 4318, device: 9479, device_type: DiscreteGpu, driver: "31.0.15.5132", driver_info: "", backend: Dx12 }
[2024-08-26T19:24:48Z INFO  wgpu_core::instance] Adapter AdapterInfo { name: "Intel(R) UHD Graphics 770", vendor: 32902, device: 18048, device_type: IntegratedGpu, driver: "31.0.101.4577", driver_info: "", backend: Dx12 }
[2024-08-26T19:24:48Z INFO  wgpu_examples::framework] Using Intel(R) UHD Graphics 770 (Dx12)
[2024-08-26T19:24:48Z WARN  wgpu_core::instance] Missing downlevel flags: DownlevelFlags(VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW)
    The underlying API or device in use does not support enough features to be a fully compliant implementation of WebGPU. A subset of the features can still be used. If you are running this program on native and not in a browser and wish to limit the features you use to the supported subset, call Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current platform supports.
[2024-08-26T19:24:48Z WARN  wgpu_core::instance] DownlevelCapabilities {
        flags: DownlevelFlags(
            COMPUTE_SHADERS | FRAGMENT_WRITABLE_STORAGE | INDIRECT_EXECUTION | BASE_VERTEX | READ_ONLY_DEPTH_STENCIL | NON_POWER_OF_TWO_MIPMAPPED_TEXTURES | CUBE_ARRAY_TEXTURES | COMPARISON_SAMPLERS | INDEPENDENT_BLEND | VERTEX_STORAGE | ANISOTROPIC_FILTERING 
| FRAGMENT_STORAGE | MULTISAMPLED_SHADING | DEPTH_TEXTURE_AND_BUFFER_COPIES | WEBGPU_TEXTURE_FORMAT_SUPPORT | BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED | UNRESTRICTED_INDEX_BUFFER | FULL_DRAW_INDEX_UINT32 | DEPTH_BIAS_CLAMP | VIEW_FORMATS | UNRESTRICTED_EXTERNAL_TEXTURE_COPIES | SURFACE_VIEW_FORMATS | NONBLOCKING_QUERY_RESOLVE,
        ),
        limits: DownlevelLimits,
        shader_model: Sm5,
    }
[2024-08-26T19:24:48Z INFO  wgpu_examples::framework] Entering event loop...
[2024-08-26T19:24:48Z INFO  wgpu_examples::framework] Surface resume PhysicalSize { width: 800, height: 600 }
[2024-08-26T19:24:48Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 1424, height: 714 }
[2024-08-26T19:24:48Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 800, height: 600 }
[2024-08-26T19:24:48Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 800, height: 600 }
[2024-08-26T19:24:49Z INFO  wgpu_examples::framework] Frame time 6.38ms (156.8 FPS)

but not my laptop ( and still frame capped at 2x fps) image

[2024-08-26T19:29:53Z INFO  wgpu_examples::framework] Initializing wgpu...
[2024-08-26T19:29:53Z INFO  wgpu_core::instance] Adapter AdapterInfo { name: "Intel(R) UHD Graphics", vendor: 32902, device: 39745, device_type: IntegratedGpu, driver: "27.20.100.9664", driver_info: "", backend: Dx12 }
[2024-08-26T19:29:53Z INFO  wgpu_examples::framework] Using Intel(R) UHD Graphics (Dx12)
[2024-08-26T19:29:53Z WARN  wgpu_core::instance] Missing downlevel flags: DownlevelFlags(VERTEX_AND_INSTANCE_INDEX_RESPECTS_RESPECTIVE_FIRST_VALUE_IN_INDIRECT_DRAW)
    The underlying API or device in use does not support enough features to be a fully compliant implementation of WebGPU. A subset of the features can still be used. If you are running this program on native and not in a browser and wish to limit the features you use to the supported subset, call Adapter::downlevel_properties or Device::downlevel_properties to get a listing of the features the current platform supports.
[2024-08-26T19:29:53Z WARN  wgpu_core::instance] DownlevelCapabilities {
        flags: DownlevelFlags(
            COMPUTE_SHADERS | FRAGMENT_WRITABLE_STORAGE | INDIRECT_EXECUTION | BASE_VERTEX | READ_ONLY_DEPTH_STENCIL | NON_POWER_OF_TWO_MIPMAPPED_TEXTURES | CUBE_ARRAY_TEXTURES | COMPARISON_SAMPLERS | INDEPENDENT_BLEND | VERTEX_STORAGE | ANISOTROPIC_FILTERING
| FRAGMENT_STORAGE | MULTISAMPLED_SHADING | DEPTH_TEXTURE_AND_BUFFER_COPIES | WEBGPU_TEXTURE_FORMAT_SUPPORT | BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED | UNRESTRICTED_INDEX_BUFFER | FULL_DRAW_INDEX_UINT32 | DEPTH_BIAS_CLAMP | VIEW_FORMATS | UNRESTRICTED_EXTERNAL_TEXTURE_COPIES | SURFACE_VIEW_FORMATS | NONBLOCKING_QUERY_RESOLVE,
        ),
        limits: DownlevelLimits,
        shader_model: Sm5,
    }
[2024-08-26T19:29:54Z INFO  wgpu_examples::framework] Entering event loop...
[2024-08-26T19:29:54Z INFO  wgpu_examples::framework] Surface resume PhysicalSize { width: 800, height: 600 }
[2024-08-26T19:29:54Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 1424, height: 714 }
[2024-08-26T19:29:54Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 800, height: 600 }
[2024-08-26T19:29:54Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 800, height: 600 }
[2024-08-26T19:29:55Z INFO  wgpu_examples::framework] Frame time 19.61ms (51.0 FPS)
[2024-08-26T19:29:56Z INFO  wgpu_examples::framework] Frame time 8.35ms (119.8 FPS)

Vecvec avatar Aug 26 '24 19:08 Vecvec

@MarijnS95 It works fine with driver 31.0.101.2128, but not with driver 27.x.x.x.

xiaopengli89 avatar Aug 27 '24 06:08 xiaopengli89

that sound right, my laptop is in 27.x.x.x with my desktop in 31.0.101.4577

Vecvec avatar Aug 27 '24 19:08 Vecvec

Can any of you test out https://github.com/MarijnS95/wgpu/compare/semantic-change on a laptop with Intel 27.x.x.x?

MarijnS95 avatar Aug 27 '24 20:08 MarijnS95

Sorry I've force-pushed a few times, please make sure you are on 759f82b32.

MarijnS95 avatar Aug 27 '24 20:08 MarijnS95

It works for me, both water and shadow - which were the ones that I previously tested - work (but there are two unused import warnings)

Vecvec avatar Aug 27 '24 23:08 Vecvec

@Vecvec so that means this fixes the issue? Can you also test #6173, which contains mostly the same change except for ClearDepthStencilView() which requires an upstream binding fix.

MarijnS95 avatar Aug 28 '24 07:08 MarijnS95

@MarijnS95 https://github.com/gfx-rs/wgpu/commit/759f82b322a5dab21b478642a4ce3e3c9eda69dc works fine for me, but not #6173

xiaopengli89 avatar Aug 28 '24 08:08 xiaopengli89

@xiaopengli89 thanks for confirming, so I'll have to push the ClearDepthStencilView() workaround (or pass a full rect) until the API fix from https://github.com/microsoft/win32metadata/pull/1971 lands in a subsequent breaking windows-rs release.

MarijnS95 avatar Aug 28 '24 10:08 MarijnS95