static deStreamResult fileIOStream_flush (deStreamData* stream) { /* \todo mika deFile doesn't have flush, how should this be handled? */ DE_UNREF(stream); return DE_STREAMRESULT_SUCCESS; }
static void CALLBACK timerCallback (PVOID lpParameter, BOOLEAN timerOrWaitFired) { const deTimer* timer = (const deTimer*)lpParameter; DE_UNREF(timerOrWaitFired); timer->callback(timer->callbackArg); }
void deSemaphore_decrement (deSemaphore semaphore) { sem_t* sem = (sem_t*)semaphore; int ret = sem_wait(sem); DE_ASSERT(ret == 0); DE_UNREF(ret); }
static void tlsTestThr (void* arg) { DE_UNREF(arg); DE_TEST_ASSERT(tls_testVar == 123); tls_testVar = 104; DE_TEST_ASSERT(tls_testVar == 104); }
GLW_APICALL void GLW_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params) { DE_UNREF(program); if (pname == GL_LINK_STATUS) *params = GL_TRUE; }
void deTimer_disable (deTimer* timer) { if (timer->timer) { const int maxTries = 100; HANDLE waitEvent = CreateEvent(NULL, FALSE, FALSE, NULL); int tryNdx = 0; DE_ASSERT(waitEvent); for (tryNdx = 0; tryNdx < maxTries; tryNdx++) { BOOL success = DeleteTimerQueueTimer(NULL, timer->timer, waitEvent); if (success) { /* Wait for all callbacks to complete. */ DWORD res = WaitForSingleObject(waitEvent, INFINITE); DE_ASSERT(res == WAIT_OBJECT_0); DE_UNREF(res); break; } else { DWORD err = GetLastError(); if (err == ERROR_IO_PENDING) break; /* \todo [2013-03-21 pyry] Does this mean that callback is still in progress? */ deYield(); } } DE_ASSERT(tryNdx < maxTries); CloseHandle(waitEvent); timer->timer = 0; } }
void deSemaphore_decrement (deSemaphore semaphore) { sem_t* sem = ((NamedSemaphore*)semaphore)->semaphore; int res = sem_wait(sem); DE_ASSERT(res == 0); DE_UNREF(res); }
GLW_APICALL void GLW_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params) { DE_UNREF(shader); if (pname == GL_COMPILE_STATUS) *params = GL_TRUE; }
static const char* qpLookupString (const qpKeyStringMap* keyMap, int keyMapSize, int key) { DE_ASSERT(keyMap); DE_ASSERT(deInBounds32(key, 0, keyMapSize)); DE_ASSERT(keyMap[key].key == key); DE_UNREF(keyMapSize); /* for asserting only */ return keyMap[key].string; }
void deSetAssertFailureCallback (deAssertFailureCallbackFunc callback) { #if defined(DE_ASSERT_FAILURE_CALLBACK) g_assertFailureCallback = callback; #else DE_UNREF(callback); #endif }
void initES30Direct (Functions* gl) { #if !defined(DEQP_GLES3_RUNTIME_LOAD) # include "glwInitES30Direct.inl" #else DE_UNREF(gl); throw std::runtime_error("Binaries were compiled without ES3 direct loading support"); #endif }
void TestProcess::terminate (void) { DBG_PRINT(("TestProcess::terminate()")); JNIEnv* env = getCurrentThreadEnv(); jboolean res = env->CallBooleanMethod(m_remote, m_kill); checkJniException(env, __FILE__, __LINE__); DE_UNREF(res); // Failure to kill process is ignored. }
static void die (int statusPipe, const char* message) { int msgLen = strlen(message); int res = 0; printf("Process launch failed: %s\n", message); res = (int)write(statusPipe, message, msgLen+1); DE_UNREF(res); /* No need to check result. */ exit(-1); }
void TestProcess::start (const char* name, const char* params, const char* workingDir, const char* caseList) { DBG_PRINT(("TestProcess::start(%s, %s, %s, ...)", name, params, workingDir)); JNIEnv* env = getCurrentThreadEnv(); jstring nameStr = 0; jstring paramsStr = 0; jstring caseListStr = 0; DE_UNREF(workingDir); // Remove old log file if such exists. if (deFileExists(LOG_FILE_NAME)) { if (!deDeleteFile(LOG_FILE_NAME) || deFileExists(LOG_FILE_NAME)) throw xs::TestProcessException(std::string("Failed to remove '") + LOG_FILE_NAME + "'"); } try { nameStr = env->NewStringUTF(name); JNI_CHECK(nameStr); paramsStr = env->NewStringUTF(params); JNI_CHECK(paramsStr); caseListStr = env->NewStringUTF(caseList); JNI_CHECK(caseListStr); jboolean res = env->CallBooleanMethod(m_remote, m_start, nameStr, paramsStr, caseListStr); checkJniException(env, __FILE__, __LINE__); if (res == JNI_FALSE) throw xs::TestProcessException("Failed to launch activity"); m_launchTime = deGetMicroseconds(); m_lastQueryTime = m_launchTime; m_lastRunningStatus = true; } catch (...) { if (nameStr) env->DeleteLocalRef(nameStr); if (paramsStr) env->DeleteLocalRef(paramsStr); if (caseListStr) env->DeleteLocalRef(caseListStr); throw; } env->DeleteLocalRef(nameStr); env->DeleteLocalRef(paramsStr); env->DeleteLocalRef(caseListStr); }
void BatchExecutor::onTestLogData (const deUint8* bytes, int numBytes) { try { m_testLogParser.parse(bytes, numBytes); } catch (const ParseError& e) { // \todo [2012-07-06 pyry] Log error. DE_UNREF(e); } }
GLW_APICALL void GLW_APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params) { static const int s_sampleCounts[] = { 16, 8, 4, 2, 1 }; DE_UNREF(internalformat); DE_UNREF(target); switch (pname) { case GL_NUM_SAMPLE_COUNTS: if (bufSize >= 1) *params = DE_LENGTH_OF_ARRAY(s_sampleCounts); break; case GL_SAMPLES: deMemcpy(params, s_sampleCounts, de::min(bufSize, DE_LENGTH_OF_ARRAY(s_sampleCounts))); break; default: break; } }
std::string SparseCaseOpImageSparseSampleImplicitLod::sparseImageOpString (const std::string& resultVariable, const std::string& resultType, const std::string& image, const std::string& coord, const std::string& miplevel) const { DE_UNREF(miplevel); std::ostringstream src; src << resultVariable << " = OpImageSparseSampleImplicitLod " << resultType << " " << image << " " << coord << "\n"; return src.str(); }
void deSemaphore_destroy (deSemaphore semaphore) { NamedSemaphore* sem = (NamedSemaphore*)semaphore; char name[128]; int res; NamedSemaphore_getName(sem, name, DE_LENGTH_OF_ARRAY(name)); res = sem_close(sem->semaphore); DE_ASSERT(res == 0); res = sem_unlink(name); DE_ASSERT(res == 0); DE_UNREF(res); deFree(sem); }
void ES2Checker::check(GLenum attPoint, const Attachment& att, const Image* image) { DE_UNREF(attPoint); DE_UNREF(att); // GLES2: "All attached images have the same width and height." if (m_width == -1) { m_width = image->width; m_height = image->height; } else { require(image->width == m_width && image->height == m_height, GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS); } // GLES2, 4.4.5: "some implementations may not support rendering to // particular combinations of internal formats. If the combination of // formats of the images attached to a framebuffer object are not // supported by the implementation, then the framebuffer is not complete // under the clause labeled FRAMEBUFFER_UNSUPPORTED." // // Hence it is _always_ allowed to report FRAMEBUFFER_UNSUPPORTED. canRequire(false, GL_FRAMEBUFFER_UNSUPPORTED); }
deSemaphore deSemaphore_create (int initialValue, const deSemaphoreAttributes* attributes) { sem_t* sem = (sem_t*)deMalloc(sizeof(sem_t)); DE_UNREF(attributes); if (!sem) return 0; if (sem_init(sem, 0, initialValue) != 0) { deFree(sem); return 0; } return (deSemaphore)sem; }
deSemaphore deSemaphore_create (int initialValue, const deSemaphoreAttributes* attributes) { NamedSemaphore* sem = (NamedSemaphore*)deCalloc(sizeof(NamedSemaphore)); char name[128]; deUint32 mode = 0700; DE_UNREF(attributes); if (!sem) return 0; NamedSemaphore_getName(sem, name, DE_LENGTH_OF_ARRAY(name)); sem->semaphore = sem_open(name, O_CREAT|O_EXCL, mode, initialValue); if (sem->semaphore == SEM_FAILED) { deFree(sem); return 0; } return (deSemaphore)sem; }
eglu::NativeDisplay *ANGLENativeDisplayFactory::createDisplay(const eglw::EGLAttrib *attribList) const { DE_UNREF(attribList); return new ANGLENativeDisplay(mPlatformAttributes); }
static void threadTestThr2 (void* arg) { DE_UNREF(arg); deSleep(100); }
void pngFlushData (png_structp png) { DE_UNREF(png); /* nada */ }
VkImageSubresourceRange sampledImageRangeToBind (const VkImageCreateInfo& imageSparseInfo, const deUint32 mipLevel) const { DE_UNREF(mipLevel); return makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, imageSparseInfo.mipLevels, 0u, imageSparseInfo.arrayLayers); }
void TestThread::onWindowResized (ANativeWindow* window) { DE_UNREF(window); print("Warning: Native window was resized, results may be undefined"); }
void RenderActivity::onNativeWindowRedrawNeeded (ANativeWindow* window) { DE_UNREF(window); }
void deMutex_lock (deMutex mutex) { int ret = pthread_mutex_lock((pthread_mutex_t*)mutex); DE_ASSERT(ret == 0); DE_UNREF(ret); }
void readPixels (tcu::Surface& dst, int x, int y, int width, int height) { DE_UNREF(x && y && width && height); DE_UNREF(dst); throw tcu::NotSupportedError("OpenGL ES 1.x is not supported", "", __FILE__, __LINE__); }
void clear (int x, int y, int width, int height, const tcu::Vec4& color) { DE_UNREF(x && y && width && height); DE_UNREF(color); throw tcu::NotSupportedError("OpenGL ES 1.x is not supported", "", __FILE__, __LINE__); }