VSIX Project that provides GLSL language integration.

Overview

GLSL language integration (for VS2017, 2019 and 2022)

Build status

Download this extension from


VSIX Project that provides GLSL language integration. Includes syntax highlighting, code completion (OpenGL 4.6 + identifiers in shader file), error tagging with squiggles and in error list (error list support is very alpha). Error tagging uses a separate OpenGL thread that compiles the shader on the primary graphics card. You can also select an external compiler executable to use for this purpose in the options menu. Please see section "External comiler" for details.

See the change log for changes and road map.

Features

  • Syntax highlighting (default file extensions: glsl, frag, vert, geom, comp, tese, tesc, mesh, task, rgen, rint, rmiss, rahit, rchit, rcall) Set color under Options (Fonts and Colors)
  • Code completion (OpenGL 4.6 keywords + all identifiers in shader file)
  • Outlining
  • Error tagging with squiggles and in error list (error list support is very alpha)
    • For the file extension glsl the extension tries to auto detect the type of shader you use based on reserved words used in the shader code.
    • Note that GLSL_NV_ray_tracing shader types support for error tagging is currently only provided via an external compiler (like glslangValidator).
    • Note that support for Vulkan shader types is currently only provided via an external compiler (like glslangValidator).
    • Auto-detection of shader stage: If you use the glsl file extension the source code is searched for keywords only used in certain shader stages.
  • Configurable (file extensions, code compilation, highlighting style, compiler)
  • Controlling the extension with comments (see below)

Configuration (extension options)

  • Options of the extension can be found via the Visual Studio options dialog (Tools -> Options -> glsl language integration).
  • Configure Fonts and Colors via "Environment" -> "Fonts and Colors"). All "Display Items" of the extension start with GLSL.

Controlling the extension with comments

The original idea is from Clocktown. The discussion can be found under #15.

When developing shaders, it is common to split one shader into multiple files, reuse files, and generally generate some parts of code in the application in order to make things easier.

Unfortunately, this does not go well with extensions like this that compile these files without any knowledge about what happens on the side of the application. One way around this are special comments //! and //? that are transformed into code before compiling.

Some examples:

//! #version 430
//! #define WORK_GROUP_SIZE 32
#include "/utils.glsl" //! #include "../include/utils.glsl"

compiles into

#version 430
#define WORK_GROUP_SIZE 32
#include "../include/utils.glsl"

Everything in the line in front of the //! is removed and replaced by the code in the comment. //! is always expanded to code, while //? is only expanded if the file being compiled has not been included, e.g.:

File A.glsl

//? #version 430 // Only expanded if this file is compiled directly, not when included in B.glsl
// Lots of utility functions

File B.glsl

//! #version 430
#include "/utils.glsl" //! #include "A.glsl"

External compiler

In the option menu you can set a file path and arguments to an external compiler. If an existing path is given compilations will be executed by starting the given executable. You can use environment variables, like %SystemDrive% in your arguments and path. The shader code (including include code and all substitutions) will be written into a temporary file named "shader.vert|frag|comp|..." (extensions follow glslangValidator standard) in the current users temp path. This temporary shader file is then used as the first argument to the external compiler executable.

Errors and questions

Please us the GitHub Issue function to report errors or ask questions.

Contribute

Check out the contribution guidelines if you want to contribute to this project.

For cloning and building this project yourself, make sure to install the Extensibility Tools 2015 extension for Visual Studio which enables some features used by this project.

License

Apache 2.0

Issues
  • Support for glslc parsing

    Support for glslc parsing

    now there remains the other issue that your extension has been targeting parsing glslangValidator output not glslc and glslangValidator doesn't really seem to honor -I, -V nor make any assumptions about the shader's stage

    Originally posted by @devshgraphicsprogramming in https://github.com/danielscherzer/GLSL/issues/58#issuecomment-638237281

    opened by danielscherzer 20
  • Add Visual Studios 2020 Support

    Add Visual Studios 2020 Support

    This pull adds support for installing the extension in visual studio 2022 by splitting the project into 3 distinct projects(currently retains the old one for now, but it's not counted here); A Shared Items Project for the code that the 2 executables share(100% at the moment) A x86 Project for building the x86 vsix for vs2017-2019. A x64 Project for building the x64 vsix for vs2022(and up)

    this pull also cleans up some of the code, removing whitespaces and formatting the code files to be more consistent.

    feel free to try download on of the vsix build of the extension from my fork of the repo and try them! feedback is needed, and you can report issues with those builds in my fork's issues until it gets merged here.

    I have an issue open for feedback too Here

    opened by TheEndHunter 18
  • No more error tagging with squiggles

    No more error tagging with squiggles

    Installed product versions

    • Visual Studio: 2017 Community
    • This extension: 0.10.111

    Steps to recreate

    update to lastest version

    Current behavior

    there is no more error tagging with squiggles, syntaxe highlight is still here and error list is still here too. I've uninstall and reinstall the add-on several time to see if it fix it or not, even with both Market place and CLI build but it seem to have nothing. tried in a new projet, also nothing.

    opened by Cewein 18
  • Using Raw string literal breaks GLSL highlighting.

    Using Raw string literal breaks GLSL highlighting.

    Installed product versions

    • Visual Studio 2017 Community
    • This extension: 0.5.67

    Description

    I want to include my shader code as follows:

    const GLchar* sFragmentShaderCode_ = #include "myShader.frag"

    That works fine when I use a Raw string literal, which makes the first line of myShader.frag this: R"( Unfortunately, GLSL Language Integration doesn't show highlighting because of that line.

    Steps to recreate

    See above.

    Current behavior

    See above. Maybe it's not wrong, but how can I get highlighting when the first line of the shader code is R"( ?

    Expected behavior

    Highlight my shader code even if the first line is R"(

    opened by Raivr-dev 15
  • Undeclared identifier gl_Position

    Undeclared identifier gl_Position

    Installed product versions

    • Visual Studio: 2017 Professional
    • This extension: 0.2.36
    • OS: Windows 10 Pro 64bit

    Description

    When assigning a vector to gl_Position, I always get the two errors:

    'gl_Position': undeclared identifier
    'assign': cannot convert from '4-component vector of highp float' to 'highp float'
    

    The compiler seems to not know gl_Position, but curiously it also thinks that it's a float.

    Steps to recreate

    1. Use any vertex shader. E.g.:
    #version 330 core
    
    in vec3 v_position;
    
    void main() 
    {
        gl_Position = vec4(v_position, 1);
    }
    

    Current behavior

    The errors from above are displayed.

    Expected behavior

    It should not display any errors.

    opened by RunDevelopment 12
  • Could not find the Microsoft.VisualC.CppClassifierProvider. Installing the C++ Visual Studio aspect should help.

    Could not find the Microsoft.VisualC.CppClassifierProvider. Installing the C++ Visual Studio aspect should help.

    Installed product versions

    • Visual Studio: 2019 Professional 16.4.0 Preview 4.0
    • This extension: 0.6.78

    Description

    Error message doing almost anything "Could not find the Microsoft.VisualC.CppClassifierProvider. Installing the C++ Visual Studio aspect should help."

    Steps to recreate

    1. Try and do most things (opening and viewing files)
    2. Message box with error

    I believe this is related to this issue but not sure if this is a bug on their end or an API change required on yours.

    opened by Yen 11
  • using EnvVars in external compiler path

    using EnvVars in external compiler path

    It would be nice if you could use environment variables in the file path of the external compiler.

    The external compiler is often used to support the Vulkan and Google include extensions and the required glslangValidator is usually installed with the LunarG Vulkan SDK. Unfortunately, the version number is in the path, so the option in the GLSL extension has to be adjusted with every update.

    Possible spellings could be $(EnvVar) or %EnvVar%:

    $(VULKAN_SDK)\Bin\glslangValidator.exe
    
    %VULKAN_SDK%\Bin\glslangValidator.exe
    
    opened by spfuetzner 10
  • Adding file extensions that are already in use

    Adding file extensions that are already in use

    Installed product versions

    • Visual Studio: [2017 Enterprise]
    • This extension: [example 0.2.33]

    Description

    Adding .vsh or .fsh file extentions in the options leads to errors upon opening a project. (Adding other file extensions like .tcsh or .tesh works just fine). ActivityLog.xml says the file extension is registered twice. Unfortunately I was not able to find out where they were already registered. Clean install of VS2017 with C++ and Graphics tools, but no further plugins.

    Steps to recreate

    1. Install GLSL plugin
    2. Add .vsh or .fsh to the file extensions
    3. Open a project containing such files

    Current behavior

    Throws errors upon loading the project and does not highlight the files with the

    Expected behavior

    Open the project and correctly display the files (highlighting, completion, etc.)

    opened by detzt 10
  • [Feedback Request]Added Support for VS2022

    [Feedback Request]Added Support for VS2022

    I have created a fork of the repo Here and made a branch with the feature added as a preview if people wish to check it out first and see if it is a good fit for a pull request. it builds with no issues and can be installed(Marked as preview since the Vs2022 nugets are previews) and I am in the process of testing it so feedback is appreciated.

    A few other changes I made are updating to .net4.8 and cleaning up some of the message/warnings from the complier output.

    [edit 22/08/2021] I Have Since split the project into 3 to support still having vs2017 along side vs2019 in there own sub project, and vs2022 as it's own project, see the pull request Here

    other than those changes the code is identical to the previous versions.

    opened by TheEndHunter 9
  • Custom colors for new or redefined funcs

    Custom colors for new or redefined funcs

    Installed product versions

    • Visual Studio: 2017 Community
    • This extension: 0.5.63

    Description

    how to set the color for texture2DRect or any redefined funcs? Like #define texLod textureLod

    opened by barnes14 9
  • `glVertexIndex` not supported

    `glVertexIndex` not supported

    Installed product versions

    • Visual Studio: [2017 Community]
    • This extension: [0.2]

    Description

    This extensions says me there is an error when i write gl_VertexIndex but when i compile the shader there is no error.

    Steps to recreate

    1. Write gl_VertexIndex

    Current behavior

    It says me an error so i can't code properly.

    Expected behavior

    It should say me nothing..

    enhancement help wanted 
    opened by Faymoon 8
  • gl_LaunchSizeEXT keyword is not detected, yet gl_LaunchSizeEX is

    gl_LaunchSizeEXT keyword is not detected, yet gl_LaunchSizeEX is

    Installed product versions

    • Visual Studio: 2022 Community
    • This extension: 0.11.159

    Description

    gl_LaunchSizeEXT keyword is not detected, yet gl_LaunchSizeEX incorrectly is. gl_LaunchSizeEX is not a keyword.

    Current behavior

    gl_LaunchSizeEX is being highlighted as a keyword (wrong)

    Expected behavior

    gl_LaunchSizeEXT should be highlighted as a keyword

    opened by DrNoodles 0
  •  Isn't working on .glsl files

    Isn't working on .glsl files

    Installed product versions

    • Visual Studio: [2022 Community]
    • This extension: [example 0.11.159]

    Description

    cannot register file extension (.glsl) image

    Steps to recreate

    Unknown, using Jetbrains ReSharper along side

    Current behavior

    Isn't working on .glsl files

    Expected behavior

    should work on .glsl files

    opened by lalishansh 3
  • Feature request: Native support for float16_t and related types

    Feature request: Native support for float16_t and related types

    Installed product versions

    • Visual Studio: 2022 Community
    • This extension: GLSL Language Integration version 0.11.158

    Description

    This is a feature request for native support for intellisence for the float16_t (and related types).

    Steps to recreate

    1. Replace this
    2. text with
    3. the steps
    4. to recreate

    Current behavior

    I'm using the glsl extension GL_AMD_gpu_shader_half_float. Although the shader happily compiles to spir-v using glslangValidator, I get squiggly lines and VS2022 intellisense complains about the type with a syntax error. The shader program also executes flawlessly.

    Expected behavior

    It would be wonderful to have the float16_t (and f16vec2 et. al.) supported natively.

    opened by smileyofoz 11
  • Does not work with VS 2022

    Does not work with VS 2022

    Installed product versions

    • Visual Studio: Community 2022
    • This extension: 0.11.158

    Description

    Replace this text with a short description

    Steps to recreate

    1. Install the 2022 version of the extension
    2. Launch VS 2022
    3. Error message pops up
    4. "The 'Microsoft.VisualStudio.Editor.Implementation.EditorPackage' package did no load correctly"

    Current behavior

    VS 2022 breaks entirely and can't compile anything after installing this extension

    Activity log pointed at by the error message: ActivityLog.zip

    opened by ComeOnAndSam 7
  • Column marker for //TODO disappeared

    Column marker for //TODO disappeared

    • Visual Studio: 2019 enterprise
    • This extension: 0.11.156 After upgrading from 0.10.124, the green + sign on the left column that marks //TODO in the code has disappeared
    opened by kyamant 1
  • Minimising/Collapsing Functions Is Erratic!

    Minimising/Collapsing Functions Is Erratic!

    Installed product versions

    • Visual Studio: Microsoft Visual Studio Community 2022 (64-bit) Version 17.0.5

    Description

    When clicking the "-" or "+" to collapse or expand functions, then often it'll un-collapse some of the already collapsed functions. Also, sometimes the "-" "+" box is missing, especially when having collapsed all but one functions, in which case the final function often cannot be collapsed because the little box isn't there.

    Steps to recreate

    1. As described in the above description.

    Current behavior

    As described in the above description.

    Expected behavior

    Collapsing or expanding any function should simply be independent of all other functions, and the "-" "+" boxes should always be showing.

    opened by GaryDT 1
Releases(0.11.160)
Owner
Daniel Scherzer
Daniel Scherzer
⚔️ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.

A cross compiler for shader languages. Convert between SPIR-V, GLSL / GLSL ES, HLSL, Metal Shader Language, or older versions of a given language. Cross Shader wraps glslang and SPIRV-Cross, exposing a simpler interface to transpile shaders.

Alain Galvan 157 Jun 23, 2022
LLVM IR and optimizer for shaders, including front-end adapters for GLSL and SPIR-V and back-end adapter for GLSL

Licensing LunarGLASS is available via a three clause BSD-style open source license. Goals The primary goals of the LunarGLASS project are: Reduce the

LunarG, Inc. 151 Jun 18, 2022
GLSL optimizer based on Mesa's GLSL compiler. Used to be used in Unity for mobile shader optimization.

GLSL optimizer ⚠️ As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a different shader compilati

Aras Pranckevičius 1.5k Jun 23, 2022
X-CUBE-AZRTOS-F4 (Azure RTOS Software Expansion for STM32Cube) provides a full integration of Microsoft Azure RTOS in the STM32Cube environment for the STM32F4 series of microcontrollers.

X-CUBE-AZRTOS-F4 Azure RTOS Software Expansion for STM32Cube With Azure RTOS complementing the extensive STM32Cube ecosystem providing free developmen

STMicroelectronics 21 Jun 3, 2022
X-CUBE-AZRTOS-F7 (Azure RTOS Software Expansion for STM32Cube) provides a full integration of Microsoft Azure RTOS in the STM32Cube environment for the STM32F7 series of microcontrollers.

X-CUBE-AZRTOS-F7 Azure RTOS Software Expansion for STM32Cube With Azure RTOS complementing the extensive STM32Cube ecosystem providing free developmen

STMicroelectronics 3 Apr 21, 2022
HLSL to GLSL language translator based on ATI's HLSL2GLSL. Used in Unity.

HLSL to GLSL shader language translator ⚠️ As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a d

Aras Pranckevičius 512 Jun 21, 2022
this is my simple voxel engine, appart from librairies like glad it is entierly written in C++ and GLSL

simple-voxel-raycaster this is my simple voxel engine, appart from librairies like glad it is entierly written in C++ and GLSL here is a gif: https://

null 1 Jun 4, 2022
glsl code blocks for org-mode

GLSL code blocks for Emacs Org-mode This org-mode extension adds the capability to run GLSL code blocks directly from inside Emacs and immediately dis

null 27 Jun 14, 2022
HLSL Parser and Translator for HLSL, GLSL, and MSL.

HLSLParser This is a fork of Unknownworld's hlslparser adapted to our needs in The Witness. We currently use it to translate pseudo-HLSL shaders (usin

null 2 May 19, 2020
HLSL Parser and Translator for HLSL, GLSL, and MSL.

HLSLParser This is a fork of Unknownworld's hlslparser adapted to our needs in The Witness. We currently use it to translate pseudo-HLSL shaders (usin

null 310 May 28, 2022
Simple printf functionality for GLSL.

Simple printf functionality for GLSL. This library is a simple proof of concept of using printf directly from a shader. The main point of being able

null 200 Jun 19, 2022
Minify and obfuscate GLSL or HLSL code

Shader Minifier Shader Minifier is a tool that minifies and obfuscates shader code (GLSL and HLSL). Its original use-case is for the demoscene, for op

Laurent Le Brun 219 Jun 23, 2022
Shader cross compiler to translate HLSL (Shader Model 4 and 5) to GLSL

XShaderCompiler ("Cross Shader Compiler") Features Cross compiles HLSL shader code (Shader Model 4 and 5) into GLSL Simple to integrate into other pro

Lukas Hermanns 342 Jun 20, 2022
An efficient texture-free GLSL procedural noise library

Wombat An efficient texture-free GLSL procedural noise library Source: https://github.com/BrianSharpe/Wombat Derived from: https://github.com/BrianSha

Brian Sharpe 192 Jun 21, 2022
Fast glsl deNoise spatial filter, with circular gaussian kernel, full configurable

glslSmartDeNoise Fast glsl spatial deNoise filter, with circular gaussian kernel and smart/flexible/adaptable -> full configurable: Standard Deviation

Michele Morrone 190 Jun 26, 2022
Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.

News Visual Studio 2013 is no longer supported As scheduled, Microsoft Visual Studio 2013 is no longer officially supported. Please upgrade to at leas

The Khronos Group 2.2k Jun 25, 2022
A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files

HLSL Tools for Visual Studio This extension is for Visual Studio 2017 / 2019. Go here for the Visual Studio Code extension. HLSL Tools is a Visual Stu

Tim Jones 398 Jun 22, 2022
Language that provides an abstraction to a PART of GTK difficulty

Welcome to GPP_COMPILER Language that provides an abstraction to a PART of GTK difficulty . To get projet on your computer, clone it using the followi

null 9 Jan 28, 2022