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-07 09:39:17 -0700
commit6a2c5c731b43d239392a6a2d3baf4894e8fd0532 (patch)
tree3fe244967ce72ad7260399c7c266607b6f36b6a7 /vulkan/libvulkan/api.cpp
parent6cac55670ee4c5869ea530faff9ffd5f98fd7199 (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 Merged-In: If75c1abdb69a4d82253f28a5a80687f546e33ee0
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
0 files changed, 0 insertions, 0 deletions