-
-
Notifications
You must be signed in to change notification settings - Fork 46
[WIP] update to wgpu-native v25.0.2.1 #718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Can you share some references? |
I managed to do use the instance extras to specify Dxc with a hard coded path for the .dll which resulted I. Shader model 6.5. the default is fxc which does like shader model 5.1 or 5.2. But I haven't been successful in doing the instance flag for debug, is is meant to set the compiler to output debug symbols for the shader module... Not quite sure where it's failing. It needs to reach here https://github.com/gfx-rs/wgpu/blob/f35cf942af1a3bb6f48aa9185f4d2bcee809f814/wgpu-hal/src/dx12/shader_compilation.rs#L297 via what's explained here gfx-rs/wgpu-native#327 But I am not sure if there is like an order to it. I will maybe paste or push the C and python version to do this, it's really janky right now. As Dxc isn't packaged you have to point to two files manually, in the Future only one of them. Maybe we can consider setting these with |
while CI is green but directx is crashing on tests that request native limits for push constants.... I will try to gather my memory from last update there this already caused some trouble. Could be one of those pointer dereferences again - but wouldn't make much sense as Vulkan and OpenGL work... I put the C code that changed directx compiler for me here: https://github.com/Vipitis/wgpu-native/tree/instance-extras |
current suspicion. D3D12 is running into another issue (gfx-rs/wgpu#5285) and therefore is using the Default DownlevelLimits, which set I also saw that Vulkan complained about these tests with the InstanceFlag for validation (proving they seem to work at least). Running test_normal_push_constants ...
Forcing backend: Vulkan (6)
VALIDATION [VUID-VkGraphicsPipelineCreateInfo-layout-10069 (0xadf5e51f)]
vkCreateGraphicsPipelines(): pCreateInfos[0].pStages[0] SPIR-V (VK_SHADER_STAGE_VERTEX_BIT) has a push constant buffer Block with range [0, 80] which outside the VkPushConstantRange of [0, 40].
The Vulkan spec states: If a push constant block is declared in a shader, the block must be contained inside the push constant range in layout that matches the stage (https://vulkan.lunarg.com/doc/view/1.4.313.0/windows/antora/spec/latestchapters/pipelines.html#VUID-VkGraphicsPipelineCreateInfo-layout-10069)
objects: (type: SHADER_MODULE, hndl: 0xb000000000b, name: ?), (type: PIPELINE_LAYOUT, hndl: 0xa000000000a, name: ?)
VALIDATION [VUID-VkGraphicsPipelineCreateInfo-layout-10069 (0xadf5e51f)]
vkCreateGraphicsPipelines(): pCreateInfos[0].pStages[1] SPIR-V (VK_SHADER_STAGE_FRAGMENT_BIT) has a push constant buffer Block with range [0, 80] which outside the VkPushConstantRange of [40, 80].
The Vulkan spec states: If a push constant block is declared in a shader, the block must be contained inside the push constant range in layout that matches the stage (https://vulkan.lunarg.com/doc/view/1.4.313.0/windows/antora/spec/latestchapters/pipelines.html#VUID-VkGraphicsPipelineCreateInfo-layout-10069)
objects: (type: SHADER_MODULE, hndl: 0xc000000000c, name: ?), (type: PIPELINE_LAYOUT, hndl: 0xa000000000a, name: ?) |
An idea for the API design. Add a function to Now subsequent calls to Will try to implement that tomorrow night, let me know if there is other suggestions. |
as far as I can tell the instance extras work, like you can request debug mode from fxc and vulkan for sure (shows up in renderdoc). While dxc works for compile, it seems to not work for debug flags, but that also happens in C, so I filed it as an issue there: gfx-rs/wgpu-native#487 still stuck on the dx12 crash with Forcing backend: D3D12 (4)
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.
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,
} And it's theoretically possible to detect this and then raise an exception to avoid a crash... so I will have a look at the logger based error handling over the weekend. |
as usual, trying to get this done. Barely anything new - but changes to Dx12 which might need some fixes.
also thinking about how to make InstanceExtras available to the user.
useful links:
Preparations
Upstream
webgpu.h
. (it hasn't changed since v24)Update to latest wgpu-native
The lines below can be copied in the PR's top post.
python tools/download_wgpu_native.py --version xx
to download the latest webgpu.h and DLL.python codegen
to apply the automatic patches to the code.hparser.py
to adjust to new formatting.wgpu_native/_api.py
to get an idea of what structs and functions have changed._api.py
:* Apply any necessary changes.
* Remove the FIXME comment if no further action is needed, or turn into a TODO for later.
python codegen
again to validate that all is well. Repeat the steps above if necessary.Wrapping up