Files
UnrealEngineUWP/Engine/Source/Developer/ShaderCompilerCommon/Public/SpirvReflectCommon.h
bryan sefcik de1956f47b Ran IWYU on Public headers under Engine/Source/Developer/...
Headers are updated to contain any missing #includes needed to compile and #includes are sorted.  Nothing is removed.

#ushell-cherrypick of 21064294 by bryan.sefcik
#jira
#preflight 62d5c2111062f2e63015e598

#ROBOMERGE-OWNER: bryan.sefcik
#ROBOMERGE-AUTHOR: bryan.sefcik
#ROBOMERGE-SOURCE: CL 21155249 via CL 21158121 via CL 21161259
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21182053 by bryan sefcik in ue5-main branch]
2022-07-20 12:03:45 -04:00

52 lines
2.2 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/Array.h"
#include "Containers/Set.h"
#include "CoreMinimal.h"
#include "HAL/Platform.h"
#if PLATFORM_MAC || PLATFORM_WINDOWS || PLATFORM_LINUX
THIRD_PARTY_INCLUDES_START
#include "spirv_reflect.h"
THIRD_PARTY_INCLUDES_END
#endif
/** Container structure for all SPIR-V reflection resources and in/out attributes. */
struct SHADERCOMPILERCOMMON_API FSpirvReflectBindings
{
TArray<SpvReflectInterfaceVariable*> InputAttributes;
TArray<SpvReflectInterfaceVariable*> OutputAttributes;
TSet<SpvReflectDescriptorBinding*> AtomicCounters;
TArray<SpvReflectDescriptorBinding*> InputAttachments; // for subpass inputs
TArray<SpvReflectDescriptorBinding*> UniformBuffers;
TArray<SpvReflectDescriptorBinding*> Samplers;
TArray<SpvReflectDescriptorBinding*> TextureSRVs;
TArray<SpvReflectDescriptorBinding*> TextureUAVs;
TArray<SpvReflectDescriptorBinding*> TBufferSRVs;
TArray<SpvReflectDescriptorBinding*> TBufferUAVs;
TArray<SpvReflectDescriptorBinding*> SBufferSRVs;
TArray<SpvReflectDescriptorBinding*> SBufferUAVs;
TArray<SpvReflectDescriptorBinding*> AccelerationStructures;
/** Adds the specified descriptor binding to the corresponding container iff the descriptor is marked as being accessed. */
void AddDescriptorBinding(SpvReflectDescriptorBinding* InBinding);
/** Gathers all descriptor bindings from the specified SPIRV-Reflect module. */
void GatherDescriptorBindings(const spv_reflect::ShaderModule& SpirvReflection);
/** Gathers all input interface variables from the specified SPIRV-Reflect module. */
void GatherInputAttributes(const spv_reflect::ShaderModule& SpirvReflection);
/** Gathers all output interface variables from the specified SPIRV-Reflect module. */
void GatherOutputAttributes(const spv_reflect::ShaderModule& SpirvReflection);
/** Assigns the binding location for all input attributes by its semantic index if their name is equal to 'SemanticName'. Used for vertex shaders where all input attributes have the "ATTRIBUTE" semantic. */
void AssignInputAttributeLocationsBySemanticIndex(spv_reflect::ShaderModule& SpirvReflection, const ANSICHAR* SemanticName);
};