Repository navigation
Limit max_binding_array_elements_per_shader_stage gets reset to 0, but why? #10510
Replies: 8 comments
|
Huh. The binding array limits can get zeroed out if |
|
It still has me puzzled, too. There are several things that force that limit to 0. Here's where that value gets set in WGPU: wgpu/wgpu-hal/src/vulkan/adapter.rs Line 1823 in dd033bf which gets its value from where the value is the min of rather a lot of values which seem to come from vk::PhysicalDeviceDescriptorIndexingPropertiesEXT. All this worked in WGPU 24 on the same hardware. |
|
I was hoping that this was some simple mistake I made. That would be easy to fix. Now this is starting to look like a WGPU bug that appears for some combinations of feature requests/backend/Vulkan driver/graphics card. What do you think? If necessary, I can make up a branch of my test program so others can try it on other hardware. Should I do that? |
|
This still has me puzzled. The value for max_binding_array_elements_per_shader_stage is computed by WGPU as the minimum of these Vulkan values, which I got from "vulkaninfo" under Linux: Those are only read if the Vulkan version is >= 1.2. It's 1.3. So that should work. Haven't yet figured out what's setting max_binding_array_elements_per_shader_stage to zero. I don't see anything the caller to WGPU does which can affect this. It's finding the right graphics device. |
|
So I dumped the Limits obtained from the adapter: So that's what WGPU is saying that Vulkan reported. Mesh shaders and ray tracing features were not requested, which explains all those zero entries at the end. That's fine. Trouble comes from which are values WGPU calculates, as mentioned above. Those should not be 0. It's as if binding arrays were turned off, for which WGPU zeroes out those values. But features We've seen from the vulkaninfo data above that Vulkan has reasonable numbers for the Vk fields used to compute those WGPU values. This looks more and more like a WGPU bug. Will look at adapter.rs some more. |
|
More dumping. Built WGPU 30.0.1 from Github source so I could add println output in adapter.rs: Added at line 1533: So everything is on track at that point. This is before adjust_raw_limits is called.
|
|
Onward: Captured Limits at create bind group. Now they're broken:
Note
Somewhere between device setup and the first bind, something zeroed that out. But where is that happening? |
|
New info: the Adapter and the Device both have Limits, and they may not be the same. More later. |
Uh oh!
There was an error while loading. Please reload this page.
I'm still struggling with WGPU 24 -> WGPU 30 conversion of Rend3.
Many tests fail with:
I've tried setting, in Limits,
The device allocates and opens, but fails at bind group creation. In the error message, that limit is shown as 0.
Here's the allocated device and the features WGPU let me get:
Device acquired: Device { inner: Core(CoreDevice { context: ContextWgpuCore { type: "Native" }, id: DeviceId(0,1), error_sink: Mutex { data: ErrorSink }, features: Features { features_wgpu: FeaturesWGPU(TEXTURE_BINDING_ARRAY | BUFFER_BINDING_ARRAY | STORAGE_RESOURCE_BINDING_ARRAY | SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING | PARTIALLY_BOUND_BINDING_ARRAY | MULTI_DRAW_INDIRECT_COUNT), features_webgpu: FeaturesWebGPU(DEPTH_CLIP_CONTROL | TEXTURE_COMPRESSION_BC | IMMEDIATES) } }) }
Adapter info: AdapterInfo { name: "NVIDIA GeForce RTX 3070", vendor: 4318, device: 9348, device_type: DiscreteGpu, device_pci_bus_id: "0000:09:00.0", driver: "NVIDIA", driver_info: "535.309.01", backend: Vulkan, subgroup_min_size: 32, subgroup_max_size: 32, transient_saves_memory: Some(false), limit_bucket: None }
Do I have to enable more features? But which one?
What seems to be going on is that, at WGPU 30, you only get the features you explicitly ask for when opening the adapter. Previously, in WGPU 24, you could ask for no features, and the adapter gave you everything it offered, which you could then check. There may be some additional feature I need to turn on for this to work. I tried requesting some more features:
but it didn't help.
What am I missing here?
All reactions