Page MenuHome

Texture Coordinates Node output crash in blender 2.8 in Lookdev Mode even with Cycles renderer.
Closed, ResolvedPublic

Description

System Information
Operating system: Darwin-17.7.0-x86_64-i386-64bit 64 Bits
Graphics card: NVIDIA GeForce GTX 780 OpenGL Engine NVIDIA Corporation 4.1 NVIDIA-10.33.0 387.10.10.10.40.113

Blender Version
Broken: version: 2.80 (sub 55), branch: blender2.7, commit date: 2019-04-11 17:43, hash: rBd1cda823e0a8
Worked: (optional)

Short description of error
Texture Coordinates Node output crashes blender 2.8 in Lookdev Mode even with Cycles renderer.
Forced to use cycles render preview and never swap back to lookdev, making the texture coordinates node unusable.

Exact steps for others to reproduce the error

  • Select Cycles renderer and cycles preview mode
  • Keep default cube
  • Edit cube shading
  • Add Image Texture, Ctrl+T, select object in the Object dropdown on the Texture Coordinates node.
  • Switch to Lookdev or Eevee rendering mode

-> Crash

Event Timeline

Cannot reproduce here. [fedora29, 970m, 418.56 drivers]

Sebastian Parborg (zeddb) lowered the priority of this task from Needs Triage by Developer to Needs Information from User.Apr 12 2019, 6:30 PM

@William Reynish (billreynish) can you reproduce this?

I can reproduce this on every Mac OSX High sierra Blender 2.8 (Mac pros and MacBooks) with factory settings. Haven't tried on Linux or Windows.

Philipp Oeser (lichtwerk) raised the priority of this task from Needs Information from User to Needs Triage by Developer.Apr 15 2019, 9:38 AM

I tested on windows and there is no crash ! I can only reproduce this on OSX High sierra 10.13.6.

Cannot reproduce in macOS 10.14 Mojave.

I updated Cuda from 410.130 to 418.105 and I have the same issue. Could this be Nvidia related ?
I (and many 3d artists) won't update to Mojave because of Nvidia compatibility issues ...?
I hope it can be solved or at least reproduced by someone.
I also unchecked Cuda in Blender preferences but it doesn't change anything

LookDev mode is using Eevee regardless of the render engine, so this would not be related to CUDA drivers.

I guess Ctrl+T means you are using the Node Wrangler add-on?

Does it still happen with the latest builds? There were some recent fixes related to this.

Yes Ctrl+T is node wrangler. Deactivating it won't solve the problem.
I always download the most recent build. (Every morning ;)
I am reproducing the crash with blender 2.8 beta build of April the 16th.

Off topic but : Keep up the good work you have a truly fantastic developper team and community. (I have been using blender for more than decades)
You are the open source heroes... I hope blender will continue to exist on Mac ;)

Same crash with today's 2.8 beta build.

It crashes in lookdev preview mode and Eevee renderer mode. No problem with wireframe, solid or cycles preview modes. So I agree it is eevee related.

Same crash with today's 2.8 beta build on High Sierra Macpro and macbook pro.
Tell me if I have to report this crash every 2.8 daily build or if I should stay quiet and not bother you with that.

The "crash report" file is from osx if it can help

Thanks for the crash report. It's not needed to test the build every day.

It seems to be the same bug in "T63826: Crashing file."

Brecht Van Lommel (brecht) lowered the priority of this task from Needs Triage by Developer to Confirmed, High.Apr 24 2019, 8:27 PM

I can't make it crash on Linux but valgrind does show me errors.

==13253== Invalid read of size 8
==13253==    at 0x24EDAD9: codegen_call_functions (blender/source/blender/gpu/intern/gpu_codegen.c:0)
==13253==    by 0x24EDAD9: code_generate_fragment (blender/source/blender/gpu/intern/gpu_codegen.c:903)
==13253==    by 0x24EDAD9: GPU_generate_pass (blender/source/blender/gpu/intern/gpu_codegen.c:1949)
==13253==    by 0x24FB0D9: GPU_material_from_nodetree (blender/source/blender/gpu/intern/gpu_material.c:695)
==13253==    by 0x184D54F: DRW_shader_create_from_material (blender/source/blender/draw/intern/draw_manager_shader.c:429)
==13253==    by 0x180E438: EEVEE_material_mesh_get (blender/source/blender/draw/engines/eevee/eevee_materials.c:781)
==13253==    by 0x180F5B4: material_opaque (blender/source/blender/draw/engines/eevee/eevee_materials.c:1278)
==13253==    by 0x180F5B4: EEVEE_materials_cache_populate (blender/source/blender/draw/engines/eevee/eevee_materials.c:1670)
==13253==    by 0x1803121: EEVEE_cache_populate (blender/source/blender/draw/engines/eevee/eevee_engine.c:130)
==13253==    by 0x17E6F3F: drw_engines_cache_populate (blender/source/blender/draw/intern/draw_manager.c:1095)
==13253==    by 0x17E6F3F: DRW_draw_render_loop_ex (blender/source/blender/draw/intern/draw_manager.c:1569)
==13253==    by 0x1AA98B7: view3d_draw_view (blender/source/blender/editors/space_view3d/view3d_draw.c:1431)
==13253==    by 0x1AA98B7: view3d_main_region_draw (blender/source/blender/editors/space_view3d/view3d_draw.c:1452)
==13253==    by 0x1B14611: ED_region_do_draw (blender/source/blender/editors/screen/area.c:558)
==13253==    by 0x10A64A5: wm_draw_window_offscreen (blender/source/blender/windowmanager/intern/wm_draw.c:596)
==13253==    by 0x10A64A5: wm_draw_window (blender/source/blender/windowmanager/intern/wm_draw.c:732)
==13253==    by 0x10A64A5: wm_draw_update (blender/source/blender/windowmanager/intern/wm_draw.c:895)
==13253==    by 0x10A426F: WM_main (blender/source/blender/windowmanager/intern/wm.c:424)
==13253==    by 0xC62A9A: main (blender/source/creator/creator.c:500)
==13253==  Address 0xc5ad1e8 is 8 bytes inside a block of size 32 free'd
==13253==    at 0x7835CB0: free (vg_replace_malloc.c:530)
==13253==    by 0xE35DD5: BLI_freelistN (blender/source/blender/blenlib/intern/listbase.c:533)
==13253==    by 0x24ED82E: codegen_process_uniforms_functions (blender/source/blender/gpu/intern/gpu_codegen.c:717)
==13253==    by 0x24ED82E: code_generate_fragment (blender/source/blender/gpu/intern/gpu_codegen.c:847)
==13253==    by 0x24ED82E: GPU_generate_pass (blender/source/blender/gpu/intern/gpu_codegen.c:1949)
==13253==    by 0x24FB0D9: GPU_material_from_nodetree (blender/source/blender/gpu/intern/gpu_material.c:695)
==13253==    by 0x184D54F: DRW_shader_create_from_material (blender/source/blender/draw/intern/draw_manager_shader.c:429)
==13253==    by 0x180E438: EEVEE_material_mesh_get (blender/source/blender/draw/engines/eevee/eevee_materials.c:781)
==13253==    by 0x180F5B4: material_opaque (blender/source/blender/draw/engines/eevee/eevee_materials.c:1278)
==13253==    by 0x180F5B4: EEVEE_materials_cache_populate (blender/source/blender/draw/engines/eevee/eevee_materials.c:1670)
==13253==    by 0x1803121: EEVEE_cache_populate (blender/source/blender/draw/engines/eevee/eevee_engine.c:130)
==13253==    by 0x17E6F3F: drw_engines_cache_populate (blender/source/blender/draw/intern/draw_manager.c:1095)
==13253==    by 0x17E6F3F: DRW_draw_render_loop_ex (blender/source/blender/draw/intern/draw_manager.c:1569)
==13253==    by 0x1AA98B7: view3d_draw_view (blender/source/blender/editors/space_view3d/view3d_draw.c:1431)
==13253==    by 0x1AA98B7: view3d_main_region_draw (blender/source/blender/editors/space_view3d/view3d_draw.c:1452)
==13253==    by 0x1B14611: ED_region_do_draw (blender/source/blender/editors/screen/area.c:558)
==13253==    by 0x10A64A5: wm_draw_window_offscreen (blender/source/blender/windowmanager/intern/wm_draw.c:596)
==13253==    by 0x10A64A5: wm_draw_window (blender/source/blender/windowmanager/intern/wm_draw.c:732)
==13253==    by 0x10A64A5: wm_draw_update (blender/source/blender/windowmanager/intern/wm_draw.c:895)
==13253==  Block was alloc'd at
==13253==    at 0x7836948: calloc (vg_replace_malloc.c:711)
==13253==    by 0xF27190: MEM_lockfree_callocN (blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c:267)
==13253==    by 0xE3633D: BLI_genericNodeN (blender/source/blender/blenlib/intern/listbase.c:911)
==13253==    by 0x24ED513: codegen_process_uniforms_functions (blender/source/blender/gpu/intern/gpu_codegen.c:689)
==13253==    by 0x24ED513: code_generate_fragment (blender/source/blender/gpu/intern/gpu_codegen.c:847)
==13253==    by 0x24ED513: GPU_generate_pass (blender/source/blender/gpu/intern/gpu_codegen.c:1949)
==13253==    by 0x24FB0D9: GPU_material_from_nodetree (blender/source/blender/gpu/intern/gpu_material.c:695)
==13253==    by 0x184D54F: DRW_shader_create_from_material (blender/source/blender/draw/intern/draw_manager_shader.c:429)
==13253==    by 0x180E438: EEVEE_material_mesh_get (blender/source/blender/draw/engines/eevee/eevee_materials.c:781)
==13253==    by 0x180F5B4: material_opaque (blender/source/blender/draw/engines/eevee/eevee_materials.c:1278)
==13253==    by 0x180F5B4: EEVEE_materials_cache_populate (blender/source/blender/draw/engines/eevee/eevee_materials.c:1670)
==13253==    by 0x1803121: EEVEE_cache_populate (blender/source/blender/draw/engines/eevee/eevee_engine.c:130)
==13253==    by 0x17E6F3F: drw_engines_cache_populate (blender/source/blender/draw/intern/draw_manager.c:1095)
==13253==    by 0x17E6F3F: DRW_draw_render_loop_ex (blender/source/blender/draw/intern/draw_manager.c:1569)
==13253==    by 0x1AA98B7: view3d_draw_view (blender/source/blender/editors/space_view3d/view3d_draw.c:1431)
==13253==    by 0x1AA98B7: view3d_main_region_draw (blender/source/blender/editors/space_view3d/view3d_draw.c:1452)
==13253==    by 0x1B14611: ED_region_do_draw (blender/source/blender/editors/screen/area.c:558)

That valgrind message is wrong, probably due to stack corruption. This is what asan shows:

/home/brecht/dev/blender/source/blender/gpu/intern/gpu_uniformbuffer.c:275:20: runtime error: index 16 out of bounds for type 'LinkData *[5]'
/home/brecht/dev/blender/source/blender/gpu/intern/gpu_uniformbuffer.c:275:34: runtime error: store to address 0x7fffffffc290 with insufficient space for an object of type 'struct LinkData *'

@Clément Foucault (fclem), this seems to work. Basically adding support for mat4 in UBOs, and raising assert if unsupported types are used. Supporting mat3 alignment requires bigger changes to the code I think, so I didn't bother with that.

1diff --git a/source/blender/gpu/intern/gpu_uniformbuffer.c b/source/blender/gpu/intern/gpu_uniformbuffer.c
2index 651e3c1..6b2c903 100644
3--- a/source/blender/gpu/intern/gpu_uniformbuffer.c
4+++ b/source/blender/gpu/intern/gpu_uniformbuffer.c
5@@ -65,7 +65,7 @@ static void gpu_uniformbuffer_inputs_sort(struct ListBase *inputs);
6
7 /* Only support up to this type, if you want to extend it, make sure the
8 * padding logic is correct for the new types. */
9-#define MAX_UBO_GPU_TYPE GPU_VEC4
10+#define MAX_UBO_GPU_TYPE GPU_MAT4
11
12 static void gpu_uniformbuffer_initialize(GPUUniformBuffer *ubo, const void *data)
13 {
14@@ -255,11 +255,11 @@ static int inputs_cmp(const void *a, const void *b)
15
16 /**
17 * Make sure we respect the expected alignment of UBOs.
18- * vec4, pad vec3 as vec4, then vec2, then floats.
19+ * mat4, vec4, pad vec3 as vec4, then vec2, then floats.
20 */
21 static void gpu_uniformbuffer_inputs_sort(ListBase *inputs)
22 {
23- /* Order them as vec4, vec3, vec2, float. */
24+ /* Order them as mat4, vec4, vec3, vec2, float. */
25 BLI_listbase_sort(inputs, inputs_cmp);
26
27 /* Creates a lookup table for the different types; */
28@@ -268,6 +268,17 @@ static void gpu_uniformbuffer_inputs_sort(ListBase *inputs)
29
30 for (LinkData *link = inputs->first; link; link = link->next) {
31 GPUInput *input = link->data;
32+
33+ if (input->type == GPU_MAT3) {
34+ /* Alignment for mat3 is not handled currently, so not supported */
35+ BLI_assert(!"mat3 not supported in UBO");
36+ continue;
37+ }
38+ else if (input->type > MAX_UBO_GPU_TYPE) {
39+ BLI_assert(!"GPU type not supported in UBO");
40+ continue;
41+ }
42+
43 if (input->type == cur_type) {
44 continue;
45 }

Thanks so much for the fix! It now works for me without crashing. Unfortunately the texture still does not update in eevee when you transform the object that is being referenced for texture coordinates. I'm not sure if this is a bug or just a current limitation of eevee?

Thank you for the bug fix too ! As Isaac Freeman said, it seems that the texture projection from an object doesn't refresh in lookdev. I have to go to cycles render to see it. I would like to know if it's an Eevee limitation too.

I would like to know if it's an Eevee limitation too.

It is a depsgraph issue, see T57489