GLSL Shader Edit+Compile : Fails intermittently

Using the hot-mod GLSL shader edit+compile feature in the Nsight Graphics Frame Debugger this morning (2023.1.1.0 build 32702986)…

I’m getting intermittent compile failures after I add a GLSL source line to the shader … but only for the 1st click of “Compile Shader”. If I immediately re-click “Compile Shader”, then Nsight Graphics successfully compiles the shader and re-renders the frame with the modified version. The first error appears to be due to an Nsight Graphics bug.

Here’s the error Nsight Graphics shows in the “Compile Results” panel when it incorrectly fails the compile for the 1st click of the compile button:

0(2): error C7621: #extension directive must occur before any non-preprocessor token

This error makes no sense, as the only “#extension” in the shader is on line 2, immediately after the #version on line 1.

It’s as if Nsight Graphics mis-allocates or mis-copies some shader source buffer before tossing it to the GLSL compiler for the first compile attempt. But then “fixes” that on the 2nd compile attempt.

FWIW, the exact same thing happens if I comment out the new source line (preceding it with // and clicking the “Compile Shader” button). The first attempt fails with the same error. The second attempt succeeds and re-renders the frame with the new shader.

The added source line doesn’t matter, but fwiw it’s:

color = texture( baseTexture, baseTexcoord1 );