Skip to content

vulkan: Put null entries in the dispatch table instead of pointers to null

Jesse Natalie requested to merge jenatali/mesa:vulkan-weak-symbol-fix-msvc into main

Filling out dispatch tables on MSVC is slightly broken in two ways right now:

  1. If we try to use more than 2 passes (e.g. driver, common, and WSI), the second pass will always fill in all previously-null entries in the table with non-null function pointers (even though they might not be callable). So the third pass will then never fill in any new entries, because there's no more null slots.
  2. When the app/loader asks for a function, they'll always get back a pointer. That means null checks for unimplemented functions won't work correctly. Of course, apps should use extension checks instead of null checks, but we all know apps get this kind of thing wrong.

The fix is simple: use the same pointer-to-zero check for MSVC when trying to add in unimplemented functions that we already use for the initial pass over the table.

/cc @jpark37 @jekstrand

Merge request reports