Skip to content

xcode, 修改shader内依赖文件, 无法及时生效 #357

@luxiaodong

Description

@luxiaodong

xcode, 修改shader内依赖文件, 无法及时生效

复现方法
打开 mesh_lighting.inl,随便输入 xxxxxx

预期行为
xcode 编译出错

实际行为
xcode 编译成功

Desktop | 桌面环境

  • OS: macOS
  • Version Big Sur
  • CPU Intel
  • Compiler xCode 12.4,debug模式

Additional context | 补充信息
单独在xcode里编译PiccoloShaderCompile也是成功的。
将Build Phases内的 脚本直接在终端运行可以出现报错。如下
shadow-MacBook-Pro:shader shadow$
/Users/shadow/Project/Git/Piccolo/engine/3rdparty/VulkanSDK/bin/MacOS/glslangValidator -I/Users/shadow/Project/Git/Piccolo/engine/shader/include -V100 -o /Users/shadow/Project/Git/Piccolo/engine/shader/generated/spv/mesh.frag.spv /Users/shadow/Project/Git/Piccolo/engine/shader/glsl/mesh.frag
/Users/shadow/Project/Git/Piccolo/engine/shader/glsl/mesh.frag
ERROR: /Users/shadow/Project/Git/Piccolo/engine/shader/include/mesh_lighting.inl:119: 'xxxxxx' : undeclared identifier
ERROR: /Users/shadow/Project/Git/Piccolo/engine/shader/include/mesh_lighting.inl:122: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.

将Build Phases内的 脚本在Xcode添加一条echo, 也能报错。
感觉是xcode哪里做了缓存导致的

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions