#Hybrid per instance for float4x4

1 messages · Page 1 of 1 (latest)

prisma mist
#

This used to work but broke, at least when doing it via shader graph, in 2022.3.11 or 12

I've tried reporting it via forums https://forum.unity.com/threads/2022-3-12-breaks-matrix4x4-override.1511819/ and a bug report IN-59424 but have had no response.

I just want to confirm if this is an actual bug or if it's intended you can not use material overrides with entities graphics and float4x4 and I just need to work around it

I was using it to pass animation data

sterile pumice
#

Looks like there has been a bug with a recent performance optimization that causes this.

#

Basically, the optimized version of the float4x4 loading function is not declared.

#

As a local workaround, if you are willing to use a modified package, you should be able to edit the UnityDOTSInstancing.hlsl file in the com.unity.render-pipelines.core package, and add the following function around line 517:

{
    uint address = ComputeDOTSInstanceDataAddressOverridden(metadata, 4 * 16);
    float4 p1 = asfloat(DOTSInstanceData_Load4(address + 0 * 16));
    float4 p2 = asfloat(DOTSInstanceData_Load4(address + 1 * 16));
    float4 p3 = asfloat(DOTSInstanceData_Load4(address + 2 * 16));
    float4 p4 = asfloat(DOTSInstanceData_Load4(address + 3 * 16));
    return float4x4(
        p1.x, p2.x, p3.x, p4.x,
        p1.y, p2.y, p3.y, p4.y,
        p1.z, p2.z, p3.z, p4.z,
        p1.w, p2.w, p3.w, p4.w);
}```
#

The bug is that the "Overridden" version of this function was missing.