* Reintroduce computepass->encoder lifetime constraint and make it opt-out via `wgpu::ComputePass::make_static`
* improve comments based on review feedback
* use the same lifetime name for all usages of `ComputePass<'encoder>`
* comment improvement that I missed earlier
* more review based comment improvements
* use suggested zero-overhead lifetime removal
* rename make_static to forge_lifetime
* missed comma
* lift encoder->computepass lifetime constraint and add now failing test
* compute passes now take an arc to their parent command encoder, thus removing compile time dependency to it
* Command encoder goes now into locked state while compute pass is open
* changelog entry
* share most of the code between get_encoder and lock_encoder
* Add support for pipeline-overridable constants in WebGPU
* Add utility function for setting constants map
* Panic on failure to set constants map
---------
Co-authored-by: Andreas Reich <r_andreas2@web.de>
* rename `command_encoder_run_*_pass` to `*_pass_end` and make it a method of compute/render pass instead of encoder
* executing a compute pass consumes it now such that it can't be executed again
* use handle_error instead of handle_error_nolabel for wgpu compute pass
* use handle_error instead of handle_error_nolabel for render_pass_end
* changelog addition
* feat: `compute_pass_set_push_constant`: move panics to error variants
Co-Authored-By: Erich Gubler <erichdongubler@gmail.com>
---------
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
* basic test setup
* remove lifetime and drop resources on test - test fails now just as expected
* compute pass recording is now hub dependent (needs gfx_select)
* compute pass recording now bumps reference count of uses resources directly on recording
TODO:
* bind groups don't work because the Binder gets an id only
* wgpu level error handling is missing
* simplify compute pass state flush, compute pass execution no longer needs to lock bind_group storage
* wgpu sided error handling
* make ComputePass hal dependent, removing command cast hack. Introduce DynComputePass on wgpu side
* remove stray repr(C)
* changelog entry
* fix deno issues -> move DynComputePass into wgc
* split out resources setup from test
* Issue SetDrawColorBuffers commands before issuing ClearColor
This is necessary for glClearBuffer calls to work correctly on some machines (e.g. AMD Renoir graphics running on Linux). Without this, glClearBuffer calls are ignored.
* Use clear_buffer_f32_slice instead of gl.clear to suppress WebGL warnings
This fixes the following WebGL warning: "WebGL warning: drawBuffers: `buffers[i]` must be NONE or COLOR_ATTACHMENTi."
When using native OpenGL, it is acceptable to call glDrawBuffers with an array of buffers where i != COLOR_ATTACHMENTi. In WebGL, this is not allowed.
* Run cargo fmt
* Add changes for PR GH-5666 to the CHANGELOG
* Avoid introducing spurious features for optional dependencies
If a feature depends on an optional dependency without using the dep:
prefix, a feature with the same name as the optional dependency is
introduced. This feature almost certainly won't have any effect when
enabled other than increasing compile times and polutes the feature list
shown by cargo add. Consistently use dep: for all optional dependencies
to avoid this problem.
* Add changelog entry
* Clean up weak references to texture views
* add change to CHANGELOG.md
* drop texture view before clean up
* cleanup weak ref to bind groups
* update changelog
* Trim weak backlinks in their holders' triage functions.
---------
Co-authored-by: Jim Blandy <jimb@red-bean.com>
Document that `wgpu_hal::CommandEncoder::discard_encoding` must not be called multiple times.
Assert in `wgpu_hal::vulkan::CommandEncoder::discard_encoding` that encoding is actually in progress.
Fixes#5255.
* Prefer OpenGL over OpenGL ES
* Fix sRGB on egl
* Check if OpenGL is supported
* Add changelog entry
* Remove expected failure for OpenGL Non-ES, add comment explaining FRAMEBUFFER_SRGB, add driver info to AdapterInfo
* Fix draw indexed
* CI host doesn't seem to support Rg8Snorm and Rgb9eUfloat clearing