- Home /
Question by
Benjames · Sep 09, 2020 at 12:50 AM ·
serializationsave datacompute shaderstructbuffer
How to save ComputeBuffer?
I have a computebuffer that holds non-blittable types that I would like to save in some way. Ideally I would want them to serialize and never release.
struct Grid{
float3 vert[15];
float4 col[15];
int index;
};
RWStructuredBuffer<Grid> pp;
//in the object script i try this
[SerializeField]public ComputeBuffer gridBuffer;
The buffer is in a 3D grid type format with a fixed length equaling width*height*length. So I could make 31 seperate buffers representing the data in the struct that way it can be passed back as a blittable type but this solution seems less then ideal.
Comment
Your answer
Follow this Question
Related Questions
Copying references via Compute Buffers to shaders 0 Answers
Version Tolerant Serialization with Unity ? 1 Answer
Saving data to export it later 0 Answers
Get Asset at runtime by its ID 0 Answers