loader: gh1120/gh1134 - Object wrapping issues
authorMark Young <marky@lunarg.com>
Mon, 7 Nov 2016 20:27:02 +0000 (13:27 -0700)
committerMark Young <marky@lunarg.com>
Mon, 14 Nov 2016 18:02:40 +0000 (11:02 -0700)
commite7bf86e164e88409324fa2c8b41e0775f9d48501
tree10ebbd2988ad6537ee5977b11ef3814ac628bc52
parent1731acbd8ce5cdadf879117f92cd0b1d1388e440
loader: gh1120/gh1134 - Object wrapping issues

First issue was that we needed to override vkGetDeviceProcAddr.  Instead
of allowing this to always go directly to the ICD, we needed to intercept
a few commands because they require a loader trampoline and terminator
call.  Most commands still return a pointer directly to ICD command.

GH1120 - Unwrap both the physical device handles and the
KHR_surface handles in the loader during both the trampoline and
terminator calls for DebugMarker commands.  This has to be done since the
values given to an application are the loader trampoline versions, and the
values given to the last layer is the loader terminator versions.

GH1134 - We were passing down the wrong device object to the ICD functions
when querying the ICD command function address and comparing it in the
override functions.

Thanks to Baldur (Mr. Renderdoc) for discovering this, testing my
fixes, and resolving several bugs.

Change-Id: I7618d71ffee6c53d9842758210a9261f6b3a1797
loader/extensions.c
loader/extensions.h
loader/loader.c
loader/loader.h
loader/table_ops.h
loader/trampoline.c