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

Broken rendering on disc surface with Clang 14 and later with -march=native #1545

Open
illwieckz opened this issue Feb 6, 2025 · 15 comments

Comments

@illwieckz
Copy link
Member

See that vega place in viewpos 486 -57 96 147 24, the wrong black triangles on the disc surface on the right:

Image

The bug disappears with r_deluxeMapping 0:

Image

I'm reproducing it with current master but I was already noticing the problems on commit 9352952. I don't know when the bug was introduced, but the Unvanquished 0.55.2 release build doesn't reproduce the bug.

@VReaperV
Copy link
Contributor

VReaperV commented Feb 6, 2025

With what other settings? I can't reproduce this so far.

@illwieckz
Copy link
Member Author

I use the ultra preset. I'm running it on an AMD Radeon W7600 PRO on Mesa radeonsi 24.2.8 (LLVM 19.1.1).

@VReaperV
Copy link
Contributor

VReaperV commented Feb 6, 2025

Still can't reproduce. Maybe a driver bug?

@VReaperV
Copy link
Contributor

VReaperV commented Feb 6, 2025

Also, it may be some other setting really, since disabling deluxe mapping disables a bunch of other features too.

@VReaperV
Copy link
Contributor

VReaperV commented Feb 6, 2025

@illwieckz Can you try on OGLP? Also, try with r_showDeluxeMaps 1, r_showNormalMaps 1, and r_showMaterialMaps 1 (separately) to see if any of those appear broken.

@illwieckz
Copy link
Member Author

Maybe a driver bug?

Maybe, but the release build isn't affected. I may do a bisect at some point.

@VReaperV
Copy link
Contributor

VReaperV commented Feb 7, 2025

I don't think anything really changed there except making texture matrices 3x2.

@slipher
Copy link
Member

slipher commented Feb 7, 2025

r_depthShaders 0 is a good thing to try with these bugs

@VReaperV
Copy link
Contributor

VReaperV commented Feb 7, 2025

The texture matrix there is just an identity matrix, so it shouldn't be that. These triangles are also all part of the same surface. I wonder if this some different build of the map? Otherwise this bug would probably show up on other maps as well.

@illwieckz
Copy link
Member Author

illwieckz commented Feb 7, 2025

I first seen that on a custom built map with custom engine branch, but then I reverted to stock released map and master engine branch to reproduce the bug before reporting it.

@illwieckz
Copy link
Member Author

illwieckz commented Feb 7, 2025

I first noticed it on some Xonotic maps with similar geometry, Vega is just the first Unvanquished stock map I reproduced with, there is no reason other Unvanquished maps featuring the same kind of geometry would not be buggy as well.

@illwieckz
Copy link
Member Author

I reproduce it with Clang 20 and -march=native on a Zen 2 CPU, the bug is still there with fast math disabled.

Since the release wasn't built that way, that may not be a regression.

A release-like build with Clang 20 (not using -march=native) is not affected.

@VReaperV
Copy link
Contributor

VReaperV commented Feb 7, 2025

Oh. Maybe it's some SIMD code breaking for triangle processing when loading the BSP, like the R_TBNtoQtangents()? Or a Clang bug.

@illwieckz
Copy link
Member Author

illwieckz commented Feb 7, 2025

I starts breaking with Clang 14:

compiler status
Clang 20 ❌️
Clang 19 ❌️
Clang 18 ❌️
Clang 17 ❌️
Clang 16 ❌️
Clang 15 ❌️
Clang 14 ❌️
Clang 13 ✅️
Clang 12 ✅️
Clang 11 ✅️
Clang 10 ✅️

@illwieckz illwieckz changed the title Broken rendering on disc surface Broken rendering on disc surface with Clang 14 and later with -march=native Feb 7, 2025
@VReaperV
Copy link
Contributor

#1451 (comment) seems to suggest that R_TBNtoQtangents() may, indeed, be the issue here.

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

No branches or pull requests

3 participants