Opened 2 years ago

Closed 2 years ago

#6480 closed defect (fixed)

[macOS] MSAA crash

Reported by: Langbart Owned by: Vladislav Belov
Priority: Should Have Milestone: Alpha 26
Component: Core engine Keywords:
Cc: Patch: Phab:D4581

Description (last modified by Langbart)

to reproduce

  • start game in main menu
  • enable MSAA on macOS in the options

  • start a match --> crash
WARNING: Wrong MSAA sample count: msaa2.
Process 19666 stopped
* thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000000000000
error: memory read failed for 0x0
Target 0: (pyrogenesis) stopped.
  • Even worse when simply starting the main menu with the MSAA option being stored in the user.cfg file, the game crashes immediately

lldb

(lldb) bt
* thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000000000000
    frame #1: 0x00000001003fcffd pyrogenesis`Renderer::Backend::GL::CTexture::Create(device=0x0000000105176e70, name="PostProcColorMS", type=TEXTURE_2D_MULTISAMPLE, format=<unavailable>, width=1920, height=1200, defaultSamplerDesc=0x00007ffeefbfe438, MIPLevelCount=1, sampleCount=4) at Texture.cpp:250:4 [opt]
    frame #2: 0x00000001003edada pyrogenesis`Renderer::Backend::GL::CDevice::CreateTexture(this=<unavailable>, name=<unavailable>, type=<unavailable>, format=<unavailable>, width=<unavailable>, height=1200, defaultSamplerDesc=0x00007ffeefbfe438, MIPLevelCount=1, sampleCount=4) at Device.cpp:791:9 [opt]
    frame #3: 0x00000001003a4036 pyrogenesis`CPostprocManager::CreateMultisampleBuffer(this=0x000000010b9360c0) at PostprocManager.cpp:609:41 [opt]
    frame #4: 0x00000001003a3390 pyrogenesis`CPostprocManager::UpdateAntiAliasingTechnique(this=0x000000010b9360c0) at PostprocManager.cpp:572:3 [opt]
    frame #5: 0x00000001003a20e5 pyrogenesis`CPostprocManager::Initialize(this=0x000000010b9360c0) at PostprocManager.cpp:103:2 [opt]
    frame #6: 0x00000001003b5ad1 pyrogenesis`CSceneRenderer::RenderSubmissions(this=0x000000010b936230, deviceCommandContext=0x000000010b0b5530, waterScissor=0x00007ffeefbfedb0) at SceneRenderer.cpp:827:19 [opt]
    frame #7: 0x00000001003b6ce0 pyrogenesis`CSceneRenderer::RenderScene(this=0x000000010b936230, deviceCommandContext=0x000000010b0b5530, scene=0x000000010b0bba40) at SceneRenderer.cpp:1163:2 [opt]
    frame #8: 0x00000001003a94ee pyrogenesis`CRenderer::RenderFrameImpl(this=0x000000010b0b4c00, renderGUI=<unavailable>, renderLogger=<unavailable>) at Renderer.cpp:462:22 [opt]
    frame #9: 0x00000001003a92ed pyrogenesis`CRenderer::RenderFrame(this=0x000000010b0b4c00, needsPresent=true) at Renderer.cpp:417:3 [opt]
    frame #10: 0x00000001000069f1 pyrogenesis`RunGameOrAtlas(int, char const**) [inlined] Frame() at main.cpp:452:13 [opt]
    frame #11: 0x0000000100006140 pyrogenesis`RunGameOrAtlas(argc=<unavailable>, argv=<unavailable>) at main.cpp:691 [opt]
    frame #12: 0x0000000100004736 pyrogenesis`main(argc=1, argv=0x00007ffeefbff680) at main.cpp:743:2 [opt]
    frame #13: 0x00007fff6b64dcc9 libdyld.dylib`start + 1

it used to display a warning in A25b #5969

bisect

The change from simply displaying a warning to an instant crash came with [26366].

IRC 0ad-dev 28/Mar/22

20:31	Vladislav	Langbart: I believe it might be macOS driver bug, so bisect might lead to introducing MSAA.
20:31		Langbart: could you run the game with GL debug enabled?
20:32		Just set: renderer.backend.debug* = "true" in cfg.

Attachments (2)

set.jpg (281.9 KB ) - added by Langbart 2 years ago.
logs.zip (9.8 KB ) - added by Langbart 2 years ago.
logs created with renderer.backend.debug* = "true"

Download all attachments as: .zip

Change History (6)

by Langbart, 2 years ago

Attachment: set.jpg added

comment:1 by Langbart, 2 years ago

Description: modified (diff)

by Langbart, 2 years ago

Attachment: logs.zip added

logs created with renderer.backend.debug* = "true"

comment:2 by Langbart, 2 years ago

IRC 0ad-dev 28/Mar/22
patch tomorrow

21:07 < Vladislav> Langbart: could you replace "if (!g_VideoMode.GetBackendDevice()->GetCapabilities().multisampling && !m_AllowedSampleCounts.empty())" by "if (!g_VideoMode.GetBackendDevice()->GetCapabilities().multisampling || m_AllowedSampleCounts.empty())" in PostprocManager.cpp?
21:09 < Langbart> https://ttm.sh/iy5.54.png
21:09 < Langbart> it is building
21:10 < Vladislav> Yep, thanks.
21:11 < Langbart> Vladislav, this worked. i now see the warning again. https://ttm.sh/iyG.42.png
21:11 < Langbart> no crash
21:12 < Vladislav> Langbart: cool, will make a patch tomorrow.
21:15 < Langbart> Отлично

comment:3 by Langbart, 2 years ago

Patch: Phab:D4581

comment:4 by Vladislav Belov, 2 years ago

Owner: set to Vladislav Belov
Resolution: fixed
Status: newclosed

In 26737:

Fixes MSAA on macOS GL drivers for textures with incorrect sample count, fixes #6480

Refs #5969

Tested By: Langbart

Differential Revision: https://code.wildfiregames.com/D4581

Note: See TracTickets for help on using tickets.