為每個著色器產生 Vulkan 標頭檔案
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
本指南將說明如何透過著色器檔案,為每個主機 OS 產生 Vulkan C++ 標頭。
下載 Khronos Group Glslang Tool:2020 年 7 月 26 日候選人。
解壓縮。
查看版本:
Windows
bin\glslangValidator --version
macOS
./bin/glslangValidator --version
Linux
./bin/glslangValidator --version
在 Cardboard 存放區中,找出 sdk/rendering/android/shaders
資料夾並儲存路徑。
在 C++ 中產生 Vulkan 標頭檔案:
Windows
bin\glslangValidator -V --vn distortion_frag %SHADERS_FOLDER_PATH%\distortion.frag -o distortion_frag.spv.h
bin\glslangValidator -V --vn distortion_vert %SHADERS_FOLDER_PATH%\distortion.vert -o distortion_vert.spv.h
macOS
./bin/glslangValidator -V --vn distortion_frag $SHADERS_FOLDER_PATH/distortion.frag -o distortion_frag.spv.h
./bin/glslangValidator -V --vn distortion_vert $SHADERS_FOLDER_PATH/distortion.vert -o distortion_vert.spv.h
Linux
./bin/glslangValidator -V --vn distortion_frag $SHADERS_FOLDER_PATH/distortion.frag -o distortion_frag.spv.h
./bin/glslangValidator -V --vn distortion_vert $SHADERS_FOLDER_PATH/distortion.vert -o distortion_vert.spv.h
現在您應有 distortion_frag.spv.h 和 distortion_vert.spv.h。
保留所有權利。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-09 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-09-09 (世界標準時間)。"],[[["This guide provides instructions on generating Vulkan C++ header files from shader files for use in your application."],["You will need to download and install the Khronos Group Glslang tool to convert shader files into header files."],["The process involves locating your shader files and using the glslangValidator tool with specific commands to generate the corresponding header files."],["The generated header files, `distortion_frag.spv.h` and `distortion_vert.spv.h`, will contain the Vulkan-compatible code derived from your shaders."]]],[]]