Files
UnrealEngine/Engine/Shaders/Private/Nanite/NaniteShadeCommon.ush
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05: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;
}