This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Issue with array of uniforms in Shader Code

I am working on GLES program using ARM GLES3.0 Emulator ver 1.4.

I want to print all active uniform detail.


I ahve 25 active Uniform in my shader code, out of these 25 uniforms, second uniform is array of uniform 'uniformArray[100]'.


But when I iterate through active uniforms to see detail of each uniform, itstarts giving garbage values after first 25 uniforms( i.e after activeUniform1, uniformArray[0], uniformArray[1], uniformArray[2],... uniformArray[23] )


Please confirm if it was an issue with EGL 1.4


Parents
  • Hello SUNIL!,

    From the information you've submitted, I cannot confirm a problem with querying active uniforms in Emulator 1.4.0 and 1.4.1 releases.

    Can you give us more information about how you iterate over it?

    Relevant portions of your shaders and application code maybe?

    Please also let us know which exactly version of the Emulator you are using. When unsure, use glGetString(GL_RENDERER) to get the version info.

    In addition, please include and run he following code right after you've linked you program:

        GLint numUniforms = 0;
        GL_CHECK(glGetProgramiv(uiProgram, GL_ACTIVE_UNIFORMS, &numUniforms));
        printf("--------------------\nList of active uniforms:\n");
        for (int i = 0; i < numUniforms; i++)
        {
            // now -iteratuing through uniforms
            GLchar name[256] = { 0 };
            GLsizei len = 0;
            GLint size = 0;
            GLenum type = 0;
            GL_CHECK(glGetActiveUniform(uiProgram, i, 256, &len, &size, &type, name));
            printf("Uniform: %s, size: %d\n", name, size);
        }
    

    And let us know console output printed,

    This will help us to get closer to you particular problem.

    Thanks

    Adam

Reply
  • Hello SUNIL!,

    From the information you've submitted, I cannot confirm a problem with querying active uniforms in Emulator 1.4.0 and 1.4.1 releases.

    Can you give us more information about how you iterate over it?

    Relevant portions of your shaders and application code maybe?

    Please also let us know which exactly version of the Emulator you are using. When unsure, use glGetString(GL_RENDERER) to get the version info.

    In addition, please include and run he following code right after you've linked you program:

        GLint numUniforms = 0;
        GL_CHECK(glGetProgramiv(uiProgram, GL_ACTIVE_UNIFORMS, &numUniforms));
        printf("--------------------\nList of active uniforms:\n");
        for (int i = 0; i < numUniforms; i++)
        {
            // now -iteratuing through uniforms
            GLchar name[256] = { 0 };
            GLsizei len = 0;
            GLint size = 0;
            GLenum type = 0;
            GL_CHECK(glGetActiveUniform(uiProgram, i, 256, &len, &size, &type, name));
            printf("Uniform: %s, size: %d\n", name, size);
        }
    

    And let us know console output printed,

    This will help us to get closer to you particular problem.

    Thanks

    Adam

Children