opengl: Bug fixes for opengl mesa software rendering.

This commit is contained in:
Rod Kay
2024-04-24 18:15:27 +10:00
parent ef35111c0a
commit e202ce548d
9 changed files with 75 additions and 35 deletions

View File

@@ -235,11 +235,13 @@ is
End_1 => [0.0, 0.0, 0.0],
End_2 => [5.0, 5.0, 0.0]);
the_collada_Model : constant Model.any.view
:= Model.any.new_Model (--Scale => (1.0, 1.0, 1.0),
Model => to_Asset ("assets/opengl/model/human.dae"),
Texture => the_Texture,
Texture_is_lucid => False);
-- The collada model requires 'Desktop' openGL build mode.
--
-- the_collada_Model : constant Model.any.view
-- := Model.any.new_Model (--Scale => (1.0, 1.0, 1.0),
-- Model => to_Asset ("assets/opengl/model/human.dae"),
-- Texture => the_Texture,
-- Texture_is_lucid => False);
the_wavefront_Model : constant Model.any.view
:= Model.any.new_Model (--Scale => (1.0, 1.0, 1.0),
@@ -267,6 +269,7 @@ is
the_segment_line_Model : constant Model.segment_line.view
:= Model.segment_line.new_segment_line_Model (Color => Green);
-- Terrain
--
heights_File : constant asset_Name := to_Asset ("assets/opengl/terrain/kidwelly-terrain.png");
@@ -318,7 +321,7 @@ is
the_rounded_hexagon_column_Model.all'Access,
the_line_Model.all'Access,
the_collada_Model.all'Access,
-- the_collada_Model.all'Access,
the_wavefront_Model.all'Access,
the_segment_line_Model.all'Access];

View File

@@ -29,23 +29,23 @@ is
GL_TEXTURE12,
GL_TEXTURE13,
GL_TEXTURE14,
GL_TEXTURE15,
GL_TEXTURE16,
GL_TEXTURE17,
GL_TEXTURE18,
GL_TEXTURE19,
GL_TEXTURE20,
GL_TEXTURE21,
GL_TEXTURE22,
GL_TEXTURE23,
GL_TEXTURE24,
GL_TEXTURE25,
GL_TEXTURE26,
GL_TEXTURE27,
GL_TEXTURE28,
GL_TEXTURE29,
GL_TEXTURE30,
GL_TEXTURE31);
GL_TEXTURE15);
-- GL_TEXTURE16,
-- GL_TEXTURE17,
-- GL_TEXTURE18,
-- GL_TEXTURE19,
-- GL_TEXTURE20,
-- GL_TEXTURE21,
-- GL_TEXTURE22,
-- GL_TEXTURE23,
-- GL_TEXTURE24,
-- GL_TEXTURE25,
-- GL_TEXTURE26,
-- GL_TEXTURE27,
-- GL_TEXTURE28,
-- GL_TEXTURE29,
-- GL_TEXTURE30,
-- GL_TEXTURE31);

View File

@@ -9,7 +9,10 @@ package openGL.texture_Set
-- Facilitates texturing of geometries.
--
is
max_Textures : constant := 32;
--- Note that Mesa currently only supports 16 texture units.
--
-- max_Textures : constant := 32;
max_Textures : constant := 16;
type texture_Id is range 1 .. max_Textures;

View File

@@ -121,8 +121,12 @@ is
if Status = 0
then
declare
use ada.Text_IO;
compile_Log : constant String := Self.shader_info_Log;
begin
new_Line;
put_Line ("Shader compile log:");
put_Line (compile_Log);
Self.destroy;
raise Error with "'" & to_Ada (the_Source) & "' compilation failed ~ " & compile_Log;
end;
@@ -147,8 +151,34 @@ is
procedure define (Self : in out Item; Kind : in Shader.Kind;
shader_Snippets : in asset_Names)
is
use ada.Text_IO,
interfaces.C;
the_Source : aliased constant C.char_array := to_C_char_array (shader_Snippets);
begin
-- if Debug
-- then
new_Line;
put_Line ("Shader snippets:");
for Each of shader_Snippets
loop
put_Line (to_String (Each));
end loop;
new_Line;
new_Line;
new_Line;
new_Line;
put_Line ("Shader source code:");
put_Line (to_Ada (the_Source));
put_Line ("End source code!");
new_Line;
new_Line;
new_Line;
new_Line;
-- end if;
create_Shader (Self, Kind, the_Source);
end define;