summaryrefslogtreecommitdiffstats
path: root/src/opengl/util
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-22 00:56:20 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-22 00:56:20 (GMT)
commit6db81533a21b08e9dffd7ef4431443732bda2f28 (patch)
treeaaec35a072f3062c8e2335a006ac6a251196f67a /src/opengl/util
parentd37a3529ec883985b2967265f0797d749db74308 (diff)
parent435eeaac07e50db4938066e36cd1a778c4523493 (diff)
downloadQt-6db81533a21b08e9dffd7ef4431443732bda2f28.zip
Qt-6db81533a21b08e9dffd7ef4431443732bda2f28.tar.gz
Qt-6db81533a21b08e9dffd7ef4431443732bda2f28.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (33 commits) Add inter-process binary shader cache for MeeGo Track average wait times under our maximum spin time threshold Store and track spin times in nanosecond resolution Optimize adaptive spinning mutex code Improve QMutex contention performance on Linux Improve QMutex contention performance on Mac OS X Disable spinning under lock contention on single CPU machines Remove unnecessary testAndSetAcquire from QMutex::lockInternal() Move contender count maintenance to QMutexPrivate test contention when using 2 mutexes Ensure that every thread does contend in the contention tests Add baseline test data to measure test overhead Test contention performance for long (10ms) critical sections Add a benchmark for contended and uncontended QMutex performance Removed QMutexPrivate::self() declaration Add QElapsedTimer::nsecsElapsed() const Delay creation of the process manager Make the QRasterPaintEngineState copy constructor cheaper. Micro-optimization for QSpanData::setup() define FSCTL_SET_REPARSE_POINT in test header ...
Diffstat (limited to 'src/opengl/util')
-rw-r--r--src/opengl/util/meego/main.cpp48
-rw-r--r--src/opengl/util/meego/shader-cache-introspector.pro7
2 files changed, 55 insertions, 0 deletions
diff --git a/src/opengl/util/meego/main.cpp b/src/opengl/util/meego/main.cpp
new file mode 100644
index 0000000..0c9a915
--- /dev/null
+++ b/src/opengl/util/meego/main.cpp
@@ -0,0 +1,48 @@
+#include <QtCore/qdebug.h>
+
+#define QT_DEBUG_SHADER_CACHE
+#define QT_MEEGO_EXPERIMENTAL_SHADERCACHE
+#define QT_OPENGL_ES_2
+#define QT_BOOTSTRAPPED
+
+typedef int GLsizei;
+typedef unsigned int GLenum;
+
+#include "../../gl2paintengineex/qglshadercache_meego_p.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+int main()
+{
+ ShaderCacheSharedMemory shm;
+
+ if (!shm.isAttached()) {
+ fprintf(stderr, "Unable to attach to shared memory\n");
+ return EXIT_FAILURE;
+ }
+
+ ShaderCacheLocker locker(&shm);
+ if (!locker.isLocked()) {
+ fprintf(stderr, "Unable to lock shared memory\n");
+ return EXIT_FAILURE;
+ }
+
+ void *data = shm.data();
+ Q_ASSERT(data);
+
+ CachedShaders *cache = reinterpret_cast<CachedShaders *>(data);
+
+ for (int i = 0; i < cache->shaderCount; ++i) {
+ printf("Shader %d: %d bytes\n", i, cache->headers[i].size);
+ }
+
+ printf("\nSummary:\n\n"
+ " Amount of cached shaders: %d\n"
+ " Bytes used: %d\n"
+ " Bytes available: %d\n",
+ cache->shaderCount, cache->dataSize, cache->availableSize());
+
+ return EXIT_SUCCESS;
+}
+
diff --git a/src/opengl/util/meego/shader-cache-introspector.pro b/src/opengl/util/meego/shader-cache-introspector.pro
new file mode 100644
index 0000000..520e9a5
--- /dev/null
+++ b/src/opengl/util/meego/shader-cache-introspector.pro
@@ -0,0 +1,7 @@
+TEMPLATE = app
+
+SOURCES += main.cpp
+
+TARGET = shader-cache-introspector
+
+QT = core