Put all glslang internals (but not the external interface) into the glslang namespace.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22882 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
23bdb29eac
commit
b603f918a4
55 changed files with 511 additions and 463 deletions
|
|
@ -45,24 +45,24 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
|||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
|
||||
if (!InitProcess())
|
||||
if (! glslang::InitProcess())
|
||||
return FALSE;
|
||||
break;
|
||||
case DLL_THREAD_ATTACH:
|
||||
|
||||
if (!InitThread())
|
||||
if (! glslang::InitThread())
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
|
||||
if (!DetachThread())
|
||||
if (! glslang::DetachThread())
|
||||
return FALSE;
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
|
||||
DetachProcess();
|
||||
glslang::DetachProcess();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@
|
|||
#error Trying to include a windows specific file in a non windows build.
|
||||
#endif
|
||||
|
||||
namespace glslang {
|
||||
|
||||
//
|
||||
// Thread Local Storage Operations
|
||||
//
|
||||
|
|
@ -56,18 +58,18 @@ bool OS_FreeTLSIndex(OS_TLSIndex nIndex);
|
|||
|
||||
void* OS_GetTLSValue(OS_TLSIndex nIndex);
|
||||
|
||||
namespace glslang {
|
||||
void InitGlobalLock();
|
||||
void GetGlobalLock();
|
||||
void ReleaseGlobalLock();
|
||||
void InitGlobalLock();
|
||||
void GetGlobalLock();
|
||||
void ReleaseGlobalLock();
|
||||
|
||||
typedef unsigned int (__stdcall *TThreadEntrypoint)(void*);
|
||||
void* OS_CreateThread(TThreadEntrypoint);
|
||||
void OS_WaitForAllThreads(void* threads, int numThreads);
|
||||
typedef unsigned int (__stdcall *TThreadEntrypoint)(void*);
|
||||
void* OS_CreateThread(TThreadEntrypoint);
|
||||
void OS_WaitForAllThreads(void* threads, int numThreads);
|
||||
|
||||
void OS_Sleep(int milliseconds);
|
||||
void OS_Sleep(int milliseconds);
|
||||
|
||||
void OS_DumpMemoryCounters();
|
||||
};
|
||||
void OS_DumpMemoryCounters();
|
||||
|
||||
} // end namespace glslang
|
||||
|
||||
#endif // __OSINCLUDE_H
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@
|
|||
#error Trying to build a windows specific file in a non windows build.
|
||||
#endif
|
||||
|
||||
namespace glslang {
|
||||
|
||||
//
|
||||
// Thread Local Storage Operations
|
||||
//
|
||||
|
|
@ -97,44 +99,44 @@ bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
|
|||
return false;
|
||||
}
|
||||
|
||||
namespace glslang {
|
||||
HANDLE GlobalLock;
|
||||
HANDLE GlobalLock;
|
||||
|
||||
void InitGlobalLock()
|
||||
{
|
||||
GlobalLock = CreateMutex(0, false, 0);
|
||||
}
|
||||
void InitGlobalLock()
|
||||
{
|
||||
GlobalLock = CreateMutex(0, false, 0);
|
||||
}
|
||||
|
||||
void GetGlobalLock()
|
||||
{
|
||||
WaitForSingleObject(GlobalLock, INFINITE);
|
||||
}
|
||||
void GetGlobalLock()
|
||||
{
|
||||
WaitForSingleObject(GlobalLock, INFINITE);
|
||||
}
|
||||
|
||||
void ReleaseGlobalLock()
|
||||
{
|
||||
ReleaseMutex(GlobalLock);
|
||||
}
|
||||
void ReleaseGlobalLock()
|
||||
{
|
||||
ReleaseMutex(GlobalLock);
|
||||
}
|
||||
|
||||
void* OS_CreateThread(TThreadEntrypoint entry)
|
||||
{
|
||||
return (void*)_beginthreadex(0, 0, entry, 0, 0, 0);
|
||||
//return CreateThread(0, 0, entry, 0, 0, 0);
|
||||
}
|
||||
void* OS_CreateThread(TThreadEntrypoint entry)
|
||||
{
|
||||
return (void*)_beginthreadex(0, 0, entry, 0, 0, 0);
|
||||
//return CreateThread(0, 0, entry, 0, 0, 0);
|
||||
}
|
||||
|
||||
void OS_WaitForAllThreads(void* threads, int numThreads)
|
||||
{
|
||||
WaitForMultipleObjects(numThreads, (HANDLE*)threads, true, INFINITE);
|
||||
}
|
||||
void OS_WaitForAllThreads(void* threads, int numThreads)
|
||||
{
|
||||
WaitForMultipleObjects(numThreads, (HANDLE*)threads, true, INFINITE);
|
||||
}
|
||||
|
||||
void OS_Sleep(int milliseconds)
|
||||
{
|
||||
Sleep(milliseconds);
|
||||
}
|
||||
void OS_Sleep(int milliseconds)
|
||||
{
|
||||
Sleep(milliseconds);
|
||||
}
|
||||
|
||||
void OS_DumpMemoryCounters()
|
||||
{
|
||||
PROCESS_MEMORY_COUNTERS counters;
|
||||
GetProcessMemoryInfo(GetCurrentProcess(), &counters, sizeof(counters));
|
||||
printf("Working set size: %d\n", counters.WorkingSetSize);
|
||||
}
|
||||
};
|
||||
void OS_DumpMemoryCounters()
|
||||
{
|
||||
PROCESS_MEMORY_COUNTERS counters;
|
||||
GetProcessMemoryInfo(GetCurrentProcess(), &counters, sizeof(counters));
|
||||
printf("Working set size: %d\n", counters.WorkingSetSize);
|
||||
}
|
||||
|
||||
} // namespace glslang
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue