Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

bad code generation causing incorrect encoding in when compiling with clang optimization. #29

Open
hypnosnhendricks opened this issue Aug 11, 2021 · 2 comments

Comments

@hypnosnhendricks
Copy link

We use ISPCTextureCompressor on a linux backend. Recently we ran into issues with clang's optimization code generation. With optimizations turned on, the generated code would cause artifacts in the resulting ASTC images as seen below:

image

This is an eyeball texture & the pink pixels showcase the isssue.
We are not sure exactly what is causing this error, only that without optimizations turned on, everything comes out ok.
We ended up adding #pragma clang optimize off to ispc_texcomp_astc.cpp to work around the issue and allow the rest of the code to work with optimizations turned on.

Recently, we ran into a new issue where Clangs new-pass-manager compile flag is causing the same behavior, even with our pragma to turn optimization off for this code.

@DaveBookout-Intel
Copy link
Contributor

could you tell me a little more about your configuration (CPU, OS version, clang version) and attach an uncompressed image to test?

thanks

@hypnosnhendricks
Copy link
Author

hypnosnhendricks commented Aug 13, 2021

CPU: Variety, similar to Amazon's EC2s
OS: CentOS Stream, version 8
Clang: clang version 9.0.20190721
editor_img15

I'll be trying to get a small, reproducible test case as sample program and see if I can figure out exactly what it going wrong.
We have multiple teams using this code, each having their own copy of the source. As far as I'm aware we are the only team that has run into this issue.

We first encountered this issue with just having clang optimization turned on, so we added a workaround by disabling optimization using a pragma. The complier flag to use the new pass manager is causing the bug to resurface. Our current stopgap solution is to disable the new pass manager and keep the pragma in the .cpp to turn off optimizations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants