Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
vkd3d_free(v->initializer.args); vkd3d_free(v->initializer.instrs); }
else if (var->modifiers & HLSL_STORAGE_STATIC)
{
struct hlsl_ir_constant *zero;
struct hlsl_ir_load *load;
/* Initialize statics to zero by default. */
if (type_has_object_components(var->data_type, false))
{
hlsl_error(ctx, &v->loc, VKD3D_SHADER_ERROR_HLSL_MISSING_INITIALIZER,
"Static variable cannot be initialized to 0 if it has object components.");
Actually, it seems that a static variable with objects is fine if it contains *only* objects.