diff options
| author | Jon Ashburn <jon@lunarg.com> | 2015-10-08 15:58:23 -0600 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2015-10-08 16:31:35 -0600 |
| commit | 7d8342c6d9550e2d4d9b47dbb446872611ea1153 (patch) | |
| tree | 10ad67346fc347b124ffd953caf5374e33dcd7a3 | |
| parent | d8b0d0d043b47c879ee9f0d65afdfb96c0ea6a88 (diff) | |
| download | usermoji-7d8342c6d9550e2d4d9b47dbb446872611ea1153.tar.xz | |
demos: Add getting GetDeviceProcAddr entrypoint from GetInstanceProcAddr
Better test for the loader.
| -rw-r--r-- | demos/cube.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/demos/cube.c b/demos/cube.c index 6437a71e..6b83080b 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -84,9 +84,13 @@ } \ } +static PFN_vkGetDeviceProcAddr g_gdpa = NULL; + #define GET_DEVICE_PROC_ADDR(dev, entrypoint) \ { \ - demo->fp##entrypoint = (PFN_vk##entrypoint) vkGetDeviceProcAddr(dev, "vk"#entrypoint); \ + if(!g_gdpa) \ + g_gdpa = (PFN_vkGetDeviceProcAddr) vkGetInstanceProcAddr(demo->inst, "vkGetDeviceProcAddr"); \ + demo->fp##entrypoint = (PFN_vk##entrypoint) g_gdpa(dev, "vk"#entrypoint); \ if (demo->fp##entrypoint == NULL) { \ ERR_EXIT("vkGetDeviceProcAddr failed to find vk"#entrypoint, \ "vkGetDeviceProcAddr Failure"); \ |
