Antoshidza / NSprites-Foundation

Basic assets for working with NSprites package
MIT License
65 stars 17 forks source link

Exception in WebGL build #9

Closed meditatingsloth closed 11 months ago

meditatingsloth commented 11 months ago

When running a WebGL build, I get the following error:

InvalidOperationException: BeginWrite requires a valid ComputeBuffer
  at UnityEngine.ComputeBuffer.BeginWrite[T] (System.Int32 computeBufferStartIndex, System.Int32 count) [0x00000] in <00000000000000000000000000000000>:0 

My scene has one entity using the sprite animation renderer. The sample can be seen here: https://github.com/meditatingsloth/Sandbox

Antoshidza commented 11 months ago

I'm sorry to bother you, but can you pls update to latest NSprites (v3.1.2), where I've added exception throwing when property tries to begin write to it's buffer more then 1 time per frame. It seems that Sarletor from NSprites discord had the similar problems with buffer and update heals it.

This exception throwed in editor or in development build only, so you may even build to WEBGL and try it.

meditatingsloth commented 11 months ago

I'm sorry to bother you, but can you pls update to latest NSprites (v3.1.2), where I've added exception throwing when property tries to begin write to it's buffer more then 1 time per frame. It seems that Sarletor from NSprites discord had the similar problems with buffer and update heals it.

This exception throwed in editor or in development build only, so you may even build to WEBGL and try it.

I've updated to the latest, but it unfortunately doesn't seem to fix the issue.

Antoshidza commented 11 months ago

I've described this issue in Compatibility wiki page. As we figured out in discord ComputeBuffer can't be used in WebGL even if it is 2.0. Though I have few ideas of how it can be avoided.