Files
UnrealEngineUWP/Engine/Shaders/Private/ComputeKernelCommon.ush
Jeremy Moore 6d2b42f0d0 ComputeGraph graph based compilation.
More work to do but this is a minimal functional starting point.
#rb halfdan.ingvarsson
#preflight 609da63e046b9d00010b8246

[CL 16321681 by Jeremy Moore in ue5-main branch]
2021-05-13 19:17:49 -04:00

39 lines
1.4 KiB
Plaintext

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
// Macro to mark a kernel entry point.
// Only one should exist per kernel.
#define KERNEL_ENTRY_POINT(EntryPointName) \
void EntryPointName( \
uint Gidx : SV_GroupIndex, \
uint3 Gid : SV_GroupID, \
uint3 GTid: SV_GroupThreadID, \
uint3 DTid : SV_DispatchThreadID)
// Macros to directly expose parameters for a kernel.
#define KERNEL_PARAM(Type, Name) Type Name;
// Macros to expose external functions for a kernel.
// A kernel assumes these functions exist and are provided by its data providers.
#define KERNEL_EXTERN_READ(Name, ...)
#define KERNEL_EXTERN_WRITE(Name, ...)
// Macro to disambiguate data interface code with a unique id.
// This allows us to include more than one instance of the same data interface.
// This should be used around all uniforms and all local (ie not DI_IMPL) functions.
#define _DI_CAT_IMPL_(A, B) A##B
#define _DI_CAT_(A, B) _DI_CAT_IMPL_(A, B)
#define DI_LOCAL(Name) _DI_CAT_(DI_UID, Name)
// Macros to expose functions implemented by a data provider.
// This makes a local unqiue function name and expands the function prototype.
// We could just use DI_LOCAL, but these macro also gives the possiblity to extract functions by parsing the file.
#define DI_IMPL_READ(Name, ReturnType, ...) ReturnType DI_LOCAL(Name)(__VA_ARGS__)
#define DI_IMPL_WRITE(Name, ...) void DI_LOCAL(Name)(__VA_ARGS__)