Commit f6b6d273 by Nicolas Capens Committed by Nicolas Capens

Add stubs for RAD entry functions.

BUG=18218488 Change-Id: I9b69d2f8fdb64b9e91877bd4f506fc30a2bcd33c Reviewed-on: https://swiftshader-review.googlesource.com/1224Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 77e72aff
...@@ -1195,9 +1195,13 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const cha ...@@ -1195,9 +1195,13 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const cha
static const Extension eglExtensions[] = static const Extension eglExtensions[] =
{ {
{"eglCreateImageKHR", (__eglMustCastToProperFunctionPointerType)eglCreateImageKHR}, #define EXTENSION(name) {#name, (__eglMustCastToProperFunctionPointerType)name}
{"eglDestroyImageKHR", (__eglMustCastToProperFunctionPointerType)eglDestroyImageKHR},
}; EXTENSION(eglCreateImageKHR),
EXTENSION(eglDestroyImageKHR),
#undef EXTENSION
};
for(int ext = 0; ext < sizeof(eglExtensions) / sizeof(Extension); ext++) for(int ext = 0; ext < sizeof(eglExtensions) / sizeof(Extension); ext++)
{ {
......
...@@ -6153,28 +6153,32 @@ __eglMustCastToProperFunctionPointerType glGetProcAddress(const char *procname) ...@@ -6153,28 +6153,32 @@ __eglMustCastToProperFunctionPointerType glGetProcAddress(const char *procname)
static const Extension glExtensions[] = static const Extension glExtensions[] =
{ {
{"glTexImage3DOES", (__eglMustCastToProperFunctionPointerType)glTexImage3DOES}, #define EXTENSION(name) {#name, (__eglMustCastToProperFunctionPointerType)name}
{"glBlitFramebufferANGLE", (__eglMustCastToProperFunctionPointerType)glBlitFramebufferANGLE},
{"glRenderbufferStorageMultisampleANGLE", (__eglMustCastToProperFunctionPointerType)glRenderbufferStorageMultisampleANGLE}, EXTENSION(glTexImage3DOES),
{"glDeleteFencesNV", (__eglMustCastToProperFunctionPointerType)glDeleteFencesNV}, EXTENSION(glBlitFramebufferANGLE),
{"glGenFencesNV", (__eglMustCastToProperFunctionPointerType)glGenFencesNV}, EXTENSION(glRenderbufferStorageMultisampleANGLE),
{"glIsFenceNV", (__eglMustCastToProperFunctionPointerType)glIsFenceNV}, EXTENSION(glDeleteFencesNV),
{"glTestFenceNV", (__eglMustCastToProperFunctionPointerType)glTestFenceNV}, EXTENSION(glGenFencesNV),
{"glGetFenceivNV", (__eglMustCastToProperFunctionPointerType)glGetFenceivNV}, EXTENSION(glIsFenceNV),
{"glFinishFenceNV", (__eglMustCastToProperFunctionPointerType)glFinishFenceNV}, EXTENSION(glTestFenceNV),
{"glSetFenceNV", (__eglMustCastToProperFunctionPointerType)glSetFenceNV}, EXTENSION(glGetFenceivNV),
{"glGetGraphicsResetStatusEXT", (__eglMustCastToProperFunctionPointerType)glGetGraphicsResetStatusEXT}, EXTENSION(glFinishFenceNV),
{"glReadnPixelsEXT", (__eglMustCastToProperFunctionPointerType)glReadnPixelsEXT}, EXTENSION(glSetFenceNV),
{"glGetnUniformfvEXT", (__eglMustCastToProperFunctionPointerType)glGetnUniformfvEXT}, EXTENSION(glGetGraphicsResetStatusEXT),
{"glGetnUniformivEXT", (__eglMustCastToProperFunctionPointerType)glGetnUniformivEXT}, EXTENSION(glReadnPixelsEXT),
{"glGenQueriesEXT", (__eglMustCastToProperFunctionPointerType)glGenQueriesEXT}, EXTENSION(glGetnUniformfvEXT),
{"glDeleteQueriesEXT", (__eglMustCastToProperFunctionPointerType)glDeleteQueriesEXT}, EXTENSION(glGetnUniformivEXT),
{"glIsQueryEXT", (__eglMustCastToProperFunctionPointerType)glIsQueryEXT}, EXTENSION(glGenQueriesEXT),
{"glBeginQueryEXT", (__eglMustCastToProperFunctionPointerType)glBeginQueryEXT}, EXTENSION(glDeleteQueriesEXT),
{"glEndQueryEXT", (__eglMustCastToProperFunctionPointerType)glEndQueryEXT}, EXTENSION(glIsQueryEXT),
{"glGetQueryivEXT", (__eglMustCastToProperFunctionPointerType)glGetQueryivEXT}, EXTENSION(glBeginQueryEXT),
{"glGetQueryObjectuivEXT", (__eglMustCastToProperFunctionPointerType)glGetQueryObjectuivEXT}, EXTENSION(glEndQueryEXT),
{"glEGLImageTargetTexture2DOES", (__eglMustCastToProperFunctionPointerType)glEGLImageTargetTexture2DOES} EXTENSION(glGetQueryivEXT),
EXTENSION(glGetQueryObjectuivEXT),
EXTENSION(glEGLImageTargetTexture2DOES),
#undef EXTENSION
}; };
for(int ext = 0; ext < sizeof(glExtensions) / sizeof(Extension); ext++) for(int ext = 0; ext < sizeof(glExtensions) / sizeof(Extension); ext++)
......
...@@ -91,7 +91,7 @@ CONSTRUCTOR static bool eglAttachProcess() ...@@ -91,7 +91,7 @@ CONSTRUCTOR static bool eglAttachProcess()
libRAD = loadLibrary(libRAD_lib); libRAD = loadLibrary(libRAD_lib);
rad::createContext = (egl::Context *(*)(const egl::Config*, const egl::Context*))getProcAddress(libRAD, "glCreateContext"); rad::createContext = (egl::Context *(*)(const egl::Config*, const egl::Context*))getProcAddress(libRAD, "glCreateContext");
rad::getProcAddress = (__eglMustCastToProperFunctionPointerType (*)(const char*))getProcAddress(libRAD, "glGetProcAddress"); rad::getProcAddress = (__eglMustCastToProperFunctionPointerType (RADAPIENTRY *)(const char*))getProcAddress(libRAD, "radGetProcAddress");
rad::createBackBuffer = (egl::Image *(*)(int, int, const egl::Config*))getProcAddress(libRAD, "createBackBuffer"); rad::createBackBuffer = (egl::Image *(*)(int, int, const egl::Config*))getProcAddress(libRAD, "createBackBuffer");
rad::createDepthStencil = (egl::Image *(*)(unsigned int, unsigned int, sw::Format, int, bool))getProcAddress(libRAD, "createDepthStencil"); rad::createDepthStencil = (egl::Image *(*)(unsigned int, unsigned int, sw::Format, int, bool))getProcAddress(libRAD, "createDepthStencil");
rad::createFrameBuffer = (sw::FrameBuffer *(*)(EGLNativeDisplayType, EGLNativeWindowType, int, int))getProcAddress(libRAD, "createFrameBuffer"); rad::createFrameBuffer = (sw::FrameBuffer *(*)(EGLNativeDisplayType, EGLNativeWindowType, int, int))getProcAddress(libRAD, "createFrameBuffer");
...@@ -303,7 +303,7 @@ void error(EGLint errorCode) ...@@ -303,7 +303,7 @@ void error(EGLint errorCode)
namespace rad namespace rad
{ {
egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext) = 0; egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext) = 0;
__eglMustCastToProperFunctionPointerType (*getProcAddress)(const char *procname) = 0; __eglMustCastToProperFunctionPointerType (RADAPIENTRY *getProcAddress)(const char *procname) = 0;
egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config) = 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; egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard) = 0;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#define EGLAPI #define EGLAPI
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include <RAD/rad.h>
namespace egl namespace egl
{ {
...@@ -86,7 +87,7 @@ namespace sw ...@@ -86,7 +87,7 @@ namespace sw
namespace rad namespace rad
{ {
extern egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext); extern egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext);
extern __eglMustCastToProperFunctionPointerType (*getProcAddress)(const char *procname); extern __eglMustCastToProperFunctionPointerType (RADAPIENTRY *getProcAddress)(const char *procname);
extern egl::Image *(*createBackBuffer)(int width, int height, const egl::Config *config); 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 egl::Image *(*createDepthStencil)(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard);
......
...@@ -168,6 +168,8 @@ EXPORTS ...@@ -168,6 +168,8 @@ EXPORTS
glGetQueryivEXT @170 glGetQueryivEXT @170
glGetQueryObjectuivEXT @171 glGetQueryObjectuivEXT @171
radGetProcAddress
; EGL dependencies ; EGL dependencies
glCreateContext glCreateContext
glGetProcAddress glGetProcAddress
......
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