Skip to content

Compute shader error on Metal #3

Open
@Prin-E

Description

@Prin-E

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions