42 #include <QtCore/qdebug.h> 44 #define QT_DEBUG_SHADER_CACHE 45 #define QT_MEEGO_EXPERIMENTAL_SHADERCACHE 46 #define QT_OPENGL_ES_2 47 #define QT_BOOTSTRAPPED 52 #include "../../gl2paintengineex/qglshadercache_meego_p.h" 59 ShaderCacheSharedMemory shm;
61 if (!shm.isAttached()) {
62 fprintf(stderr,
"Unable to attach to shared memory\n");
66 ShaderCacheLocker locker(&shm);
67 if (!locker.isLocked()) {
68 fprintf(stderr,
"Unable to lock shared memory\n");
72 void *
data = shm.data();
75 CachedShaders *cache =
reinterpret_cast<CachedShaders *
>(
data);
77 for (
int i = 0; i < cache->shaderCount; ++i) {
78 printf(
"Shader %d: %d bytes\n", i, cache->headers[i].size);
81 printf(
"\nSummary:\n\n" 82 " Amount of cached shaders: %d\n" 84 " Bytes available: %d\n",
85 cache->shaderCount, cache->dataSize, cache->availableSize());
static const char * data(const QByteArray &arr)