Hello, I’m trying to write a compute shader to multithread part of my game, but when it automatically compiles, it gives me these errors:

Attached is the editor log.
I’m using 2020.3.32f1 on Win10.
I tried switching to the Vulkan pipeline, because DirectX has been giving my graphics card trouble recently, but the same error still persists.
Here is the shader code:
#pragma kernel ReadFileToArray //id 0
Texture2D textureToRead; //texture to extreact heightmap data from
RWBuffer<float> res; //resulting flat array
uint width = 256; //width of the image
//Read a chunk of the texture
[numthreads(8,8,1)]
void ReadFileToArray(uint3 id : SV_DispatchThreadID)
{
[unroll(256)] for (uint x = 0; x < width; x++) //columns
{
[unroll(256)] for (uint y = 0; y < width; y++) //rows
{
res[
((id.y * 8 + y) * width) + //get y position in flattened array
(id.x * 8) + x //add x position
] = textureToRead.Load(width - y, width - x); //Read texture
}
}
}
8023994–1033652–Editor.txt (85.4 KB)
