Skip to content

Commit

Permalink
linux/clgl: Remove broken tests
Browse files Browse the repository at this point in the history
Theses were heavily reliant on the old implementation and don't test
anything of value. (CL/GL sharing is completely broken yet the test
pass ...). So get rid of that junk.

Signed-off-by: Sylvain Munaut <[email protected]>
  • Loading branch information
smunaut committed Jan 25, 2024
1 parent f270404 commit b4364cb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 830 deletions.
183 changes: 0 additions & 183 deletions opencl/test/unit_test/mock_gl/linux/mock_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@ extern "C" {
const char *glString = "Intel";
const char *glVersion = "4.0";
const char *arrayStringi[2]{"GL_OES_framebuffer_object", "GL_EXT_framebuffer_object"};
int glAcquireSharedBufferCalled = 0;
int glAcquireSharedRenderBufferCalled = 0;
int glAcquireSharedTextureCalled = 0;
int glDeleteContextCalled = 0;
int glGetCurrentContextCalled = 0;
int glGetCurrentDisplayCalled = 0;
int glGetSyncivCalled = 0;
int glMakeCurrentCalled = 0;
int glReleaseSharedBufferCalled = 0;
int glReleaseSharedRenderBufferCalled = 0;
int glReleaseSharedTextureCalled = 0;
int glReleaseSyncCalled = 0;
int glRetainSyncCalled = 0;
int eglCreateContextCalled = 0;
int eglDeleteContextCalled = 0;
int eglShareListsCalled = 0;
CL_GL_BUFFER_INFO bufferInfoInput = {0};
CL_GL_BUFFER_INFO bufferInfoOutput = {0};
CL_GL_RESOURCE_INFO textureInfoInput = {0};
Expand All @@ -46,163 +30,11 @@ const unsigned char *glGetString(unsigned int name) {
return reinterpret_cast<const unsigned char *>("");
};

EGLBoolean eglExportDMABUFImageMESA(EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets) {
glAcquireSharedTextureCalled++;
if (image == mockImage) {
*fds = 10;
textureInfoInput.name = 1;
return GL_TRUE;
} else {
return GL_FALSE;
}
};

void *eglGetCurrentContext() {
glGetCurrentContextCalled++;
return nullptr;
};
void *eglGetCurrentDisplay() {
glGetCurrentDisplayCalled++;
return nullptr;
};

EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext shareContext, const EGLint *attribList) {
eglCreateContextCalled++;
return (GLContext)0x101;
};
EGLBoolean eglDestroyContext(EGLDisplay display, EGLContext context) {
eglDeleteContextCalled++;
glDeleteContextCalled++;
return (GLboolean)1;
};
void glGetIntegerv(GLenum pname, GLint *params) { return NEO::MockGLSharingFunctions::glGetIntegervTest(pname, params); };
unsigned char eglShareLists(void *arg1, void *arg2) {
eglShareListsCalled++;
return 1;
};

EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext arg2) {
glMakeCurrentCalled++;
return EGL_TRUE;
};

void resetParam(const char *name) {
if (strcmp(name, "GLAcquireSharedBufferCalled") == 0) {
glAcquireSharedBufferCalled = 0;
}
if (strcmp(name, "GLAcquireSharedRenderBufferCalled") == 0) {
glAcquireSharedRenderBufferCalled = 0;
}
if (strcmp(name, "GLAcquireSharedTextureCalled") == 0) {
glAcquireSharedTextureCalled = 0;
}
if (strcmp(name, "GLDeleteContextCalled") == 0) {
glDeleteContextCalled = 0;
}
if (strcmp(name, "GLGetCurrentContextCalled") == 0) {
glGetCurrentContextCalled = 0;
}
if (strcmp(name, "GLGetCurrentDisplayCalled") == 0) {
glGetCurrentDisplayCalled = 0;
}
if (strcmp(name, "GLGetSyncivCalled") == 0) {
glGetSyncivCalled = 0;
}
if (strcmp(name, "GLMakeCurrentCalled") == 0) {
glMakeCurrentCalled = 0;
}
if (strcmp(name, "GLReleaseSharedBufferCalled") == 0) {
glReleaseSharedBufferCalled = 0;
}
if (strcmp(name, "GLReleaseSharedRenderBufferCalled") == 0) {
glReleaseSharedRenderBufferCalled = 0;
}
if (strcmp(name, "GLReleaseSharedTextureCalled") == 0) {
glReleaseSharedTextureCalled = 0;
}
if (strcmp(name, "GLReleaseSyncCalled") == 0) {
glReleaseSyncCalled = 0;
}
if (strcmp(name, "GLRetainSyncCalled") == 0) {
glRetainSyncCalled = 0;
}
if (strcmp(name, "EGLCreateContextCalled") == 0) {
eglCreateContextCalled = 0;
}
if (strcmp(name, "EGLDeleteContextCalled") == 0) {
eglDeleteContextCalled = 0;
}
if (strcmp(name, "EGLShareListsCalled") == 0) {
eglShareListsCalled = 0;
}
if (strcmp(name, "") == 0) {
glAcquireSharedBufferCalled = 0;
glAcquireSharedRenderBufferCalled = 0;
glAcquireSharedTextureCalled = 0;
glDeleteContextCalled = 0;
glGetCurrentContextCalled = 0;
glGetCurrentDisplayCalled = 0;
glGetSyncivCalled = 0;
glMakeCurrentCalled = 0;
glReleaseSharedBufferCalled = 0;
glReleaseSharedRenderBufferCalled = 0;
glReleaseSharedTextureCalled = 0;
glReleaseSyncCalled = 0;
glRetainSyncCalled = 0;
eglCreateContextCalled = 0;
eglDeleteContextCalled = 0;
eglShareListsCalled = 0;
}
};
int getParam(const char *name) {
if (strcmp(name, "GLAcquireSharedBufferCalled") == 0) {
return glAcquireSharedBufferCalled;
}
if (strcmp(name, "GLAcquireSharedRenderBufferCalled") == 0) {
return glAcquireSharedRenderBufferCalled;
}
if (strcmp(name, "GLAcquireSharedTextureCalled") == 0) {
return glAcquireSharedTextureCalled;
}
if (strcmp(name, "GLDeleteContextCalled") == 0) {
return glDeleteContextCalled;
}
if (strcmp(name, "GLGetCurrentContextCalled") == 0) {
return glGetCurrentContextCalled;
}
if (strcmp(name, "GLGetCurrentDisplayCalled") == 0) {
return glGetCurrentDisplayCalled;
}
if (strcmp(name, "GLGetSyncivCalled") == 0) {
return glGetSyncivCalled;
}
if (strcmp(name, "GLMakeCurrentCalled") == 0) {
return glMakeCurrentCalled;
}
if (strcmp(name, "GLReleaseSharedBufferCalled") == 0) {
return glReleaseSharedBufferCalled;
}
if (strcmp(name, "GLReleaseSharedRenderBufferCalled") == 0) {
return glReleaseSharedRenderBufferCalled;
}
if (strcmp(name, "GLReleaseSharedTextureCalled") == 0) {
return glReleaseSharedTextureCalled;
}
if (strcmp(name, "GLReleaseSyncCalled") == 0) {
return glReleaseSyncCalled;
}
if (strcmp(name, "GLRetainSyncCalled") == 0) {
return glRetainSyncCalled;
}
if (strcmp(name, "EGLCreateContextCalled") == 0) {
return eglCreateContextCalled;
}
if (strcmp(name, "EGLDeleteContextCalled") == 0) {
return eglDeleteContextCalled;
}
if (strcmp(name, "EGLShareListsCalled") == 0) {
return eglShareListsCalled;
}
return 0;
};
CL_GL_BUFFER_INFO getBufferInfo() { return bufferInfoInput; };
Expand All @@ -227,21 +59,6 @@ void setGLSetSharedOCLContextStateReturnedValue(GLboolean value) { glSetSharedOC
GLboolean getGLSetSharedOCLContextStateReturnedValue() { return glSetSharedOCLContextStateReturnedValue; };

EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname) {

std::string functionName(procname);
if (functionName == "eglGetCurrentContext") {
return reinterpret_cast<__eglMustCastToProperFunctionPointerType EGLAPIENTRY>(eglGetCurrentContext);
} else if (functionName == "eglGetCurrentDisplay") {
return reinterpret_cast<__eglMustCastToProperFunctionPointerType EGLAPIENTRY>(eglGetCurrentDisplay);
} else if (functionName == "eglCreateContext") {
return reinterpret_cast<__eglMustCastToProperFunctionPointerType EGLAPIENTRY>(eglCreateContext);
} else if (functionName == "eglDestroyContext") {
return reinterpret_cast<__eglMustCastToProperFunctionPointerType EGLAPIENTRY>(eglDestroyContext);
} else if (functionName == "eglMakeCurrent") {
return reinterpret_cast<__eglMustCastToProperFunctionPointerType EGLAPIENTRY>(eglMakeCurrent);
} else if (functionName == "eglExportDMABUFImageMESA") {
return reinterpret_cast<__eglMustCastToProperFunctionPointerType EGLAPIENTRY>(eglExportDMABUFImageMESA);
}
return nullptr;
}
}
2 changes: 0 additions & 2 deletions opencl/test/unit_test/sharings/gl/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ if(UNIX)
set(IGDRCL_SRCS_tests_sharings_gl_linux
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/gl_arb_sync_event_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gl_create_from_texture_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gl_library_name.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gl_sharing_enable_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gl_sharing_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gl_texture_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/gl_types_tests.cpp
)
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_sharings_gl_linux})
Expand Down
Loading

0 comments on commit b4364cb

Please sign in to comment.