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

glsl-in: Fix panic when culling nested block #1714

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

JCapucho
Copy link
Collaborator

@JCapucho JCapucho commented Feb 3, 2022

Under certatin circumstances the parser would panic because of culling
using an index out of bound, for example take the following code:

{
    x = 1; // Index 0 on nested block
    discard; // Index 1 on nested block
} // Index 0 on block

The parser seeing this would attempt to cull the block using the start
index of 1 which would be out of bound and panic. Now instead the nested
block properly does it's internal culling and the outer block culls
everything after the nested block only.

Under certatin circumstances the parser would panic because of culling
using an index out of bound, for example take the following code:

```glsl
{
    x = 1; // Index 0 on nested block
    discard; // Index 1 on nested block
} // Index 0 on block
```

The parser seeing this would attempt to cull the block using the start
index of 1 which would be out of bound and panic. Now instead the nested
block properly does it's internal culling and the outer block culls
everything after the nested block only.
@kvark kvark merged commit 54c3f51 into gfx-rs:master Feb 4, 2022
@JCapucho JCapucho deleted the glsl-cull branch February 19, 2022 15:10
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.

2 participants