Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Opening the `test-video` map with `r_materialSystem on` crashes the engine

Open illwieckz opened this issue 6 months ago • 11 comments

Opening the test-video map crashes the engine.

Hard to debug because of:

  • https://github.com/DaemonEngine/Daemon/issues/1800

illwieckz avatar Sep 13 '25 14:09 illwieckz

Stack trace:

Thread 1 "daemon" received signal SIGSEGV, Segmentation fault.
0x00006432fed2e3ff in TextureData::operator== (this=0x6433250f8e78, other=...) at src/engine/renderer/Material.h:195
195					if ( bundle->numImages != otherBundle->numImages ) {

Thread 1 (Thread 0x708253a789c0 (LWP 1927315) "daemon"):
#0  0x00006432fed2e3ff in TextureData::operator== (this=0x6433250f8e78, other=...) at src/engine/renderer/Material.h:195

illwieckz avatar Sep 13 '25 14:09 illwieckz

It only affects the material system.

illwieckz avatar Sep 13 '25 14:09 illwieckz

Both bundle and otherBundle are nullptr.

illwieckz avatar Sep 13 '25 14:09 illwieckz

If I tell the loop to continue on !bundle, it displays the default cinematic pixel color (currently blue because it reuses normal flat colors, something to be fixed in #1793) instead of the actual video frame.

illwieckz avatar Sep 13 '25 14:09 illwieckz

Ah, yes the bundle is never set at https://github.com/DaemonEngine/Daemon/blob/01d7e720a83817c679ca3c95ace3f4e2af4b55d6/src/engine/renderer/Material.cpp#L1535

Video textures don't currently work with bindless textures anyway though.

VReaperV avatar Sep 13 '25 15:09 VReaperV

So maybe we should render them with the core path?

illwieckz avatar Sep 13 '25 17:09 illwieckz

So maybe we should render them with the core path?

Video textures never worked with bindless textures even with material system turned off. So I don't think there's an easy switch to do that.

They didn't use to crash though!

slipher avatar Sep 13 '25 21:09 slipher

Well I guess bypassing material system could stop them from crashing, even if they don't actually work.

slipher avatar Sep 13 '25 21:09 slipher

So I don't think there's an easy switch to do that.

Easiest would probably be to do it similarly to autosprite/skyboxes/portals: add a vector of those surfaces to render at all times, and skip them in the material system.

VReaperV avatar Sep 13 '25 22:09 VReaperV

How would you make the textures not bindless though? You would need a special code path to use textures with bindings even though bindless textures are enabled. Autosprite/skyboxes/portals have special handling of vertexes but not of textures.

slipher avatar Sep 13 '25 22:09 slipher

How would you make the textures not bindless though? You would need a special code path to use textures with bindings even though bindless textures are enabled. Autosprite/skyboxes/portals have special handling of vertexes but not of textures.

Same as I did in #1684 for the depth texture.

VReaperV avatar Sep 13 '25 23:09 VReaperV