Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7842893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:25:36+00:00 2026-06-02T16:25:36+00:00

Using Radeon 3870HD I’ve run into strange behavior with AMD’s drivers (updated yesterday to

  • 0

Using Radeon 3870HD I’ve run into strange behavior with AMD’s drivers (updated yesterday to newest version available).

First of all I’d like to note that whole code ran without problem on NVIDIA GeForce 540M and that glGetUniformLocation isn’t failing all the time.

So my problem is that I get from glGetUniformLocation strange values with one of my shader programs used in app, while the other shader program doesn’t have such flaw. I switch that shaders between frames so I’m sure it isn’t temporary and is related to that shader. By strange values I mean something like 17-26, while I have only 9 uniforms present. I’m using my interface for shaders that afterwards queries for type of GLSL variable with just obtained variable and as side effect I also query its name. For all those 17-26 locations I got returned the name wasn’t set and same for type. Now I’ve got idea to debug into interface which is separate library and change those values to something I’d expect: 0-8. Using debugger I changed these and indeed they returned proper variable name in that shader and also type was correct.

My question is how possibly could the code that is working always with NVIDIA and also with that other shader on Radeon behave differently for another shader, that is treated the same way, fail?

I include related part of interface for this:

//this fails to return correct value
m_location = glGetUniformLocation(m_program.getGlID(), m_name.c_str());

printGLError();
if(m_location == -1){
    std::cerr << "ERROR: Uniform " << m_name <<  " doesn't exist in program" << std::endl;
    return FAILURE;
}

GLsizei charSize = m_name.size()+1, size = 0, length = 0;
GLenum type = 0;
GLchar* name = new GLchar[charSize];
name[charSize-1] = '\0';
glGetActiveUniform(m_program.getGlID(), m_location, charSize, &length, &size, &type, name); 

delete name; name = 0;

if(!TypeResolver::resolve(type, m_type))
    return FAILURE;

m_prepared = true;
m_applied = false;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:25:37+00:00Added an answer on June 2, 2026 at 4:25 pm

    The index you pass to glGetActiveUniform is not supposed to be a uniform location. Uniform locations are only used with glUniform calls; nothing else.

    The index you pass to glGetActiveUniform is just a index between 0 and the value returned by glGetProgram(GL_ACTIVE_UNIFORMS). It is used to ask what uniforms exist and to inspect the properties of those uniforms.

    Your code works on NVIDIA only because you got lucky. The OpenGL specification doesn’t guarantee that the order of uniform locations is the same as the order of active uniform indices. AMD’s drivers don’t work that way, so your code doesn’t work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using mercurial, I've run into an odd problem where a line from one committer
using opengl 3.3, radeon 3870HD, c++.. I got question about interleaved arrays of data.
Using C# for ASP.NET and MOSS development, we often have to embed JavaScript into
Using online interfaces to a version control system is a nice way to have
Specifying the GLSL version gives a syntax error when using LWJGL. I haven't tried
First, my OpenGL Information (I grabbed this at run time): OpenGL version=4.0.10243 Compatibility Profile
Using LINQ on collections, what is the difference between the following lines of code?
using (var file_stream = File.Create(users.xml)) { var serializer = new XmlSerializer(typeof(PasswordManager)); serializer.Serialize(file_stream, this); file_stream.Close();
Using Nunit, I want to be able to write a test fixture that will
Using a restful resource in Rails, I would like to be able to insert

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.