self.postExtract(dstPath)
class GitRepo (Source):
- def __init__(self, url, revision, baseDir, extractDir = "src"):
+ def __init__(self, url, revision, baseDir, extractDir = "src", postFetch=None):
Source.__init__(self, baseDir, extractDir)
self.url = url
self.revision = revision
+ self.postFetch = postFetch
def update (self):
fullDstPath = os.path.join(EXTERNAL_DIR, self.baseDir, self.extractDir)
try:
execute(["git", "fetch", self.url, "+refs/heads/*:refs/remotes/origin/*"])
execute(["git", "checkout", self.revision])
+
+ if self.postFetch != None:
+ self.postFetch(fullDstPath)
finally:
popWorkingDir()
shutil.copy(os.path.join(path, "scripts", "pnglibconf.h.prebuilt"),
os.path.join(path, "pnglibconf.h"))
+def postFetchGlslang (path):
+ execute(["git", "fetch", "git@github.com:phaulos/glslang.git", "+refs/heads/*:refs/remotes/origin/*"])
+ execute(["git", "cherry-pick", "5f6892e23c9eed8c308bc16e145abccaacacb6b7"])
+
PACKAGES = [
SourcePackage(
"http://zlib.net/zlib-1.2.8.tar.gz",
"spirv-tools"),
GitRepo(
"git@gitlab.khronos.org:GLSL/glslang.git",
- "500e698906229d81c5ebd44661e770474f590897",
- "glslang"),
+ "75be019cfac8f29e93f0bebe90b85bc4d5a761c2",
+ "glslang",
+ postFetch = postFetchGlslang),
]
def parseArgs ():
message(STATUS "glslang found; building with DEQP_SUPPORT_GLSLANG")
include_directories(
- .
${GLSLANG_ABS_PATH}
${GLSLANG_ABS_PATH}/glslang
${GLSLANG_ABS_PATH}/glslang/Include
${GLSLANG_ABS_PATH}/glslang/Public
${GLSLANG_ABS_PATH}/glslang/MachineIndependent
${GLSLANG_ABS_PATH}/glslang/GenericCodeGen
+ ${GLSLANG_ABS_PATH}/glslang/OSDependent
${GLSLANG_ABS_PATH}/OGLCompilersDLL
${GLSLANG_ABS_PATH}/SPIRV
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp
${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h
- osinclude.h
osinclude.cpp
)
#include "osinclude.h"
+#include "deThread.h"
+#include "deThreadLocal.h"
+
namespace glslang
{
+DE_STATIC_ASSERT(sizeof(deThreadLocal) == sizeof(OS_TLSIndex));
+DE_STATIC_ASSERT(sizeof(deThread) == sizeof(void*));
+
// Thread-local
OS_TLSIndex OS_AllocTLSIndex (void)
{
- return deThreadLocal_create();
+ return (OS_TLSIndex)deThreadLocal_create();
}
bool OS_SetTLSValue (OS_TLSIndex nIndex, void* lpvValue)
{
- deThreadLocal_set(nIndex, lpvValue);
+ deThreadLocal_set((deThreadLocal)nIndex, lpvValue);
return true;
}
bool OS_FreeTLSIndex (OS_TLSIndex nIndex)
{
- deThreadLocal_destroy(nIndex);
+ deThreadLocal_destroy((deThreadLocal)nIndex);
return true;
}
void* OS_GetTLSValue (OS_TLSIndex nIndex)
{
- return deThreadLocal_get(nIndex);
+ return deThreadLocal_get((deThreadLocal)nIndex);
}
// Global lock - not used
DE_STATIC_ASSERT(sizeof(void*) >= sizeof(deThread));
+static void EnterGenericThread (void* entry)
+{
+ ((TThreadEntrypoint)entry)(DE_NULL);
+}
+
void* OS_CreateThread (TThreadEntrypoint entry)
{
- return (void*)(deUintptr)deThread_create(entry, DE_NULL, DE_NULL);
+ return (void*)(deUintptr)deThread_create(EnterGenericThread, (void*)entry, DE_NULL);
}
void OS_WaitForAllThreads (void* threads, int numThreads)
+++ /dev/null
-#ifndef _OSINCLUDE_H
-#define _OSINCLUDE_H
-/*-------------------------------------------------------------------------
- * dEQP glslang integration
- * ------------------------
- *
- * Copyright 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *//*!
- * \file
- * \brief glslang OS interface.
- *//*--------------------------------------------------------------------*/
-
-#include "deDefs.hpp"
-#include "deThreadLocal.h"
-#include "deThread.h"
-
-namespace glslang
-{
-
-// Thread-local
-
-typedef deThreadLocal OS_TLSIndex;
-
-#define OS_INVALID_TLS_INDEX DE_NULL
-
-OS_TLSIndex OS_AllocTLSIndex (void);
-bool OS_SetTLSValue (OS_TLSIndex nIndex, void* lpvValue);
-bool OS_FreeTLSIndex (OS_TLSIndex nIndex);
-
-void* OS_GetTLSValue (OS_TLSIndex nIndex);
-
-// Global lock?
-
-void InitGlobalLock (void);
-void GetGlobalLock (void);
-void ReleaseGlobalLock (void);
-
-// Threading
-
-typedef deThreadFunc TThreadEntrypoint;
-
-void* OS_CreateThread (TThreadEntrypoint);
-void OS_WaitForAllThreads (void* threads, int numThreads);
-
-void OS_Sleep (int milliseconds);
-
-void OS_DumpMemoryCounters (void);
-
-} // glslang
-
-#endif /* _OSINCLUDE_H */