Skip to content

Commit

Permalink
fixup! layer: Add a Vulkan layer required for Reflex support
Browse files Browse the repository at this point in the history
Be more explicit about instance context data
  • Loading branch information
Saancreed committed Dec 26, 2024
1 parent 7259e15 commit b124c98
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions layer/vulkan_reflex_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ struct ReflexQueueContextData {
bool outOfBandPresent;
};

using ReflexInstanceContextData = uint32_t;
struct ReflexInstanceContextData {
uint32_t apiVersion;
};

VKROOTS_DEFINE_SYNCHRONIZED_MAP_TYPE(ReflexInstanceContext, VkInstance);
VKROOTS_DEFINE_SYNCHRONIZED_MAP_TYPE(ReflexDeviceContext, VkDevice);
Expand Down Expand Up @@ -291,7 +293,7 @@ struct VkInstanceOverrides {
auto vr = pfnCreateInstanceProc(&info, pAllocator, pInstance);

if (vr == VK_SUCCESS)
ReflexInstanceContext::create(*pInstance, apiVersion);
ReflexInstanceContext::create(*pInstance, {.apiVersion = apiVersion});

return vr;
}
Expand Down Expand Up @@ -384,7 +386,7 @@ struct VkInstanceOverrides {
if (!hasLL2)
extensions.push_back(ll2.data());

if (auto apiver = ReflexInstanceContext::get(pDispatch->Instance); apiver && *apiver.get() < VK_VERSION_1_2) {
if (auto instanceContext = ReflexInstanceContext::get(pDispatch->Instance); instanceContext && instanceContext.get()->apiVersion < VK_VERSION_1_2) {
if (std::ranges::find(extensions, ts) == extensions.end())
extensions.push_back(ts.data());
}
Expand Down

0 comments on commit b124c98

Please sign in to comment.