Update glslang revision
authorPyry Haulos <phaulos@google.com>
Tue, 1 Dec 2015 23:35:07 +0000 (15:35 -0800)
committerPyry Haulos <phaulos@google.com>
Thu, 3 Dec 2015 22:06:09 +0000 (14:06 -0800)
Change-Id: I4035385be1efa8137a29cab25f08a97990f20af4

external/fetch_sources.py
external/glslang/CMakeLists.txt
external/glslang/osinclude.cpp
external/glslang/osinclude.h [deleted file]

index d3e8773..f6ef240 100644 (file)
@@ -134,10 +134,11 @@ class SourcePackage (Source):
                        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)
@@ -149,6 +150,9 @@ class GitRepo (Source):
                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()
 
@@ -156,6 +160,10 @@ def postExtractLibpng (path):
        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",
@@ -174,8 +182,9 @@ PACKAGES = [
                "spirv-tools"),
        GitRepo(
                "git@gitlab.khronos.org:GLSL/glslang.git",
-               "500e698906229d81c5ebd44661e770474f590897",
-               "glslang"),
+               "75be019cfac8f29e93f0bebe90b85bc4d5a761c2",
+               "glslang",
+               postFetch = postFetchGlslang),
 ]
 
 def parseArgs ():
index 97c344b..4d977a3 100644 (file)
@@ -31,13 +31,13 @@ if (BISON_FOUND AND EXISTS ${GLSLANG_ABS_PATH}/glslang/GenericCodeGen/CodeGen.cp
        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}
@@ -81,7 +81,6 @@ if (BISON_FOUND AND EXISTS ${GLSLANG_ABS_PATH}/glslang/GenericCodeGen/CodeGen.cp
                ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp
                ${CMAKE_CURRENT_BINARY_DIR}/glslang_tab.cpp.h
 
-               osinclude.h
                osinclude.cpp
                )
 
index 9341ec7..7ce67f6 100644 (file)
 
 #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
@@ -68,9 +74,14 @@ void ReleaseGlobalLock (void)
 
 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)
diff --git a/external/glslang/osinclude.h b/external/glslang/osinclude.h
deleted file mode 100644 (file)
index 7174579..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#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 */