Stack overflow when converting textures to virtual textures

Hi everyone, I’m using UE5.4.4 and in my project there are many textures and materials/material instances. So the reference relationship could be complex. When I try to convert textures to virtual textures using engine provided tool, It could crash because of stack overflow. The call stack is repeating FDefaultMaterialInstance::GetParameterValue() which is in \Source\Runtime\Engine\Private\Material\Material.cpp line 437 - 465. Anyone has any clues about this? Many thanks.

Changing the rendering thread stack size will not fix this (using source code and modify StartRenderingThread and giving a much more larger size). It seems to fall into some infinite looping trying to get the parameter value of fallback material render resource. Still don’t know how to resolve this problem :cry: .

Hi everyone, after invest the source code and debugging I finally found that some of the material instances in my project HAS NO parent material(and somehow it referenced the textures which is affected by other textures that will convert to virtual textures). More informations:

  1. If deleted these broken assets, the stack overflow crash will be fixed.
  2. This will not only cause stack overflow, some other crash will also happen. So if you are also suffering these crashes during virtual texture converting(and converting backward), maybe you should check your assets(material instances and material function instances to see if there are such assets).
  3. If the converting affects too many textures/materials/material functions, there might be OOM crashes/Out of video memory crashes/Virtual Texture Allocator crashes.

Hope this will help.