News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - revelator

#1
So no not related to idtech as such unless you count compilers :P
been working on fixing a rather bizarre bug in the TDM gcc compiler, first i found out that the dev used CreateMutex to lock the same named mutex in two places which ofc wont work as you would get the ERROR_ALLREADY_EXIST flag and the mutex would deadlock, so i rewrote that part but ran into a new bug which only seems to affect glib2 based sources like gdk-pixbuf2. turns out glib2 now also uses a mutex locking mechanism which collides with the one in TDM gcc basically deadlocking it again urgh... This should actually not be possible as far as i know as the TDM gcc code uses a named mutex with a unique identifier, so how it does this is beyond me unless they screwed up royally writing the locking code. so far all attempts at making it behave have met with failure and im at my wits end.
so if anyone wants to take a look feel free to contact me.
#2
little tidbit for systems like mine with more than 4gb of system memory.

in win_shared.cpp put this at the top ->

/* functions for the below */
typedef BOOL( WINAPI *PGetPhysicallyInstalledSystemMemory )( PULONGLONG TotalMemoryInKilobytes );
#define GPA( module, func ) ( PGetPhysicallyInstalledSystemMemory ) GetProcAddress( GetModuleHandle( module ), func )

/*
================
Sys_GetSystemMemory

description:
retrieves installed physical memory from bios
================
*/
static uint64_t Sys_GetSystemMemory( void )
{
/* This code only works on XP or older */
#if ( _WIN32_WINNT <= 0x501 )
MEMORYSTATUSEX statex;
statex.dwLength = sizeof( statex );
GlobalMemoryStatusEx( &statex );
uint64_t mem = static_cast<uint64_t>( statex.ullTotalPhys ) / 1024.0; /* else it would return bytes */
return mem;
#else
/* this works on vista and up */
ULONGLONG mem; /* physical memory installed (kb) */

PGetPhysicallyInstalledSystemMemory pFGetPhysicallyInstalledSystemMemory = GPA("kernel32.dll", "GetPhysicallyInstalledSystemMemory");

/* Uh oh... */
if ( !pFGetPhysicallyInstalledSystemMemory || !pFGetPhysicallyInstalledSystemMemory( &mem ) )
{
return 0;
}

/* Couldnt get system ram */
if ( !mem )
{
return 0;
}
return static_cast<uint64_t>( mem );
#endif
}


and replace Sys_GetSystemRam with this ->

uint64_t Sys_GetSystemRam( void )
{
    uint64_t physRam = Sys_GetSystemMemory() / 1024.0;
    physRam = ( physRam + 8 ) & ~15;
    return physRam;
}


remember to change it in the header as well since the original used int as a return value.

code will now correctly report your system ram on newer windows versions, the old code could only report 4 GB max.

and get rid of the video ram detection code it no longer works correctly and also suffers from the same limit,
you can only get videoram on modern gfx cards by using card specific codepaths like this ->

void idVertexCache::Show( void )
{
GLint  mem[4];

if ( GLEW_NVX_gpu_memory_info && ( glConfig.vendor == glvNVIDIA ) )
{
common->Printf( "\nNvidia specific memory info:\n" );
common->Printf( "\n" );
glGetIntegerv( GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX , mem );
common->Printf( "dedicated video memory %i MB\n", mem[0] >> 10 );
glGetIntegerv( GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX , mem );
common->Printf( "total available memory %i MB\n", mem[0] >> 10 );
glGetIntegerv( GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX , mem );
common->Printf( "currently unused GPU memory %i MB\n", mem[0] >> 10 );
glGetIntegerv( GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX , mem );
common->Printf( "count of total evictions seen by system %i MB\n", mem[0] >> 10 );
glGetIntegerv( GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX , mem );
common->Printf( "total video memory evicted %i MB\n", mem[0] >> 10 );
}
else if ( GLEW_ATI_meminfo && ( glConfig.vendor == glvAMD ) )
{
common->Printf( "\nATI/AMD specific memory info:\n" );
common->Printf( "\n" );
glGetIntegerv( GL_VBO_FREE_MEMORY_ATI, mem );
common->Printf( "VBO: total memory free in the pool %i MB\n", mem[0] >> 10 );
common->Printf( "VBO: largest available free block in the pool %i MB\n", mem[1] >> 10 );
common->Printf( "VBO: total auxiliary memory free %i MB\n", mem[2] >> 10 );
common->Printf( "VBO: largest auxiliary free block %i MB\n", mem[3] >> 10 );
glGetIntegerv( GL_TEXTURE_FREE_MEMORY_ATI, mem );
common->Printf( "Texture: total memory free in the pool %i MB\n", mem[0] >> 10 );
common->Printf( "Texture: largest available free block in the pool %i MB\n", mem[1] >> 10 );
common->Printf( "Texture: total auxiliary memory free %i MB\n", mem[2] >> 10 );
common->Printf( "Texture: largest auxiliary free block %i MB\n", mem[3] >> 10 );
glGetIntegerv( GL_RENDERBUFFER_FREE_MEMORY_ATI, mem );
common->Printf( "RenderBuffer: total memory free in the pool %i MB\n", mem[0] >> 10 );
common->Printf( "RenderBuffer: largest available free block in the pool %i MB\n", mem[1] >> 10 );
common->Printf( "RenderBuffer: total auxiliary memory free %i MB\n", mem[2] >> 10 );
common->Printf( "RenderBuffer: largest auxiliary free block %i MB\n", mem[3] >> 10 );
}
else
{
common->Printf( "MemInfo not availabled for your video card or driver!\n" );
}
}


and sadly this only works on nvidia and AMD.
#3
Strutt your stuff! / insideqc gone or ?
December 01, 2019, 08:13:35 AM
No longer able to access the forum section of the site (blank page comes up).
Maintainance or did it just die ?
#4
Strutt your stuff! / TDM version of gcc-9.2.0
November 28, 2019, 01:22:21 PM
I allmost gave up on this when i made my last update to my codeblocks + msys2 / mingw64 compiler (gcc-7.4.0 at that time).
To many changes to how the compiler did stuff and in a bad need for updates to the shared memory interface used for supporting exceptions thrown from static libraries.

I took another look a few days ago, and was finally succesfull in updating the patches needed.

gcc now has full support for C++17 (i had to update the libstdc++ makefiles for them to accept the TDM patchset but it works now).

My own compiler has grown to preposterous sizes since i started work on this so it is not avaliable for download unless you are comfortable waiting on a 300gb+ download from FTP :P
It does sport everything under the sun but the size is not that fun.

So i can upload the gcc-9.2.0 packages to my sourceforge site and those who still use my older versions can then use pacman to update the old gcc (warning you also need binutils-2.33 which i will also upload).