| 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 |
float4 Color; |
| 52 |
spvUnsafeArray<float2, 2> TexCoords; |
| 53 |
}; |
| 54 |
|
| 55 |
struct FVertexFactoryInterpolantsVSToDS |
| 56 |
{ |
| 57 |
FVertexFactoryInterpolantsVSToPS InterpolantsVSToPS; |
| 58 |
}; |
| 59 |
|
| 60 |
struct FHitProxyVSToDS |
| 61 |
{ |
| 62 |
FVertexFactoryInterpolantsVSToDS FactoryInterpolants; |
| 63 |
float4 Position; |
| 64 |
}; |
| 65 |
|
| 66 |
struct FPNTessellationHSToDS |
| 67 |
{ |
| 68 |
FHitProxyVSToDS PassSpecificData; |
| 69 |
spvUnsafeArray<float4, 3> WorldPosition; |
| 70 |
float3 DisplacementScale; |
| 71 |
float TessellationMultiplier; |
| 72 |
float WorldDisplacementMultiplier; |
| 73 |
}; |
| 74 |
|
| 75 |
struct type_View |
| 76 |
{ |
| 77 |
float4x4 View_TranslatedWorldToClip; |
| 78 |
float4x4 View_WorldToClip; |
| 79 |
float4x4 View_ClipToWorld; |
| 80 |
float4x4 View_TranslatedWorldToView; |
| 81 |
float4x4 View_ViewToTranslatedWorld; |
| 82 |
float4x4 View_TranslatedWorldToCameraView; |
| 83 |
float4x4 View_CameraViewToTranslatedWorld; |
| 84 |
float4x4 View_ViewToClip; |
| 85 |
float4x4 View_ViewToClipNoAA; |
| 86 |
float4x4 View_ClipToView; |
| 87 |
float4x4 View_ClipToTranslatedWorld; |
| 88 |
float4x4 View_SVPositionToTranslatedWorld; |
| 89 |
float4x4 View_ScreenToWorld; |
| 90 |
float4x4 View_ScreenToTranslatedWorld; |
| 91 |
packed_float3 View_ViewForward; |
| 92 |
float PrePadding_View_908; |
| 93 |
packed_float3 View_ViewUp; |
| 94 |
float PrePadding_View_924; |
| 95 |
packed_float3 View_ViewRight; |
| 96 |
float PrePadding_View_940; |
| 97 |
packed_float3 View_HMDViewNoRollUp; |
| 98 |
float PrePadding_View_956; |
| 99 |
packed_float3 View_HMDViewNoRollRight; |
| 100 |
float PrePadding_View_972; |
| 101 |
float4 View_InvDeviceZToWorldZTransform; |
| 102 |
float4 View_ScreenPositionScaleBias; |
| 103 |
packed_float3 View_WorldCameraOrigin; |
| 104 |
float PrePadding_View_1020; |
| 105 |
packed_float3 View_TranslatedWorldCameraOrigin; |
| 106 |
float PrePadding_View_1036; |
| 107 |
packed_float3 View_WorldViewOrigin; |
| 108 |
float PrePadding_View_1052; |
| 109 |
packed_float3 View_PreViewTranslation; |
| 110 |
float PrePadding_View_1068; |
| 111 |
float4x4 View_PrevProjection; |
| 112 |
float4x4 View_PrevViewProj; |
| 113 |
float4x4 View_PrevViewRotationProj; |
| 114 |
float4x4 View_PrevViewToClip; |
| 115 |
float4x4 View_PrevClipToView; |
| 116 |
float4x4 View_PrevTranslatedWorldToClip; |
| 117 |
float4x4 View_PrevTranslatedWorldToView; |
| 118 |
float4x4 View_PrevViewToTranslatedWorld; |
| 119 |
float4x4 View_PrevTranslatedWorldToCameraView; |
| 120 |
float4x4 View_PrevCameraViewToTranslatedWorld; |
| 121 |
packed_float3 View_PrevWorldCameraOrigin; |
| 122 |
float PrePadding_View_1724; |
| 123 |
packed_float3 View_PrevWorldViewOrigin; |
| 124 |
float PrePadding_View_1740; |
| 125 |
packed_float3 View_PrevPreViewTranslation; |
| 126 |
float PrePadding_View_1756; |
| 127 |
float4x4 View_PrevInvViewProj; |
| 128 |
float4x4 View_PrevScreenToTranslatedWorld; |
| 129 |
float4x4 View_ClipToPrevClip; |
| 130 |
float4 View_TemporalAAJitter; |
| 131 |
float4 View_GlobalClippingPlane; |
| 132 |
float2 View_FieldOfViewWideAngles; |
| 133 |
float2 View_PrevFieldOfViewWideAngles; |
| 134 |
float4 View_ViewRectMin; |
| 135 |
float4 View_ViewSizeAndInvSize; |
| 136 |
float4 View_BufferSizeAndInvSize; |
| 137 |
float4 View_BufferBilinearUVMinMax; |
| 138 |
int View_NumSceneColorMSAASamples; |
| 139 |
float View_PreExposure; |
| 140 |
float View_OneOverPreExposure; |
| 141 |
float PrePadding_View_2076; |
| 142 |
float4 View_DiffuseOverrideParameter; |
| 143 |
float4 View_SpecularOverrideParameter; |
| 144 |
float4 View_NormalOverrideParameter; |
| 145 |
float2 View_RoughnessOverrideParameter; |
| 146 |
float View_PrevFrameGameTime; |
| 147 |
float View_PrevFrameRealTime; |
| 148 |
float View_OutOfBoundsMask; |
| 149 |
float PrePadding_View_2148; |
| 150 |
float PrePadding_View_2152; |
| 151 |
float PrePadding_View_2156; |
| 152 |
packed_float3 View_WorldCameraMovementSinceLastFrame; |
| 153 |
float View_CullingSign; |
| 154 |
float View_NearPlane; |
| 155 |
float View_AdaptiveTessellationFactor; |
| 156 |
float View_GameTime; |
| 157 |
float View_RealTime; |
| 158 |
float View_DeltaTime; |
| 159 |
float View_MaterialTextureMipBias; |
| 160 |
float View_MaterialTextureDerivativeMultiply; |
| 161 |
uint View_Random; |
| 162 |
uint View_FrameNumber; |
| 163 |
uint View_StateFrameIndexMod8; |
| 164 |
uint View_StateFrameIndex; |
| 165 |
float View_CameraCut; |
| 166 |
float View_UnlitViewmodeMask; |
| 167 |
float PrePadding_View_2228; |
| 168 |
float PrePadding_View_2232; |
| 169 |
float PrePadding_View_2236; |
| 170 |
float4 View_DirectionalLightColor; |
| 171 |
packed_float3 View_DirectionalLightDirection; |
| 172 |
float PrePadding_View_2268; |
| 173 |
float4 View_TranslucencyLightingVolumeMin[2]; |
| 174 |
float4 View_TranslucencyLightingVolumeInvSize[2]; |
| 175 |
float4 View_TemporalAAParams; |
| 176 |
float4 View_CircleDOFParams; |
| 177 |
float View_DepthOfFieldSensorWidth; |
| 178 |
float View_DepthOfFieldFocalDistance; |
| 179 |
float View_DepthOfFieldScale; |
| 180 |
float View_DepthOfFieldFocalLength; |
| 181 |
float View_DepthOfFieldFocalRegion; |
| 182 |
float View_DepthOfFieldNearTransitionRegion; |
| 183 |
float View_DepthOfFieldFarTransitionRegion; |
| 184 |
float View_MotionBlurNormalizedToPixel; |
| 185 |
float View_bSubsurfacePostprocessEnabled; |
| 186 |
float View_GeneralPurposeTweak; |
| 187 |
float View_DemosaicVposOffset; |
| 188 |
float PrePadding_View_2412; |
| 189 |
packed_float3 View_IndirectLightingColorScale; |
| 190 |
float View_HDR32bppEncodingMode; |
| 191 |
packed_float3 View_AtmosphericFogSunDirection; |
| 192 |
float View_AtmosphericFogSunPower; |
| 193 |
float View_AtmosphericFogPower; |
| 194 |
float View_AtmosphericFogDensityScale; |
| 195 |
float View_AtmosphericFogDensityOffset; |
| 196 |
float View_AtmosphericFogGroundOffset; |
| 197 |
float View_AtmosphericFogDistanceScale; |
| 198 |
float View_AtmosphericFogAltitudeScale; |
| 199 |
float View_AtmosphericFogHeightScaleRayleigh; |
| 200 |
float View_AtmosphericFogStartDistance; |
| 201 |
float View_AtmosphericFogDistanceOffset; |
| 202 |
float View_AtmosphericFogSunDiscScale; |
| 203 |
float View_AtmosphericFogSunDiscHalfApexAngleRadian; |
| 204 |
float PrePadding_View_2492; |
| 205 |
float4 View_AtmosphericFogSunDiscLuminance; |
| 206 |
uint View_AtmosphericFogRenderMask; |
| 207 |
uint View_AtmosphericFogInscatterAltitudeSampleNum; |
| 208 |
uint PrePadding_View_2520; |
| 209 |
uint PrePadding_View_2524; |
| 210 |
float4 View_AtmosphericFogSunColor; |
| 211 |
packed_float3 View_NormalCurvatureToRoughnessScaleBias; |
| 212 |
float View_RenderingReflectionCaptureMask; |
| 213 |
float4 View_AmbientCubemapTint; |
| 214 |
float View_AmbientCubemapIntensity; |
| 215 |
float View_SkyLightParameters; |
| 216 |
float PrePadding_View_2584; |
| 217 |
float PrePadding_View_2588; |
| 218 |
float4 View_SkyLightColor; |
| 219 |
float4 View_SkyIrradianceEnvironmentMap[7]; |
| 220 |
float View_MobilePreviewMode; |
| 221 |
float View_HMDEyePaddingOffset; |
| 222 |
float View_ReflectionCubemapMaxMip; |
| 223 |
float View_ShowDecalsMask; |
| 224 |
uint View_DistanceFieldAOSpecularOcclusionMode; |
| 225 |
float View_IndirectCapsuleSelfShadowingIntensity; |
| 226 |
float PrePadding_View_2744; |
| 227 |
float PrePadding_View_2748; |
| 228 |
packed_float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight; |
| 229 |
int View_StereoPassIndex; |
| 230 |
float4 View_GlobalVolumeCenterAndExtent[4]; |
| 231 |
float4 View_GlobalVolumeWorldToUVAddAndMul[4]; |
| 232 |
float View_GlobalVolumeDimension; |
| 233 |
float View_GlobalVolumeTexelSize; |
| 234 |
float View_MaxGlobalDistance; |
| 235 |
float PrePadding_View_2908; |
| 236 |
int2 View_CursorPosition; |
| 237 |
float View_bCheckerboardSubsurfaceProfileRendering; |
| 238 |
float PrePadding_View_2924; |
| 239 |
packed_float3 View_VolumetricFogInvGridSize; |
| 240 |
float PrePadding_View_2940; |
| 241 |
packed_float3 View_VolumetricFogGridZParams; |
| 242 |
float PrePadding_View_2956; |
| 243 |
float2 View_VolumetricFogSVPosToVolumeUV; |
| 244 |
float View_VolumetricFogMaxDistance; |
| 245 |
float PrePadding_View_2972; |
| 246 |
packed_float3 View_VolumetricLightmapWorldToUVScale; |
| 247 |
float PrePadding_View_2988; |
| 248 |
packed_float3 View_VolumetricLightmapWorldToUVAdd; |
| 249 |
float PrePadding_View_3004; |
| 250 |
packed_float3 View_VolumetricLightmapIndirectionTextureSize; |
| 251 |
float View_VolumetricLightmapBrickSize; |
| 252 |
packed_float3 View_VolumetricLightmapBrickTexelSize; |
| 253 |
float View_StereoIPD; |
| 254 |
float View_IndirectLightingCacheShowFlag; |
| 255 |
float View_EyeToPixelSpreadAngle; |
| 256 |
}; |
| 257 |
|
| 258 |
struct type_Primitive |
| 259 |
{ |
| 260 |
float4x4 Primitive_LocalToWorld; |
| 261 |
float4 Primitive_InvNonUniformScaleAndDeterminantSign; |
| 262 |
float4 Primitive_ObjectWorldPositionAndRadius; |
| 263 |
float4x4 Primitive_WorldToLocal; |
| 264 |
float4x4 Primitive_PreviousLocalToWorld; |
| 265 |
float4x4 Primitive_PreviousWorldToLocal; |
| 266 |
packed_float3 Primitive_ActorWorldPosition; |
| 267 |
float Primitive_UseSingleSampleShadowFromStationaryLights; |
| 268 |
packed_float3 Primitive_ObjectBounds; |
| 269 |
float Primitive_LpvBiasMultiplier; |
| 270 |
float Primitive_DecalReceiverMask; |
| 271 |
float Primitive_PerObjectGBufferData; |
| 272 |
float Primitive_UseVolumetricLightmapShadowFromStationaryLights; |
| 273 |
float Primitive_DrawsVelocity; |
| 274 |
float4 Primitive_ObjectOrientation; |
| 275 |
float4 Primitive_NonUniformScale; |
| 276 |
packed_float3 Primitive_LocalObjectBoundsMin; |
| 277 |
uint Primitive_LightingChannelMask; |
| 278 |
packed_float3 Primitive_LocalObjectBoundsMax; |
| 279 |
uint Primitive_LightmapDataIndex; |
| 280 |
packed_float3 Primitive_PreSkinnedLocalBounds; |
| 281 |
int Primitive_SingleCaptureIndex; |
| 282 |
uint Primitive_OutputVelocity; |
| 283 |
uint PrePadding_Primitive_420; |
| 284 |
uint PrePadding_Primitive_424; |
| 285 |
uint PrePadding_Primitive_428; |
| 286 |
float4 Primitive_CustomPrimitiveData[4]; |
| 287 |
}; |
| 288 |
|
| 289 |
constant float4 _537 = {}; |
| 290 |
|
| 291 |
struct main0_out |
| 292 |
{ |
| 293 |
float4 out_var_COLOR0; |
| 294 |
float3 out_var_PN_DisplacementScales; |
| 295 |
spvUnsafeArray<float4, 3> out_var_PN_POSITION; |
| 296 |
float out_var_PN_TessellationMultiplier; |
| 297 |
float out_var_PN_WorldDisplacementMultiplier; |
| 298 |
spvUnsafeArray<float2, 2> out_var_TEXCOORD0; |
| 299 |
float4 out_var_TEXCOORD10_centroid; |
| 300 |
float4 out_var_TEXCOORD11_centroid; |
| 301 |
float4 out_var_VS_To_DS_Position; |
| 302 |
}; |
| 303 |
|
| 304 |
struct main0_patchOut |
| 305 |
{ |
| 306 |
float4 out_var_PN_POSITION9; |
| 307 |
}; |
| 308 |
|
| 309 |
struct main0_in |
| 310 |
{ |
| 311 |
float4 in_var_TEXCOORD10_centroid [[attribute(0)]]; |
| 312 |
float4 in_var_TEXCOORD11_centroid [[attribute(1)]]; |
| 313 |
float4 in_var_COLOR0 [[attribute(2)]]; |
| 314 |
float2 in_var_TEXCOORD0_0 [[attribute(3)]]; |
| 315 |
float2 in_var_TEXCOORD0_1 [[attribute(4)]]; |
| 316 |
float4 in_var_VS_To_DS_Position [[attribute(5)]]; |
| 317 |
}; |
| 318 |
|
| 319 |
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)]]) |
| 320 |
{ |
| 321 |
threadgroup FPNTessellationHSToDS temp_var_hullMainRetVal[3]; |
| 322 |
device main0_out* gl_out = &spvOut[gl_PrimitiveID * 3]; |
| 323 |
device main0_patchOut& patchOut = spvPatchOut[gl_PrimitiveID]; |
| 324 |
if (gl_InvocationID < spvIndirectParams[0]) |
| 325 |
gl_in[gl_InvocationID] = in; |
| 326 |
threadgroup_barrier(mem_flags::mem_threadgroup); |
| 327 |
if (gl_InvocationID >= 3) |
| 328 |
return; |
| 329 |
spvUnsafeArray<float4, 12> _129 = 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 }); |
| 330 |
spvUnsafeArray<float4, 12> _130 = 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 }); |
| 331 |
spvUnsafeArray<float4, 12> _131 = spvUnsafeArray<float4, 12>({ gl_in[0].in_var_COLOR0, gl_in[1].in_var_COLOR0, gl_in[2].in_var_COLOR0, gl_in[3].in_var_COLOR0, gl_in[4].in_var_COLOR0, gl_in[5].in_var_COLOR0, gl_in[6].in_var_COLOR0, gl_in[7].in_var_COLOR0, gl_in[8].in_var_COLOR0, gl_in[9].in_var_COLOR0, gl_in[10].in_var_COLOR0, gl_in[11].in_var_COLOR0 }); |
| 332 |
spvUnsafeArray<spvUnsafeArray<float2, 2>, 12> _132 = spvUnsafeArray<spvUnsafeArray<float2, 2>, 12>({ spvUnsafeArray<float2, 2>({ gl_in[0].in_var_TEXCOORD0_0, gl_in[0].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[1].in_var_TEXCOORD0_0, gl_in[1].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[2].in_var_TEXCOORD0_0, gl_in[2].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[3].in_var_TEXCOORD0_0, gl_in[3].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[4].in_var_TEXCOORD0_0, gl_in[4].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[5].in_var_TEXCOORD0_0, gl_in[5].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[6].in_var_TEXCOORD0_0, gl_in[6].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[7].in_var_TEXCOORD0_0, gl_in[7].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[8].in_var_TEXCOORD0_0, gl_in[8].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[9].in_var_TEXCOORD0_0, gl_in[9].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[10].in_var_TEXCOORD0_0, gl_in[10].in_var_TEXCOORD0_1 }), spvUnsafeArray<float2, 2>({ gl_in[11].in_var_TEXCOORD0_0, gl_in[11].in_var_TEXCOORD0_1 }) }); |
| 333 |
spvUnsafeArray<float4, 12> _205 = 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 }); |
| 334 |
spvUnsafeArray<FHitProxyVSToDS, 12> _230 = spvUnsafeArray<FHitProxyVSToDS, 12>({ FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[0], _130[0], _131[0], _132[0] } }, _205[0] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[1], _130[1], _131[1], _132[1] } }, _205[1] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[2], _130[2], _131[2], _132[2] } }, _205[2] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[3], _130[3], _131[3], _132[3] } }, _205[3] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[4], _130[4], _131[4], _132[4] } }, _205[4] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[5], _130[5], _131[5], _132[5] } }, _205[5] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[6], _130[6], _131[6], _132[6] } }, _205[6] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[7], _130[7], _131[7], _132[7] } }, _205[7] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[8], _130[8], _131[8], _132[8] } }, _205[8] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[9], _130[9], _131[9], _132[9] } }, _205[9] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[10], _130[10], _131[10], _132[10] } }, _205[10] }, FHitProxyVSToDS{ FVertexFactoryInterpolantsVSToDS{ FVertexFactoryInterpolantsVSToPS{ _129[11], _130[11], _131[11], _132[11] } }, _205[11] } }); |
| 335 |
spvUnsafeArray<FHitProxyVSToDS, 12> param_var_I; |
| 336 |
param_var_I = _230; |
| 337 |
float4 _247 = float4(param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0); |
| 338 |
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); |
| 339 |
uint _254 = (gl_InvocationID < 2u) ? (gl_InvocationID + 1u) : 0u; |
| 340 |
uint _255 = 2u * gl_InvocationID; |
| 341 |
uint _256 = 3u + _255; |
| 342 |
uint _257 = _255 + 4u; |
| 343 |
float4 _269 = float4(param_var_I[_254].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0); |
| 344 |
float4 _277 = float4(param_var_I[_256].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0); |
| 345 |
float4 _285 = float4(param_var_I[_257].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2.xyz, 0.0); |
| 346 |
spvUnsafeArray<float4, 3> _333 = 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(2.0) * param_var_I[_256].Position) + param_var_I[_257].Position) - (float4(dot(param_var_I[_257].Position - param_var_I[_256].Position, _277)) * _277))) * float4(0.16666667163372039794921875), ((((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, _269)) * _269)) + (((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, _285)) * _285))) * float4(0.16666667163372039794921875) }); |
| 347 |
gl_out[gl_InvocationID].out_var_TEXCOORD10_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld0; |
| 348 |
gl_out[gl_InvocationID].out_var_TEXCOORD11_centroid = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TangentToWorld2; |
| 349 |
gl_out[gl_InvocationID].out_var_COLOR0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.Color; |
| 350 |
gl_out[gl_InvocationID].out_var_TEXCOORD0 = param_var_I[gl_InvocationID].FactoryInterpolants.InterpolantsVSToPS.TexCoords; |
| 351 |
gl_out[gl_InvocationID].out_var_VS_To_DS_Position = param_var_I[gl_InvocationID].Position; |
| 352 |
gl_out[gl_InvocationID].out_var_PN_POSITION = _333; |
| 353 |
gl_out[gl_InvocationID].out_var_PN_DisplacementScales = _251; |
| 354 |
gl_out[gl_InvocationID].out_var_PN_TessellationMultiplier = 1.0; |
| 355 |
gl_out[gl_InvocationID].out_var_PN_WorldDisplacementMultiplier = 1.0; |
| 356 |
temp_var_hullMainRetVal[gl_InvocationID] = FPNTessellationHSToDS{ param_var_I[gl_InvocationID], _333, _251, 1.0, 1.0 }; |
| 357 |
threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup); |
| 358 |
if (gl_InvocationID == 0u) |
| 359 |
{ |
| 360 |
float4 _385 = (((((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); |
| 361 |
float4 _398 = _537; |
| 362 |
_398.x = 0.5 * (temp_var_hullMainRetVal[1u].TessellationMultiplier + temp_var_hullMainRetVal[2u].TessellationMultiplier); |
| 363 |
float4 _404 = _398; |
| 364 |
_404.y = 0.5 * (temp_var_hullMainRetVal[2u].TessellationMultiplier + temp_var_hullMainRetVal[0u].TessellationMultiplier); |
| 365 |
float4 _409 = _404; |
| 366 |
_409.z = 0.5 * (temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier); |
| 367 |
float4 _416 = _409; |
| 368 |
_416.w = 0.333000004291534423828125 * ((temp_var_hullMainRetVal[0u].TessellationMultiplier + temp_var_hullMainRetVal[1u].TessellationMultiplier) + temp_var_hullMainRetVal[2u].TessellationMultiplier); |
| 369 |
float4 _524; |
| 370 |
for (;;) |
| 371 |
{ |
| 372 |
float4 _424 = View.View_ViewToClip * float4(0.0); |
| 373 |
float4 _429 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[0u].WorldPosition[0].xyz, 1.0); |
| 374 |
float3 _430 = _429.xyz; |
| 375 |
float3 _431 = _424.xyz; |
| 376 |
float _433 = _429.w; |
| 377 |
float _434 = _424.w; |
| 378 |
float4 _451 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[1u].WorldPosition[0].xyz, 1.0); |
| 379 |
float3 _452 = _451.xyz; |
| 380 |
float _454 = _451.w; |
| 381 |
float4 _472 = View.View_TranslatedWorldToClip * float4(temp_var_hullMainRetVal[2u].WorldPosition[0].xyz, 1.0); |
| 382 |
float3 _473 = _472.xyz; |
| 383 |
float _475 = _472.w; |
| 384 |
if (any((((select(int3(0), int3(1), (_430 - _431) < float3(_433 + _434)) + (int3(2) * select(int3(0), int3(1), (_430 + _431) > float3((-_433) - _434)))) | (select(int3(0), int3(1), (_452 - _431) < float3(_454 + _434)) + (int3(2) * select(int3(0), int3(1), (_452 + _431) > float3((-_454) - _434))))) | (select(int3(0), int3(1), (_473 - _431) < float3(_475 + _434)) + (int3(2) * select(int3(0), int3(1), (_473 + _431) > float3((-_475) - _434))))) != int3(3))) |
| 385 |
{ |
| 386 |
_524 = float4(0.0); |
| 387 |
break; |
| 388 |
} |
| 389 |
float3 _493 = temp_var_hullMainRetVal[0u].WorldPosition[0].xyz - temp_var_hullMainRetVal[1u].WorldPosition[0].xyz; |
| 390 |
float3 _494 = temp_var_hullMainRetVal[1u].WorldPosition[0].xyz - temp_var_hullMainRetVal[2u].WorldPosition[0].xyz; |
| 391 |
float3 _495 = temp_var_hullMainRetVal[2u].WorldPosition[0].xyz - temp_var_hullMainRetVal[0u].WorldPosition[0].xyz; |
| 392 |
float3 _498 = (float3(0.5) * (temp_var_hullMainRetVal[0u].WorldPosition[0].xyz + temp_var_hullMainRetVal[1u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin); |
| 393 |
float3 _501 = (float3(0.5) * (temp_var_hullMainRetVal[1u].WorldPosition[0].xyz + temp_var_hullMainRetVal[2u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin); |
| 394 |
float3 _504 = (float3(0.5) * (temp_var_hullMainRetVal[2u].WorldPosition[0].xyz + temp_var_hullMainRetVal[0u].WorldPosition[0].xyz)) - float3(View.View_TranslatedWorldCameraOrigin); |
| 395 |
float _508 = sqrt(dot(_494, _494) / dot(_501, _501)); |
| 396 |
float _512 = sqrt(dot(_495, _495) / dot(_504, _504)); |
| 397 |
float _516 = sqrt(dot(_493, _493) / dot(_498, _498)); |
| 398 |
float4 _521 = float4(_508, _512, _516, 1.0); |
| 399 |
_521.w = 0.333000004291534423828125 * ((_508 + _512) + _516); |
| 400 |
_524 = float4(View.View_AdaptiveTessellationFactor) * _521; |
| 401 |
break; |
| 402 |
} |
| 403 |
float4 _526 = fast::clamp(_416 * _524, float4(1.0), float4(15.0)); |
| 404 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[0u] = half(_526.x); |
| 405 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[1u] = half(_526.y); |
| 406 |
spvTessLevel[gl_PrimitiveID].edgeTessellationFactor[2u] = half(_526.z); |
| 407 |
spvTessLevel[gl_PrimitiveID].insideTessellationFactor = half(_526.w); |
| 408 |
patchOut.out_var_PN_POSITION9 = _385 + ((_385 - (((temp_var_hullMainRetVal[2u].WorldPosition[0] + temp_var_hullMainRetVal[1u].WorldPosition[0]) + temp_var_hullMainRetVal[0u].WorldPosition[0]) * float4(0.3333333432674407958984375))) * float4(0.5)); |
| 409 |
} |
| 410 |
} |
| 411 |
|