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

@@ -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;