Files
UnrealEngine/Engine/Shaders/Private/Nanite/NaniteShadeCommon.ush
2025-05-18 13:04:45 +08:00

30 lines
680 B
HLSL

// Copyright Epic Games, Inc. All Rights Reserved.
#include "../Common.ush"
#include "../SceneData.ush"
#include "../WaveOpUtil.ush"
#include "../VariableRateShading/VRSShadingRateCommon.ush"
#include "../Visualization.ush"
#include "../MortonCode.ush"
#include "NaniteAttributeDecode.ush"
#if COMPILER_SUPPORTS_WAVE_32_64_MODE
#define COMPUTE_MATERIAL_GROUP_SIZE 32
#else
#define COMPUTE_MATERIAL_GROUP_SIZE 64
#endif
uint PackQuadMask(bool4 Quad)
{
// [X][Y]
// [Z][W] -> 0000 wzyx
uint Mask = 0u;
Mask |= select(Quad.x, 1u << 0u, 0u);
Mask |= select(Quad.y, 1u << 1u, 0u);
Mask |= select(Quad.z, 1u << 2u, 0u);
Mask |= select(Quad.w, 1u << 3u, 0u);
return Mask;
}