diff options
author | 2019-03-02 12:49:40 -0700 | |
---|---|---|
committer | 2019-03-25 07:56:21 -0600 | |
commit | b5b0ce62e71b65248d59d2c717faff397b3339b3 (patch) | |
tree | b56c6c19333a9f63b13bb7d8ce9e19b41b0c697f | |
parent | 1722f8e61d3ffe02de7b7ae3f0885cd262afc090 (diff) |
More verbose debugging for GLES layers
These have been useful while debugging layer implementations.
Bug: 110883880
Test: atest CtsGpuToolsHostTestCases
Test: Connect with GLES layers using GAPID and RenderDoc
Change-Id: I7b797fb8fd8a43c57dd3c2baac2712bf6c839ef2
-rw-r--r-- | opengl/libs/EGL/egl_layers.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/opengl/libs/EGL/egl_layers.cpp b/opengl/libs/EGL/egl_layers.cpp index ab631de376..ac01dc8f96 100644 --- a/opengl/libs/EGL/egl_layers.cpp +++ b/opengl/libs/EGL/egl_layers.cpp @@ -76,23 +76,26 @@ const void* getNextLayerProcAddress(void* layer_id, const char* name) { auto next_layer_funcs = reinterpret_cast<FunctionTable*>(layer_id); EGLFuncPointer val; + ALOGV("getNextLayerProcAddress servicing %s", name); + if (func_indices.find(name) == func_indices.end()) { // No entry for this function - it is an extension // call down the GPA chain directly to the impl - ALOGV("getNextLayerProcAddress servicing %s", name); + ALOGV("getNextLayerProcAddress - name(%s) no func_indices entry found", name); // Look up which GPA we should use int gpaIndex = func_indices["eglGetProcAddress"]; + ALOGV("getNextLayerProcAddress - name(%s) gpaIndex(%i) <- using GPA from this index", name, gpaIndex); EGLFuncPointer gpaNext = (*next_layer_funcs)[gpaIndex]; + ALOGV("getNextLayerProcAddress - name(%s) gpaIndex(%i) gpaNext(%llu) <- using GPA at this address", name, gpaIndex, (unsigned long long)gpaNext); - ALOGV("Calling down the GPA chain (%llu) for %s", (unsigned long long)gpaNext, name); // Call it for the requested function typedef void* (*PFNEGLGETPROCADDRESSPROC)(const char*); PFNEGLGETPROCADDRESSPROC next = reinterpret_cast<PFNEGLGETPROCADDRESSPROC>(gpaNext); val = reinterpret_cast<EGLFuncPointer>(next(name)); - ALOGV("Got back %llu for %s", (unsigned long long)val, name); + ALOGV("getNextLayerProcAddress - name(%s) gpaIndex(%i) gpaNext(%llu) Got back (%llu) from GPA", name, gpaIndex, (unsigned long long)gpaNext, (unsigned long long)val); // We should store it now, but to do that, we need to move func_idx to the class so we can // increment it separately @@ -100,10 +103,10 @@ const void* getNextLayerProcAddress(void* layer_id, const char* name) { return reinterpret_cast<void*>(val); } - // int index = func_indices[name]; - // val = (*next_layer_funcs)[index]; - // return reinterpret_cast<void*>(val); - return reinterpret_cast<void*>((*next_layer_funcs)[func_indices[name]]); + int index = func_indices[name]; + val = (*next_layer_funcs)[index]; + ALOGV("getNextLayerProcAddress - name(%s) index(%i) entry(%llu) - Got a hit, returning known entry", name, index, (unsigned long long)val); + return reinterpret_cast<void*>(val); } void SetupFuncMaps(FunctionTable& functions, char const* const* entries, EGLFuncPointer* curr, @@ -114,14 +117,20 @@ void SetupFuncMaps(FunctionTable& functions, char const* const* entries, EGLFunc // Some names overlap, only fill with initial entry // This does mean that some indices will not be used if (func_indices.find(name) == func_indices.end()) { + ALOGV("SetupFuncMaps - name(%s), func_idx(%i), No entry for func_indices, assigning now", name, func_idx); func_names[func_idx] = name; func_indices[name] = func_idx; + } else { + ALOGV("SetupFuncMaps - name(%s), func_idx(%i), Found entry for func_indices", name, func_idx); } // Populate layer_functions once with initial value // These values will arrive in priority order, starting with platform entries if (functions[func_idx] == nullptr) { + ALOGV("SetupFuncMaps - name(%s), func_idx(%i), No entry for functions, assigning (%llu)", name, func_idx, (unsigned long long) *curr); functions[func_idx] = *curr; + } else { + ALOGV("SetupFuncMaps - name(%s), func_idx(%i), Found entry for functions (%llu)", name, func_idx, (unsigned long long) functions[func_idx]); } entries++; |