-
Notifications
You must be signed in to change notification settings - Fork 946
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
crash from naga::spv::back with wgsl compute shader #4569
Comments
this fixes it, though maybe not in the most elegant way diff --git a/src/span.rs b/src/span.rs
index 0bc97ff4..06219ca9 100644
--- a/src/span.rs
+++ b/src/span.rs
@@ -70,6 +70,15 @@ impl Span {
/// Return a [`SourceLocation`] for this span in the provided source.
pub fn location(&self, source: &str) -> SourceLocation {
+ if source.is_empty() {
+ return SourceLocation {
+ line_number: 0,
+ line_position: 0,
+ offset: 0,
+ length: 0,
+ }
+ }
+
let prefix = &source[..self.start as usize];
let line_number = prefix.matches('\n').count() as u32 + 1;
let line_start = prefix.rfind('\n').map(|pos| pos + 1).unwrap_or(0); |
This is caused by the changes in #4028 and how they interact with users passing the wgpu/wgpu-core/src/device/resource.rs Line 1245 in e78e9dd
A simple solution would be to check if |
Could any of the simple/dirty solutions above be done please? 🥺 It seems like this single issue blocks a lot of things from switching to wgpu 0.18. |
Done, see #4642. |
Thanks. Any chance we could get a new release? (Either back-porting #4642 as a patch or a breaking release.) |
This is up in wgpu-core 0.18.1 |
# Objective Keep up to date with wgpu. ## Solution Update the wgpu version. Currently blocked on naga_oil updating to naga 0.14 and releasing a new version. 3d scenes (or maybe any scene with lighting?) currently don't render anything due to ``` error: naga_oil bug, please file a report: composer failed to build a valid header: Type [2] '' is invalid = Capability Capabilities(CUBE_ARRAY_TEXTURES) is required ``` I'm not sure what should be passed in for `wgpu::InstanceFlags`, or if we want to make the gles3minorversion configurable (might be useful for debugging?) Currently blocked on bevyengine/naga_oil#63, and gfx-rs/wgpu#4569 to be fixed upstream in wgpu first. ## Known issues Amd+windows+vulkan has issues with texture_binding_arrays (see the image [here](#10266 (comment))), but that'll be fixed in the next wgpu/naga version, and you can just use dx12 as a workaround for now (Amd+linux mesa+vulkan texture_binding_arrays are fixed though). --- ## Changelog Updated wgpu to 0.18, naga to 0.14.2, and naga_oil to 0.11. - Windows desktop GL should now be less painful as it no longer requires Angle. - You can now toggle shader validation and debug information for debug and release builds using `WgpuSettings.instance_flags` and [InstanceFlags](https://docs.rs/wgpu/0.18.0/wgpu/struct.InstanceFlags.html) ## Migration Guide - `RenderPassDescriptor` `color_attachments` (as well as `RenderPassColorAttachment`, and `RenderPassDepthStencilAttachment`) now use `StoreOp::Store` or `StoreOp::Discard` instead of a `boolean` to declare whether or not they should be stored. - `RenderPassDescriptor` now have `timestamp_writes` and `occlusion_query_set` fields. These can safely be set to `None`. - `ComputePassDescriptor` now have a `timestamp_writes` field. This can be set to `None` for now. - See the [wgpu changelog](https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#v0180-2023-10-25) for additional details
Description
thread 'main' panicked at ...\naga-0.14.0\src\span.rs:73:29:
byte index 224 is out of bounds of ``
full backtrace:
Repro steps
main.rs
cargo.toml
Expected vs observed behavior
expected result: no crash, observed: crash
Platform
win/rtx3070/vulkan
The text was updated successfully, but these errors were encountered: