Unsigned ints in GLSL macros causing UI shader compilation failure/crashes on Intel HD 4000 #106457
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#106457
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.19044-SP0
Graphics card: Intel HD Graphics 4000 (10.18.10.5161)
Blender Version
Broken: 3.5.0,
1be25cfff1
, release, 2023-03-29Worked: 3.4.1
I realise that the Intel HD 4000 isn't supported, but I thought I'd better post anyway in case similar issues exist with other GPUs.
There seems to be a bug in the graphics driver that can cause shader compilation to fail when defining and using macros that involve operations on uints in GLSL code. When this happens in the UI shader code this causes Blender to crash with the error EXCEPTION_ACCESS_VIOLATION.
For instance in overlay_motion_path_point_vert.glsl the line
if ((flag & MOTIONPATH_VERT_KEY) != 0u) {
causes a crash on startup since MOTIONPATH_VERT_KEY is defined in overlay_shader_shared.h with# define MOTIONPATH_VERT_KEY (1u << 1)
Changing this to
# define MOTIONPATH_VERT_KEY 2u
fixes the compilation error.Similar macros defined in draw_common_shader_shared.h result in crashes when entering edit mode and can be fixed in the same way.
These macros in gpu_shader_2D_nodelink_vert.glsl result in crashes when attempting to display links in a node editor.
Using int instead of uint literals in the above comparisons is a quick fix, though is technically less correct.
Error Messages
N.B. The lines given in the error messages are wrong.
On startup:
Entering edit mode (message below repeated for overlay_edit_mesh_face VertShader):
Entering the shader editor:
Actually later we found out it's probably the same problem as stated in this issue #106432.
This should get fixed.
I think this might be specifically to do with macros, since (at least in the case of MOTIONPATH_VERT_KEY) there are no errors when either manually expanding the macro or defining the macro as just an unsigned literal.
It's probably the same as #106446 though (I probably should have made clear that the MOTIONPATH_VERT_KEY line causes a crash on start-up, the other crashes only occur once that one has been resolved).
@ChengduLittleA : can you confirm this on supported hardware? Or can you confirm it is a duplicate? Then either close as duplicate or confirm it :)
The information is good (thx @Avelgest) but technically, we should not really keep reports open if this only affects unsupported hardware.
Or maybe @fclem can confirm?
@lichtwerk From the graphics information, it's just 1 generation behind Haswell (which is the official requirement), maybe through some driver magic it might still work with that shader if #106432 is fixed. These two issues do look similar but not exactly the same, but they both involve the
&
with integer and booleans.I've seen this issue with this GPU before and it appears to be different than #106432.
While #106432 appears to be about unsigned vs signed type conflicts, here the Intel driver simply ignores the parentheses [
(
and)
] within the macro.As far as I can tell, this is a problem specific to
Intel HD Graphics 4000
.We could change the line
# define MOTIONPATH_VERT_KEY (1u << 1)
to# define MOTIONPATH_VERT_KEY 2u /*(1u << 1)*/
but that would be a blind fix, as this GPU is no longer maintained by any developer in Blender.Therefore, please provide a Pull Request if you want this issue addressed: https://wiki.blender.org/wiki/Process/Contributing_Code
I am closing this report as this GPU is below the minimum requirements for Blender.