Skip to content

fix: dynamics lights causing sigfpe#3361

Open
menguele wants to merge 1 commit intoZDoom:masterfrom
menguele:fix-lights
Open

fix: dynamics lights causing sigfpe#3361
menguele wants to merge 1 commit intoZDoom:masterfrom
menguele:fix-lights

Conversation

@menguele
Copy link
Copy Markdown

closes #2292

Needs testing with Nvidia, Intel and AMD gpus (pre-RDNA) before merge.

@RicardoLuis0
Copy link
Copy Markdown
Contributor

RicardoLuis0 commented Sep 21, 2025

this should probably be fixed by ensuring sane limits here instead (ex. a clamp for enforcing a minimum of 16 - as for why 16, it's the minimum alignment for anything std140, and most of the code was made with that in mind, and most drivers also report that as the minimum alignment) https://github.com/ZDoom/gzdoom/blob/master/src/common/rendering/gl_load/gl_interface.cpp#L188-L189

@coelckers
Copy link
Copy Markdown
Member

The people who wrote this driver should hook up with Raymond Chen...

https://devblogs.microsoft.com/oldnewthing/20251013-00/?p=111677

@KrossX
Copy link
Copy Markdown

KrossX commented Nov 5, 2025

From the OpenGL Wiki

GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT (integer, defaults to 1, see glUniformBlockBinding)
The minimum required alignment for uniform buffer sizes and offset.

Perhaps changing the line in hw_lightbuffer.cpp#L55 for something like in hw_bonebuffer.cpp#L47 would do the trick?

--- mBlockAlign = screen->uniformblockalignment / ELEMENT_SIZE;
+++ // 64 ?
+++ mBlockAlign = screen->uniformblockalignment < 64 ? 1 : screen->uniformblockalignment / ELEMENT_SIZE;

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] OpenGL Crash on Windows when using Lights

4 participants