GLSL Error GL_EXT_gpu_shader4 not supported since latest Vulkan version

Hi all,

I’m porting a project over from an older version of Touch into the latest vulkan release and I’m getting a ‘#extension’ : extension not supported: GL_EXT_gpu_shader4’ error message.

First hit of google gives me this page: ubuntu - vtk error: extension `GL_EXT_gpu_shader4' unsupported in fragment shader - Stack Overflow but I don’t see how I could apply this to save my patch.

I’m specifically looking to adapt this file: GitHub - yeataro/TD-Anisotropic-Kuwahara: Jan Eric Kyprianidis' Anisotropic Kuwahara filter in TouchDesigner.

Does anyone have any tips or insight?


What happens if you just remove that line? What feature from that extension is needed that isn’t supported in the core GLSL 4.60?

Hi Malcom,

Thanks for the quick response. I was just about to delete this thread as I’ve found a solution. It involves replacing “textureSize2D” with “textureSize”, “texture2D” with “texture” and “uniform sampler2D src” with sTD2DInputs.

Now it works.


Hi, @owenkirby could you tell me how to use textureSize2D() please?


Just replace “textureSize2d” in your text box with “textureSize”.

1 Like

Hi Owen,
I’m also trying to update Anisotrophic Kuwahara - but I’m stuck on “replacing uniform sampler2D src” with sTD2DInputs.”

Can you show how that is done?

// by Jan Eric Kyprianidis <>
layout (location = 0) out vec4 fragColor;
extension GL_EXT_gpu_shader4 : enable

vec4 src = texture(sTD2DInputs[0],  <-- wrong

void main (void) {	
    vec2 src_size = vec2(textureSize(src, 0));
    vec2 uv = gl_FragCoord.xy / src_size;
    vec2 d = 1.0 / src_size;

    vec3 c = texture(src, uv).xyz;
    vec3 u = (
           -1.0 * texture(src, uv + vec2(-d.x, -d.y)).xyz +
           -2.0 * texture(src, uv + vec2(-d.x,  0.0)).xyz + 
           -1.0 * texture(src, uv + vec2(-d.x,  d.y)).xyz +
           +1.0 * texture(src, uv + vec2( d.x, -d.y)).xyz +
           +2.0 * texture(src, uv + vec2( d.x,  0.0)).xyz + 
           +1.0 * texture(src, uv + vec2( d.x,  d.y)).xyz
           ) / 4.0;

    vec3 v = (
           -1.0 * texture(src, uv + vec2(-d.x, -d.y)).xyz + 
           -2.0 * texture(src, uv + vec2( 0.0, -d.y)).xyz + 
           -1.0 * texture(src, uv + vec2( d.x, -d.y)).xyz +
           +1.0 * texture(src, uv + vec2(-d.x,  d.y)).xyz +
           +2.0 * texture(src, uv + vec2( 0.0,  d.y)).xyz + 
           +1.0 * texture(src, uv + vec2( d.x,  d.y)).xyz
           ) / 4.0;

    fragColor = vec4(dot(u, u), dot(v, v), dot(u, v), 1.0);

You can’t sample your texture outside of the main() function. This line:
vec3 c = texture(src, uv).xyz;
should be
vec3 c = texture(sTD2DInputs[0], uv).xyz;

1 Like

I have another shader that behaves differently in the current stable version (2022.35320) vs under 099 (2021.14360).

WARNING: /project1/GLOscope/osci_geom1:1: ‘extension’ : extension not supported: GL_EXT_geometry_shader4

099 - geometry shader looks correct - as a curved quad that follows the path of the SOP points. No warning.

2022.35320 - extension warning - it does not make a difference if I remove the extension line. Draws a series of triangles instead of quads.

layout(lines_adjacency) in;
layout(triangle_strip, max_vertices = 4) out;


GLSL requires that all outputs be written for each EmitVertex() call. You can’t assume the values you wrote to an output earlier in the shader will still be valid without re-writting it, even if it’s the same value. The results are undefined, Different GPUs and API will have different behaviors, including seeming to work.