I just applied those two fixes to kekkos part of kjliews combined patch. I'll update ECE with it when a new SVN comes out.
Thanks for keeping this up to date for the rest of us, it's very much appreciated.
I'm attaching a tiny patch that also looks for glide2x.ovl in the user config directory (e.g. ~/.dosbox). This was more convenient for me than moving files to the system. Perhaps it's useful to you, too.
Hi everyone,
I found some time to set up again my compiler environment.
This is an updated patch against current svn.
- fixes minor compiling issues
- fixes a major video memory leak in Quake2 and Descent2
Quake2 uses sort of dynamic textures for realtime lighting, changing existing textures thus invalidating textures cache and forcing to reload them.
Descent 2 writes to existing textures for animations and fonts.
The fix adds a glDeleteTextures in function voodoo_ogl_texture_clear, which is called when a texture is invalidated due to a write.
There is still a performance issue because of texture caching during explosions or gun firing.
If anyone has an idea of how efficiently handle textures in the above scenarios please let me know here.
@kekko, i just updated the patch to the latest version on the ppa, and it failed building. I think it's because of a path separator thing in a header include, and i'm going to edit the patch to see if it is, but i thought you should know:
I don't know if the forward slash also works in windows, but i have the idea that it's possible and it would be something where the compilers would prefer to allow.
the 'expected' typedef or define seems to be (from grep):
src/debug/debug_disasm.cpp:typedef Bit32s INT32;
since this appears to only be defined in the debug path i'm not sure how it even compiles in other places, if it even does. I'm reverting to the old version until these linux miscompiles are fixed.
Has anyone been able to get the latest version of the patch (voodoo_20200616) working in Linux or MacOS?
I am using MacOS Mojave and I was able to apply the patch to SVN 4441 without any errors.
When I first tried to compile, it came up with this error:
1pci_bus.cpp:29:10: fatal error: '..\ints\int10.h' file not found 2#include "..\ints\int10.h"
I then changed the "\" to "/" and tried again.
Second time around it comes up with this:
1voodoo_opengl.cpp:1796:57: error: cannot initialize a parameter of type 'GLhandleARB' (aka 'void *') with an lvalue of type 'UINT32' 2 (aka 'unsigned int') 3 if (info->so_vertex_shader >= 0) glDetachObjectARB(info->so_shader_program, info->so_vertex_shader); 4 ^~~~~~~~~~~~~~~~~~~~~~~ 5voodoo_opengl.cpp:1797:59: error: cannot initialize a parameter of type 'GLhandleARB' (aka 'void *') with an lvalue of type 'UINT32' 6 (aka 'unsigned int') 7 if (info->so_fragment_shader >= 0) glDetachObjectARB(info->so_shader_program, info->so_fragment_shader); 8 ^~~~~~~~~~~~~~~~~~~~~~~ 9voodoo_opengl.cpp:1798:57: error: cannot initialize a parameter of type 'GLhandleARB' (aka 'void *') with an lvalue of type 'UINT32' 10 (aka 'unsigned int') 11 if (info->so_vertex_shader >= 0) glDeleteObjectARB(info->so_vertex_shader); 12 ^~~~~~~~~~~~~~~~~~~~~~ 13voodoo_opengl.cpp:1799:59: error: cannot initialize a parameter of type 'GLhandleARB' (aka 'void *') with an lvalue of type 'UINT32' 14 (aka 'unsigned int') 15 if (info->so_fragment_shader >= 0) glDeleteObjectARB(info->so_fragment_shader); 16 ^~~~~~~~~~~~~~~~~~~~~~~~ 17voodoo_opengl.cpp:1800:24: error: cannot initialize a parameter of type 'GLhandleARB' (aka 'void *') with an lvalue of type 'UINT32' 18 (aka 'unsigned int') 19 glDeleteObjectARB(info->so_shader_program);
I think you had issues with header files inclusion, particularly SDL_opengl.h. Someone had provided the solution for Linux compile here at VOGONS. You could probably do a search. Both my 64-bit version on Windows 10 and Linux compiled fine with the latest patch.
I have had success in applying the above Linux-specific version of the patch to the latest SVN 4441 in macOS.
It patches cleanly (with -p1), except for two lines in the /include/video.h file which I manually inserted.
I also had to edit /src/hardware/voodoo_opengl.cpp as follows:
The references to UINT32 need to be altered:
1/* use this shader */ 2 glUseProgramObjectARB(m_hProgramObject); 3 extra->info->so_shader_program=(UINT32)m_hProgramObject; 4 extra->info->so_vertex_shader=(UINT32)m_hVertexShader; 5 extra->info->so_fragment_shader=(UINT32)m_hFragmentShader;
As follows:
1/* use this shader */ 2 glUseProgramObjectARB(m_hProgramObject); 3 extra->info->so_shader_program=(uintptr_t)m_hProgramObject; 4 extra->info->so_vertex_shader=(uintptr_t)m_hVertexShader; 5 extra->info->so_fragment_shader=(uintptr_t)m_hFragmentShader;
All tested and working fine.
I still have to figure out why the very latest patch is failing in macOS.
The errors I get for "UINT32" from the new patch (as reported in my earlier post) reference multiple lines in voodoo_opengl.cpp that do not actually contain "UINT32". So, it is not obvious where to make the replacement/s with "unintptr_t".
So yes, it is probably header related.. if I am successful in resolving that one I will report back, but I am happy enough with the earlier patch working.