Skip to content
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

multi_draw_indirect_counter #594

Closed
wants to merge 55 commits into from
Closed

multi_draw_indirect_counter #594

wants to merge 55 commits into from

Conversation

fyellin
Copy link
Contributor

@fyellin fyellin commented Sep 20, 2024

Implementation of the final two functions.
Fix some typos I had previous made.

@fyellin
Copy link
Contributor Author

fyellin commented Sep 20, 2024

This code is working now, but it wasn't working an hour ago, and I didn't really do anything to fix it. I want to make sure I understand what's going on before this is merged. But it's rather straightforward code.

@fyellin
Copy link
Contributor Author

fyellin commented Sep 20, 2024

The naga bug is back.

@fyellin
Copy link
Contributor Author

fyellin commented Oct 1, 2024

This code is waiting for a new wgpu-native-lib to include:

gfx-rs/wgpu-native#432
gfx-rs/wgpu#6194

We pull directly from wpgu-native, so their next update should include the change. I'm not sure how wgpu-native decides which version of wgpu to use.

@almarklein
Copy link
Member

I'm not sure how wgpu-native decides which version of wgpu to use.

Here's an example: gfx-rs/wgpu-native#402 Basically bumping versions in cargo.toml and then making the necessary changes. It usually updates for each release of wgpu-core.

@fyellin
Copy link
Contributor Author

fyellin commented Oct 1, 2024

@almarklein.

I ask because it seems that tag 22.1.0.5 was created on gfx-rs/wgpu-native on Sept 12.

Meanwhile I don't see any tags on gfx-rs/wgpu, and the fix was merged into "trunk" on Sept 2. But it doesn't seem to have made it into the build of lib-native.

@almarklein
Copy link
Member

That's correct. The latest tag from wgpu-core is 22.1.0. The versioning of wgpu-native is to take the version of wgpu-core and add a fourth number to it. We've had a few releases (22.1.0.x) for bugfixes and changes to how the binary archives are composed.

@fyellin
Copy link
Contributor Author

fyellin commented Oct 10, 2024

I've confirmed that this code works with a patched wgpu. I've tried it out both on emulated GPUs and on real GPUs.

I just need to wait for us to catch up.

fyellin and others added 28 commits December 28, 2024 21:55
…ime sleeping. (pygfx#655)

* Bring sleep back to WgpuAwaitable.  Slowly back off on the amount of time sleeping.

* Need anyio

* Need anyio

* Need anyio

* Remove no-longer-needed-comment
…ygfx#657)

* Stop setting AA_EnableHighDpiScaling since Qt Says it is not needed

See https://doc.qt.io/qt-6/highdpi.html

* update comment

* fix variable name

* Update wgpu/gui/qt.py
* Actually run the tests instead of fully skipping them

Its easy to "fix tests" by completely skipping them ^_^_^_^_^

* Add the gui_auto.png

* TODO: actually fix --- brutally force the cube example to run so i can regenereate the images

* Attempt at better testing???
* Improve error reporting with screenshots and provide a method
to test locally

* improve readme.

* Break everything because i don't understand async

* run ruff format...

* spelling

* minimize changes
* use default lavapipe for screenshot

* ruff format

* bump pypy to 3.10

* run codegen
Maybe the cause of pygfx/pygfx#938

I'm still getting:
```
Traceback (most recent call last):
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/wgpu/gui/_gui_utils.py", line 76, in log_exception
    yield
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/wgpu/gui/base.py", line 167, in _draw_frame_and_present
    self.draw_frame()
  File "/home/mark/git/python-owl/owl/gui/_scene_control_gfx.py", line 2464, in animate
    self._renderer.render(
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/pygfx/renderers/wgpu/engine/renderer.py", line 536, in render
    container_group = get_pipeline_container_group(wobject, environment)
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/pygfx/renderers/wgpu/engine/pipeline.py", line 181, in get_pipeline_container_group
    pipeline_container_group.update(wobject, environment, changed_labels)
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/pygfx/renderers/wgpu/engine/pipeline.py", line 261, in update
    container.update(wobject, environment, env_hash, changed)
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/pygfx/renderers/wgpu/engine/pipeline.py", line 336, in update
    raise err
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/pygfx/renderers/wgpu/engine/pipeline.py", line 333, in update
    self.update_shader_data(wobject, changed)
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/pygfx/renderers/wgpu/engine/pipeline.py", line 369, in update_shader_data
    self.update_bind_groups()
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/pygfx/renderers/wgpu/engine/pipeline.py", line 464, in update_bind_groups
    binding_des, binding_layout_des = binding.get_bind_group_descriptors(
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/pygfx/renderers/wgpu/engine/binding.py", line 134, in get_bind_group_descriptors
    "resource": ensure_wgpu_object(resource),
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/pygfx/renderers/wgpu/engine/update.py", line 173, in ensure_wgpu_object
    resource._wgpu_object = wgpu_texture.create_view()
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/wgpu/backends/wgpu_native/_api.py", line 2343, in create_view
    id = libf.wgpuTextureCreateView(self._internal, struct)
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/wgpu/backends/wgpu_native/_helpers.py", line 384, in proxy_func
    error_type_msg = error_handler.release(name)
  File "/home/mark/miniforge3/envs/dev/lib/python3.10/site-packages/wgpu/backends/wgpu_native/_helpers.py", line 321, in release
    n = self._proxy_stack.pop()
IndexError: pop from an empty deque
```

Co-authored-by: Almar Klein <[email protected]>
* Improve docs regarding drives on Linux

* tweak more

* Add note on wsl

* not everyone uses pip
For the conda-forge packages I package wgpu-native myself and install
them in the "system" libraries.

This should continue to allow you to use the "wheel" vendored headers
but then also look for the headers in the "system" locations.

I've been dragging on a simpler (less upstreamable) version of this
patch for about a year but I'm hoping I don't have to with this
addition.
* Allow disabling downloading lib when creating wheel

* Update tools/hatch_build.py

Co-authored-by: Mark Harfouche <[email protected]>

* lazy-import

* tweak

---------

Co-authored-by: Mark Harfouche <[email protected]>
* stats auto render

* auto render property
* add simple matmul example

* flake8, put shader src in same file
* pass constants to compute helper

* flake8 remove whitespace
* Improve performance for 'bitmap' render method

* add comment

* codegen

* Only store buffer, and share between textures

* fix memtest

* codegen

* leftover print call
* Release notes

* --amend

* more correct

* adapt to new ruff
* update headers

* try to fix hparser

* handle escaped newlines

* run codegen

* fix escaped newlines in lib

* add string view in logger

* simplify limits

* fix more callbacks

* update surface descriptors

* update shader module

* update render pipeline

* fix surface status

* update copy info

* fix parsing of MAX values

* update buffer map

* avoid magic values

* update generate_report

* fix limits again

* fix labels

* update error messages

* make async unimplemented

* fix string view null value

* enable bundle test

* avoid pointer references

* request native limits

* update mem tests

* cleanup hparser

* handle nested structs

* update codegen test

* apidiff compilation hint

* lint

* ruff format

* bump wgpu-native build

* set callback modes

* small tweaks

* tweak codegen of flags so they're not reported missing

* Make limit logic a bit more consistent

* tweak new to_c_string_view

* tweak to_c_string_view and add from_c_string_view

* Check result of function that return WGPUStatus

* Need the null-string

* map-read workaround still needed. Update test/comments a bit

* comment on textureview.usage

* codegen

* the new test failed intermittendly

* Use to_c_string_view for labels too

* avoid hardcoded enum value

---------

Co-authored-by: Almar Klein <[email protected]>
* new idl

* tweaks to codegen

* Codegen and adjustements

* remove apidiff for create_shader_module

* small tweaks

* lint
@fyellin fyellin closed this Mar 18, 2025
@fyellin fyellin deleted the mdi_count branch March 18, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants