System Information
Operating system: Linux-5.4.0-100-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: NVIDIA GeForce GTX 750 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.103.01
Blender Version
Broken: version: 3.2.0 Alpha, branch: master, commit date: 2022-02-23 01:31, hash: rBc6df7266c718
Worked: 3.0.1 (Think the issue started sometime in the 3.1.0 Alpha cycle)
Caused by rB9d3f35a0bf1b: Revert "Revert "GPUShaderCreateInfo for interface abstraction"" look at that :)
Short description of error
Setting Stencil Mask->Stencil Image either by creating a new image or selecting an existing image will immediate crash Blender.
Bug affects both linux and windows and is 100% reproducible on my system.
Exact steps for others to reproduce the error
- Load the attached .blend file (Optional:switch to the mask tool)
- In the 3D view, scroll the tool tab down to Masking->Stencil Mask->Stencil Image
- Click the 'New' button then click 'Ok' to accept the defaults
- crash straight to the desktop
I've also attached the error message that you'll receive after the crash if you start blender via a terminal or cmd prompt.
It explains the problem: the smoothstep function is now interpreting "0" as an integer, rather than assuming it's a float.
The Fix
Edit: blender-git/blender/source/blender/draw/engines/overlay/shaders/paint_texture_frag.glsl
simply change line 18 from:
float mask_step = smoothstep(0, 3.0, mask.r + mask.g + mask.b);
to:
float mask_step = smoothstep(0.0, 3.0, mask.r + mask.g + mask.b);
I've tested this by locally compiling a version of Blender with this change and it creates a binary that works as expected and does not crash when setting the stencil mask.