UnityGraphicsProgramming icon indicating copy to clipboard operation
UnityGraphicsProgramming copied to clipboard

Compute shader error on Metal

Open Prin-E opened this issue 5 years ago • 0 comments

I'm using 2018.3.6f1, MacBook Pro. I found out that some compute shaders are not correctly compiled on Metal because the lines of #pragma kernel contain comments. Unity shows error like "Macro names must be identifiers at kernel [KERNEL_NAME] metal :00".

ex) Boids.compute

// カーネル関数を指定
#pragma kernel ForceCS      // 操舵力を計算
#pragma kernel IntegrateCS  // 速度, 位置を計算

When I remove comments at the right, I can run samples without problems.

// カーネル関数を指定
#pragma kernel ForceCS
#pragma kernel IntegrateCS

Maybe it's Unity bug but I think it's safe to delete comments after #pragma kernel lines.

Prin-E avatar Mar 08 '19 16:03 Prin-E