warning: extension `GL_ARB_gpu_shader5' unsupported...

790 views
Skip to first unread message

bobajeff

unread,
Mar 20, 2017, 3:17:54 PM3/20/17
to emscripten-discuss
I have a very simple GLES example that keeps giving me a warning about some unsupported shader extension in my shader info logs. As far as I can tell I'm not even using it.

The warnings look like:

0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in vertex shader

0:2(12): warning: extension `GL_ARB_gpu_shader5' unsupported in fragment shader

Here's the code:
#include <GLES2/gl2.h>
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif

#define __ALLWAYS_SHOW_SHADER_DEBUG_LOG__
#include "debug_gl.h"


GLFWwindow* window;

void main_loop();


int main()
{
    glfwInit
();
    window
= glfwCreateWindow(800, 600, "OpenGL ES", nullptr, nullptr);     // Windowed
    glfwMakeContextCurrent
(window);
   
       
// Shader sources
const GLchar* vertexSource =
   
"#version 100\n"
   
"attribute vec2 position;"
   
"void main()"
   
"{"
   
"    gl_Position = vec4(position, 0.0, 1.0);"
   
"}";
const GLchar* fragmentSource =
   
"#version 100\n"
   
"void main()"
   
"{"
   
"    gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);"
   
"}";
   
   
//Shader compile
   
GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);
    glShaderSource
(vertexShader, 1, &vertexSource, NULL);
    glCompileShader
(vertexShader);
   
GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
    glShaderSource
(fragmentShader, 1, &fragmentSource, NULL);
    glCompileShader
(fragmentShader);

    __CHECK_VSHADER
(vertexShader)
    __CHECK_FSHADER
(fragmentShader)
   
   
//Shader link
   
GLuint shaderProgram = glCreateProgram();
    glAttachShader
(shaderProgram, vertexShader);
    glAttachShader
(shaderProgram, fragmentShader);
    glLinkProgram
(shaderProgram);
    glUseProgram
(shaderProgram);
   
    __CHECK_SHADER_PROG
(shaderProgram)

   
//vertice data
   
float vertices[] = {
         
0.0f,  0.5f, // Vertex 1 (X, Y)
         
0.5f, -0.5f, // Vertex 2 (X, Y)
       
-0.5f, -0.5f  // Vertex 3 (X, Y)
   
};
   
   
//initialize buffers
   
GLuint vbo;
    glGenBuffers
(1, &vbo);
   
   
//send data to buffers
    glBindBuffer
(GL_ARRAY_BUFFER, vbo);
    glBufferData
(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
       
   
//Format of vertice data?
   
GLint posAttrib = glGetAttribLocation(shaderProgram, "position");
    glEnableVertexAttribArray
(posAttrib);
    glVertexAttribPointer
(posAttrib, 2, GL_FLOAT, GL_FALSE, 0, 0);
    __CHECK_GL_ERROR__
   
   
#ifdef __EMSCRIPTEN__
    emscripten_set_main_loop
(main_loop, 0, 1);
   
#else    
   
while(!glfwWindowShouldClose(window))
   
{
        main_loop
();
   
}
   
#endif

    glfwTerminate
();
   
return 0;
}

void main_loop()
{
    glDrawArrays
(GL_TRIANGLES, 0, 3);
   
    glfwSwapBuffers
(window);
    glfwPollEvents
();
   
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
    glfwSetWindowShouldClose
(window, GL_TRUE);
}



Jukka Jylänki

unread,
Mar 21, 2017, 9:00:05 AM3/21/17
to emscripte...@googlegroups.com
These look like browser bugs where internal WebGL->native GLSL shader translation introduces some warnings. Try creating a native WebGL test case and submit it to browser bug trackers, that should give some visibility to the issue. (or perhaps these issues might already have been reported to browsers, though can't recall having seen this exact message in a bug report)

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bobajeff

unread,
Mar 21, 2017, 3:05:58 PM3/21/17
to emscripten-discuss
I guess it is Firefox or the combination of my system and Firefox.

I was just wandering if I was using that extension without knowing it. I've modified one of the tests in tests/glbook to show the shader logs and it confirms that's not the case. This settles my concern thanks.

Reply all
Reply to author
Forward
0 new messages