From 6d1fe29cdcbca18d559e302d6427a504d1762173 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 22 Oct 2020 23:44:11 -0700 Subject: Generate `if` based dispatch logic on GPU targets. (#1585) --- source/slang/slang-ir-specialize-dispatch.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 source/slang/slang-ir-specialize-dispatch.h (limited to 'source/slang/slang-ir-specialize-dispatch.h') diff --git a/source/slang/slang-ir-specialize-dispatch.h b/source/slang/slang-ir-specialize-dispatch.h new file mode 100644 index 000000000..fe87eb0bf --- /dev/null +++ b/source/slang/slang-ir-specialize-dispatch.h @@ -0,0 +1,13 @@ +// slang-ir-specialize-dispatch.h +#pragma once + +namespace Slang +{ +struct SharedGenericsLoweringContext; + +/// Modifies the body of interface dispatch functions to use branching instead +/// of function pointer calls to implement the dynamic dispatch logic. +/// This is only used on GPU targets where function pointers are not supported +/// or are not efficient. +void specializeDispatchFunctions(SharedGenericsLoweringContext* sharedContext); +} -- cgit v1.2.3