[Mesa-dev] [Bug 36761] glGetAttachedObjects ignores maxcount

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon May 2 06:58:44 PDT 2011


--- Comment #1 from Brian Paul <brian.e.paul at gmail.com> 2011-05-02 06:58:44 PDT ---
Are you sure about this?  The code is as follows:

static void
get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount,
                     GLsizei *count, GLuint *obj)
   struct gl_shader_program *shProg =
      _mesa_lookup_shader_program_err(ctx, program, "glGetAttachedShaders");
   if (shProg) {
      GLuint i;
      for (i = 0; i < (GLuint) maxCount && i < shProg->NumShaders; i++) {
         obj[i] = shProg->Shaders[i]->Name;
      if (count)
         *count = i;

The maxCount parameter is used to limit the loop.

I also hacked a demo program to test this and didn't see any problem.

Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the mesa-dev mailing list