Commit a6778bbe by Nicolas Capens Committed by Nicolas Capens

Merge libEGL into libRAD.

Bug 18621031 Change-Id: I9a0cc1864bb573aef48a851e8094c6f675a3395b Reviewed-on: https://swiftshader-review.googlesource.com/1592Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 241b77ba
LIBRARY libEGL
EXPORTS
eglBindAPI @14
eglChooseConfig @7
eglCopyBuffers @33
eglCreateContext @23
eglCreatePbufferFromClientBuffer @18
eglCreatePbufferSurface @10
eglCreatePixmapSurface @11
eglCreateWindowSurface @9
eglDestroyContext @24
eglDestroySurface @12
eglGetConfigAttrib @8
eglGetConfigs @6
eglGetCurrentContext @26
eglGetCurrentDisplay @28
eglGetCurrentSurface @27
eglGetDisplay @2
eglGetError @1
eglGetProcAddress @34
eglInitialize @3
eglMakeCurrent @25
eglQueryAPI @15
eglQueryContext @29
eglQueryString @5
eglQuerySurface @13
eglReleaseThread @17
eglSurfaceAttrib @19
eglSwapBuffers @32
eglSwapInterval @22
eglTerminate @4
eglWaitClient @16
eglWaitGL @30
eglWaitNative @31
; Functions that don't change the error code, for use by client APIs
clientGetCurrentContext
clientGetCurrentDisplay
\ No newline at end of file
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include <windows.h>
#include "../../common/Version.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"#include ""../common/version.h""\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION MAJOR_VERSION,MINOR_VERSION,BUILD_VERSION,BUILD_REVISION
PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,BUILD_VERSION,BUILD_REVISION
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "SwiftShader libEGL Dynamic Link Library"
VALUE "FileVersion", VERSION_STRING
VALUE "InternalName", "libEGL"
VALUE "LegalCopyright", "Copyright (C) 2012 TransGaming Inc."
VALUE "OriginalFilename", "libEGL.dll"
VALUE "PrivateBuild", VERSION_STRING
VALUE "ProductName", "SwiftShader libEGL Dynamic Link Library"
VALUE "ProductVersion", VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG1 DIALOGEX 0, 0, 129, 47
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Waiting for debugger"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
PUSHBUTTON "Cancel",IDCANCEL,72,26,50,14
LTEXT "Attach a debugger or ESC to cancel",IDC_STATIC,7,7,115,8
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_DIALOG1, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 122
TOPMARGIN, 7
BOTTOMMARGIN, 40
END
END
#endif // APSTUDIO_INVOKED
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Config.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Common\debug.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Display.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="libEGL.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Surface.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Display.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="main.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Surface.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\EGL\egl.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\EGL\eglext.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\EGL\eglplatform.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\common\debug.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Context.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Texture2D.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Image.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="libEGL.rc" />
</ItemGroup>
<ItemGroup>
<None Include="libEGL.def" />
</ItemGroup>
</Project>
\ No newline at end of file
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2013 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
// main.cpp: DLL entry point and management of thread-local data.
#include "main.h"
#include "resource.h"
#include "Common/Thread.hpp"
#include "Common/SharedLibrary.hpp"
#include "common/debug.h"
static sw::Thread::LocalStorageKey currentTLS = TLS_OUT_OF_INDEXES;
#if !defined(_MSC_VER)
#define CONSTRUCTOR __attribute__((constructor))
#define DESTRUCTOR __attribute__((destructor))
#else
#define CONSTRUCTOR
#define DESTRUCTOR
#endif
static void eglAttachThread()
{
TRACE("()");
egl::Current *current = new egl::Current;
if(current)
{
sw::Thread::setLocalStorage(currentTLS, current);
current->error = EGL_SUCCESS;
current->API = EGL_OPENGL_ES_API;
current->display = EGL_NO_DISPLAY;
current->drawSurface = EGL_NO_SURFACE;
current->readSurface = EGL_NO_SURFACE;
current->context = EGL_NO_CONTEXT;
}
}
static void eglDetachThread()
{
TRACE("()");
egl::Current *current = (egl::Current*)sw::Thread::getLocalStorage(currentTLS);
if(current)
{
delete current;
}
}
CONSTRUCTOR static bool eglAttachProcess()
{
TRACE("()");
#if !defined(ANGLE_DISABLE_TRACE)
FILE *debug = fopen(TRACE_OUTPUT_FILE, "rt");
if(debug)
{
fclose(debug);
debug = fopen(TRACE_OUTPUT_FILE, "wt"); // Erase
fclose(debug);
}
#endif
currentTLS = sw::Thread::allocateLocalStorageKey();
if(currentTLS == TLS_OUT_OF_INDEXES)
{
return false;
}
eglAttachThread();
#if defined(_WIN32)
const char *libRAD_lib = "libRAD.dll";
#else
const char *libRAD_lib = "libRAD.so";
#endif
libRAD = loadLibrary(libRAD_lib);
es2::createContext = (egl::Context *(*)(const egl::Config*, const egl::Context*))getProcAddress(libRAD, "glCreateContext");
rad::getProcAddress = (__eglMustCastToProperFunctionPointerType (RADAPIENTRY *)(const char*))getProcAddress(libRAD, "radGetProcAddress");
es2::createBackBuffer = (egl::Image *(*)(int, int, const egl::Config*))getProcAddress(libRAD, "createBackBuffer");
es2::createDepthStencil = (egl::Image *(*)(unsigned int, unsigned int, sw::Format, int, bool))getProcAddress(libRAD, "createDepthStencil");
es2::createFrameBuffer = (sw::FrameBuffer *(*)(EGLNativeDisplayType, EGLNativeWindowType, int, int))getProcAddress(libRAD, "createFrameBuffer");
return libRAD != 0;
}
DESTRUCTOR static void eglDetachProcess()
{
TRACE("()");
eglDetachThread();
sw::Thread::freeLocalStorageKey(currentTLS);
freeLibrary(libRAD);
}
#if defined(_WIN32)
static INT_PTR CALLBACK DebuggerWaitDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
RECT rect;
switch(uMsg)
{
case WM_INITDIALOG:
GetWindowRect(GetDesktopWindow(), &rect);
SetWindowPos(hwnd, HWND_TOP, rect.right / 2, rect.bottom / 2, 0, 0, SWP_NOSIZE);
SetTimer(hwnd, 1, 100, NULL);
return TRUE;
case WM_COMMAND:
if(LOWORD(wParam) == IDCANCEL)
{
EndDialog(hwnd, 0);
}
break;
case WM_TIMER:
if(IsDebuggerPresent())
{
EndDialog(hwnd, 0);
}
}
return FALSE;
}
static void WaitForDebugger(HINSTANCE instance)
{
if(!IsDebuggerPresent())
{
HRSRC dialog = FindResource(instance, MAKEINTRESOURCE(IDD_DIALOG1), RT_DIALOG);
DLGTEMPLATE *dialogTemplate = (DLGTEMPLATE*)LoadResource(instance, dialog);
DialogBoxIndirect(instance, dialogTemplate, NULL, DebuggerWaitDialogProc);
}
}
extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{
switch(reason)
{
case DLL_PROCESS_ATTACH:
if(false)
{
WaitForDebugger(instance);
}
return eglAttachProcess();
break;
case DLL_THREAD_ATTACH:
eglAttachThread();
break;
case DLL_THREAD_DETACH:
eglDetachThread();
break;
case DLL_PROCESS_DETACH:
eglDetachProcess();
break;
default:
break;
}
return TRUE;
}
#endif
namespace egl
{
static Current *eglGetCurrent(void)
{
Current *current = (Current*)sw::Thread::getLocalStorage(currentTLS);
if(!current)
{
eglAttachThread();
}
return (Current*)sw::Thread::getLocalStorage(currentTLS);
}
void setCurrentError(EGLint error)
{
Current *current = eglGetCurrent();
current->error = error;
}
EGLint getCurrentError()
{
Current *current = eglGetCurrent();
return current->error;
}
void setCurrentAPI(EGLenum API)
{
Current *current = eglGetCurrent();
current->API = API;
}
EGLenum getCurrentAPI()
{
Current *current = eglGetCurrent();
return current->API;
}
void setCurrentDisplay(EGLDisplay dpy)
{
Current *current = eglGetCurrent();
current->display = dpy;
}
EGLDisplay getCurrentDisplay()
{
Current *current = eglGetCurrent();
return current->display;
}
void setCurrentContext(EGLContext ctx)
{
Current *current = eglGetCurrent();
current->context = ctx;
}
EGLContext getCurrentContext()
{
Current *current = eglGetCurrent();
return current->context;
}
void setCurrentDrawSurface(EGLSurface surface)
{
Current *current = eglGetCurrent();
current->drawSurface = surface;
}
EGLSurface getCurrentDrawSurface()
{
Current *current = eglGetCurrent();
return current->drawSurface;
}
void setCurrentReadSurface(EGLSurface surface)
{
Current *current = eglGetCurrent();
current->readSurface = surface;
}
EGLSurface getCurrentReadSurface()
{
Current *current = eglGetCurrent();
return current->readSurface;
}
}
void error(EGLint errorCode)
{
egl::setCurrentError(errorCode);
if(errorCode != EGL_SUCCESS)
{
switch(errorCode)
{
case EGL_NOT_INITIALIZED: TRACE("\t! Error generated: not initialized\n"); break;
case EGL_BAD_ACCESS: TRACE("\t! Error generated: bad access\n"); break;
case EGL_BAD_ALLOC: TRACE("\t! Error generated: bad alloc\n"); break;
case EGL_BAD_ATTRIBUTE: TRACE("\t! Error generated: bad attribute\n"); break;
case EGL_BAD_CONFIG: TRACE("\t! Error generated: bad config\n"); break;
case EGL_BAD_CONTEXT: TRACE("\t! Error generated: bad context\n"); break;
case EGL_BAD_CURRENT_SURFACE: TRACE("\t! Error generated: bad current surface\n"); break;
case EGL_BAD_DISPLAY: TRACE("\t! Error generated: bad display\n"); break;
case EGL_BAD_MATCH: TRACE("\t! Error generated: bad match\n"); break;
case EGL_BAD_NATIVE_PIXMAP: TRACE("\t! Error generated: bad native pixmap\n"); break;
case EGL_BAD_NATIVE_WINDOW: TRACE("\t! Error generated: bad native window\n"); break;
case EGL_BAD_PARAMETER: TRACE("\t! Error generated: bad parameter\n"); break;
case EGL_BAD_SURFACE: TRACE("\t! Error generated: bad surface\n"); break;
case EGL_CONTEXT_LOST: TRACE("\t! Error generated: context lost\n"); break;
default: TRACE("\t! Error generated: <0x%X>\n", errorCode); break;
}
}
}
extern "C"
{
EGLContext clientGetCurrentContext()
{
return egl::getCurrentContext();
}
EGLContext clientGetCurrentDisplay()
{
return egl::getCurrentDisplay();
}
}
namespace es2
{
egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext) = 0;
egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config) = 0;
egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard) = 0;
sw::FrameBuffer *(*createFrameBuffer)(EGLNativeDisplayType display, EGLNativeWindowType window, int width, int height) = 0;
}
namespace rad
{
__eglMustCastToProperFunctionPointerType (RADAPIENTRY *getProcAddress)(const char *procname) = 0;
}
void *libRAD = 0; // Handle to the libRAD module
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
// main.h: Management of thread-local data.
#ifndef LIBEGL_MAIN_H_
#define LIBEGL_MAIN_H_
#define EGLAPI
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <RAD/rad.h>
namespace egl
{
struct Current
{
EGLint error;
EGLenum API;
EGLDisplay display;
EGLContext context;
EGLSurface drawSurface;
EGLSurface readSurface;
};
void setCurrentError(EGLint error);
EGLint getCurrentError();
void setCurrentAPI(EGLenum API);
EGLenum getCurrentAPI();
void setCurrentDisplay(EGLDisplay dpy);
EGLDisplay getCurrentDisplay();
void setCurrentContext(EGLContext ctx);
EGLContext getCurrentContext();
void setCurrentDrawSurface(EGLSurface surface);
EGLSurface getCurrentDrawSurface();
void setCurrentReadSurface(EGLSurface surface);
EGLSurface getCurrentReadSurface();
}
void error(EGLint errorCode);
template<class T>
const T &error(EGLint errorCode, const T &returnValue)
{
error(errorCode);
return returnValue;
}
template<class T>
const T &success(const T &returnValue)
{
egl::setCurrentError(EGL_SUCCESS);
return returnValue;
}
namespace egl
{
class Config;
class Surface;
class Display;
class Context;
class Image;
}
namespace sw
{
class FrameBuffer;
enum Format : unsigned char;
}
// libRAD dependencies
namespace es2
{
extern egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext);
extern egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config);
extern egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
extern sw::FrameBuffer *(*createFrameBuffer)(EGLNativeDisplayType display, EGLNativeWindowType window, int width, int height);
}
namespace rad
{
extern __eglMustCastToProperFunctionPointerType (RADAPIENTRY *getProcAddress)(const char *procname);
}
extern void *libRAD; // Handle to the libRAD module
#endif // LIBEGL_MAIN_H_
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by libEGL.rc
//
#define IDD_DIALOG1 101
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include "Program.h" #include "Program.h"
#include "Shader.h" #include "Shader.h"
#include "Texture.h" #include "Texture.h"
#include "libEGL/Display.h" #include "Display.h"
#include "libEGL/Surface.h" #include "Surface.h"
#include "Common/Half.hpp" #include "Common/Half.hpp"
#include <EGL/eglext.h> #include <EGL/eglext.h>
...@@ -704,7 +704,7 @@ void Context::applyState(GLenum drawMode) ...@@ -704,7 +704,7 @@ void Context::applyState(GLenum drawMode)
mState.stencilMask != mState.stencilBackMask) mState.stencilMask != mState.stencilBackMask)
{ {
ERR("Separate front/back stencil writemasks, reference values, or stencil mask values are invalid under WebGL."); ERR("Separate front/back stencil writemasks, reference values, or stencil mask values are invalid under WebGL.");
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
// get the maximum size of the stencil ref // get the maximum size of the stencil ref
...@@ -1047,14 +1047,14 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count) ...@@ -1047,14 +1047,14 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
{ {
if(!mState.program) if(!mState.program)
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
PrimitiveType primitiveType; PrimitiveType primitiveType;
int primitiveCount; int primitiveCount;
if(!rad2sw::ConvertPrimitiveType(mode, count, primitiveType, primitiveCount)) if(!rad2sw::ConvertPrimitiveType(mode, count, primitiveType, primitiveCount))
return error(GL_INVALID_ENUM); return rad::error(GL_INVALID_ENUM);
if(primitiveCount <= 0) if(primitiveCount <= 0)
{ {
...@@ -1071,14 +1071,14 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count) ...@@ -1071,14 +1071,14 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
GLenum err = applyVertexBuffer(0, first); GLenum err = applyVertexBuffer(0, first);
if(err != GL_NO_ERROR) if(err != GL_NO_ERROR)
{ {
return error(err); return rad::error(err);
} }
applyShaders(); applyShaders();
if(!mState.program->validateSamplers(false)) if(!mState.program->validateSamplers(false))
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
if(!cullSkipsDraw(mode)) if(!cullSkipsDraw(mode))
...@@ -1091,14 +1091,14 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, intptr_t off ...@@ -1091,14 +1091,14 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, intptr_t off
{ {
if(!mState.program || !mState.elementArrayBuffer) if(!mState.program || !mState.elementArrayBuffer)
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
PrimitiveType primitiveType; PrimitiveType primitiveType;
int primitiveCount; int primitiveCount;
if(!rad2sw::ConvertPrimitiveType(mode, count, primitiveType, primitiveCount)) if(!rad2sw::ConvertPrimitiveType(mode, count, primitiveType, primitiveCount))
return error(GL_INVALID_ENUM); return rad::error(GL_INVALID_ENUM);
if(primitiveCount <= 0) if(primitiveCount <= 0)
{ {
...@@ -1117,7 +1117,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, intptr_t off ...@@ -1117,7 +1117,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, intptr_t off
GLenum err = applyVertexBuffer(0, 0); GLenum err = applyVertexBuffer(0, 0);
if(err != GL_NO_ERROR) if(err != GL_NO_ERROR)
{ {
return error(err); return rad::error(err);
} }
applyShaders(); applyShaders();
...@@ -1125,7 +1125,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, intptr_t off ...@@ -1125,7 +1125,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, intptr_t off
if(!mState.program->validateSamplers(false)) if(!mState.program->validateSamplers(false))
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
if(!cullSkipsDraw(mode)) if(!cullSkipsDraw(mode))
...@@ -1256,12 +1256,3 @@ Device *Context::getDevice() ...@@ -1256,12 +1256,3 @@ Device *Context::getDevice()
} }
} }
// Exported functions for use by EGL
extern "C"
{
es2::Context *glCreateContext(const egl::Config *config, const es2::Context *shareContext)
{
return new es2::Context(config, shareContext);
}
}
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#ifndef LIBGLESV2_CONTEXT_H_ #ifndef LIBGLESV2_CONTEXT_H_
#define LIBGLESV2_CONTEXT_H_ #define LIBGLESV2_CONTEXT_H_
#include "libEGL/Context.hpp" #include "Context.hpp"
#include "Image.hpp" #include "Image.hpp"
#include "Renderer/Sampler.hpp" #include "Renderer/Sampler.hpp"
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
#include "Display.h" #include "Display.h"
#include "main.h" #include "main.h"
#include "libEGL/Surface.h" #include "Surface.h"
#include "libEGL/Context.hpp" #include "Context.hpp"
#include "common/debug.h" #include "common/debug.h"
#include <algorithm> #include <algorithm>
...@@ -390,10 +390,7 @@ EGLContext Display::createContext(EGLConfig configHandle, const egl::Context *sh ...@@ -390,10 +390,7 @@ EGLContext Display::createContext(EGLConfig configHandle, const egl::Context *sh
if(clientVersion == 2 && config->mRenderableType & EGL_OPENGL_ES2_BIT) if(clientVersion == 2 && config->mRenderableType & EGL_OPENGL_ES2_BIT)
{ {
if(es2::createContext != 0) context = new es2::Context(config, static_cast<const es2::Context*>(shareContext));
{
context = es2::createContext(config, shareContext);
}
} }
else else
{ {
......
...@@ -49,7 +49,7 @@ GLboolean Fence::testFence() ...@@ -49,7 +49,7 @@ GLboolean Fence::testFence()
{ {
if(!mQuery) if(!mQuery)
{ {
return error(GL_INVALID_OPERATION, GL_TRUE); return rad::error(GL_INVALID_OPERATION, GL_TRUE);
} }
UNIMPLEMENTED(); UNIMPLEMENTED();
...@@ -62,7 +62,7 @@ void Fence::finishFence() ...@@ -62,7 +62,7 @@ void Fence::finishFence()
{ {
if(!mQuery) if(!mQuery)
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
while(!testFence()) while(!testFence())
...@@ -75,7 +75,7 @@ void Fence::getFenceiv(GLenum pname, GLint *params) ...@@ -75,7 +75,7 @@ void Fence::getFenceiv(GLenum pname, GLint *params)
{ {
if(!mQuery) if(!mQuery)
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
switch (pname) switch (pname)
...@@ -100,7 +100,7 @@ void Fence::getFenceiv(GLenum pname, GLint *params) ...@@ -100,7 +100,7 @@ void Fence::getFenceiv(GLenum pname, GLint *params)
params[0] = mCondition; params[0] = mCondition;
break; break;
default: default:
return error(GL_INVALID_ENUM); return rad::error(GL_INVALID_ENUM);
break; break;
} }
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#define gl_Image_hpp #define gl_Image_hpp
#include "Renderer/Surface.hpp" #include "Renderer/Surface.hpp"
#include "libEGL/Image.hpp" #include "ImageEGL.hpp"
#define GL_APICALL #define GL_APICALL
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
......
...@@ -29,6 +29,13 @@ ...@@ -29,6 +29,13 @@
#include <algorithm> #include <algorithm>
extern "C"
{
es2::Image *createBackBuffer(int width, int height, const egl::Config *config);
es2::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
sw::FrameBuffer *createFrameBuffer(HDC display, HWND window, int width, int height);
}
namespace egl namespace egl
{ {
...@@ -126,7 +133,7 @@ bool Surface::reset(int backBufferWidth, int backBufferHeight) ...@@ -126,7 +133,7 @@ bool Surface::reset(int backBufferWidth, int backBufferHeight)
if(mWindow) if(mWindow)
{ {
frameBuffer = es2::createFrameBuffer(mDisplay->getNativeDisplay(), mWindow, backBufferWidth, backBufferHeight); frameBuffer = createFrameBuffer(mDisplay->getNativeDisplay(), mWindow, backBufferWidth, backBufferHeight);
if(!frameBuffer) if(!frameBuffer)
{ {
...@@ -136,7 +143,7 @@ bool Surface::reset(int backBufferWidth, int backBufferHeight) ...@@ -136,7 +143,7 @@ bool Surface::reset(int backBufferWidth, int backBufferHeight)
} }
} }
backBuffer = es2::createBackBuffer(backBufferWidth, backBufferHeight, mConfig); backBuffer = createBackBuffer(backBufferWidth, backBufferHeight, mConfig);
if(!backBuffer) if(!backBuffer)
{ {
...@@ -147,7 +154,7 @@ bool Surface::reset(int backBufferWidth, int backBufferHeight) ...@@ -147,7 +154,7 @@ bool Surface::reset(int backBufferWidth, int backBufferHeight)
if(mConfig->mDepthStencilFormat != sw::FORMAT_NULL) if(mConfig->mDepthStencilFormat != sw::FORMAT_NULL)
{ {
mDepthStencil = es2::createDepthStencil(backBufferWidth, backBufferHeight, mConfig->mDepthStencilFormat, 1, false); mDepthStencil = createDepthStencil(backBufferWidth, backBufferHeight, mConfig->mDepthStencilFormat, 1, false);
if(!mDepthStencil) if(!mDepthStencil)
{ {
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#include "main.h" #include "main.h"
#include "mathutil.h" #include "mathutil.h"
#include "Device.hpp" #include "Device.hpp"
#include "libEGL/Display.h" #include "Display.h"
#include "libEGL/Surface.h" #include "Surface.h"
#include "common/debug.h" #include "common/debug.h"
#include <algorithm> #include <algorithm>
...@@ -222,22 +222,22 @@ void Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig ...@@ -222,22 +222,22 @@ void Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig
{ {
if(!image) if(!image)
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
if(width + xoffset > image->getWidth() || height + yoffset > image->getHeight()) if(width + xoffset > image->getWidth() || height + yoffset > image->getHeight())
{ {
return error(GL_INVALID_VALUE); return rad::error(GL_INVALID_VALUE);
} }
if(IsCompressed(image->getFormat())) if(IsCompressed(image->getFormat()))
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
if(format != image->getFormat()) if(format != image->getFormat())
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
if(pixels) if(pixels)
...@@ -250,17 +250,17 @@ void Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GL ...@@ -250,17 +250,17 @@ void Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GL
{ {
if(!image) if(!image)
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
if(width + xoffset > image->getWidth() || height + yoffset > image->getHeight()) if(width + xoffset > image->getWidth() || height + yoffset > image->getHeight())
{ {
return error(GL_INVALID_VALUE); return rad::error(GL_INVALID_VALUE);
} }
if(format != image->getFormat()) if(format != image->getFormat())
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
if(pixels) if(pixels)
...@@ -278,7 +278,7 @@ bool Texture::copy(egl::Image *source, const sw::Rect &sourceRect, GLenum destFo ...@@ -278,7 +278,7 @@ bool Texture::copy(egl::Image *source, const sw::Rect &sourceRect, GLenum destFo
if(!success) if(!success)
{ {
return error(GL_OUT_OF_MEMORY, false); return rad::error(GL_OUT_OF_MEMORY, false);
} }
return true; return true;
...@@ -393,7 +393,7 @@ void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum form ...@@ -393,7 +393,7 @@ void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum form
if(!image[level]) if(!image[level])
{ {
return error(GL_OUT_OF_MEMORY); return rad::error(GL_OUT_OF_MEMORY);
} }
Texture::setImage(format, type, unpackAlignment, pixels, image[level]); Texture::setImage(format, type, unpackAlignment, pixels, image[level]);
...@@ -410,7 +410,7 @@ void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GL ...@@ -410,7 +410,7 @@ void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GL
if(!image[level]) if(!image[level])
{ {
return error(GL_OUT_OF_MEMORY); return rad::error(GL_OUT_OF_MEMORY);
} }
Texture::setCompressedImage(imageSize, pixels, image[level]); Texture::setCompressedImage(imageSize, pixels, image[level]);
...@@ -522,7 +522,7 @@ void Texture2D::generateMipmaps() ...@@ -522,7 +522,7 @@ void Texture2D::generateMipmaps()
if(!image[i]) if(!image[i])
{ {
return error(GL_OUT_OF_MEMORY); return rad::error(GL_OUT_OF_MEMORY);
} }
getDevice()->stretchRect(image[i - 1], 0, image[i], 0, true); getDevice()->stretchRect(image[i - 1], 0, image[i], 0, true);
...@@ -656,7 +656,7 @@ void TextureCubeMap::setCompressedImage(GLenum target, GLint level, GLenum forma ...@@ -656,7 +656,7 @@ void TextureCubeMap::setCompressedImage(GLenum target, GLint level, GLenum forma
if(!image[face][level]) if(!image[face][level])
{ {
return error(GL_OUT_OF_MEMORY); return rad::error(GL_OUT_OF_MEMORY);
} }
Texture::setCompressedImage(imageSize, pixels, image[face][level]); Texture::setCompressedImage(imageSize, pixels, image[face][level]);
...@@ -792,7 +792,7 @@ void TextureCubeMap::setImage(GLenum target, GLint level, GLsizei width, GLsizei ...@@ -792,7 +792,7 @@ void TextureCubeMap::setImage(GLenum target, GLint level, GLsizei width, GLsizei
if(!image[face][level]) if(!image[face][level])
{ {
return error(GL_OUT_OF_MEMORY); return rad::error(GL_OUT_OF_MEMORY);
} }
Texture::setImage(format, type, unpackAlignment, pixels, image[face][level]); Texture::setImage(format, type, unpackAlignment, pixels, image[face][level]);
...@@ -812,7 +812,7 @@ void TextureCubeMap::generateMipmaps() ...@@ -812,7 +812,7 @@ void TextureCubeMap::generateMipmaps()
{ {
if(!isCubeComplete()) if(!isCubeComplete())
{ {
return error(GL_INVALID_OPERATION); return rad::error(GL_INVALID_OPERATION);
} }
unsigned int q = log2(image[0][0]->getWidth()); unsigned int q = log2(image[0][0]->getWidth());
...@@ -830,7 +830,7 @@ void TextureCubeMap::generateMipmaps() ...@@ -830,7 +830,7 @@ void TextureCubeMap::generateMipmaps()
if(!image[f][i]) if(!image[f][i])
{ {
return error(GL_OUT_OF_MEMORY); return rad::error(GL_OUT_OF_MEMORY);
} }
getDevice()->stretchRect(image[f][i - 1], 0, image[f][i], 0, true); getDevice()->stretchRect(image[f][i - 1], 0, image[f][i], 0, true);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#define LIBGLESV2_TEXTURE_H_ #define LIBGLESV2_TEXTURE_H_
#include "utilities.h" #include "utilities.h"
#include "libEGL/Texture2D.hpp" #include "Texture2D.hpp"
#include "common/debug.h" #include "common/debug.h"
#define GL_APICALL #define GL_APICALL
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "common/debug.h" #include "common/debug.h"
#include "Common/Version.h" #include "Common/Version.h"
#include "Main/Register.hpp" #include "Main/Register.hpp"
#include "../libEGL/Surface.h" #include "Surface.h"
#define GL_APICALL #define GL_APICALL
#include <RAD/rad.h> #include <RAD/rad.h>
......
...@@ -2,11 +2,15 @@ LIBRARY libRAD ...@@ -2,11 +2,15 @@ LIBRARY libRAD
EXPORTS EXPORTS
radGetProcAddress radGetProcAddress
; EGL dependencies eglBindAPI
glCreateContext eglChooseConfig
eglCreateContext
createFrameBuffer eglCreateWindowSurface
createBackBuffer eglGetDisplay
createDepthStencil eglGetError
eglGetProcAddress
eglInitialize
eglMakeCurrent
eglTerminate
Register Register
...@@ -14,13 +14,11 @@ ...@@ -14,13 +14,11 @@
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources // English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252) #pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
...@@ -70,13 +68,13 @@ BEGIN ...@@ -70,13 +68,13 @@ BEGIN
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "FileDescription", "SwiftShader libGLESv2 Dynamic Link Library" VALUE "FileDescription", "SwiftShader libRAD Dynamic Link Library"
VALUE "FileVersion", VERSION_STRING VALUE "FileVersion", VERSION_STRING
VALUE "InternalName", "libGLESv2" VALUE "InternalName", "libRAD"
VALUE "LegalCopyright", "Copyright (C) 2012 TransGaming Inc." VALUE "LegalCopyright", "Copyright (C) 2014 Google Inc."
VALUE "OriginalFilename", "libGLESv2.dll" VALUE "OriginalFilename", "libRAD.dll"
VALUE "PrivateBuild", VERSION_STRING VALUE "PrivateBuild", VERSION_STRING
VALUE "ProductName", "SwiftShader libGLESv2 Dynamic Link Library" VALUE "ProductName", "SwiftShader libRAD Dynamic Link Library"
VALUE "ProductVersion", VERSION_STRING VALUE "ProductVersion", VERSION_STRING
END END
END END
...@@ -86,7 +84,41 @@ BEGIN ...@@ -86,7 +84,41 @@ BEGIN
END END
END END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_DIALOG1 DIALOGEX 0, 0, 129, 47
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Waiting for debugger"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
PUSHBUTTON "Cancel",IDCANCEL,72,26,50,14
LTEXT "Attach a debugger or ESC to cancel",IDC_STATIC,7,7,115,8
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_DIALOG1, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 122
TOPMARGIN, 7
BOTTOMMARGIN, 40
END
END
#endif // APSTUDIO_INVOKED
#endif // English (United States) resources
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
...@@ -100,3 +132,5 @@ END ...@@ -100,3 +132,5 @@ END
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED #endif // not APSTUDIO_INVOKED
...@@ -160,15 +160,19 @@ copy "$(OutDir)libRAD.dll" "$(ProjectDir)..\..\..\lib\$(Configuration)\"</Comman ...@@ -160,15 +160,19 @@ copy "$(OutDir)libRAD.dll" "$(ProjectDir)..\..\..\lib\$(Configuration)\"</Comman
</PostBuildEvent> </PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="Config.cpp" />
<ClCompile Include="Context.cpp" /> <ClCompile Include="Context.cpp" />
<ClCompile Include="..\common\debug.cpp" /> <ClCompile Include="..\common\debug.cpp" />
<ClCompile Include="Device.cpp" /> <ClCompile Include="Device.cpp" />
<ClCompile Include="Display.cpp" />
<ClCompile Include="Fence.cpp" /> <ClCompile Include="Fence.cpp" />
<ClCompile Include="Image.cpp" /> <ClCompile Include="Image.cpp" />
<ClCompile Include="libEGL.cpp" />
<ClCompile Include="libRAD.cpp" /> <ClCompile Include="libRAD.cpp" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
<ClCompile Include="Program.cpp" /> <ClCompile Include="Program.cpp" />
<ClCompile Include="Shader.cpp" /> <ClCompile Include="Shader.cpp" />
<ClCompile Include="Surface.cpp" />
<ClCompile Include="Texture.cpp" /> <ClCompile Include="Texture.cpp" />
<ClCompile Include="utilities.cpp" /> <ClCompile Include="utilities.cpp" />
</ItemGroup> </ItemGroup>
...@@ -177,16 +181,23 @@ copy "$(OutDir)libRAD.dll" "$(ProjectDir)..\..\..\lib\$(Configuration)\"</Comman ...@@ -177,16 +181,23 @@ copy "$(OutDir)libRAD.dll" "$(ProjectDir)..\..\..\lib\$(Configuration)\"</Comman
<ClInclude Include="..\include\GLES2\gl2.h" /> <ClInclude Include="..\include\GLES2\gl2.h" />
<ClInclude Include="..\include\GLES2\gl2ext.h" /> <ClInclude Include="..\include\GLES2\gl2ext.h" />
<ClInclude Include="..\include\GLES2\gl2platform.h" /> <ClInclude Include="..\include\GLES2\gl2platform.h" />
<ClInclude Include="Config.h" />
<ClInclude Include="Context.h" /> <ClInclude Include="Context.h" />
<ClInclude Include="Context.hpp" />
<ClInclude Include="Device.hpp" /> <ClInclude Include="Device.hpp" />
<ClInclude Include="Display.h" />
<ClInclude Include="Fence.h" /> <ClInclude Include="Fence.h" />
<ClInclude Include="Image.hpp" /> <ClInclude Include="Image.hpp" />
<ClInclude Include="ImageEGL.hpp" />
<ClInclude Include="main.h" /> <ClInclude Include="main.h" />
<ClInclude Include="mainEGL.h" />
<ClInclude Include="mathutil.h" /> <ClInclude Include="mathutil.h" />
<ClInclude Include="Program.h" /> <ClInclude Include="Program.h" />
<ClInclude Include="resource.h" /> <ClInclude Include="resource.h" />
<ClInclude Include="Shader.h" /> <ClInclude Include="Shader.h" />
<ClInclude Include="Surface.h" />
<ClInclude Include="Texture.h" /> <ClInclude Include="Texture.h" />
<ClInclude Include="Texture2D.hpp" />
<ClInclude Include="utilities.h" /> <ClInclude Include="utilities.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -44,6 +44,18 @@ ...@@ -44,6 +44,18 @@
<ClCompile Include="Image.cpp"> <ClCompile Include="Image.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Config.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Display.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="libEGL.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Surface.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="Context.h"> <ClInclude Include="Context.h">
...@@ -91,6 +103,27 @@ ...@@ -91,6 +103,27 @@
<ClInclude Include="..\common\debug.h"> <ClInclude Include="..\common\debug.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Config.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Context.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Display.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ImageEGL.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mainEGL.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Surface.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Texture2D.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="libRAD.rc" /> <ResourceCompile Include="libRAD.rc" />
......
...@@ -13,10 +13,13 @@ ...@@ -13,10 +13,13 @@
#include "main.h" #include "main.h"
#include "libEGL/Surface.h" #include "Surface.h"
#include "Common/Thread.hpp" #include "Common/Thread.hpp"
#include "Common/SharedLibrary.hpp" #include "Common/SharedLibrary.hpp"
#include "common/debug.h" #include "common/debug.h"
#include "resource.h"
static sw::Thread::LocalStorageKey currentTLS = TLS_OUT_OF_INDEXES;
#if !defined(_MSC_VER) #if !defined(_MSC_VER)
#define CONSTRUCTOR __attribute__((constructor)) #define CONSTRUCTOR __attribute__((constructor))
...@@ -26,59 +29,127 @@ ...@@ -26,59 +29,127 @@
#define DESTRUCTOR #define DESTRUCTOR
#endif #endif
static void glAttachThread() static void eglAttachThread()
{ {
TRACE("()"); TRACE("()");
egl::Current *current = new egl::Current;
if(current)
{
sw::Thread::setLocalStorage(currentTLS, current);
current->error = EGL_SUCCESS;
current->API = EGL_OPENGL_ES_API;
current->display = EGL_NO_DISPLAY;
current->drawSurface = EGL_NO_SURFACE;
current->readSurface = EGL_NO_SURFACE;
current->context = EGL_NO_CONTEXT;
}
} }
static void glDetachThread() static void eglDetachThread()
{ {
TRACE("()"); TRACE("()");
egl::Current *current = (egl::Current*)sw::Thread::getLocalStorage(currentTLS);
if(current)
{
delete current;
}
} }
CONSTRUCTOR static bool glAttachProcess() CONSTRUCTOR static void eglAttachProcess()
{ {
TRACE("()"); TRACE("()");
glAttachThread(); #if !defined(ANGLE_DISABLE_TRACE)
FILE *debug = fopen(TRACE_OUTPUT_FILE, "rt");
if(debug)
{
fclose(debug);
debug = fopen(TRACE_OUTPUT_FILE, "wt"); // Erase
fclose(debug);
}
#endif
#if defined(_WIN32) currentTLS = sw::Thread::allocateLocalStorageKey();
const char *libEGL_lib = "libEGL.dll";
#else
const char *libEGL_lib = "libEGL.so.1";
#endif
libEGL = loadLibrary(libEGL_lib); if(currentTLS == TLS_OUT_OF_INDEXES)
egl::getCurrentContext = (egl::Context *(*)())getProcAddress(libEGL, "clientGetCurrentContext"); {
egl::getCurrentDisplay = (egl::Display *(*)())getProcAddress(libEGL, "clientGetCurrentDisplay"); return;
}
return libEGL != 0; eglAttachThread();
} }
DESTRUCTOR static void glDetachProcess() DESTRUCTOR static void eglDetachProcess()
{ {
TRACE("()"); TRACE("()");
glDetachThread(); eglDetachThread();
freeLibrary(libEGL); sw::Thread::freeLocalStorageKey(currentTLS);
} }
#if defined(_WIN32) #if defined(_WIN32)
static INT_PTR CALLBACK DebuggerWaitDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
RECT rect;
switch(uMsg)
{
case WM_INITDIALOG:
GetWindowRect(GetDesktopWindow(), &rect);
SetWindowPos(hwnd, HWND_TOP, rect.right / 2, rect.bottom / 2, 0, 0, SWP_NOSIZE);
SetTimer(hwnd, 1, 100, NULL);
return TRUE;
case WM_COMMAND:
if(LOWORD(wParam) == IDCANCEL)
{
EndDialog(hwnd, 0);
}
break;
case WM_TIMER:
if(IsDebuggerPresent())
{
EndDialog(hwnd, 0);
}
}
return FALSE;
}
static void WaitForDebugger(HINSTANCE instance)
{
if(!IsDebuggerPresent())
{
HRSRC dialog = FindResource(instance, MAKEINTRESOURCE(IDD_DIALOG1), RT_DIALOG);
DLGTEMPLATE *dialogTemplate = (DLGTEMPLATE*)LoadResource(instance, dialog);
DialogBoxIndirect(instance, dialogTemplate, NULL, DebuggerWaitDialogProc);
}
}
extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
{ {
switch(reason) switch(reason)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
return glAttachProcess(); if(false)
{
WaitForDebugger(instance);
}
eglAttachProcess();
break; break;
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:
glAttachThread(); eglAttachThread();
break; break;
case DLL_THREAD_DETACH: case DLL_THREAD_DETACH:
glDetachThread(); eglDetachThread();
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
glDetachProcess(); eglDetachProcess();
break; break;
default: default:
break; break;
...@@ -88,11 +159,153 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved ...@@ -88,11 +159,153 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved
} }
#endif #endif
namespace egl
{
static Current *eglGetCurrent(void)
{
Current *current = (Current*)sw::Thread::getLocalStorage(currentTLS);
if(!current)
{
eglAttachThread();
}
return (Current*)sw::Thread::getLocalStorage(currentTLS);
}
void setCurrentError(EGLint error)
{
Current *current = eglGetCurrent();
current->error = error;
}
EGLint getCurrentError()
{
Current *current = eglGetCurrent();
return current->error;
}
void setCurrentAPI(EGLenum API)
{
Current *current = eglGetCurrent();
current->API = API;
}
EGLenum getCurrentAPI()
{
Current *current = eglGetCurrent();
return current->API;
}
void setCurrentDisplay(EGLDisplay dpy)
{
Current *current = eglGetCurrent();
current->display = dpy;
}
EGLDisplay getCurrentDisplay()
{
Current *current = eglGetCurrent();
return current->display;
}
void setCurrentContext(EGLContext ctx)
{
Current *current = eglGetCurrent();
current->context = ctx;
}
EGLContext getCurrentContext()
{
Current *current = eglGetCurrent();
return current->context;
}
void setCurrentDrawSurface(EGLSurface surface)
{
Current *current = eglGetCurrent();
current->drawSurface = surface;
}
EGLSurface getCurrentDrawSurface()
{
Current *current = eglGetCurrent();
return current->drawSurface;
}
void setCurrentReadSurface(EGLSurface surface)
{
Current *current = eglGetCurrent();
current->readSurface = surface;
}
EGLSurface getCurrentReadSurface()
{
Current *current = eglGetCurrent();
return current->readSurface;
}
}
namespace egl
{
void error(EGLint errorCode)
{
egl::setCurrentError(errorCode);
if(errorCode != EGL_SUCCESS)
{
switch(errorCode)
{
case EGL_NOT_INITIALIZED: TRACE("\t! Error generated: not initialized\n"); break;
case EGL_BAD_ACCESS: TRACE("\t! Error generated: bad access\n"); break;
case EGL_BAD_ALLOC: TRACE("\t! Error generated: bad alloc\n"); break;
case EGL_BAD_ATTRIBUTE: TRACE("\t! Error generated: bad attribute\n"); break;
case EGL_BAD_CONFIG: TRACE("\t! Error generated: bad config\n"); break;
case EGL_BAD_CONTEXT: TRACE("\t! Error generated: bad context\n"); break;
case EGL_BAD_CURRENT_SURFACE: TRACE("\t! Error generated: bad current surface\n"); break;
case EGL_BAD_DISPLAY: TRACE("\t! Error generated: bad display\n"); break;
case EGL_BAD_MATCH: TRACE("\t! Error generated: bad match\n"); break;
case EGL_BAD_NATIVE_PIXMAP: TRACE("\t! Error generated: bad native pixmap\n"); break;
case EGL_BAD_NATIVE_WINDOW: TRACE("\t! Error generated: bad native window\n"); break;
case EGL_BAD_PARAMETER: TRACE("\t! Error generated: bad parameter\n"); break;
case EGL_BAD_SURFACE: TRACE("\t! Error generated: bad surface\n"); break;
case EGL_CONTEXT_LOST: TRACE("\t! Error generated: context lost\n"); break;
default: TRACE("\t! Error generated: <0x%X>\n", errorCode); break;
}
}
}
}
extern "C"
{
EGLContext clientGetCurrentContext()
{
return egl::getCurrentContext();
}
EGLContext clientGetCurrentDisplay()
{
return egl::getCurrentDisplay();
}
}
namespace es2 namespace es2
{ {
es2::Context *getContext() es2::Context *getContext()
{ {
egl::Context *context = egl::getCurrentContext(); egl::Context *context = static_cast<egl::Context*>(egl::getCurrentContext());
if(context && context->getClientVersion() == 2) if(context && context->getClientVersion() == 2)
{ {
...@@ -104,7 +317,7 @@ es2::Context *getContext() ...@@ -104,7 +317,7 @@ es2::Context *getContext()
egl::Display *getDisplay() egl::Display *getDisplay()
{ {
return egl::getCurrentDisplay(); return static_cast<egl::Display*>(egl::getCurrentDisplay());
} }
Device *getDevice() Device *getDevice()
...@@ -119,15 +332,17 @@ namespace egl ...@@ -119,15 +332,17 @@ namespace egl
{ {
GLint getClientVersion() GLint getClientVersion()
{ {
Context *context = egl::getCurrentContext(); Context *context = static_cast<egl::Context*>(egl::getCurrentContext());
return context ? context->getClientVersion() : 0; return context ? context->getClientVersion() : 0;
} }
} }
// Records an error code namespace rad
void error(GLenum errorCode)
{ {
// Records an error code
void error(GLenum errorCode)
{
es2::Context *context = es2::getContext(); es2::Context *context = es2::getContext();
if(context) if(context)
...@@ -157,12 +372,5 @@ void error(GLenum errorCode) ...@@ -157,12 +372,5 @@ void error(GLenum errorCode)
default: UNREACHABLE(); default: UNREACHABLE();
} }
} }
}
} }
namespace egl
{
egl::Context *(*getCurrentContext)() = 0;
egl::Display *(*getCurrentDisplay)() = 0;
}
void *libEGL = 0; // Handle to the libEGL module
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "Context.h" #include "Context.h"
#include "Device.hpp" #include "Device.hpp"
#include "common/debug.h" #include "common/debug.h"
#include "libEGL/Display.h" #include "Display.h"
#define GL_APICALL #define GL_APICALL
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
...@@ -35,6 +35,8 @@ namespace egl ...@@ -35,6 +35,8 @@ namespace egl
GLint getClientVersion(); GLint getClientVersion();
} }
namespace rad
{
void error(GLenum errorCode); void error(GLenum errorCode);
template<class T> template<class T>
...@@ -44,14 +46,66 @@ const T &error(GLenum errorCode, const T &returnValue) ...@@ -44,14 +46,66 @@ const T &error(GLenum errorCode, const T &returnValue)
return returnValue; return returnValue;
} }
}
#define EGLAPI
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <RAD/rad.h>
// libEGL dependencies
namespace egl namespace egl
{ {
extern egl::Context *(*getCurrentContext)(); struct Current
extern egl::Display *(*getCurrentDisplay)(); {
} EGLint error;
EGLenum API;
EGLDisplay display;
EGLContext context;
EGLSurface drawSurface;
EGLSurface readSurface;
};
void setCurrentError(EGLint error);
EGLint getCurrentError();
void setCurrentAPI(EGLenum API);
EGLenum getCurrentAPI();
void setCurrentDisplay(EGLDisplay dpy);
EGLDisplay getCurrentDisplay();
void setCurrentContext(EGLContext ctx);
EGLContext getCurrentContext();
void setCurrentDrawSurface(EGLSurface surface);
EGLSurface getCurrentDrawSurface();
void setCurrentReadSurface(EGLSurface surface);
EGLSurface getCurrentReadSurface();
extern void *libEGL; // Handle to the libEGL module void error(EGLint errorCode);
template<class T>
const T &error(EGLint errorCode, const T &returnValue)
{
error(errorCode);
return returnValue;
}
template<class T>
const T &success(const T &returnValue)
{
egl::setCurrentError(EGL_SUCCESS);
return returnValue;
}
class Config;
class Surface;
class Display;
class Context;
class Image;
}
#endif // LIBGLESV2_MAIN_H_ #endif // LIBGLESV2_MAIN_H_
// SwiftShader Software Renderer
//
// Copyright(c) 2005-2012 TransGaming Inc.
//
// All rights reserved. No part of this software may be copied, distributed, transmitted,
// transcribed, stored in a retrieval system, translated into any human or computer
// language by any means, or disclosed to third parties without the explicit written
// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
// or implied, including but not limited to any patent rights, are granted to you.
//
// main.h: Management of thread-local data.
#ifndef LIBEGL_MAIN_H_
#define LIBEGL_MAIN_H_
namespace sw
{
class FrameBuffer;
enum Format : unsigned char;
}
#endif // LIBEGL_MAIN_H_
//{{NO_DEPENDENCIES}} //{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file. // Microsoft Visual C++ generated include file.
// Used by libRAD.rc // Used by libRAD.rc
//
#define IDD_DIALOG1 101
#define IDC_STATIC -1
// Next default values for new objects // Next default values for new objects
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
......
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013 # Visual Studio 2013
VisualStudioVersion = 12.0.30110.0 VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LLVM", "LLVM", "{B408B98A-E888-4ECF-81E0-7A37A6854B17}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "LLVM", "LLVM", "{B408B98A-E888-4ECF-81E0-7A37A6854B17}"
EndProject EndProject
...@@ -239,17 +239,9 @@ EndProject ...@@ -239,17 +239,9 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libRAD", "Radiance\libRAD\libRAD.vcxproj", "{A08DD1A8-998C-4FBB-8710-89B80D0BC3AD}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libRAD", "Radiance\libRAD\libRAD.vcxproj", "{A08DD1A8-998C-4FBB-8710-89B80D0BC3AD}"
ProjectSection(ProjectDependencies) = postProject
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893} = {2F6770B5-F168-4FCD-8A56-4DD95BEC8893}
EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Radiance", "Radiance", "{CA0EBD66-3F60-4F3D-8143-B31F14458B40}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Radiance", "Radiance", "{CA0EBD66-3F60-4F3D-8143-B31F14458B40}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEGL", "Radiance\libEGL\libEGL.vcxproj", "{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}"
ProjectSection(ProjectDependencies) = postProject
{7B02CB19-4CDF-4F79-BC9B-7F3F6164A003} = {7B02CB19-4CDF-4F79-BC9B-7F3F6164A003}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Compiler", "Radiance\compiler\Compiler.vcxproj", "{5AEBF8B8-3454-4984-9D77-A8F13BC0377B}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Compiler", "Radiance\compiler\Compiler.vcxproj", "{5AEBF8B8-3454-4984-9D77-A8F13BC0377B}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "preprocessor", "Radiance\compiler\preprocessor\preprocessor.vcxproj", "{6303975E-7060-4CE7-8090-CB2DE0B840B4}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "preprocessor", "Radiance\compiler\preprocessor\preprocessor.vcxproj", "{6303975E-7060-4CE7-8090-CB2DE0B840B4}"
...@@ -257,7 +249,6 @@ EndProject ...@@ -257,7 +249,6 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rad", "..\tests\HelloRAD\rad.vcxproj", "{B4537008-1302-4EE7-98C8-6897472B9E36}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rad", "..\tests\HelloRAD\rad.vcxproj", "{B4537008-1302-4EE7-98C8-6897472B9E36}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{A08DD1A8-998C-4FBB-8710-89B80D0BC3AD} = {A08DD1A8-998C-4FBB-8710-89B80D0BC3AD} {A08DD1A8-998C-4FBB-8710-89B80D0BC3AD} = {A08DD1A8-998C-4FBB-8710-89B80D0BC3AD}
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893} = {2F6770B5-F168-4FCD-8A56-4DD95BEC8893}
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
...@@ -675,15 +666,6 @@ Global ...@@ -675,15 +666,6 @@ Global
{A08DD1A8-998C-4FBB-8710-89B80D0BC3AD}.Release|Win32.ActiveCfg = Release|Win32 {A08DD1A8-998C-4FBB-8710-89B80D0BC3AD}.Release|Win32.ActiveCfg = Release|Win32
{A08DD1A8-998C-4FBB-8710-89B80D0BC3AD}.Release|Win32.Build.0 = Release|Win32 {A08DD1A8-998C-4FBB-8710-89B80D0BC3AD}.Release|Win32.Build.0 = Release|Win32
{A08DD1A8-998C-4FBB-8710-89B80D0BC3AD}.Release|x64.ActiveCfg = Release|Win32 {A08DD1A8-998C-4FBB-8710-89B80D0BC3AD}.Release|x64.ActiveCfg = Release|Win32
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}.Debug|Win32.ActiveCfg = Debug|Win32
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}.Debug|Win32.Build.0 = Debug|Win32
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}.Debug|x64.ActiveCfg = Debug|Win32
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}.Profile|Win32.ActiveCfg = Profile|Win32
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}.Profile|Win32.Build.0 = Profile|Win32
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}.Profile|x64.ActiveCfg = Profile|Win32
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}.Release|Win32.ActiveCfg = Release|Win32
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}.Release|Win32.Build.0 = Release|Win32
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893}.Release|x64.ActiveCfg = Release|Win32
{5AEBF8B8-3454-4984-9D77-A8F13BC0377B}.Debug|Win32.ActiveCfg = Debug|Win32 {5AEBF8B8-3454-4984-9D77-A8F13BC0377B}.Debug|Win32.ActiveCfg = Debug|Win32
{5AEBF8B8-3454-4984-9D77-A8F13BC0377B}.Debug|Win32.Build.0 = Debug|Win32 {5AEBF8B8-3454-4984-9D77-A8F13BC0377B}.Debug|Win32.Build.0 = Debug|Win32
{5AEBF8B8-3454-4984-9D77-A8F13BC0377B}.Debug|x64.ActiveCfg = Debug|Win32 {5AEBF8B8-3454-4984-9D77-A8F13BC0377B}.Debug|x64.ActiveCfg = Debug|Win32
...@@ -716,6 +698,8 @@ Global ...@@ -716,6 +698,8 @@ Global
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{B5871A7A-968C-42E3-A33B-981E6F448E78} = {D33114D7-E582-4D61-B27D-FAB0297C43FF}
{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6} = {D33114D7-E582-4D61-B27D-FAB0297C43FF}
{97EDF19C-6360-4770-9255-EBA2F1A13E9B} = {B408B98A-E888-4ECF-81E0-7A37A6854B17} {97EDF19C-6360-4770-9255-EBA2F1A13E9B} = {B408B98A-E888-4ECF-81E0-7A37A6854B17}
{7BE5F26F-0525-42BB-AAED-56C5B4582B99} = {B408B98A-E888-4ECF-81E0-7A37A6854B17} {7BE5F26F-0525-42BB-AAED-56C5B4582B99} = {B408B98A-E888-4ECF-81E0-7A37A6854B17}
{00F3295C-F7A0-43D3-BD0B-1BC0515B30E1} = {B408B98A-E888-4ECF-81E0-7A37A6854B17} {00F3295C-F7A0-43D3-BD0B-1BC0515B30E1} = {B408B98A-E888-4ECF-81E0-7A37A6854B17}
...@@ -737,21 +721,18 @@ Global ...@@ -737,21 +721,18 @@ Global
{531B1D71-5EE6-4576-971E-9CC28B0B3868} = {B408B98A-E888-4ECF-81E0-7A37A6854B17} {531B1D71-5EE6-4576-971E-9CC28B0B3868} = {B408B98A-E888-4ECF-81E0-7A37A6854B17}
{E9B87B46-1EB0-4D95-9049-41B148FBADCD} = {B408B98A-E888-4ECF-81E0-7A37A6854B17} {E9B87B46-1EB0-4D95-9049-41B148FBADCD} = {B408B98A-E888-4ECF-81E0-7A37A6854B17}
{1F8587CB-0779-44BB-AFA4-03DD8A036D75} = {B408B98A-E888-4ECF-81E0-7A37A6854B17} {1F8587CB-0779-44BB-AFA4-03DD8A036D75} = {B408B98A-E888-4ECF-81E0-7A37A6854B17}
{B5871A7A-968C-42E3-A33B-981E6F448E78} = {D33114D7-E582-4D61-B27D-FAB0297C43FF}
{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6} = {D33114D7-E582-4D61-B27D-FAB0297C43FF}
{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD} = {D33114D7-E582-4D61-B27D-FAB0297C43FF} {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD} = {D33114D7-E582-4D61-B27D-FAB0297C43FF}
{92940255-AB4B-42FB-A2C4-0FAB19C3C48A} = {D33114D7-E582-4D61-B27D-FAB0297C43FF} {92940255-AB4B-42FB-A2C4-0FAB19C3C48A} = {D33114D7-E582-4D61-B27D-FAB0297C43FF}
{235B1D85-E6B6-45E2-BA5D-5C60396428FF} = {D33114D7-E582-4D61-B27D-FAB0297C43FF}
{9DAFEE32-19F6-4410-AA09-2B564FB86F62} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D} {9DAFEE32-19F6-4410-AA09-2B564FB86F62} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{9CF4408B-9B08-481F-95DA-3DF0846DABE4} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D} {9CF4408B-9B08-481F-95DA-3DF0846DABE4} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D} {09ABE661-9BC0-4152-A820-1FB0522CAC01} = {B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9}
{04FC5430-3F1B-42A2-A18A-D8BB7E5B2733} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D} {04FC5430-3F1B-42A2-A18A-D8BB7E5B2733} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{235B1D85-E6B6-45E2-BA5D-5C60396428FF} = {D33114D7-E582-4D61-B27D-FAB0297C43FF}
{AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D} {AB1EB229-D86C-41B3-8E20-7A7E1FF5DDF5} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{B4537008-1302-4EE7-98C8-6897472B9E36} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D} {B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
{09ABE661-9BC0-4152-A820-1FB0522CAC01} = {B7E24D8E-6BE9-4DEF-A8B9-6A6E60CA60E9}
{A08DD1A8-998C-4FBB-8710-89B80D0BC3AD} = {CA0EBD66-3F60-4F3D-8143-B31F14458B40} {A08DD1A8-998C-4FBB-8710-89B80D0BC3AD} = {CA0EBD66-3F60-4F3D-8143-B31F14458B40}
{2F6770B5-F168-4FCD-8A56-4DD95BEC8893} = {CA0EBD66-3F60-4F3D-8143-B31F14458B40}
{5AEBF8B8-3454-4984-9D77-A8F13BC0377B} = {CA0EBD66-3F60-4F3D-8143-B31F14458B40} {5AEBF8B8-3454-4984-9D77-A8F13BC0377B} = {CA0EBD66-3F60-4F3D-8143-B31F14458B40}
{6303975E-7060-4CE7-8090-CB2DE0B840B4} = {CA0EBD66-3F60-4F3D-8143-B31F14458B40} {6303975E-7060-4CE7-8090-CB2DE0B840B4} = {CA0EBD66-3F60-4F3D-8143-B31F14458B40}
{B4537008-1302-4EE7-98C8-6897472B9E36} = {ED25C308-5BDB-43A7-BED6-C2C059FC2D7D}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal
...@@ -109,9 +109,6 @@ ...@@ -109,9 +109,6 @@
<Text Include="ReadMe.txt" /> <Text Include="ReadMe.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Radiance\libEGL\libEGL.vcxproj">
<Project>{2f6770b5-f168-4fcd-8a56-4dd95bec8893}</Project>
</ProjectReference>
<ProjectReference Include="..\..\src\Radiance\libRAD\libRAD.vcxproj"> <ProjectReference Include="..\..\src\Radiance\libRAD\libRAD.vcxproj">
<Project>{a08dd1a8-998c-4fbb-8710-89b80d0bc3ad}</Project> <Project>{a08dd1a8-998c-4fbb-8710-89b80d0bc3ad}</Project>
</ProjectReference> </ProjectReference>
......
...@@ -105,7 +105,6 @@ bool benchmark = false; ...@@ -105,7 +105,6 @@ bool benchmark = false;
void InitRAD() void InitRAD()
{ {
// obfuscated string for radGetProcAddress
PFNRADGETPROCADDRESSPROC getProc = (PFNRADGETPROCADDRESSPROC)eglGetProcAddress("radGetProcAddress"); PFNRADGETPROCADDRESSPROC getProc = (PFNRADGETPROCADDRESSPROC)eglGetProcAddress("radGetProcAddress");
radLoadProcs(getProc); radLoadProcs(getProc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment