Error calling glGetTexImage (atioglxx.dll)

I am having a difficult problem on some ATI cards (Radeon X1650, X1550 + and others).

Message: "Access violation at address 6959DD46 in the module" atioglxx.dll. Reading address 00000000 "

This happens on this line:

glGetTexImage(GL_TEXTURE_2D,0,GL_RGBA,GL_FLOAT,P);

Note:

  • The latest graphics drivers are installed.
  • It works great on other cards.

Here is what I have tried so far (with statements in the code):

  • That the pointer P is valid and allocates enough memory to hold the image
  • Texturing enabled: glIsEnabled (GL_TEXTURE_2D)
  • Check that the current bound texture is the one I expect: glGetIntegerv (GL_TEXTURE_2D_BINDING)
  • Check that the bound texture has the expected dimensions: glGetTexLevelParameteriv (GL_TEXTURE_WIDTH / HEIGHT)
  • , : glGetError

, .

, , . , - GL- !

EDIT:

, , , , , : http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=295137#Post295137

GL_PACK_ALIGNMENT, .

, , , glCopyTexSubImage2D. , glCopyTexSubImage2d glReadPixels, glTexImage2D.

:

{
  glCopyTexSubImage2D cannot be used here because the combination of calling
  glCopyTexSubImage2D and then later glGetTexImage on the same texture causes
  a crash in atioglxx.dll on ATI Radeon X1650 and X1550.
  Instead we copy to the main memory first and then update.
}
//    glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, PixelWidth, PixelHeight);  //**
GetMem(P, PixelWidth * PixelHeight * 4);
glReadPixels(0, 0, PixelWidth, PixelHeight, GL_RGBA, GL_UNSIGNED_BYTE, P);
SetMemory(P,GL_RGBA,GL_UNSIGNED_BYTE);
+5
2

GL_PACK_ALIGNEMENT. , . , 645 :

  • GL_PACK_ALIGNEMENT 4 ( ) 648 .
  • GL_PACK_ALIGNEMENT 1, 645 .

, :

glPixelStorei(GL_PACK_ALIGNMENT, 1)

glGetTexImage() GL_PACK_ALIGNEMENT.

+1

. 3D-apis, , . - , : ​​8 . . , , . , , - , . float 8- . GL api . , , float, RGBA. 8 , float?

0

All Articles