Missing UBO Binding

Hi,

I’m attempting to build Blender in Visual Studio 2019 for the first time in a while. My set up is Windows 7 with an old Intel graphics card, so that may be the main issue. I eventually got Blender to build (Debug version) but upon running it I get the following output in the terminal and Blender effectively hangs:

C:\Users\Tom\Documents\repos\build_windows_Full_x64_vc16_Release\bin\Debug>blender.ex
e
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
Vendor: Intel
Renderer: Intel(R) HD Graphics 4600
Version: 4.3.0 - Build 10.18.14.4414 
Context Version: 4.3
Vendor: Intel
Renderer: Intel(R) HD Graphics 4600
Version: 4.3.0 - Build 10.18.14.4414
Context Version: 4.3
found bundled python: C:\Users\Tom\Documents\repos\build_windows_Full_x64_vc16_Releas
e\bin\Debug\2.83\python
Trying to draw with missing UBO binding.
Pass : , Shader : GPU_shader_create_from_arrays_impl_12, Block : viewBlock

I managed to get Blender to run by changing

#  ifdef DEBUG_UBO_BINDING

On line 865 of draw_manager_exec.c to

#  ifndef DEBUG_UBO_BINDING

There’s comments in the code that emntion T55475 so I don’t know if that is related in any way?

Any advice would be appreciated.
Thanks, Tom

Update.

I applied the attached patch which is copied from the patch supplied in T55475 and it seems to have fixed it. However it may just be because I commented out the if(valid)... section. This is the output I get at the console when Blender loads:

C:\Users\Tom\Documents\repos\build_windows_Full_x64_vc16_Release\bin\Debug>blender.ex
e
Read prefs: C:\Users\Tom\AppData\Roaming\Blender Foundation\Blender\2.83\config\userp
ref.blend
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
Vendor: Intel
Renderer: Intel(R) HD Graphics 4600
Version: 4.3.0 - Build 10.18.14.4414
Context Version: 4.3
Vendor: Intel
Renderer: Intel(R) HD Graphics 4600
Version: 4.3.0 - Build 10.18.14.4414
Context Version: 4.3
found bundled python: C:\Users\Tom\Documents\repos\build_windows_Full_x64_vc16_Releas
e\bin\Debug\2.83\python
Pass : , Shader : GPU_shader_create_from_arrays_impl_12, Block : viewBlock
Pass : , Shader : GPU_shader_create_from_arrays_impl_13, Block : viewBlock
Pass : , Shader : GPU_shader_create_from_arrays_impl_14, Block : viewBlock
Pass : , Shader : DRW_shader_create_fullscreen_15, Block : viewBlock
Pass : , Shader : GPU_shader_create_from_arrays_impl_45, Block : viewBlock
Pass : , Shader : GPU_shader_create_from_arrays_impl_41, Block : viewBlock

Patch:

I think the first thing to investigate is if the shader(s) are missing UBO binding for viewBlock, or using viewBlock in a shader where it shouldn’t be used?

CC @Hypersomniac

So I think I may have narrowed it down a bit here (apologies if not, I don’t really know what I’m doing here, this is all speculative). In common_view_lib.glsl on line 142 there is an else statement to help deal with legacy Intel GPUs (like mine). As far as I can tell it creates two uniform mat4 and then specifically doesn’t bind them to a UBO. I got rid of the else statement and that seemed to stop the error appearing.

Note that driver 10.18.14.4414 is unsupported, Blender should show a warning the first time it starts with that driver. It has known bugs that are fixed with newer Intel drivers.

I’m not sure if it affects this particular assert in debug mode, but it may be related.

The assert is about viewBlock which is the same on all platform not related to the ifdef/else for legacy intel.

I really think this is a driver bug since all these binds should be the same on all platforms and we could detect these faults too.

Thanks for looking into this and apologies for taking a while to get back to you.

My drivers were out of date and I was getting the message you mentioned from the version of Blender I downloaded form blender.org. I’ve updated my drivers and that message now doesn’t appear when I open an official build of Blender. However I’m still getting the same problems when I try and compile from source.

Read prefs: C:\Users\Tom\AppData\Roaming\Blender Foundation\Blender\2.83\config\
userpref.blend
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
Vendor: Intel
Renderer: Intel(R) HD Graphics 4600
Version: 4.3.0 - Build 10.18.14.5117
Context Version: 4.3
Vendor: Intel
Renderer: Intel(R) HD Graphics 4600
Version: 4.3.0 - Build 10.18.14.5117
Context Version: 4.3
found bundled python: C:\Users\Tom\Documents\repos\build_windows_Full_x64_vc16_R
elease\bin\Debug\2.83\python
Warning: property 'deselect' not found in keymap item 'ARMATURE_OT_select_linked
'
Warning: property 'deselect' not found in keymap item 'ARMATURE_OT_select_linked
'
Warning: property 'deselect' not found in keymap item 'ARMATURE_OT_select_linked
'
Warning: property 'deselect' not found in keymap item 'ARMATURE_OT_select_linked
'
Trying to draw with missing UBO binding.
Pass : , Shader : GPU_shader_create_from_arrays_impl_12, Block : viewBlock
31: BLI_system_backtrace - 0x14C4BC550
30: draw_update_uniforms - 0x145CC8220
29: draw_shgroup - 0x145CC78C0
28: drw_draw_pass_ex - 0x145CC8C70
27: DRW_draw_pass - 0x145CC4EC0
26: workbench_draw_sample - 0x145D44250
25: workbench_draw_scene - 0x145D42D70
24: drw_engines_draw_scene - 0x145CB42C0
23: DRW_draw_render_loop_ex - 0x145CAD1C0
22: DRW_draw_view - 0x145CAEB20
21: view3d_draw_view - 0x146CD2A40
20: view3d_main_region_draw - 0x146CD3140
19: ED_region_do_draw - 0x14639F0E0
18: wm_draw_window_offscreen - 0x145A7C4F0
17: wm_draw_window - 0x145A7C180
16: wm_draw_update - 0x145A7BB70
15: ghost_event_proc - 0x145A40C10
14: GHOST_CallbackEventConsumer::processEvent - 0x1470C9DD0
13: GHOST_EventManager::dispatchEvent - 0x1470FA330
12: GHOST_EventManager::dispatchEvent - 0x1470FA4C0
11: GHOST_EventManager::dispatchEvents - 0x1470FA590
10: GHOST_System::dispatchEvents - 0x1470FE190
9: GHOST_DispatchEvents - 0x1470C4FC0
8: wm_window_process_events - 0x145A44E20
7: WM_main - 0x145A309D0
6: main - 0x1452A96D0
5: invoke_main - 0x14D63CED0
4: __scrt_common_main_seh - 0x14D63CC80
3: __scrt_common_main - 0x14D63CC60
2: mainCRTStartup - 0x14D63CF90
1: BaseThreadInitThunk - 0x772D5700
0: RtlUserThreadStart - 0x77433840
BLI_assert failed: C:\Users\Tom\Documents\repos\blender\source\blender\draw\inte
rn\draw_manager_exec.c:1025, draw_update_uniforms(), at 'ubo_bindings_validate(s
hgroup)'

Thanks