FNA-XNA / FNA3D

FNA3D - 3D Graphics Library for FNA
http://fna-xna.github.io/
Other
287 stars 48 forks source link

Swizzle fixes #144

Closed thatcosmonaut closed 2 years ago

thatcosmonaut commented 2 years ago

Really weird that you just committed a swizzle fix, was discussing this exact problem with a user in the Discord trying to get Bastion to run on RaspPi.

Internal texture formats mismatching is triggering undefined GL behavior. This patch fixes that. We also missed an incorrect swizzle on BGRA4444 in Vulkan.

flibitijibibo commented 2 years ago

I ended up finding this one during Wayland testing this week. Should be back in the Discord eventually!

thatcosmonaut commented 2 years ago

Hold off on merging this, investigating a GL crash.

thatcosmonaut commented 2 years ago

Alright I'll continue investigating. Will commit the Vulkan change separately

flibitijibibo commented 2 years ago

Note that the array being touched here is bit size and not swizzling, that's done in the array right above this one.

If this was reported from an ES3 user this is not a bug, it's just ES3 omitting BGRA8 for some unknown reason.

thatcosmonaut commented 2 years ago

Actually the BGRA error is on mainline OpenGL and not ES3. Trying to get to the bottom of this. There's a depthRange error on Nvidia GL as well that I'm looking into.

flibitijibibo commented 2 years ago

This is all very very highly suspicious - ARB_debug_output would have been screaming about this 6 years ago. NV rightly errors on BGRA in ES3 but there's no way it trips in desktop GL. Depth range it might claim that double precision is unsupported in ES3 but this isn't a hard error (and on Tegra you can either ignore it or force a desktop profile).

I don't know what's going on but the fact that we're suddenly getting a report for GL formats reeks of someone secretly using some crap like a mobile vendor's driver.

thatcosmonaut commented 2 years ago

According to this user both desktop GL and ES3 are crashing on Intel HD 630 using Mesa 21.3.4

flibitijibibo commented 2 years ago

Why are we even testing ES3 on Mesa??? That's not going to help at all and never has.

If it's crashing with desktop GL that needs to be reported to the Mesa team, not us:

https://docs.mesa3d.org/bugs.html

JohnnyonFlame commented 2 years ago

The mismatch between internal format and format affects all platforms I have that are ES3 capable, NV, Intel, Mali Midgard r18p0 and Mali Bifrost r24p0. On Mali it causes texture corruptions, on NV/Intel it causes a crash.

However the proposed changes for OpenGL ES3 causes the OpenGL path to fail as reported.

Why are we even testing ES3 on Mesa??? That's not going to help at all and never has.

I was asked to ensure it wasn't a mali driver bug, since those are landfill material.

flibitijibibo commented 2 years ago

This is this third time I've said it in this thread alone and it had better be the last:

ES3 DOES NOT SUPPORT BGRA8. THIS IS HOW ES3 WORKS. IT IS NOT A BUG, IT IS JUST A SPEC OVERSIGHT.

I can only assume that because we're even looking at this you're trying to run Bastion. Don't even try it on ES hardware, it has a GetData in the current public build that basically makes it a no-go. I have this fixed locally but Supergiant haven't taken the patches in. Until they take those patches in, you're not running this game. Play something else.

thatcosmonaut commented 2 years ago

My bad, I was under the impression this was a desktop GL issue, apologies for the time waste.

JohnnyonFlame commented 2 years ago

ES3 DOES NOT SUPPORT BGRA8. THIS IS HOW ES3 WORKS. IT IS NOT A BUG, IT IS JUST A SPEC OVERSIGHT.

Loud and clear, I had tested it on mesa/nv/mali on ES3 without actually checking spec then reported it on Discord, sorry for the bogus report cosmo, I really hate this API sometimes.