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

example mesh2d_manual crash #4036

Closed
omarbassam88 opened this issue Feb 25, 2022 · 7 comments
Closed

example mesh2d_manual crash #4036

omarbassam88 opened this issue Feb 25, 2022 · 7 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this! S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Milestone

Comments

@omarbassam88
Copy link

Bevy version

0.6.0

Operating system & version

Arch Linux with NVIDIA Geforce GTX 1060 6GB

What you did

I ran the command:

cargo run --example mesh2d_manual

What you expected to happen

A window should open with a 2D shape in it.

What actually happened

and immediately crashed with the following error

thread 'TaskPool (11)' panicked at 'range end index 192 out of range for slice o
f length 176', crates/bevy_render/src/mesh/mesh/mod.rs:239:17

Additional information

@omarbassam88 omarbassam88 added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 25, 2022
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled C-Examples An addition or correction to our examples labels Feb 25, 2022
@alice-i-cecile
Copy link
Member

Okay, that's working for me locally. So, some sort of driver or backend bug :/

When I run this example, I get the following line.

INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce GTX 970", vendor: 4318, device: 5058, device_type: DiscreteGpu, backend: Vulkan }

What's your version of that?

@mockersf
Copy link
Member

are you sure you're on 0.6.0 and not on latest git version?

I can reproduce with main, it seems it's a regression introduced by e369a8a (#3959)

@alice-i-cecile alice-i-cecile added the P-Regression Functionality that used to work but no longer does. Add a test for this! label Feb 25, 2022
@alice-i-cecile alice-i-cecile added this to the Bevy 0.7 milestone Feb 25, 2022
@omarbassam88
Copy link
Author

omarbassam88 commented Feb 25, 2022

Okay, that's working for me locally. So, some sort of driver or backend bug :/

When I run this example, I get the following line.

INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce GTX 970", vendor: 4318, device: 5058, device_type: DiscreteGpu, backend: Vulkan }

What's your version of that?

This is the version of the same line for me.

2022-02-25T16:35:51.237754Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce GTX 1060 6GB", vendor: 4318, device: 7171, device_type: DiscreteGpu, backend: Vulkan }

@omarbassam88
Copy link
Author

are you sure you're on 0.6.0 and not on latest git version?

I can reproduce with main, it seems it's a regression introduced by e369a8a (#3959)

Yes, I guess you are right I am on main branch and I just checked the commit you mentioned regarding the change of handling of vertex attribute.
The example custom_vertex_attribute works fine for me. So I guess it's the mesh2d_manual example that needs to be updated maybe? if that's the case i can try to work on it if needed.

@mockersf
Copy link
Member

there is a fix in #4037 you could try 🙂

@omarbassam88
Copy link
Author

there is a fix in #4037 you could try slightly_smiling_face

I did check check this pull request and I can confirm that it does fix the problem.

@ghost
Copy link

ghost commented Feb 26, 2022

I just encountered a problem while creating a mesh and tried the mesh2d_manual to see what I was missing and it also didn't work for me on main. I can also confirm that the fix in #4037 works.

@bors bors bot closed this as completed in 1a85fb5 Mar 8, 2022
aevyrie pushed a commit to aevyrie/bevy that referenced this issue Jun 7, 2022
# Objective

Fixes bevyengine#4036 

## Solution

- Use `VertexBufferLayout::from_vertex_formats`
- Actually put a u32 into `ATTRIBUTE_COLOR` and convert it in the shader

I'm not 100% sure about the color stuff. It seems like `ATTRIBUTE_COLOR` has been `Uint32` this whole time, but this example previously worked with `[f32; 4]` somehow, perhaps because the vertex layout was manually specified.

Let me know if that can be improved, or feel free to close for an alternative fix.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

Fixes bevyengine#4036 

## Solution

- Use `VertexBufferLayout::from_vertex_formats`
- Actually put a u32 into `ATTRIBUTE_COLOR` and convert it in the shader

I'm not 100% sure about the color stuff. It seems like `ATTRIBUTE_COLOR` has been `Uint32` this whole time, but this example previously worked with `[f32; 4]` somehow, perhaps because the vertex layout was manually specified.

Let me know if that can be improved, or feel free to close for an alternative fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this! S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants