Can I apply a Shader-Graph shader to an ECS entity?

Hello.
My Unity Editor crashes when I run this code, using ECS and HDRP in Unity 2019.3.14:

        // 1
        EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
        var settings = GameObjectConversionSettings.FromWorld(World.DefaultGameObjectInjectionWorld, null);

        // 2
        EntityArchetype archetype = entityManager.CreateArchetype(
            typeof(Translation),
            typeof(RenderMesh),
            typeof(RenderBounds),
            typeof(LocalToWorld));

        // 3
        Entity grassEntity = entityManager.CreateEntity(archetype);

        // 4
        entityManager.AddComponentData(grassEntity, new Translation { Value = new Vector3(0, 0, 0) });
        entityManager.AddSharedComponentData(grassEntity, new RenderMesh
        {
            mesh = grassBladeMesh,
            material = grassBladeMaterial
        });

The Unity Editor when I apply the material. Here’s some more info:

  • The mesh is a Unity primitive Cube.

  • The material is any material using a Shader created with Shader Graph.

  • If I use a material made with a built-in Shader, the Unity Editor does not crash.

  • I’ve tested this with graphs that are new, blank, un-edited Unlit Master Nodes.

  • Applying the material to the entity crashes the Editor, and using a Prefab with that material applied also crashes the Editor.

  • I tried copying the Shader as text and pasting it into a blank .shader file, but the method still crashed the Editor.

Here’s what the crash log said:
Assertion failed on expression: 'data->elementSize'

Am I doing something wrong, is this not supported, or is it a bug?
(Sorry, not sure if this should go in /shader-graph or /ecs)

Here’s an update: It seems like the answer is just no. I think these two systems are incompatible as of now.

I decided to open the VFX graph and try that. It’s good, I’m happy with many aspects of it, but I don’t have as much control over how this interacts with a mesh in 3D space (like a building or my terrain height-map).

So that’s the closest work-around I have as of now.