המדריך הזה מראה איך ליצור כותרות Vulkan C++ לכל מערכת הפעלה מארחת מקובצי ההצללה.
יצירת כותרות C++ מקובצי ההצללה
מורידים למחשב המקומי את הכליKhronos Group Glslang: מועמד ל-26 ביולי 2020.
מחלצים את הקבצים.
כדאי לבדוק את הגרסה שלה:
Windows
bin\glslangValidator --version
macOS
./bin/glslangValidator --version
Linux
./bin/glslangValidator --version
במאגר של Cardboard, מאתרים את התיקייה
sdk/rendering/android/shaders
ושומרים את הנתיב שלה.יוצרים את קובצי הכותרת Vulkan ב-C++:
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.