在 Vulcan 中编译着色器,"Create a compile.bat file?" Windows 10 Visual Studio

Compiling shaders in Vulcan, "Create a compile.bat file?" Windows 10 Visual Studio

嗨,我在关注 this Vulkan tutorial,我只是不知道他们所说的

是什么意思

创建一个包含以下内容的 compile.bat 文件:

C:/VulkanSDK/x.x.x.x/Bin32/glslc.exe shader.vert -o vert.spv
C:/VulkanSDK/x.x.x.x/Bin32/glslc.exe shader.frag -o frag.spv
pause

这在“编译着色器”下的 link 中。

什么是 compile.bat 文件?我在哪里创建它?我尝试输入这些命令,但输入的是适当的版本,它只是说找不到 shader.frag 或 shader.vert,这是我按照教程指示在我的项目中创建的。我在 Windows 10.

上使用 Visual Studio

我认为这是假设我对本教程有一些命令行的了解,我没有大声笑我知道基本的东西,如 mkdir 和 cd,但仅此而已。看起来 .spv 文件必须进入我项目中的 shaders 目录,但这些命令不引用该目录。稍后,您只需从 vert.spv 和 frag.spv 中读取字节,例如 readFile("shaders/vert.spv") 那么 compile.bat 文件的用途是什么?谢谢。

@krOoze 在评论中帮助我:您在着色器文件夹中创建 compile.bat,将命令放在 compile.bat 文件中。然后,在文件资源管理器中打开您的项目并双击 .bat 文件以 运行 它。