summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/api.cpp
diff options
context:
space:
mode:
author Cody Northrop <cnorthrop@google.com> 2019-11-05 09:04:33 -0700
committer Cody Northrop <cnorthrop@google.com> 2019-11-05 15:06:26 -0700
commit00260e4a7907dabd2f628ac395c97c7107e4a080 (patch)
tree2747ff6e98aa5fd3d7f8440c0cceb73577647c76 /vulkan/libvulkan/api.cpp
parentcee9c595034cab9b49bf4397d10d63806d99cf21 (diff)
EGL: Fix repeated extension lookups
When adding support for GLES layers, we refactored eglGetProcAddress to allow layers to intercept functions unknown to the Loader. During the cleanup, we broke slot tracking if an extension were looked up multiple times. Follow up queries would use an incremented slot that had not been initialized: eglGetProcAddress("foo1") = fptr0:0x77e2c2abd8 eglGetProcAddress("foo2") = fptr1:0x77e2c2abf4 eglGetProcAddress("foo3") = fptr2:0x77e2c2ac10 eglGetProcAddress("foo1") = fptr3:0x77e2c2ac2c <= wrong eglGetProcAddress("foo2") = fptr4:0x77e2c2ac2c <= repeated eglGetProcAddress("foo3") = fptr5:0x77e2c2ac2c <= repeated This CL tracks which slot was used for a given extension, and when it is queried a second time, we look up the correct slot using extensionSlotMap. eglGetProcAddress("foo1") = fptr0:0x77e2c2abd8 eglGetProcAddress("foo2") = fptr1:0x77e2c2abf4 eglGetProcAddress("foo3") = fptr2:0x77e2c2ac10 eglGetProcAddress("foo1") = fptr3:0x77e2c2abd8 <= correct eglGetProcAddress("foo2") = fptr4:0x77e2c2abf4 <= correct eglGetProcAddress("foo3") = fptr5:0x77e2c2ac10 <= correct It also refactors the code a bit to be more readable, and fixes a typo throughout the file. Bug: 143860847 Test: egl_api_test Change-Id: If75c1abdb69a4d82253f28a5a80687f546e33ee0
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
0 files changed, 0 insertions, 0 deletions