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

Do not declare MRT shader ouputs over the specified number #5395

Merged
merged 1 commit into from Jun 15, 2023

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Jun 15, 2023

Fixes #5393

We used to declare 8 MRT outputs for all fragment shaders, assuming the compiler would ignore unused ones. Turns out this fails on some android devices that only support 4 attachments.

This PR addresses it by only declaring supported outputs, by stripping unsupported outputs using ifdefs. On a device with only 4 attachments, the generated code (after the pre-processor steps) looks like this, with only 4 instead of 8 outputs:

Screenshot 2023-06-15 at 11 15 24

@mvaligursky mvaligursky self-assigned this Jun 15, 2023
@mvaligursky mvaligursky added bug area: graphics Graphics related issue labels Jun 15, 2023
@mvaligursky mvaligursky merged commit e343957 into main Jun 15, 2023
7 checks passed
@mvaligursky mvaligursky deleted the mv-mrt-limits branch June 15, 2023 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shader compilation fails on some devices with MRT attachments less than 8
2 participants