Visual Studio sets shader (CG, GLSL) syntax prompts and highlights and displays line numbers
date
Sep 17, 2022
slug
post1
status
Published
tags
Program
Graphics
summary
[Vulkan/OpenGL]GLSL language integration plugin configuration
type
Post
支持Vulkan/OpenGL
一、GLSL language integration插件安装
编译环境:vs2022
支持版本:vs2017、vs2019、vs2022
扩展->管理拓展->搜索GLSL language integration,点击下载使用,重启vs安装

vs下得慢可以在这里下:GLSL language integration (vsixgallery.com)
保存在磁盘中,关闭vs,双击安装

二、添加 Vulkan 支持
配置完插件后,发现插件只支持 OpenGL 相关的关键字/变量
想要支持 Vulkan 相关的(比如:gl_VertexIndex、推送常量等等)
在工具->选项 中按照以下内容对插件进行配置:
.png?table=block&id=9b43d5fb-83b9-4d75-8289-0a2cb30ef218&cache=v2)
–target-env vulkan1.2
%VK_SDK_PATH%\\Bin\\glslangValidator.exe
注意: VK_SDK_PATH 这个环境变量要装了 LunarG 的 SDK 才有(装的时候自动生成的)。总之给出 glslangValidator 的路径就是了