Hi, I run into problems building on Mac and get the error when doing cloud builds for mac platforms
One of our employees developing on mac also runs into a similar issue when using the Mac editor.
The weirdest thing is that the specific shader does render and functions properly, but other shaders, which used to work fine, don’t anymore.
The problem started happening when we used a compute buffer in the specified shader using a
RWStructuredBuffer<int> _outputBuffer : register(u1);
The only pragma/includes for that shader are:
#pragma vertex vert
#pragma fragment frag
#pragma target 4.5
#include "UnityCG.cginc"
Further in the shader, in the frag portion, I write to the buffer as such:
_outputBuffer[p0.x + dim.x*p0.y] = 16;
For initialization, from the CPU side in a monobehavior, I have the following code:
internalsBuffer = new ComputeBuffer(interns_width*interns_height, sizeof(int), ComputeBufferType.Default);
Graphics.SetRandomWriteTarget(1, internalsBuffer, true);
interns_mat.SetBuffer(OutputBuffer, internalsBuffer);
At some point in that monobehavior, I read from that same buffer using
var array = new int[interns_width*interns_height];
internalsBuffer.GetData( array, 0, 0, interns_width*interns_height);
And everything works fine and functions properly in the editor and on Windows builds.
But like mentionned, my employee using the Mac editor, and the Mac Universal cloud build have problems where that individual shader, and the reading of the computeBuffer results works fine and as expected, but other shaders, especially ones using shaderGraph, breaks.
We tried a few things, but with no avail, and after reading through all of the documentation regarding compatibility rules with the Metal API, we’re at a bit of a loss.
Is there something we overlooked or missed?
I’m glad to try any ideas anyone has