Broken geometry on macOS Intel

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is ON
[img] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Broken geometry on macOS Intel

Re: Broken geometry on macOS Intel

by _mental_ » Sun Jul 28, 2019 10:15 am

Overridden Draw() in VkRenderStateMolten doesn’t explain why it works correctly with NVIDIA GPU.
Actually, I can play with this function, I’m not sure what should be changed here exactly.

Re: Broken geometry on macOS Intel

by dpJudas » Sun Jul 28, 2019 9:47 am

My best theory right now is unfortunately still that VkRenderStateMolten::Draw might be messing up some state. It doesn't really match well with the evidence you've presented so far though. Only other theory I got is driver error, but that doesn't help us much. :(

Re: Broken geometry on macOS Intel

by _mental_ » Sun Jul 28, 2019 7:29 am

I tested with Vulkan Portability Implementation instead of MoltenVK, and the bug still persist.
The issue isn't caused by particular Vulkan implementation but most likely by Intel Metal driver.

Curiously enough, I found a workaround by occasional. Addition of the following code after this line fixes broken geometry.

Code: Select all

GetRenderState()->EnableTexture(false);
GetRenderState()->Draw(DT_TriangleStrip, 0, 0, false);
Calling VkRenderState::Apply() without "drawing" zero primitives didn't do the trick. Honestly, I have no idea what's going on here.

Re: Broken geometry on macOS Intel

by _mental_ » Sun Jun 16, 2019 3:23 am

That broken ceiling is rendered via triangle list. Also, floor of the same sector uses triangles too, but it's rendered properly.

At first, I suspected a bug in MoltenVK or in specific render state we have for it.
Although, it's not the case as everything is rendered correctly on the same Mac using NVIDIA GPU.
Validation layers are silent regardless of active graphics hardware.

Re: Broken geometry on macOS Intel

by dpJudas » Sat Jun 15, 2019 10:38 am

If the draw type for the ceiling is DT_TriangleFan there's also the possibility that this line doesn't get executed. It could perhaps leave it in a situation where the drawIndexed call isn't using DT_Triangles as expected. It might be worth extending it with a mPipelineKey.DrawType != DT_Triangles check, just in case that's the reason.

Re: Broken geometry on macOS Intel

by dpJudas » Sat Jun 15, 2019 10:29 am

I'm not really sure what could be causing this. It renders the entire scene in one render pass where it switches between pipeline objects (unless flushed, but then its starts a new immediately after). Inside a single subpass (which we only have one) the render order is guaranteed without a need for the application to set up any barriers.

My best bet would be an uninitialized variable, or a state variable that doesn't get reset properly. But which one? It looks like on the first screenshot that some vertex gets the wrong position as the textures don't match. It doesn't look completely corrupted though as the texture change makes it seem like a different valid vertex got used instead. Which primitive draw type does the ceiling use?

Broken geometry on macOS Intel

by _mental_ » Sat Jun 15, 2019 8:00 am

I encountered a very specific hardware/driver issue, and I unable to fix it.

In very specific map spots with complex geometry, sector's floor and/or ceiling is rendered incorrectly.
The bug is limited to Intel Iris Pro integrated GPU and macOS. NVIDIA GPU in the same Mac isn't affected.
Screenshot_Doom_20190615_163522.jpg
Somehow, it's tightly coupled with sky rendering. When sky is visible, everything is correct.
Both screenshots were taken in the same map spot with slightly different angle.
Screenshot_Doom_20190615_163526.jpg
It's this map from Vinesauce Doom Mapping Contest II: Hellectric Boogaloo.

Code: Select all

-iwad doom2 -file bloodmind90x.-.Fists.in.Blood.2.by.Bloodmind90x.aka.Hevn.Demonic.pk3 +map map01 +warp 540 920 -nomonsters +noclip +god
With gl_no_skyclear CVAR set, broken geometry persists regardless of sky portal in view.
Curiously enough, Metal GPU capture in Xcode shows recorded frame without an issue.

At the moment, I have no idea what else I can check. Any advice will greatly appreciated.

Top