mkrebser / GPUInstance

Instancing & Animation library for Unity3D
Other
228 stars 44 forks source link

Packaging iOS to draw real-time point cloud will report an error,How to solve this problem? #16

Closed myningall closed 5 months ago

myningall commented 10 months ago

Xcode Packaging iOS to draw real-time point cloud will report an error: ArgumentException: The t parameter is a generic type. Parameter name: t at UnityEngine.Rendering.CommandBuffer.SetBufferData (UnityEngine.ComputeBuffer buffer, System.Array data, System.Int32 managedBufferStartIndex, System.Int32 graphicsBufferStartIndex, System.Int32 count) [0x00000] in <00000000000000000000000000000000>:0 at GPUInstance.InstanceMeshDeltaBuffer`1+InstanceMeshIndirectIDBuffer[T].UpdateComputeBuffer (UnityEngine.ComputeBuffer buffer, UnityEngine.Rendering.CommandBuffer cmd) [0x00000] in <00000000000000000000000000000000>:0 at GPUInstance.instancemesh.computeshader_UpdateDataTask (System.Boolean& force_dispatch) [0x00000] in <00000000000000000000000000000000>:0 at GPUInstance.instancemesh.Update (System.Single dt) [0x00000] in <00000000000000000000000000000000>:0 at GPUInstance.MeshInstancer.Update (System.Single deltaTime) [0x00000] in <00000000000000000000000000000000>:0 at PointCloudSubscriber.Update () [0x00000] in <00000000000000000000000000000000>:0

mkrebser commented 10 months ago

Yeah this library may not work on most mobile devices, they tend to have lots of limitations. It has not been tested with mobile devices. For a mobile device, you may need a simpler solution like just mapping animations in a texture.

Questions which are relevant to your use case:

Does your device support shader model 5.0?

https://github.com/mkrebser/GPUInstance/blob/28b05a802ca5d977996bedd5b0639296ad252ffa/Assets/Resources/GPUInstance/instancemeshdefault.shader#L17

Some devices are limited in the number of compute buffers they can have: https://docs.unity3d.com/Manual/class-ComputeShader.html