| 1 |
#pragma clang diagnostic ignored "-Wmissing-prototypes" |
| 2 |
#pragma clang diagnostic ignored "-Wmissing-braces" |
| 3 |
|
| 4 |
#include <metal_stdlib> |
| 5 |
#include <simd/simd.h> |
| 6 |
|
| 7 |
using namespace metal; |
| 8 |
|
| 9 |
template<typename T, size_t Num> |
| 10 |
struct spvUnsafeArray |
| 11 |
{ |
| 12 |
T elements[Num ? Num : 1]; |
| 13 |
|
| 14 |
thread T& operator [] (size_t pos) thread |
| 15 |
{ |
| 16 |
return elements[pos]; |
| 17 |
} |
| 18 |
constexpr const thread T& operator [] (size_t pos) const thread |
| 19 |
{ |
| 20 |
return elements[pos]; |
| 21 |
} |
| 22 |
|
| 23 |
device T& operator [] (size_t pos) device |
| 24 |
{ |
| 25 |
return elements[pos]; |
| 26 |
} |
| 27 |
constexpr const device T& operator [] (size_t pos) const device |
| 28 |
{ |
| 29 |
return elements[pos]; |
| 30 |
} |
| 31 |
|
| 32 |
constexpr const constant T& operator [] (size_t pos) const constant |
| 33 |
{ |
| 34 |
return elements[pos]; |
| 35 |
} |
| 36 |
|
| 37 |
threadgroup T& operator [] (size_t pos) threadgroup |
| 38 |
{ |
| 39 |
return elements[pos]; |
| 40 |
} |
| 41 |
constexpr const threadgroup T& operator [] (size_t pos) const threadgroup |
| 42 |
{ |
| 43 |
return elements[pos]; |
| 44 |
} |
| 45 |
}; |
| 46 |
|
| 47 |
struct FVertexFactoryInterpolantsVSToPS |
| 48 |
{ |
| 49 |
float4 TangentToWorld0; |
| 50 |
float4 TangentToWorld2; |
| 51 |
}; |
| 52 |
|
| 53 |
struct FVertexFactoryInterpolantsVSToDS |
| 54 |
{ |
| 55 |
FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS; |
| 56 |
}; |
| 57 |
|
| 58 |
struct FHitProxyVSToDS |
| 59 |
{ |
| 60 |
FVertexFactoryInterpolantsVSToDS FactoryInterpolants; |
| 61 |
float4 Position; |
| 62 |
uint VertexID; |
| 63 |
}; |
| 64 |
|
| 65 |
struct FHullShaderConstantDominantVertexData |
| 66 |
{ |
| 67 |
float2 UV; |
| 68 |
float4 Normal; |
| 69 |
float3 Tangent; |
| 70 |
}; |
| 71 |
|
| 72 |
struct FHullShaderConstantDominantEdgeData |
| 73 |
{ |
| 74 |
float2 UV0; |
| 75 |
float2 UV1; |
| 76 |
float4 Normal0; |
| 77 |
float4 Normal1; |
| 78 |
float3 Tangent0; |
| 79 |
float3 Tangent1; |
| 80 |
}; |
| 81 |
|
| 82 |
struct FPNTessellationHSToDS |
| 83 |
{ |
| 84 |
FHitProxyVSToDS PassSpecificData; |
| 85 |
spvUnsafeArray<float4, 3> WorldPosition; |
| 86 |
float3 DisplacementScale; |
| 87 |
float TessellationMultiplier; |
| 88 |
float WorldDisplacementMultiplier; |
| 89 |
FHullShaderConstantDominantVertexData DominantVertex; |
| 90 |
FHullShaderConstantDominantEdgeData DominantEdge; |
| 91 |
}; |
| 92 |
|
| 93 |
struct type_View |
| 94 |
{ |
| 95 |
float4x4 View_TranslatedWorldToClip; |
| 96 |
float4x4 View_WorldToClip; |
| 97 |
float4x4 View_ClipToWorld; |
| 98 |
float4x4 View_TranslatedWorldToView; |
| 99 |
float4x4 View_ViewToTranslatedWorld; |
| 100 |
float4x4 View_TranslatedWorldToCameraView; |
| 101 |
float4x4 View_CameraViewToTranslatedWorld; |
| 102 |
float4x4 View_ViewToClip; |
| 103 |
float4x4 View_ViewToClipNoAA; |
| 104 |
float4x4 View_ClipToView; |
| 105 |
float4x4 View_ClipToTranslatedWorld; |
| 106 |
float4x4 View_SVPositionToTranslatedWorld; |
| 107 |
float4x4 View_ScreenToWorld; |
| 108 |
float4x4 View_ScreenToTranslatedWorld; |
| 109 |
packed_float3 View_ViewForward; |
| 110 |
float PrePadding_View_908; |
| 111 |
packed_float3 View_ViewUp; |
| 112 |
float PrePadding_View_924; |
| 113 |
packed_float3 View_ViewRight; |
| 114 |
float PrePadding_View_940; |
| 115 |
packed_float3 View_HMDViewNoRollUp; |
| 116 |
float PrePadding_View_956; |
| 117 |
packed_float3 View_HMDViewNoRollRight; |
| 118 |
float PrePadding_View_972; |
| 119 |
float4 View_InvDeviceZToWorldZTransform; |
| 120 |
float4 View_ScreenPositionScaleBias; |
| 121 |
packed_float3 View_WorldCameraOrigin; |
| 122 |
float PrePadding_View_1020; |
| 123 |
packed_float3 View_TranslatedWorldCameraOrigin; |
| 124 |
float PrePadding_View_1036; |
| 125 |
packed_float3 View_WorldViewOrigin; |
| 126 |
float PrePadding_View_1052; |
| 127 |
packed_float3 View_PreViewTranslation; |
| 128 |
float PrePadding_View_1068; |
| 129 |
float4x4 View_PrevProjection; |
| 130 |
float4x4 View_PrevViewProj; |
| 131 |
float4x4 View_PrevViewRotationProj; |
| 132 |
float4x4 View_PrevViewToClip; |
| 133 |
float4x4 View_PrevClipToView; |
| 134 |
float4x4 View_PrevTranslatedWorldToClip; |
| 135 |
float4x4 View_PrevTranslatedWorldToView; |
| 136 |
float4x4 View_PrevViewToTranslatedWorld; |
| 137 |
float4x4 View_PrevTranslatedWorldToCameraView; |
| 138 |
float4x4 View_PrevCameraViewToTranslatedWorld; |
| 139 |
packed_float3 View_PrevWorldCameraOrigin; |
| 140 |
float PrePadding_View_1724; |
| 141 |
packed_float3 View_PrevWorldViewOrigin; |
| 142 |
float PrePadding_View_1740; |
| 143 |
packed_float3 View_PrevPreViewTranslation; |
| 144 |
float PrePadding_View_1756; |
| 145 |
float4x4 View_PrevInvViewProj; |
| 146 |
float4x4 View_PrevScreenToTranslatedWorld; |
| 147 |
float4x4 View_ClipToPrevClip; |
| 148 |
float4 View_TemporalAAJitter; |
| 149 |
float4 View_GlobalClippingPlane; |
| 150 |
float2 View_FieldOfViewWideAngles; |
| 151 |
float2 View_PrevFieldOfViewWideAngles; |
| 152 |
float4 View_ViewRectMin; |
| 153 |
float4 View_ViewSizeAndInvSize; |
| 154 |
float4 View_BufferSizeAndInvSize; |
| 155 |
float4 View_BufferBilinearUVMinMax; |
| 156 |
int View_NumSceneColorMSAASamples; |
| 157 |
float View_PreExposure; |
| 158 |
float View_OneOverPreExposure; |
| 159 |
float PrePadding_View_2076; |
| 160 |
float4 View_DiffuseOverrideParameter; |
| 161 |
float4 View_SpecularOverrideParameter; |
| 162 |
float4 View_NormalOverrideParameter; |
| 163 |
float2 View_RoughnessOverrideParameter; |
| 164 |
float View_PrevFrameGameTime; |
| 165 |
float View_PrevFrameRealTime; |
| 166 |
float View_OutOfBoundsMask; |
| 167 |
float PrePadding_View_2148; |
| 168 |
float PrePadding_View_2152; |
| 169 |
float PrePadding_View_2156; |
| 170 |
packed_float3 View_WorldCameraMovementSinceLastFrame; |
| 171 |
float View_CullingSign; |
| 172 |
float View_NearPlane; |
| 173 |
float View_AdaptiveTessellationFactor; |
| 174 |
float View_GameTime; |
| 175 |
float View_RealTime; |
| 176 |
float View_DeltaTime; |
| 177 |
float View_MaterialTextureMipBias; |
| 178 |
float View_MaterialTextureDerivativeMultiply; |
| 179 |
uint View_Random; |
| 180 |
uint View_FrameNumber; |
| 181 |
uint View_StateFrameIndexMod8; |
| 182 |
uint View_StateFrameIndex; |
| 183 |
float View_CameraCut; |
| 184 |
float View_UnlitViewmodeMask; |
| 185 |
float PrePadding_View_2228; |
| 186 |
float PrePadding_View_2232; |
| 187 |
float PrePadding_View_2236; |
| 188 |
float4 View_DirectionalLightColor; |
| 189 |
packed_float3 View_DirectionalLightDirection; |
| 190 |
float PrePadding_View_2268; |
| 191 |
float4 View_TranslucencyLightingVolumeMin[2]; |
| 192 |
float4 View_TranslucencyLightingVolumeInvSize[2]; |
| 193 |
float4 View_TemporalAAParams; |
| 194 |
float4 View_CircleDOFParams; |
| 195 |
float View_DepthOfFieldSensorWidth; |
| 196 |
float View_DepthOfFieldFocalDistance; |
| 197 |
float View_DepthOfFieldScale; |
| 198 |
float View_DepthOfFieldFocalLength; |
| 199 |
float View_DepthOfFieldFocalRegion; |
| 200 |
float View_DepthOfFieldNearTransitionRegion; |
| 201 |
float View_DepthOfFieldFarTransitionRegion; |
| 202 |
float View_MotionBlurNormalizedToPixel; |
| 203 |
float View_bSubsurfacePostprocessEnabled; |
| 204 |
float View_GeneralPurposeTweak; |
| 205 |
float View_DemosaicVposOffset; |
| 206 |
float PrePadding_View_2412; |
| 207 |
packed_float3 View_IndirectLightingColorScale; |
| 208 |
float View_HDR32bppEncodingMode; |
| 209 |
packed_float3 View_AtmosphericFogSunDirection; |
| 210 |
float View_AtmosphericFogSunPower; |
| 211 |
float View_AtmosphericFogPower; |
| 212 |
float View_AtmosphericFogDensityScale; |
| 213 |
float View_AtmosphericFogDensityOffset; |
| 214 |
float View_AtmosphericFogGroundOffset; |
| 215 |
float View_AtmosphericFogDistanceScale; |
| 216 |
float View_AtmosphericFogAltitudeScale; |
| 217 |
float View_AtmosphericFogHeightScaleRayleigh; |
| 218 |
float View_AtmosphericFogStartDistance; |
| 219 |
float View_AtmosphericFogDistanceOffset; |
| 220 |
float View_AtmosphericFogSunDiscScale; |
| 221 |
float View_AtmosphericFogSunDiscHalfApexAngleRadian; |
| 222 |
float PrePadding_View_2492; |
| 223 |
float4 View_AtmosphericFogSunDiscLuminance; |
| 224 |
uint View_AtmosphericFogRenderMask; |
| 225 |
uint View_AtmosphericFogInscatterAltitudeSampleNum; |
| 226 |
uint PrePadding_View_2520; |
| 227 |
uint PrePadding_View_2524; |
| 228 |
float4 View_AtmosphericFogSunColor; |
| 229 |
packed_float3 View_NormalCurvatureToRoughnessScaleBias; |
| 230 |
float View_RenderingReflectionCaptureMask; |
| 231 |
float4 View_AmbientCubemapTint; |
| 232 |
float View_AmbientCubemapIntensity; |
| 233 |
float View_SkyLightParameters; |
| 234 |
float PrePadding_View_2584; |
| 235 |
float PrePadding_View_2588; |
| 236 |
float4 View_SkyLightColor; |
| 237 |
float4 View_SkyIrradianceEnvironmentMap[7]; |
| 238 |
float View_MobilePreviewMode; |
| 239 |
float View_HMDEyePaddingOffset; |
| 240 |
float View_ReflectionCubemapMaxMip; |
| 241 |
float View_ShowDecalsMask; |
| 242 |
uint View_DistanceFieldAOSpecularOcclusionMode; |
| 243 |
float View_IndirectCapsuleSelfShadowingIntensity; |
| 244 |
float PrePadding_View_2744; |
| 245 |
float PrePadding_View_2748; |
| 246 |
packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight; |
| 247 |
int View_StereoPassIndex; |
| 248 |
float4 View_GlobalVolumeCenterAndExtent[4]; |
| 249 |
float4 View_GlobalVolumeWorldToUVAddAndMul[4]; |
| 250 |
float View_GlobalVolumeDimension; |
| 251 |
float View_GlobalVolumeTexelSize; |
| 252 |
float View_MaxGlobalDistance; |
| 253 |
float PrePadding_View_2908; |
| 254 |
int2 View_CursorPosition; |
| 255 |
float View_bCheckerboardSubsurfaceProfileRendering; |
| 256 |
float PrePadding_View_2924; |
| 257 |
packed_float3 View_VolumetricFogInvGridSize; |
| 258 |
float PrePadding_View_2940; |
| 259 |
packed_float3 View_VolumetricFogGridZParams; |
| 260 |
float PrePadding_View_2956; |
| 261 |
float2 View_VolumetricFogSVPosToVolumeUV; |
| 262 |
float View_VolumetricFogMaxDistance; |
| 263 |
float PrePadding_View_2972; |
| 264 |
packed_float3 View_VolumetricLightmapWorldToUVScale; |
| 265 |
float PrePadding_View_2988; |
| 266 |
packed_float3 View_VolumetricLightmapWorldToUVAdd; |
| 267 |
float PrePadding_View_3004; |
| 268 |
packed_float3 View_VolumetricLightmapIndirectionTextureSize; |
| 269 |
float View_VolumetricLightmapBrickSize; |
| 270 |
packed_float3 View_VolumetricLightmapBrickTexelSize; |
| 271 |
float View_StereoIPD; |
| 272 |
float View_IndirectLightingCacheShowFlag; |
| 273 |
float View_EyeToPixelSpreadAngle; |
| 274 |
}; |
| 275 |
|
| 276 |
struct type_Primitive |
| 277 |
{ |
| 278 |
float4x4 Primitive_LocalToWorld; |
| 279 |
float4 Primitive_InvNonUniformScaleAndDeterminantSign; |
| 280 |
float4 Primitive_ObjectWorldPositionAndRadius; |
| 281 |
float4x4 Primitive_WorldToLocal; |
| 282 |
float4x4 Primitive_PreviousLocalToWorld; |
| 283 |
float4x4 Primitive_PreviousWorldToLocal; |
| 284 |
packed_float3 Primitive_ActorWorldPosition; |
| 285 |
float Primitive_UseSingleSampleShadowFromStationaryLights; |
| 286 |
packed_float3 Primitive_ObjectBounds; |
| 287 |
float Primitive_LpvBiasMultiplier; |
| 288 |
float Primitive_DecalReceiverMask; |
| 289 |
float Primitive_PerObjectGBufferData; |
| 290 |
float Primitive_UseVolumetricLightmapShadowFromStationaryLights; |
| 291 |
float Primitive_DrawsVelocity; |
| 292 |
float4 Primitive_ObjectOrientation; |
| 293 |
float4 Primitive_NonUniformScale; |
| 294 |
packed_float3 Primitive_LocalObjectBoundsMin; |
| 295 |
uint Primitive_LightingChannelMask; |
| 296 |
packed_float3 Primitive_LocalObjectBoundsMax; |
| 297 |
uint Primitive_LightmapDataIndex; |
| 298 |
packed_float3 Primitive_PreSkinnedLocalBounds; |
| 299 |
int Primitive_SingleCaptureIndex; |
| 300 |
uint Primitive_OutputVelocity; |
| 301 |
uint PrePadding_Primitive_420; |
| 302 |
uint PrePadding_Primitive_424; |
| 303 |
uint PrePadding_Primitive_428; |
| 304 |
float4 Primitive_CustomPrimitiveData[4]; |
| 305 |
}; |
| 306 |
|
| 307 |
constant float4 _140 = {}; |
| 308 |
|
| 309 |
struct main0_out |
| 310 |
{ |
| 311 |
float3 out_var_PN_DisplacementScales; |
| 312 |
float2 out_var_PN_DominantEdge; |
| 313 |
float2 out_var_PN_DominantEdge1; |
| 314 |
float4 out_var_PN_DominantEdge2; |
| 315 |
float4 out_var_PN_DominantEdge3; |
| 316 |
float3 out_var_PN_DominantEdge4; |
| 317 |
float3 out_var_PN_DominantEdge5; |
| 318 |
float2 out_var_PN_DominantVertex; |
| 319 |
float4 out_var_PN_DominantVertex1; |
| 320 |
float3 out_var_PN_DominantVertex2; |
| 321 |
spvUnsafeArray<float4, 3> out_var_PN_POSITION; |
| 322 |
float out_var_PN_TessellationMultiplier; |
| 323 |
float out_var_PN_WorldDisplacementMultiplier; |
| 324 |
float4 out_var_TEXCOORD10_centroid; |
| 325 |
float4 out_var_TEXCOORD11_centroid; |
| 326 |
float4 out_var_VS_To_DS_Position; |
| 327 |
uint out_var_VS_To_DS_VertexID; |
| 328 |
}; |
| 329 |
|
| 330 |
struct main0_patchOut |
| 331 |
{ |
| 332 |
float4 out_var_PN_POSITION9; |
| 333 |
}; |
| 334 |
|
| 335 |
struct main0_in |
| 336 |
{ |
| 337 |
float4 in_var_TEXCOORD10_centroid [[attribute(0)]]; |
| 338 |
float4 in_var_TEXCOORD11_centroid [[attribute(1)]]; |
| 339 |
float4 in_var_VS_To_DS_Position [[attribute(2)]]; |
| 340 |
uint in_var_VS_To_DS_VertexID [[attribute(3)]]; |
| 341 |
}; |
| 342 |
|
| 343 |
kernel void main0(main0_in in [[stage_in]], constant type_View& View [[buffer(0)]], constant type_Primitive& Primitive [[buffer(1)]], uint gl_InvocationID [[thread_index_in_threadgroup]], uint gl_PrimitiveID [[threadgroup_position_in_grid]], device main0_out* spvOut [[buffer(28)]], constant uint* spvIndirectParams [[buffer(29)]], device main0_patchOut* spvPatchOut [[buffer(27)]], device MTLTriangleTessellationFactorsHalf* spvTessLevel [[buffer(26)]], threadgroup main0_in* gl_in [[threadgroup(0)]]) |
| 344 |
{ |
| 345 |
threadgroup FPNTessellationHSToDS temp_var_hullMainRetVal[3]; |
| 346 |
device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3]; |
| 347 |
device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; |
| 348 |
if (gl_InvocationID < spvIndirectParams[0]) |
| 349 |
gl_in[gl_InvocationID] = in; |
| 350 |
threadgroup_barrier(mem_flags::mem_threadgroup); |
| 351 |
if (gl_InvocationID >= 3) |
| 352 |
return; |
| 353 |
spvUnsafeArray<float4, 12> _142 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD10_centroid, gl_in[1].in_var_TEXCOORD10_centroid, gl_in[2].in_var_TEXCOORD10_centroid, gl_in[3].in_var_TEXCOORD10_centroid, gl_in[4].in_var_TEXCOORD10_centroid, gl_in[5].in_var_TEXCOORD10_centroid, gl_in[6].in_var_TEXCOORD10_centroid, gl_in[7].in_var_TEXCOORD10_centroid, gl_in[8].in_var_TEXCOORD10_centroid, gl_in[9].in_var_TEXCOORD10_centroid, gl_in[10].in_var_TEXCOORD10_centroid, gl_in[11].in_var_TEXCOORD10_centroid }); |
| 354 |
spvUnsafeArray<float4, 12> _143 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_TEXCOORD11_centroid, gl_in[1].in_var_TEXCOORD11_centroid, gl_in[2].in_var_TEXCOORD11_centroid, gl_in[3].in_var_TEXCOORD11_centroid, gl_in[4].in_var_TEXCOORD11_centroid, gl_in[5].in_var_TEXCOORD11_centroid, gl_in[6].in_var_TEXCOORD11_centroid, gl_in[7].in_var_TEXCOORD11_centroid, gl_in[8].in_var_TEXCOORD11_centroid, gl_in[9].in_var_TEXCOORD11_centroid, gl_in[10].in_var_TEXCOORD11_centroid, gl_in[11].in_var_TEXCOORD11_centroid }); |
| 355 |
spvUnsafeArray<float4, 12> _192 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_VS_To_DS_Position, gl_in[1].in_var_VS_To_DS_Position, gl_in[2].in_var_VS_To_DS_Position, gl_in[3].in_var_VS_To_DS_Position, gl_in[4].in_var_VS_To_DS_Position, gl_in[5].in_var_VS_To_DS_Position, gl_in[6].in_var_VS_To_DS_Position, gl_in[7].in_var_VS_To_DS_Position, gl_in[8].in_var_VS_To_DS_Position, gl_in[9].in_var_VS_To_DS_Position, gl_in[10].in_var_VS_To_DS_Position, gl_in[11].in_var_VS_To_DS_Position }); |
| 356 |
spvUnsafeArray<uint, 12> _193 = spvUnsafeArray<uint, 12>({ gl_in[0].in_var_VS_To_DS_VertexID, gl_in[1].in_var_VS_To_DS_VertexID, gl_in[2].in_var_VS_To_DS_VertexID, gl_in[3].in_var_VS_To_DS_VertexID, gl_in[4].in_var_VS_To_DS_VertexID, gl_in[5].in_var_VS_To_DS_VertexID, gl_in[6].in_var_VS_To_DS_VertexID, gl_in[7].in_var_VS_To_DS_VertexID, gl_in[8].in_var_VS_To_DS_VertexID, gl_in[9].in_var_VS_To_DS_VertexID, gl_in[10].in_var_VS_To_DS_VertexID, gl_in[11].in_var_VS_To_DS_VertexID }); |
| 357 |
spvUnsafeArray<FHitProxyVSToDS, 12> _230 = spvUnsafeArray<FHitProxyVSToDS, 12>({ FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[0], _143[0] } }, _192[0], _193[0] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[1], _143[1] } }, _192[1], _193[1] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[2], _143[2] } }, _192[2], _193[2] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[3], _143[3] } }, _192[3], _193[3] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[4], _143[4] } }, _192[4], _193[4] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[5], _143[5] } }, _192[5], _193[5] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[6], _143[6] } }, _192[6], _193[6] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[7], _143[7] } }, _192[7], _193[7] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[8], _143[8] } }, _192[8], _193[8] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[9], _143[9] } }, _192[9], _193[9] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[10], _143[10] } }, _192[10], _193[10] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _142[11], _143[11] } }, _192[11], _193[11] } }); |
| 358 |
spvUnsafeArray<FHitProxyVSToDS, 12> param_var_I; |
| 359 |
param_var_I = _230; |
| 360 |
float4 _247 = float4(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0); |
| 361 |
float3 _251 = Primitive.Primitive_NonUniformScale.xyz * float3x3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz, cross(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz) * float3(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.w), param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz); |
| 362 |
uint _254 = (gl_InvocationID < 2u) ? (gl_InvocationID + 1u) : 0u; |
| 363 |
uint _255 = 2u * gl_InvocationID; |
| 364 |
uint _256 = 3u + _255; |
| 365 |
uint _257 = _255 + 4u; |
| 366 |
uint _264 = (_254 < 2u) ? (_254 + 1u) : 0u; |
| 367 |
uint _265 = 2u * _254; |
| 368 |
uint _266 = 3u + _265; |
| 369 |
uint _267 = _265 + 4u; |
| 370 |
float4 _279 = float4(param_var_I[9u + gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0); |
| 371 |
float4 _315; |
| 372 |
float4 _316; |
| 373 |
float4 _317; |
| 374 |
float4 _318; |
| 375 |
if ((param_var_I[_266].VertexID < param_var_I[_254].VertexID) || ((param_var_I[_266].VertexID == param_var_I[_254].VertexID) && (param_var_I[_267].VertexID < param_var_I[_264].VertexID))) |
| 376 |
{ |
| 377 |
_315 = param_var_I[_267].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0; |
| 378 |
_316 = param_var_I[_267].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2; |
| 379 |
_317 = param_var_I[_266].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0; |
| 380 |
_318 = param_var_I[_266].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2; |
| 381 |
} |
| 382 |
else |
| 383 |
{ |
| 384 |
_315 = param_var_I[_264].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0; |
| 385 |
_316 = param_var_I[_264].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2; |
| 386 |
_317 = param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0; |
| 387 |
_318 = param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2; |
| 388 |
} |
| 389 |
float4 _324 = float4(_318.xyz, 0.0); |
| 390 |
float4 _328 = float4(_316.xyz, 0.0); |
| 391 |
float4 _336 = float4(param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0); |
| 392 |
float4 _344 = float4(param_var_I[_256].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0); |
| 393 |
float4 _352 = float4(param_var_I[_257].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0); |
| 394 |
spvUnsafeArray<float4, 3> _402 = spvUnsafeArray<float4, 3>({ param_var_I[gl_InvocationID].Position, (((((float4(2.0) * param_var_I[gl_InvocationID].Position) + param_var_I[_254].Position) - (float4(dot(param_var_I[_254].Position - param_var_I[gl_InvocationID].Position, _247)) * _247)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_256].Position) + param_var_I[_257].Position) - (float4(dot(param_var_I[_257].Position - param_var_I[_256].Position, _344)) * _344)) * float4(0.3333333432674407958984375))) * float4(0.5), (((((float4(2.0) * param_var_I[_254].Position) + param_var_I[gl_InvocationID].Position) - (float4(dot(param_var_I[gl_InvocationID].Position - param_var_I[_254].Position, _336)) * _336)) * float4(0.3333333432674407958984375)) + ((((float4(2.0) * param_var_I[_257].Position) + param_var_I[_256].Position) - (float4(dot(param_var_I[_256].Position - param_var_I[_257].Position, _352)) * _352)) * float4(0.3333333432674407958984375))) * float4(0.5) }); |
| 395 |
gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0; |
| 396 |
gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2; |
| 397 |
gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position; |
| 398 |
gl_out[gl_InvocationID].out_var_VS_To_DS_VertexID = param_var_I[gl_InvocationID].VertexID; |
| 399 |
gl_out[gl_InvocationID].out_var_PN_POSITION = _402; |
| 400 |
gl_out[gl_InvocationID].out_var_PN_DisplacementScales = _251; |
| 401 |
gl_out[gl_InvocationID].out_var_PN_TessellationMultiplier = 1.0; |
| 402 |
gl_out[gl_InvocationID].out_var_PN_WorldDisplacementMultiplier = 1.0; |
| 403 |
gl_out[gl_InvocationID].out_var_PN_DominantVertex = float2(0.0); |
| 404 |
gl_out[gl_InvocationID].out_var_PN_DominantVertex1 = _279; |
| 405 |
gl_out[gl_InvocationID].out_var_PN_DominantVertex2 = param_var_I[9u + gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz; |
| 406 |
gl_out[gl_InvocationID].out_var_PN_DominantEdge = float2(0.0); |
| 407 |
gl_out[gl_InvocationID].out_var_PN_DominantEdge1 = float2(0.0); |
| 408 |
gl_out[gl_InvocationID].out_var_PN_DominantEdge2 = _324; |
| 409 |
gl_out[gl_InvocationID].out_var_PN_DominantEdge3 = _328; |
| 410 |
gl_out[gl_InvocationID].out_var_PN_DominantEdge4 = _317.xyz; |
| 411 |
gl_out[gl_InvocationID].out_var_PN_DominantEdge5 = _315.xyz; |
| 412 |
temp_var_hullMainRetVal[gl_InvocationID] = FPNTessellationHSToDS{ param_var_I[gl_InvocationID], _402, _251, 1.0, 1.0, FHullShaderConstantDominantVertexData{ float2(0.0), _279, param_var_I[9u + gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0.xyz }, FHullShaderConstantDominantEdgeData{ float2(0.0), float2(0.0), _324, _328, _317.xyz, _315.xyz } }; |
| 413 |
threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup); |
| 414 |
if (gl_InvocationID == 0u) |
| 415 |
{ |
| 416 |
float4 _461 = (((((temp_var_hullMainRetVal[0u].WorldPosition[1] + temp_var_hullMainRetVal[0u].WorldPosition[2]) + temp_var_hullMainRetVal[1u].WorldPosition[1]) + temp_var_hullMainRetVal[1u].WorldPosition[2]) + temp_var_hullMainRetVal[2u].WorldPosition[1]) + temp_var_hullMainRetVal[2u].WorldPosition[2]) * float4(0.16666667163372039794921875); |
| 417 |
float4 _474 = _140; |
| 418 |
_474.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier); |
| 419 |
float4 _480 = _474; |
| 420 |
_480.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier); |
| 421 |
float4 _485 = _480; |
| 422 |
_485.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier); |
| 423 |
float4 _492 = _485; |
| 424 |
_492.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier); |
| 425 |
float4 _600; |
| 426 |
for (;;) |
| 427 |
{ |
| 428 |
float4 _500 = View.View_ViewToClip * float4(0.0); |
| 429 |
float4 _505 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[0u].WorldPosition[0].xyz, 1.0); |
| 430 |
float3 _506 = _505.xyz; |
| 431 |
float3 _507 = _500.xyz; |
| 432 |
float _509 = _505.w; |
| 433 |
float _510 = _500.w; |
| 434 |
float4 _527 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[1u].WorldPosition[0].xyz, 1.0); |
| 435 |
float3 _528 = _527.xyz; |
| 436 |
float _530 = _527.w; |
| 437 |
float4 _548 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[2u].WorldPosition[0].xyz, 1.0); |
| 438 |
float3 _549 = _548.xyz; |
| 439 |
float _551 = _548.w; |
| 440 |
if (any((((select(int3(0), int3(1), (_506 - _507) < float3(_509 + _510)) + (int3(2) * select(int3(0), int3(1), (_506 + _507) > float3((-_509) - _510)))) | (select(int3(0), int3(1), (_528 - _507) < float3(_530 + _510)) + (int3(2) * select(int3(0), int3(1), (_528 + _507) > float3((-_530) - _510))))) | (select(int3(0), int3(1), (_549 - _507) < float3(_551 + _510)) + (int3(2) * select(int3(0), int3(1), (_549 + _507) > float3((-_551) - _510))))) != int3(3))) |
| 441 |
{ |
| 442 |
_600 = float4(0.0); |
| 443 |
break; |
| 444 |
} |
| 445 |
float3 _569 = temp_var_hullMainRetVal[0u].WorldPosition[0].xyz - temp_var_hullMainRetVal[1u].WorldPosition[0].xyz; |
| 446 |
float3 _570 = temp_var_hullMainRetVal[1u].WorldPosition[0].xyz - temp_var_hullMainRetVal[2u].WorldPosition[0].xyz; |
| 447 |
float3 _571 = temp_var_hullMainRetVal[2u].WorldPosition[0].xyz - temp_var_hullMainRetVal[0u].WorldPosition[0].xyz; |
| 448 |
float3 _574 = (float3(0.5) * (temp_var_hullMainRetVal[0u].WorldPosition[0].xyz + temp_var_hullMainRetVal[1u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin); |
| 449 |
float3 _577 = (float3(0.5) * (temp_var_hullMainRetVal[1u].WorldPosition[0].xyz + temp_var_hullMainRetVal[2u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin); |
| 450 |
float3 _580 = (float3(0.5) * (temp_var_hullMainRetVal[2u].WorldPosition[0].xyz + temp_var_hullMainRetVal[0u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin); |
| 451 |
float _584 = sqrt(dot(_570, _570) / dot(_577, _577)); |
| 452 |
float _588 = sqrt(dot(_571, _571) / dot(_580, _580)); |
| 453 |
float _592 = sqrt(dot(_569, _569) / dot(_574, _574)); |
| 454 |
float4 _597 = float4(_584, _588, _592, 1.0); |
| 455 |
_597.w = 0.333000004291534423828125 * ((_584 + _588) + _592); |
| 456 |
_600 = float4(View.View_AdaptiveTessellationFactor) * _597; |
| 457 |
break; |
| 458 |
} |
| 459 |
float4 _602 = fast::clamp(_492 * _600, float4(1.0), float4(15.0)); |
| 460 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_602.x); |
| 461 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_602.y); |
| 462 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_602.z); |
| 463 |
spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_602.w); |
| 464 |
patchOut.out_var_PN_POSITION9 = _461 + ((_461 - (((temp_var_hullMainRetVal[2u].WorldPosition[0] + temp_var_hullMainRetVal[1u].WorldPosition[0]) + temp_var_hullMainRetVal[0u].WorldPosition[0]) * float4(0.3333333432674407958984375))) * float4(0.5)); |
| 465 |
} |
| 466 |
} |
| 467 |
|