Skip to content

fix issue with negation of (bool->int) result - #22

Closed
fitzymj wants to merge 1 commit into
Unity-Technologies:masterfrom
harmonix:logic_grouping_fix
Closed

fitzymj wants to merge 1 commit into
Unity-Technologies:masterfrom
harmonix:logic_grouping_fix

Conversation

@fitzymj

@fitzymj fitzymj commented Apr 21, 2017

Copy link
Copy Markdown

An OPCODE_NOT followed by a SVT_BOOL->SVT_INT conversion can result in the following when the needsBoolUpscale block is hit:

bool myBool = false;
int result = ~(myBool) * int(0xffffffffu);

This PR emits the correct GLSL, wrapping the upscale operation in parentheses:

int result = ~((myBool) * int(0xffffffffu));

It applies the same fix to generated Metal Shading Language.

@aet

aet commented Dec 27, 2018

Copy link
Copy Markdown
Contributor

Thanks! I've applied the change manually into the latest batch of changes from upstream, due to indentation changes etc

@aet aet closed this Dec 27, 2018
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