Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sokol-shdc won't compile shader with samplerExternalOES #42

Open
oviano opened this issue Oct 28, 2020 · 0 comments
Open

sokol-shdc won't compile shader with samplerExternalOES #42

oviano opened this issue Oct 28, 2020 · 0 comments

Comments

@oviano
Copy link

oviano commented Oct 28, 2020

@vs ext_vs
in vec4 position;
in vec2 texcoord0;
out vec2 uv;

void main()
{
    gl_Position = position;
    uv = texcoord0;
}
@end

/* ext fragment shader */
@fs ext_fs
#extension GL_OES_EGL_image_external : require
uniform samplerExternalOES ext_fs_tex;

in vec2 uv;
out vec4 frag_color;

void main()
{
	frag_color = texture(ext_fs_tex, uv);
}
@end

/* ext shader program */
@program ext ext_vs ext_fs

Two issues:

  1. it states it requires GL_OES_EGL_image_external_essl3 even when compiling for glsl100.
  2. it cannot find a match for the texture() call.

If I manually embed the shader source below into an sokol app, it works fine. This is what I would have expected sokol-shdc to output. I had a look through the code, and it seems like it ought to work as the version of the glsl code it is using does recognise this extension.

    #version 100
    #extension GL_OES_EGL_image_external : require
    precision mediump float;
    precision highp int;
    
    uniform highp samplerExternalOES ext_fs_tex;
    
    varying highp vec2 uv;
    
    void main()
    {
        gl_FragData[0] = texture2D(ext_fs_tex, uv);
    }
@oviano oviano changed the title sokol-shadc won't compile shader with samplerExternalOES sokol-shdc won't compile shader with samplerExternalOES Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant