Skip to content

[Merged by Bors] - bevy_render2: Support nested shader defs#3113

Closed
superdump wants to merge 3 commits intobevyengine:pipelined-renderingfrom
superdump:nested-shader-defs
Closed

[Merged by Bors] - bevy_render2: Support nested shader defs#3113
superdump wants to merge 3 commits intobevyengine:pipelined-renderingfrom
superdump:nested-shader-defs

Conversation

@superdump
Copy link
Contributor

Objective

Fix nested shader defs. For example, in:

#ifdef A
#ifdef B
some code here
#endif
#endif

...before this PR, if A is not defined, and B is defined, then some code here will be output.

Solution

  • Combine the logic of whether the parent and child scope guards are defined and use that as the resulting child scope guard boolean value

Fixes the case where A is false but B is true in:

your code here

...would still produce your code here.
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior labels Nov 12, 2021
@alice-i-cecile alice-i-cecile added this to the Bevy 0.6 milestone Nov 12, 2021
@cart
Copy link
Member

cart commented Nov 16, 2021

bors r+

bors bot pushed a commit that referenced this pull request Nov 16, 2021
# Objective

Fix nested shader defs. For example, in:
```rust
#ifdef A
#ifdef B
some code here
#endif
#endif
```
...before this PR, if `A` *is not* defined, and `B` *is* defined, then `some code here` will be output.

## Solution

- Combine the logic of whether the parent and child scope guards are defined and use that as the resulting child scope guard boolean value
@bors
Copy link
Contributor

bors bot commented Nov 16, 2021

@bors bors bot changed the title bevy_render2: Support nested shader defs [Merged by Bors] - bevy_render2: Support nested shader defs Nov 16, 2021
@bors bors bot closed this Nov 16, 2021
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants