View Issue Details

IDProjectCategoryView StatusLast Update
0037368FPCPackagespublic2020-07-16 12:37
ReporterChris Rorden Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformMacBook 2012 Retina 13"OSDarwin 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0037368: Load_GL_version_1_2x not run for OpenGL > 1.2
DescriptionIf one calls Load_GL_version_X_Y, it should sequentially install itself and all early versions. For example
 Load_GL_version_2_1 invokes Load_GL_version_2_0x which invokes Load_GL_version_1_5x which invokes Load_GL_version_1_4x which invokes Load_GL_version_1_3x. However, Load_GL_version_1_3x FAILS to invoke Load_GL_version_1_2x. Therefore, functions defined in OpenGL 1.2 are not defined when the user loads higher versions. This is incorrect, as OpenGL versions 1.2..2.1 are a superset of prior versions (OpenGL 3.3 core removed deprecated functions, though retain classic functions like OpenGL 1.2's glTexImage3D.xml). Consider:

 https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTexImage3D.xml
  glTexImage3D is available only if the GL version is 1.2 or greater.
 https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glTexSubImage3D.xml
  glTexSubImage3D is available only if the GL version is 1.2 or greater.
 
However, "Load_GL_version_2_1 " will fail to assign glTexSubImage3D(). This can be fixed by calling "Load_GL_version_1_2x" from the last line in Load_GL_version_1_3x

 procedure Load_GL_version_1_3x(var allOK: Boolean);
begin
...
  if not Assigned(glGetCompressedTexImage) then allOK := false;
  Load_GL_version_1_2x(allOK);
end;
Steps To ReproduceThe code below will report
  Load_GL_version_2_1 did not assign glTexImage3D!
  The ugly kludge has assigned glTexImage3D!
  
----------------------------------
  if not Load_GL_version_2_1 then
       writeln('Unable to load OpenGL v2.1: ');
    if not Assigned(glTexImage3D) then
       writeln('Load_GL_version_2_1 did not assign glTexImage3D!');
    glext_LoadExtension('GL_version_1_2'); //required for glTexSubImage3D
    if not Assigned(glTexImage3D) then
       writeln('glext_LoadExtension(GL_version_1_2) did not assign glTexImage3D!')
    else
        writeln('The ugly kludge has assigned glTexImage3D!');
TagsNo tags attached.
Fixed in Revision45796
FPCOldBugId
FPCTarget3.2.2
Attached Files

Activities

Michael Van Canneyt

2020-07-16 09:48

administrator   ~0124079

Fixed as proposed, thanks for reporting !

Issue History

Date Modified Username Field Change
2020-07-15 23:00 Chris Rorden New Issue
2020-07-16 09:48 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-07-16 09:48 Michael Van Canneyt Status new => resolved
2020-07-16 09:48 Michael Van Canneyt Resolution open => fixed
2020-07-16 09:48 Michael Van Canneyt Fixed in Version => 3.3.1
2020-07-16 09:48 Michael Van Canneyt Fixed in Revision => 45796
2020-07-16 09:48 Michael Van Canneyt FPCTarget => 3.2.2
2020-07-16 09:48 Michael Van Canneyt Note Added: 0124079
2020-07-16 12:37 Chris Rorden Status resolved => closed