#define N_TLaneVector_Vectorize_1 #define N_TLaneVector_OPERATOR_ADD_0 #define N_x2B_0 #define N_x2A_4 #define N_clamp_0 #define N_and_internal_0 #define GROUP_TILE_SIZE 16 #if DIM_WAVE_SIZE == 64 #define LANE_COUNT 64 #define LANE_STRIDE_X 2 #define LANE_STRIDE_Y 2 #elif DIM_WAVE_SIZE == 32 #define LANE_COUNT 32 #define LANE_STRIDE_X 4 #define LANE_STRIDE_Y 2 #elif DIM_WAVE_SIZE == 0 && 0 #define LANE_COUNT 32 #define LANE_STRIDE_X 4 #define LANE_STRIDE_Y 2 #elif DIM_WAVE_SIZE == 0 && 1 #define LANE_COUNT (GROUP_TILE_SIZE * GROUP_TILE_SIZE) #define LANE_STRIDE_X 1 #define LANE_STRIDE_Y 1 #else #error Unknown wave size #endif #define LANE_COUNT_X (GROUP_TILE_SIZE / LANE_STRIDE_X) #define LANE_COUNT_Y (GROUP_TILE_SIZE / LANE_STRIDE_Y) // SIMD_SIZE is 8 when DIM_WAVE_SIZE is 32 // SIMD_SIZE is 4 when DIM_WAVE_SIZE is 64 #ifndef SIMD_SIZE #define SIMD_SIZE (LANE_STRIDE_X * LANE_STRIDE_Y) #endif bool select_internal(bool c, bool a, bool b) { return bool (c ? a.x : b.x); } bool2 select_internal(bool c, bool a, bool2 b) { return bool2(c ? a : b.x, c ? a : b.y); } bool2 select_internal(bool c, bool2 a, bool b) { return bool2(c ? a.x : b , c ? a.y : b ); } bool2 select_internal(bool c, bool2 a, bool2 b) { return bool2(c ? a.x : b.x, c ? a.y : b.y); } bool2 select_internal(bool2 c, bool a, bool b) { return bool2(c.x ? a : b , c.y ? a : b ); } bool2 select_internal(bool2 c, bool a, bool2 b) { return bool2(c.x ? a : b.x, c.y ? a : b.y); } bool2 select_internal(bool2 c, bool2 a, bool b) { return bool2(c.x ? a.x : b , c.y ? a.y : b ); } bool2 select_internal(bool2 c, bool2 a, bool2 b) { return bool2(c.x ? a.x : b.x, c.y ? a.y : b.y); } bool3 select_internal(bool c, bool a, bool3 b) { return bool3(c ? a : b.x, c ? a : b.y, c ? a : b.z); } bool3 select_internal(bool c, bool3 a, bool b) { return bool3(c ? a.x : b , c ? a.y : b , c ? a.z : b ); } bool3 select_internal(bool c, bool3 a, bool3 b) { return bool3(c ? a.x : b.x, c ? a.y : b.y, c ? a.z : b.z); } bool3 select_internal(bool3 c, bool a, bool b) { return bool3(c.x ? a : b , c.y ? a : b , c.z ? a : b ); } bool3 select_internal(bool3 c, bool a, bool3 b) { return bool3(c.x ? a : b.x, c.y ? a : b.y, c.z ? a : b.z); } bool3 select_internal(bool3 c, bool3 a, bool b) { return bool3(c.x ? a.x : b , c.y ? a.y : b , c.z ? a.z : b ); } bool3 select_internal(bool3 c, bool3 a, bool3 b) { return bool3(c.x ? a.x : b.x, c.y ? a.y : b.y, c.z ? a.z : b.z); } bool4 select_internal(bool c, bool a, bool4 b) { return bool4(c ? a : b.x, c ? a : b.y, c ? a : b.z, c ? a : b.w); } bool4 select_internal(bool c, bool4 a, bool b) { return bool4(c ? a.x : b , c ? a.y : b , c ? a.z : b , c ? a.w : b ); } bool4 select_internal(bool c, bool4 a, bool4 b) { return bool4(c ? a.x : b.x, c ? a.y : b.y, c ? a.z : b.z, c ? a.w : b.w); } bool4 select_internal(bool4 c, bool a, bool b) { return bool4(c.x ? a : b , c.y ? a : b , c.z ? a : b , c.w ? a : b ); } bool4 select_internal(bool4 c, bool a, bool4 b) { return bool4(c.x ? a : b.x, c.y ? a : b.y, c.z ? a : b.z, c.w ? a : b.w); } bool4 select_internal(bool4 c, bool4 a, bool b) { return bool4(c.x ? a.x : b , c.y ? a.y : b , c.z ? a.z : b , c.w ? a.w : b ); } bool4 select_internal(bool4 c, bool4 a, bool4 b) { return bool4(c.x ? a.x : b.x, c.y ? a.y : b.y, c.z ? a.z : b.z, c.w ? a.w : b.w); } #pragma pack_matrix(column_major) #ifdef SLANG_HLSL_ENABLE_NVAPI #include "nvHLSLExtns.h" #endif #pragma warning(disable: 3557) struct SLANG_ParameterGroup_RootShaderParameters_0 { float2 InputInfo_Extent; float2 InputInfo_ExtentInverse; float2 InputInfo_ScreenPosToViewportScale; float2 InputInfo_ScreenPosToViewportBias; uint2 InputInfo_ViewportMin; uint2 InputInfo_ViewportMax; float2 InputInfo_ViewportSize; float2 InputInfo_ViewportSizeInverse; float2 InputInfo_UVViewportMin; float2 InputInfo_UVViewportMax; float2 InputInfo_UVViewportSize; float2 InputInfo_UVViewportSizeInverse; float2 InputInfo_UVViewportBilinearMin; float2 InputInfo_UVViewportBilinearMax; float2 HistoryInfo_Extent; float2 HistoryInfo_ExtentInverse; uint2 HistoryInfo_ViewportMin; uint2 HistoryInfo_ViewportMax; float2 HistoryInfo_ViewportSize; float2 HistoryInfo_ViewportSizeInverse; float2 HistoryInfo_UVViewportBilinearMin; float2 HistoryInfo_UVViewportBilinearMax; int2 InputPixelPosMin; int2 InputPixelPosMax; float4 InputPixelPosToScreenPos; float2 InputJitter; uint bCameraCut; float2 ScreenVelocityToInputPixelVelocity; float2 InputPixelVelocityToScreenVelocity; float4 InputPixelPosToTranslucencyTextureUV; float2 TranslucencyTextureUVMin; float2 TranslucencyTextureUVMax; float3 HistoryGuideQuantizationError; float FlickeringFramePeriod; float TheoricBlendFactor; }; cbuffer _RootShaderParameters : register(b0) { float2 InputInfo_Extent : packoffset(c0); float2 InputInfo_ExtentInverse : packoffset(c0.z); float2 InputInfo_ScreenPosToViewportScale : packoffset(c1); float2 InputInfo_ScreenPosToViewportBias : packoffset(c1.z); uint2 InputInfo_ViewportMin : packoffset(c2); uint2 InputInfo_ViewportMax : packoffset(c2.z); float2 InputInfo_ViewportSize : packoffset(c3); float2 InputInfo_ViewportSizeInverse : packoffset(c3.z); float2 InputInfo_UVViewportMin : packoffset(c4); float2 InputInfo_UVViewportMax : packoffset(c4.z); float2 InputInfo_UVViewportSize : packoffset(c5); float2 InputInfo_UVViewportSizeInverse : packoffset(c5.z); float2 InputInfo_UVViewportBilinearMin : packoffset(c6); float2 InputInfo_UVViewportBilinearMax : packoffset(c6.z); float2 HistoryInfo_Extent : packoffset(c7); float2 HistoryInfo_ExtentInverse : packoffset(c7.z); uint2 HistoryInfo_ViewportMin : packoffset(c9); uint2 HistoryInfo_ViewportMax : packoffset(c9.z); float2 HistoryInfo_ViewportSize : packoffset(c10); float2 HistoryInfo_ViewportSizeInverse : packoffset(c10.z); float2 HistoryInfo_UVViewportBilinearMin : packoffset(c13); float2 HistoryInfo_UVViewportBilinearMax : packoffset(c13.z); int2 InputPixelPosMin : packoffset(c14); int2 InputPixelPosMax : packoffset(c14.z); float4 InputPixelPosToScreenPos : packoffset(c15); float2 InputJitter : packoffset(c16); uint bCameraCut : packoffset(c16.z); float2 ScreenVelocityToInputPixelVelocity : packoffset(c17); float2 InputPixelVelocityToScreenVelocity : packoffset(c17.z); float4 InputPixelPosToTranslucencyTextureUV : packoffset(c19); float2 TranslucencyTextureUVMin : packoffset(c20); float2 TranslucencyTextureUVMax : packoffset(c20.z); float3 HistoryGuideQuantizationError : packoffset(c21); float FlickeringFramePeriod : packoffset(c21.w); float TheoricBlendFactor : packoffset(c22); } Texture2D InputTexture; Texture2D InputSceneTranslucencyTexture; SamplerState D3DStaticBilinearClampedSampler : register(s3, space1000); Texture2D ReprojectedHistoryGuideTexture; Texture2D ParallaxRejectionMaskTexture; struct SLANG_ParameterGroup_UniformBufferConstants_View_0 { matrix View_TranslatedWorldToClip; matrix View_TranslatedWorldToSubpixelClip; matrix View_RelativeWorldToClip; matrix View_ClipToRelativeWorld; matrix View_TranslatedWorldToView; matrix View_ViewToTranslatedWorld; matrix View_TranslatedWorldToCameraView; matrix View_CameraViewToTranslatedWorld; matrix View_ViewToClip; matrix View_ViewToClipNoAA; matrix View_ClipToView; matrix View_ClipToTranslatedWorld; matrix View_SVPositionToTranslatedWorld; matrix View_ScreenToRelativeWorld; matrix View_ScreenToTranslatedWorld; matrix View_MobileMultiviewShadowTransform; float3 View_ViewTilePosition; float PrePadding_View_1036; float3 View_MatrixTilePosition; float PrePadding_View_1052; float3 View_ViewForward; float PrePadding_View_1068; float3 View_ViewUp; float PrePadding_View_1084; float3 View_ViewRight; float PrePadding_View_1100; float3 View_HMDViewNoRollUp; float PrePadding_View_1116; float3 View_HMDViewNoRollRight; float PrePadding_View_1132; float4 View_InvDeviceZToWorldZTransform; float4 View_ScreenPositionScaleBias; float3 View_RelativeWorldCameraOrigin; float PrePadding_View_1180; float3 View_TranslatedWorldCameraOrigin; float PrePadding_View_1196; float3 View_RelativeWorldViewOrigin; float PrePadding_View_1212; float3 View_RelativePreViewTranslation; float PrePadding_View_1228; matrix View_PrevViewToClip; matrix View_PrevClipToView; matrix View_PrevTranslatedWorldToClip; matrix View_PrevTranslatedWorldToView; matrix View_PrevViewToTranslatedWorld; matrix View_PrevTranslatedWorldToCameraView; matrix View_PrevCameraViewToTranslatedWorld; float3 View_PrevTranslatedWorldCameraOrigin; float PrePadding_View_1692; float3 View_PrevRelativeWorldCameraOrigin; float PrePadding_View_1708; float3 View_PrevRelativeWorldViewOrigin; float PrePadding_View_1724; float3 View_RelativePrevPreViewTranslation; float PrePadding_View_1740; matrix View_PrevClipToRelativeWorld; matrix View_PrevScreenToTranslatedWorld; matrix View_ClipToPrevClip; matrix View_ClipToPrevClipWithAA; float4 View_TemporalAAJitter; float4 View_GlobalClippingPlane; float2 View_FieldOfViewWideAngles; float2 View_PrevFieldOfViewWideAngles; float4 View_ViewRectMin; float4 View_ViewSizeAndInvSize; uint4 View_ViewRectMinAndSize; float4 View_LightProbeSizeRatioAndInvSizeRatio; float4 View_BufferSizeAndInvSize; float4 View_BufferBilinearUVMinMax; float4 View_ScreenToViewSpace; float2 View_BufferToSceneTextureScale; float2 View_ResolutionFractionAndInv; int View_NumSceneColorMSAASamples; float View_PreExposure; float View_OneOverPreExposure; float PrePadding_View_2188; float4 View_DiffuseOverrideParameter; float4 View_SpecularOverrideParameter; float4 View_NormalOverrideParameter; float2 View_RoughnessOverrideParameter; float View_PrevFrameGameTime; float View_PrevFrameRealTime; float View_OutOfBoundsMask; float PrePadding_View_2260; float PrePadding_View_2264; float PrePadding_View_2268; float3 View_WorldCameraMovementSinceLastFrame; float View_CullingSign; float View_NearPlane; float View_GameTime; float View_RealTime; float View_DeltaTime; float View_MaterialTextureMipBias; float View_MaterialTextureDerivativeMultiply; uint View_Random; uint View_FrameNumber; uint View_StateFrameIndexMod8; uint View_StateFrameIndex; uint View_DebugViewModeMask; uint View_WorldIsPaused; float View_CameraCut; float View_UnlitViewmodeMask; float PrePadding_View_2344; float PrePadding_View_2348; float4 View_DirectionalLightColor; float3 View_DirectionalLightDirection; float PrePadding_View_2380; float4 View_TranslucencyLightingVolumeMin[int(2)]; float4 View_TranslucencyLightingVolumeInvSize[int(2)]; float4 View_TemporalAAParams; float4 View_CircleDOFParams; float View_DepthOfFieldSensorWidth; float View_DepthOfFieldFocalDistance; float View_DepthOfFieldScale; float View_DepthOfFieldFocalLength; float View_DepthOfFieldFocalRegion; float View_DepthOfFieldNearTransitionRegion; float View_DepthOfFieldFarTransitionRegion; float View_MotionBlurNormalizedToPixel; float View_GeneralPurposeTweak; float View_GeneralPurposeTweak2; float View_DemosaicVposOffset; float View_DecalDepthBias; float3 View_IndirectLightingColorScale; float PrePadding_View_2540; float3 View_PrecomputedIndirectLightingColorScale; float PrePadding_View_2556; float3 View_PrecomputedIndirectSpecularColorScale; float PrePadding_View_2572; float4 View_AtmosphereLightDirection[int(2)]; float4 View_AtmosphereLightIlluminanceOnGroundPostTransmittance[int(2)]; float4 View_AtmosphereLightIlluminanceOuterSpace[int(2)]; float4 View_AtmosphereLightDiscLuminance[int(2)]; float4 View_AtmosphereLightDiscCosHalfApexAngle_PPTrans[int(2)]; float4 View_SkyViewLutSizeAndInvSize; float3 View_SkyCameraTranslatedWorldOrigin; float PrePadding_View_2764; float4 View_SkyPlanetTranslatedWorldCenterAndViewHeight; matrix View_SkyViewLutReferential; float4 View_SkyAtmosphereSkyLuminanceFactor; float View_SkyAtmospherePresentInScene; float View_SkyAtmosphereHeightFogContribution; float View_SkyAtmosphereBottomRadiusKm; float View_SkyAtmosphereTopRadiusKm; float4 View_SkyAtmosphereCameraAerialPerspectiveVolumeSizeAndInvSize; float View_SkyAtmosphereAerialPerspectiveStartDepthKm; float View_SkyAtmosphereCameraAerialPerspectiveVolumeDepthResolution; float View_SkyAtmosphereCameraAerialPerspectiveVolumeDepthResolutionInv; float View_SkyAtmosphereCameraAerialPerspectiveVolumeDepthSliceLengthKm; float View_SkyAtmosphereCameraAerialPerspectiveVolumeDepthSliceLengthKmInv; float View_SkyAtmosphereApplyCameraAerialPerspectiveVolume; float PrePadding_View_2920; float PrePadding_View_2924; float3 View_NormalCurvatureToRoughnessScaleBias; float View_RenderingReflectionCaptureMask; float View_RealTimeReflectionCapture; float View_RealTimeReflectionCapturePreExposure; float PrePadding_View_2952; float PrePadding_View_2956; float4 View_AmbientCubemapTint; float View_AmbientCubemapIntensity; float View_SkyLightApplyPrecomputedBentNormalShadowingFlag; float View_SkyLightAffectReflectionFlag; float View_SkyLightAffectGlobalIlluminationFlag; float4 View_SkyLightColor; float4 View_MobileSkyIrradianceEnvironmentMap[int(8)]; float View_MobilePreviewMode; float View_HMDEyePaddingOffset; float View_ReflectionCubemapMaxMip; float View_ShowDecalsMask; uint View_DistanceFieldAOSpecularOcclusionMode; float View_IndirectCapsuleSelfShadowingIntensity; float PrePadding_View_3160; float PrePadding_View_3164; float3 View_ReflectionEnvironmentRoughnessMixingScaleBiasAndLargestWeight; int View_StereoPassIndex; float4 View_GlobalVolumeTranslatedCenterAndExtent[int(6)]; float4 View_GlobalVolumeTranslatedWorldToUVAddAndMul[int(6)]; float4 View_GlobalDistanceFieldMipTranslatedWorldToUVScale[int(6)]; float4 View_GlobalDistanceFieldMipTranslatedWorldToUVBias[int(6)]; float View_GlobalDistanceFieldMipFactor; float View_GlobalDistanceFieldMipTransition; int View_GlobalDistanceFieldClipmapSizeInPages; int PrePadding_View_3580; float3 View_GlobalDistanceFieldInvPageAtlasSize; float PrePadding_View_3596; float3 View_GlobalDistanceFieldInvCoverageAtlasSize; float View_GlobalVolumeDimension; float View_GlobalVolumeTexelSize; float View_MaxGlobalDFAOConeDistance; uint View_NumGlobalSDFClipmaps; float View_CoveredExpandSurfaceScale; float View_NotCoveredExpandSurfaceScale; float View_NotCoveredMinStepScale; float View_DitheredTransparencyStepThreshold; float View_DitheredTransparencyTraceThreshold; int2 View_CursorPosition; float View_bCheckerboardSubsurfaceProfileRendering; float PrePadding_View_3660; float3 View_VolumetricFogInvGridSize; float PrePadding_View_3676; float3 View_VolumetricFogGridZParams; float PrePadding_View_3692; float2 View_VolumetricFogSVPosToVolumeUV; float2 View_VolumetricFogScreenUVToHistoryVolumeUV; float View_VolumetricFogMaxDistance; float PrePadding_View_3716; float PrePadding_View_3720; float PrePadding_View_3724; float3 View_VolumetricLightmapWorldToUVScale; float PrePadding_View_3740; float3 View_VolumetricLightmapWorldToUVAdd; float PrePadding_View_3756; float3 View_VolumetricLightmapIndirectionTextureSize; float View_VolumetricLightmapBrickSize; float3 View_VolumetricLightmapBrickTexelSize; float View_IndirectLightingCacheShowFlag; float View_EyeToPixelSpreadAngle; float PrePadding_View_3796; float PrePadding_View_3800; float PrePadding_View_3804; float4 View_XRPassthroughCameraUVs[int(2)]; float View_GlobalVirtualTextureMipBias; uint View_VirtualTextureFeedbackShift; uint View_VirtualTextureFeedbackMask; uint View_VirtualTextureFeedbackStride; uint View_VirtualTextureFeedbackJitterOffset; uint View_VirtualTextureFeedbackSampleOffset; uint PrePadding_View_3864; uint PrePadding_View_3868; float4 View_RuntimeVirtualTextureMipLevel; float2 View_RuntimeVirtualTexturePackHeight; float PrePadding_View_3896; float PrePadding_View_3900; float4 View_RuntimeVirtualTextureDebugParams; float View_OverrideLandscapeLOD; int View_FarShadowStaticMeshLODBias; float View_MinRoughness; float PrePadding_View_3932; float4 View_HairRenderInfo; uint View_EnableSkyLight; uint View_HairRenderInfoBits; uint View_HairComponents; float View_bSubsurfacePostprocessEnabled; float4 View_SSProfilesTextureSizeAndInvSize; float4 View_SSProfilesPreIntegratedTextureSizeAndInvSize; float3 View_PhysicsFieldClipmapCenter; float View_PhysicsFieldClipmapDistance; int View_PhysicsFieldClipmapResolution; int View_PhysicsFieldClipmapExponent; int View_PhysicsFieldClipmapCount; int View_PhysicsFieldTargetCount; int4 View_PhysicsFieldTargets[int(32)]; uint View_InstanceSceneDataSOAStride; uint View_GPUSceneViewId; float View_ViewResolutionFraction; float View_SubSurfaceColorAsTransmittanceAtDistanceInMeters; uint BindlessSampler_View_MaterialTextureBilinearWrapedSampler; uint PrePadding_View_4564; uint BindlessSampler_View_MaterialTextureBilinearClampedSampler; uint PrePadding_View_4572; uint BindlessResource_View_VolumetricLightmapIndirectionTexture; uint PrePadding_View_4580; uint BindlessResource_View_VolumetricLightmapBrickAmbientVector; uint PrePadding_View_4588; uint BindlessResource_View_VolumetricLightmapBrickSHCoefficients0; uint PrePadding_View_4596; uint BindlessResource_View_VolumetricLightmapBrickSHCoefficients1; uint PrePadding_View_4604; uint BindlessResource_View_VolumetricLightmapBrickSHCoefficients2; uint PrePadding_View_4612; uint BindlessResource_View_VolumetricLightmapBrickSHCoefficients3; uint PrePadding_View_4620; uint BindlessResource_View_VolumetricLightmapBrickSHCoefficients4; uint PrePadding_View_4628; uint BindlessResource_View_VolumetricLightmapBrickSHCoefficients5; uint PrePadding_View_4636; uint BindlessResource_View_SkyBentNormalBrickTexture; uint PrePadding_View_4644; uint BindlessResource_View_DirectionalLightShadowingBrickTexture; uint PrePadding_View_4652; uint BindlessSampler_View_VolumetricLightmapBrickAmbientVectorSampler; uint PrePadding_View_4660; uint BindlessSampler_View_VolumetricLightmapTextureSampler0; uint PrePadding_View_4668; uint BindlessSampler_View_VolumetricLightmapTextureSampler1; uint PrePadding_View_4676; uint BindlessSampler_View_VolumetricLightmapTextureSampler2; uint PrePadding_View_4684; uint BindlessSampler_View_VolumetricLightmapTextureSampler3; uint PrePadding_View_4692; uint BindlessSampler_View_VolumetricLightmapTextureSampler4; uint PrePadding_View_4700; uint BindlessSampler_View_VolumetricLightmapTextureSampler5; uint PrePadding_View_4708; uint BindlessSampler_View_SkyBentNormalTextureSampler; uint PrePadding_View_4716; uint BindlessSampler_View_DirectionalLightShadowingTextureSampler; uint PrePadding_View_4724; uint BindlessResource_View_GlobalDistanceFieldPageAtlasTexture; uint PrePadding_View_4732; uint BindlessResource_View_GlobalDistanceFieldCoverageAtlasTexture; uint PrePadding_View_4740; uint BindlessResource_View_GlobalDistanceFieldPageTableTexture; uint PrePadding_View_4748; uint BindlessResource_View_GlobalDistanceFieldMipTexture; uint PrePadding_View_4756; uint BindlessResource_View_AtmosphereTransmittanceTexture; uint PrePadding_View_4764; uint BindlessSampler_View_AtmosphereTransmittanceTextureSampler; uint PrePadding_View_4772; uint BindlessResource_View_AtmosphereIrradianceTexture; uint PrePadding_View_4780; uint BindlessSampler_View_AtmosphereIrradianceTextureSampler; uint PrePadding_View_4788; uint BindlessResource_View_AtmosphereInscatterTexture; uint PrePadding_View_4796; uint BindlessSampler_View_AtmosphereInscatterTextureSampler; uint PrePadding_View_4804; uint BindlessResource_View_PerlinNoiseGradientTexture; uint PrePadding_View_4812; uint BindlessSampler_View_PerlinNoiseGradientTextureSampler; uint PrePadding_View_4820; uint BindlessResource_View_PerlinNoise3DTexture; uint PrePadding_View_4828; uint BindlessSampler_View_PerlinNoise3DTextureSampler; uint PrePadding_View_4836; uint BindlessResource_View_SobolSamplingTexture; uint PrePadding_View_4844; uint BindlessSampler_View_SharedPointWrappedSampler; uint PrePadding_View_4852; uint BindlessSampler_View_SharedPointClampedSampler; uint PrePadding_View_4860; uint BindlessSampler_View_SharedBilinearWrappedSampler; uint PrePadding_View_4868; uint BindlessSampler_View_SharedBilinearClampedSampler; uint PrePadding_View_4876; uint BindlessSampler_View_SharedBilinearAnisoClampedSampler; uint PrePadding_View_4884; uint BindlessSampler_View_SharedTrilinearWrappedSampler; uint PrePadding_View_4892; uint BindlessSampler_View_SharedTrilinearClampedSampler; uint PrePadding_View_4900; uint BindlessResource_View_PreIntegratedBRDF; uint PrePadding_View_4908; uint BindlessSampler_View_PreIntegratedBRDFSampler; uint PrePadding_View_4916; uint BindlessResource_View_PrimitiveSceneData; uint PrePadding_View_4924; uint BindlessResource_View_InstanceSceneData; uint PrePadding_View_4932; uint BindlessResource_View_InstancePayloadData; uint PrePadding_View_4940; uint BindlessResource_View_LightmapSceneData; uint PrePadding_View_4948; uint BindlessResource_View_SkyIrradianceEnvironmentMap; uint PrePadding_View_4956; uint BindlessResource_View_TransmittanceLutTexture; uint PrePadding_View_4964; uint BindlessSampler_View_TransmittanceLutTextureSampler; uint PrePadding_View_4972; uint BindlessResource_View_SkyViewLutTexture; uint PrePadding_View_4980; uint BindlessSampler_View_SkyViewLutTextureSampler; uint PrePadding_View_4988; uint BindlessResource_View_DistantSkyLightLutTexture; uint PrePadding_View_4996; uint BindlessSampler_View_DistantSkyLightLutTextureSampler; uint PrePadding_View_5004; uint BindlessResource_View_CameraAerialPerspectiveVolume; uint PrePadding_View_5012; uint BindlessSampler_View_CameraAerialPerspectiveVolumeSampler; uint PrePadding_View_5020; uint BindlessResource_View_CameraAerialPerspectiveVolumeMieOnly; uint PrePadding_View_5028; uint BindlessSampler_View_CameraAerialPerspectiveVolumeMieOnlySampler; uint PrePadding_View_5036; uint BindlessResource_View_CameraAerialPerspectiveVolumeRayOnly; uint PrePadding_View_5044; uint BindlessSampler_View_CameraAerialPerspectiveVolumeRayOnlySampler; uint PrePadding_View_5052; uint BindlessResource_View_HairScatteringLUTTexture; uint PrePadding_View_5060; uint BindlessSampler_View_HairScatteringLUTSampler; uint PrePadding_View_5068; uint BindlessResource_View_LTCMatTexture; uint PrePadding_View_5076; uint BindlessSampler_View_LTCMatSampler; uint PrePadding_View_5084; uint BindlessResource_View_LTCAmpTexture; uint PrePadding_View_5092; uint BindlessSampler_View_LTCAmpSampler; uint PrePadding_View_5100; uint View_bShadingEnergyConservation; uint View_bShadingEnergyPreservation; uint BindlessResource_View_ShadingEnergyGGXSpecTexture; uint PrePadding_View_5116; uint BindlessResource_View_ShadingEnergyGGXGlassTexture; uint PrePadding_View_5124; uint BindlessResource_View_ShadingEnergyClothSpecTexture; uint PrePadding_View_5132; uint BindlessResource_View_ShadingEnergyDiffuseTexture; uint PrePadding_View_5140; uint BindlessSampler_View_ShadingEnergySampler; uint PrePadding_View_5148; uint BindlessResource_View_SSProfilesTexture; uint PrePadding_View_5156; uint BindlessSampler_View_SSProfilesSampler; uint PrePadding_View_5164; uint BindlessSampler_View_SSProfilesTransmissionSampler; uint PrePadding_View_5172; uint BindlessResource_View_SSProfilesPreIntegratedTexture; uint PrePadding_View_5180; uint BindlessSampler_View_SSProfilesPreIntegratedSampler; uint PrePadding_View_5188; uint BindlessResource_View_WaterIndirection; uint PrePadding_View_5196; uint BindlessResource_View_WaterData; uint PrePadding_View_5204; uint PrePadding_View_5208; uint PrePadding_View_5212; float4 View_RectLightAtlasSizeAndInvSize; float View_RectLightAtlasMaxMipLevel; float PrePadding_View_5236; uint BindlessResource_View_RectLightAtlasTexture; uint PrePadding_View_5244; uint BindlessSampler_View_RectLightAtlasSampler; uint PrePadding_View_5252; uint PrePadding_View_5256; uint PrePadding_View_5260; float4 View_IESAtlasSizeAndInvSize; uint BindlessResource_View_IESAtlasTexture; uint PrePadding_View_5284; uint BindlessSampler_View_IESAtlasSampler; uint PrePadding_View_5292; uint BindlessSampler_View_LandscapeWeightmapSampler; uint PrePadding_View_5300; uint BindlessResource_View_LandscapeIndirection; uint PrePadding_View_5308; uint BindlessResource_View_LandscapePerComponentData; uint PrePadding_View_5316; uint BindlessResource_View_VTFeedbackBuffer; uint PrePadding_View_5324; uint BindlessResource_View_EditorVisualizeLevelInstanceIds; uint PrePadding_View_5332; uint BindlessResource_View_EditorSelectedHitProxyIds; uint PrePadding_View_5340; uint BindlessResource_View_PhysicsFieldClipmapBuffer; uint PrePadding_View_5348; uint PrePadding_View_5352; uint PrePadding_View_5356; float3 View_TLASRelativePreViewTranslation; float PrePadding_View_5372; float3 View_TLASViewTilePosition; }; cbuffer UniformBufferConstants_View { SLANG_ParameterGroup_UniformBufferConstants_View_0 UniformBufferConstants_View; } RWTexture2D HistoryGuideOutput; RWTexture2D HistoryRejectionOutput; RWTexture2D InputSceneColorLdrLumaOutput; int2 GetSimdIndexPixelCoordinateInLane(const uint SimdIndex) { return int2(int(SimdIndex % uint(LANE_STRIDE_X)), int(SimdIndex / uint(LANE_STRIDE_X))); } int2 GetSimdIndexPixelCoordinateInLane_0(uint SimdIndex_0) { return int2(int(SimdIndex_0 % uint(LANE_STRIDE_X)), int(SimdIndex_0 / uint(LANE_STRIDE_X))); } int2 GetLaneSimdPixelOffset(uint LaneIndex, uint SimdIndex) { return int2(int(LaneIndex % uint(LANE_COUNT_X)), int(LaneIndex / uint(LANE_COUNT_X))) * int2(int(LANE_STRIDE_X), int(LANE_STRIDE_Y)) + GetSimdIndexPixelCoordinateInLane(SimdIndex); } int2 GetLaneSimdPixelOffset_0(uint LaneIndex_0, uint SimdIndex_1) { return int2(int(LaneIndex_0 % uint(LANE_COUNT_X)), int(LaneIndex_0 / uint(LANE_COUNT_X))) * int2(int(LANE_STRIDE_X), int(LANE_STRIDE_Y)) + GetSimdIndexPixelCoordinateInLane_0(SimdIndex_1); } float2 ApplyScreenTransform_0(float2 PInA_0, float4 AToB_0) { return PInA_0 * AToB_0.xy + AToB_0.zw; } int2 ClampPixelOffset_0(int2 SamplePixelPos_0, int2 MinPixelPos_0, int2 MaxPixelPos_0) { int2 _S1 = SamplePixelPos_0; _S1[int(0)] = min(SamplePixelPos_0.x, MaxPixelPos_0.x); _S1[int(0)] = max(_S1.x, MinPixelPos_0.x); _S1[int(1)] = min(_S1.y, MaxPixelPos_0.y); _S1[int(1)] = max(_S1.y, MinPixelPos_0.y); return _S1; } template struct TLaneVector { vector RegisterArray[SimdSize]; TLaneVector operator [](const uint ComponentIndex) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, GetElement(SimdIndex)[ComponentIndex]); } return R; } vector GetElement(const uint SimdIndex) { return RegisterArray[SimdIndex]; } void SetElement(const uint SimdIndex, vector Element) { RegisterArray[SimdIndex] = Element; } void SetAllElements(vector Element) { [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { RegisterArray[SimdIndex] = Element; } } TLaneVector operator +(TLaneVector B) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, GetElement(SimdIndex) + B.GetElement(SimdIndex)); } return R; } TLaneVector operator +(vector B) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, GetElement(SimdIndex) + B); } return R; } TLaneVector operator -() { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, -GetElement(SimdIndex)); } return R; } TLaneVector operator -(TLaneVector B) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, GetElement(SimdIndex) - B.GetElement(SimdIndex)); } return R; } TLaneVector operator -(vector B) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, GetElement(SimdIndex) - B); } return R; } TLaneVector operator *(TLaneVector B) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, GetElement(SimdIndex) * B.GetElement(SimdIndex)); } return R; } TLaneVector operator *(vector B) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, GetElement(SimdIndex) * B); } return R; } static TLaneVector Vectorize( TLaneVector A) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, A.GetElement(SimdIndex)[0]); } return R; } static TLaneVector Const( vector A) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, A); } return R; } }; struct TLaneVector_0 { float3 RegisterArray_0[int(SIMD_SIZE)]; void toSlang(TLaneVector val) { [unroll] for (int i = 0; i < SIMD_SIZE; ++i) RegisterArray_0[i].xyz = val.RegisterArray[i].xyz; } TLaneVector fromSlang() { TLaneVector Result; [unroll] for (int i = 0; i < SIMD_SIZE; ++i) Result.RegisterArray[i].xyz = RegisterArray_0[i].xyz; return Result; } }; void TLaneVector_SetElement_0(inout TLaneVector_0 this_0, uint SimdIndex_2, float3 Element_0) { this_0.RegisterArray_0[SimdIndex_2] = Element_0; return; } struct TLaneVector_1 { float4 RegisterArray_0[int(SIMD_SIZE)]; void toSlang(TLaneVector val) { [unroll] for (int i = 0; i < SIMD_SIZE; ++i) RegisterArray_0[i].xyzw = val.RegisterArray[i].xyzw; } TLaneVector fromSlang() { TLaneVector Result; [unroll] for (int i = 0; i < SIMD_SIZE; ++i) Result.RegisterArray[i].xyzw = RegisterArray_0[i].xyzw; return Result; } }; void TLaneVector_SetElement_1(inout TLaneVector_1 this_1, uint SimdIndex_3, float4 Element_1) { this_1.RegisterArray_0[SimdIndex_3] = Element_1; return; } struct TLaneVector_2 { float RegisterArray_0[int(SIMD_SIZE)]; void toSlang(TLaneVector val) { [unroll] for (int i = 0; i < SIMD_SIZE; ++i) RegisterArray_0[i] = val.RegisterArray[i]; } TLaneVector fromSlang() { TLaneVector Result; [unroll] for (int i = 0; i < SIMD_SIZE; ++i) Result.RegisterArray[i] = RegisterArray_0[i]; return Result; } }; void TLaneVector_SetElement_2(inout TLaneVector_2 this_2, uint SimdIndex_4, float Element_2) { this_2.RegisterArray_0[SimdIndex_4] = Element_2; return; } float3 TLaneVector_GetElement_0(TLaneVector_0 this_3, uint SimdIndex_5) { return this_3.RegisterArray_0[SimdIndex_5]; } float4 TLaneVector_GetElement_1(TLaneVector_1 this_4, uint SimdIndex_6) { return this_4.RegisterArray_0[SimdIndex_6]; } float TLaneVector_GetElement_2(TLaneVector_2 this_5, uint SimdIndex_7) { return this_5.RegisterArray_0[SimdIndex_7]; } bool TAccumulatorMax_NeedWeightInAccumulate_0() { return false; } bool TAccumulatorMin_NeedWeightInAccumulate_0() { return false; } bool TAccumulatorMin_NeedWeightInAccumulate_1() { return false; } bool TAccumulatorAvg_NeedWeightInAccumulate_0() { return true; } bool TAccumulatorAvg_NeedWeightInAccumulate_1() { return true; } #ifndef M_select_internal_0 int2 select_internal_0(vector c_0, int2 a_0, int b_0) { int _S2; if(c_0.x) { _S2 = a_0.x; } else { _S2 = b_0; } int _S3; if(c_0.y) { _S3 = a_0.y; } else { _S3 = b_0; } return int2(_S2, _S3); } #else int2 select_internal_0(vector c_0, int2 a_0, int b_0) { return select_internal(c_0, a_0, b_0); } #endif struct FWaveBroadcastSettings { uint Operation; uint SourceLaneIndex; uint GroupThreadIndex; uint SwizzleAnd; uint SwizzleOr; uint SwizzleXor; int Rotate; uint RotateFixMask; }; struct FWaveBroadcastSettings_0 { uint Operation_0; uint SourceLaneIndex_0; uint GroupThreadIndex_0; uint SwizzleAnd_0; uint SwizzleOr_0; uint SwizzleXor_0; int Rotate_0; uint RotateFixMask_0; FWaveBroadcastSettings fromSlang() { FWaveBroadcastSettings result; result.Operation = Operation_0; result.SourceLaneIndex = SourceLaneIndex_0; result.GroupThreadIndex = GroupThreadIndex_0; result.SwizzleAnd = SwizzleAnd_0; result.SwizzleOr = SwizzleOr_0; result.SwizzleXor = SwizzleXor_0; result.Rotate = Rotate_0; result.RotateFixMask = RotateFixMask_0; return result; } }; FWaveBroadcastSettings InitWaveRotateLaneGroup(const uint LaneGroupSize, const int LaneRotation) { FWaveBroadcastSettings Settings; Settings.Operation = 4; Settings.Rotate = LaneRotation; Settings.RotateFixMask = ~(LaneGroupSize - 1); return Settings; } FWaveBroadcastSettings_0 InitWaveRotateLaneGroup_0(uint LaneGroupSize_0, int LaneRotation_0) { FWaveBroadcastSettings_0 Settings_0; Settings_0.Operation_0 = 4U; Settings_0.Rotate_0 = LaneRotation_0; Settings_0.RotateFixMask_0 = ~(LaneGroupSize_0 - 1U); return Settings_0; } uint GetWaveBroadcastSourceLaneIndex(const FWaveBroadcastSettings Settings, uint DestLaneIndex) { if (Settings.Operation == 1) { return Settings.SourceLaneIndex; } else if (Settings.Operation == 2) { return Settings.SourceLaneIndex; } else if (Settings.Operation == 3) { return (((DestLaneIndex & Settings.SwizzleAnd) | Settings.SwizzleOr) ^ Settings.SwizzleXor) % 32; } else if (Settings.Operation == 4) { return (Settings.RotateFixMask & DestLaneIndex) | ((~Settings.RotateFixMask) & uint(DestLaneIndex + Settings.Rotate)); } return DestLaneIndex; } #ifndef M_GetWaveBroadcastSourceLaneIndex_0 uint GetWaveBroadcastSourceLaneIndex_0(FWaveBroadcastSettings_0 Settings_1, uint DestLaneIndex_0) { if(Settings_1.Operation_0 == 1U) { return Settings_1.SourceLaneIndex_0; } else { if(Settings_1.Operation_0 == 2U) { return Settings_1.SourceLaneIndex_0; } else { if(Settings_1.Operation_0 == 3U) { return (((DestLaneIndex_0 & Settings_1.SwizzleAnd_0) | Settings_1.SwizzleOr_0) ^ Settings_1.SwizzleXor_0) % 32U; } else { if(Settings_1.Operation_0 == 4U) { return (Settings_1.RotateFixMask_0 & DestLaneIndex_0) | ((~Settings_1.RotateFixMask_0) & uint(int(DestLaneIndex_0) + Settings_1.Rotate_0)); } } } } return DestLaneIndex_0; } #else uint GetWaveBroadcastSourceLaneIndex_0(FWaveBroadcastSettings_0 Settings_1, uint DestLaneIndex_0) { return GetWaveBroadcastSourceLaneIndex(Settings_1.fromSlang(), DestLaneIndex_0); } #endif uint WaveBroadcast(const FWaveBroadcastSettings Settings, uint x) { if (Settings.Operation == 1) { return WaveReadLaneAt(x, Settings.SourceLaneIndex); } else if (Settings.Operation == 3) { return WaveReadLaneAt(x, GetWaveBroadcastSourceLaneIndex(Settings, WaveGetLaneIndex())); } else if (Settings.Operation == 4) { return WaveReadLaneAt(x, GetWaveBroadcastSourceLaneIndex(Settings, WaveGetLaneIndex())); } return x; } #ifndef M_WaveBroadcast_0 uint WaveBroadcast_0(FWaveBroadcastSettings_0 Settings_2, uint x_0) { if(Settings_2.Operation_0 == 1U) { uint _S4 = WaveReadLaneAt(x_0, int(Settings_2.SourceLaneIndex_0)); return _S4; } else { if(Settings_2.Operation_0 == 3U) { uint _S5 = (WaveGetLaneIndex()); uint _S6 = WaveReadLaneAt(x_0, int(GetWaveBroadcastSourceLaneIndex_0(Settings_2, _S5))); return _S6; } else { if(Settings_2.Operation_0 == 4U) { uint _S7 = (WaveGetLaneIndex()); uint _S8 = WaveReadLaneAt(x_0, int(GetWaveBroadcastSourceLaneIndex_0(Settings_2, _S7))); return _S8; } } } return x_0; } #else uint WaveBroadcast_0(FWaveBroadcastSettings_0 Settings_2, uint x_0) { return WaveBroadcast(Settings_2.fromSlang(), x_0); } #endif float WaveBroadcast(FWaveBroadcastSettings Settings, float v) { return asfloat(WaveBroadcast(Settings, asuint(v))); } #ifndef M_WaveBroadcast_1 float WaveBroadcast_1(FWaveBroadcastSettings_0 Settings_3, float v_0) { uint _S9 = WaveBroadcast_0(Settings_3, (uint)(asuint(v_0))); return asfloat(_S9); } #else float WaveBroadcast_1(FWaveBroadcastSettings_0 Settings_3, float v_0) { return asfloat(WaveBroadcast(Settings_3.fromSlang(), asuint(v_0))); } #endif float3 WaveBroadcast(FWaveBroadcastSettings Settings, float3 v) { return float3( WaveBroadcast(Settings, v.x), WaveBroadcast(Settings, v.y), WaveBroadcast(Settings, v.z)); } #ifndef M_WaveBroadcast_2 float3 WaveBroadcast_2(FWaveBroadcastSettings_0 Settings_4, float3 v_1) { float3 result_0; uint _S10 = WaveBroadcast_0(Settings_4, (uint)(asuint(v_1[0U]))); result_0[0U] = asfloat(_S10); uint _S11 = WaveBroadcast_0(Settings_4, (uint)(asuint(v_1[1U]))); result_0[1U] = asfloat(_S11); uint _S12 = WaveBroadcast_0(Settings_4, (uint)(asuint(v_1[2U]))); result_0[2U] = asfloat(_S12); return result_0; } #else float3 WaveBroadcast_2(FWaveBroadcastSettings_0 Settings_4, float3 v_1) { return float3( WaveBroadcast(Settings_4.fromSlang(), v_1.x), WaveBroadcast(Settings_4.fromSlang(), v_1.y), WaveBroadcast(Settings_4.fromSlang(), v_1.z)); } #endif float4 WaveBroadcast(FWaveBroadcastSettings Settings, float4 v) { return float4( WaveBroadcast(Settings, v.x), WaveBroadcast(Settings, v.y), WaveBroadcast(Settings, v.z), WaveBroadcast(Settings, v.w)); } #ifndef M_WaveBroadcast_3 float4 WaveBroadcast_3(FWaveBroadcastSettings_0 Settings_5, float4 v_2) { float4 result_1; uint _S13 = WaveBroadcast_0(Settings_5, (uint)(asuint(v_2[0U]))); result_1[0U] = asfloat(_S13); uint _S14 = WaveBroadcast_0(Settings_5, (uint)(asuint(v_2[1U]))); result_1[1U] = asfloat(_S14); uint _S15 = WaveBroadcast_0(Settings_5, (uint)(asuint(v_2[2U]))); result_1[2U] = asfloat(_S15); uint _S16 = WaveBroadcast_0(Settings_5, (uint)(asuint(v_2[3U]))); result_1[3U] = asfloat(_S16); return result_1; } #else float4 WaveBroadcast_3(FWaveBroadcastSettings_0 Settings_5, float4 v_2) { return float4( WaveBroadcast(Settings_5.fromSlang(), v_2.x), WaveBroadcast(Settings_5.fromSlang(), v_2.y), WaveBroadcast(Settings_5.fromSlang(), v_2.z), WaveBroadcast(Settings_5.fromSlang(), v_2.w)); } #endif template TLaneVector AccessNeighborTexel(TLaneVector Input, const int2 Offset, uint GroupThreadIndex) { TLaneVector Return; [unroll( SIMD_SIZE )] for (uint SimdIndex = 0; SimdIndex < SIMD_SIZE; SimdIndex++) { const uint2 SimdPixelCoord = uint2(GetSimdIndexPixelCoordinateInLane(SimdIndex)); const uint2 NeigborSimdPixelCoord = (SimdPixelCoord + uint2(Offset)) % uint2(LANE_STRIDE_X, LANE_STRIDE_Y); const uint NeigborSimdIndex = dot(NeigborSimdPixelCoord, uint2(1, LANE_STRIDE_X)); const bool2 bNeedsLaneRotation = (SimdPixelCoord + uint2(Offset)) >= uint2(LANE_STRIDE_X, LANE_STRIDE_Y); const int LaneRotation = dot( select_internal( bNeedsLaneRotation , int2(Offset) , 0 ), int2(1, LANE_COUNT_X)); vector SimdElement = Input.GetElement(NeigborSimdIndex); vector ReturnSimdElement = SimdElement; if (LaneRotation != 0) { const FWaveBroadcastSettings BroadcastSettings = InitWaveRotateLaneGroup( LANE_COUNT, LaneRotation); ReturnSimdElement = WaveBroadcast(BroadcastSettings, SimdElement); } Return.SetElement(SimdIndex, ReturnSimdElement); } return Return; } #ifndef M_AccessNeighborTexel_0 TLaneVector_1 AccessNeighborTexel_0(TLaneVector_1 Input_0, int2 Offset_0, uint GroupThreadIndex_1) { TLaneVector_1 Return_0; uint SimdIndex_8 = 0U; [unroll] for(;;) { if(int(SimdIndex_8) < int(SIMD_SIZE)) { } else { break; } uint2 SimdPixelCoord_0 = uint2(GetSimdIndexPixelCoordinateInLane_0(SimdIndex_8)); uint2 NeigborSimdPixelCoord_0 = (SimdPixelCoord_0 + uint2(Offset_0)) % uint2(LANE_STRIDE_X, LANE_STRIDE_Y); int LaneRotation_1 = dot(select_internal_0(SimdPixelCoord_0 + uint2(Offset_0) >= uint2(LANE_STRIDE_X, LANE_STRIDE_Y), Offset_0, int(0)), int2(int(1), int(LANE_COUNT_X))); float4 SimdElement_0 = TLaneVector_GetElement_1(Input_0, dot(NeigborSimdPixelCoord_0, uint2(1U, LANE_STRIDE_X))); float4 ReturnSimdElement_0; if(LaneRotation_1 != int(0)) { float4 _S17 = WaveBroadcast_3(InitWaveRotateLaneGroup_0(LANE_COUNT, LaneRotation_1), SimdElement_0); ReturnSimdElement_0 = _S17; } else { ReturnSimdElement_0 = SimdElement_0; } TLaneVector_SetElement_1(Return_0, SimdIndex_8, ReturnSimdElement_0); SimdIndex_8 = SimdIndex_8 + 1U; } return Return_0; } #else TLaneVector_1 AccessNeighborTexel_0(TLaneVector_1 Input_0, int2 Offset_0, uint GroupThreadIndex_1) { typedef TLaneVector FSampleType; FSampleType tmp = AccessNeighborTexel(Input_0.fromSlang(), Offset_0, GroupThreadIndex_1); TLaneVector_1 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_AccessNeighborTexel_1 TLaneVector_2 AccessNeighborTexel_1(TLaneVector_2 Input_1, int2 Offset_1, uint GroupThreadIndex_2) { TLaneVector_2 Return_1; uint SimdIndex_9 = 0U; [unroll] for(;;) { if(int(SimdIndex_9) < int(SIMD_SIZE)) { } else { break; } uint2 SimdPixelCoord_1 = uint2(GetSimdIndexPixelCoordinateInLane_0(SimdIndex_9)); uint2 NeigborSimdPixelCoord_1 = (SimdPixelCoord_1 + uint2(Offset_1)) % uint2(LANE_STRIDE_X, LANE_STRIDE_Y); int LaneRotation_2 = dot(select_internal_0(SimdPixelCoord_1 + uint2(Offset_1) >= uint2(LANE_STRIDE_X, LANE_STRIDE_Y), Offset_1, int(0)), int2(int(1), int(LANE_COUNT_X))); float SimdElement_1 = TLaneVector_GetElement_2(Input_1, dot(NeigborSimdPixelCoord_1, uint2(1U, LANE_STRIDE_X))); float ReturnSimdElement_1; if(LaneRotation_2 != int(0)) { float _S18 = WaveBroadcast_1(InitWaveRotateLaneGroup_0(LANE_COUNT, LaneRotation_2), SimdElement_1); ReturnSimdElement_1 = _S18; } else { ReturnSimdElement_1 = SimdElement_1; } TLaneVector_SetElement_2(Return_1, SimdIndex_9, ReturnSimdElement_1); SimdIndex_9 = SimdIndex_9 + 1U; } return Return_1; } #else TLaneVector_2 AccessNeighborTexel_1(TLaneVector_2 Input, int2 Offset, uint GroupThreadIndex) { typedef TLaneVector FSampleType; FSampleType tmp = AccessNeighborTexel(Input.fromSlang(), Offset, GroupThreadIndex); TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_AccessNeighborTexel_2 TLaneVector_0 AccessNeighborTexel_2(TLaneVector_0 Input_2, int2 Offset_2, uint GroupThreadIndex_3) { TLaneVector_0 Return_2; uint SimdIndex_10 = 0U; [unroll] for(;;) { if(int(SimdIndex_10) < int(SIMD_SIZE)) { } else { break; } uint2 SimdPixelCoord_2 = uint2(GetSimdIndexPixelCoordinateInLane_0(SimdIndex_10)); uint2 NeigborSimdPixelCoord_2 = (SimdPixelCoord_2 + uint2(Offset_2)) % uint2(LANE_STRIDE_X, LANE_STRIDE_Y); int LaneRotation_3 = dot(select_internal_0(SimdPixelCoord_2 + uint2(Offset_2) >= uint2(LANE_STRIDE_X, LANE_STRIDE_Y), Offset_2, int(0)), int2(int(1), int(LANE_COUNT_X))); float3 SimdElement_2 = TLaneVector_GetElement_0(Input_2, dot(NeigborSimdPixelCoord_2, uint2(1U, LANE_STRIDE_X))); float3 ReturnSimdElement_2; if(LaneRotation_3 != int(0)) { float3 _S19 = WaveBroadcast_2(InitWaveRotateLaneGroup_0(LANE_COUNT, LaneRotation_3), SimdElement_2); ReturnSimdElement_2 = _S19; } else { ReturnSimdElement_2 = SimdElement_2; } TLaneVector_SetElement_0(Return_2, SimdIndex_10, ReturnSimdElement_2); SimdIndex_10 = SimdIndex_10 + 1U; } return Return_2; } #else TLaneVector_0 AccessNeighborTexel_2(TLaneVector_0 Input_2, int2 Offset_2, uint GroupThreadIndex_3) { typedef TLaneVector FSampleType; FSampleType tmp = AccessNeighborTexel(Input_2.fromSlang(), Offset_2, GroupThreadIndex_3); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif template struct TAccumulatorAvg { Type Value; TLaneVector Weight; static bool NeedWeightInAccumulate() { return true; } void Start(Type CenterSample) { Value = CenterSample; Weight = TLaneVector ::Const(1.0); } static Type PreprocessNeighborSample(Type Sample, TLaneVector InWeight) { return Sample; } void Accumulate(const int2 Offset, Type Sample, TLaneVector InWeight) { const float SampleSpatialWeight = float(rcp(abs(float(Offset.x)) + 1.0) * rcp(abs(float(Offset.y)) + 1.0)); Value = Value + Sample * Type::Vectorize(InWeight * SampleSpatialWeight); Weight = Weight + InWeight * TLaneVector ::Const(SampleSpatialWeight); } void Finish(const uint SampleCount) { Value = Value * Type::Vectorize(rcp(Weight)); } }; template struct TAccumulatorMin { Type Value; static bool NeedWeightInAccumulate() { return false; } void Start(Type CenterSample) { Value = CenterSample; } static Type PreprocessNeighborSample(Type Sample, TLaneVector InWeight) { return Sample; } void Accumulate(const int2 Offset, Type Sample, TLaneVector Weight) { Value = min(Value, Sample); } void Finish(const uint SampleCount) {} }; template struct TAccumulatorMax { Type Value; static bool NeedWeightInAccumulate() { return false; } void Start(Type CenterSample) { Value = CenterSample; } static Type PreprocessNeighborSample(Type Sample, TLaneVector InWeight) { return Sample; } void Accumulate(const int2 Offset, Type Sample, TLaneVector Weight) { Value = max(Value, Sample); } void Finish(const uint SampleCount) { } }; #ifndef M_TLaneVector_Const_0 TLaneVector_0 TLaneVector_Const_0(float3 A_0) { TLaneVector_0 R_0; uint SimdIndex_11 = 0U; [unroll] for(;;) { if(SimdIndex_11 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_0, SimdIndex_11, A_0); SimdIndex_11 = SimdIndex_11 + 1U; } return R_0; } #else TLaneVector_0 TLaneVector_Const_0(float3 A) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SIMD_SIZE; SimdIndex++) { R.SetElement(SimdIndex, A); } TLaneVector_0 Result; Result.toSlang(R); return Result; } #endif #ifndef M_TLaneVector_Const_1 TLaneVector_2 TLaneVector_Const_1(float A_1) { TLaneVector_2 R_1; uint SimdIndex_12 = 0U; [unroll] for(;;) { if(SimdIndex_12 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_1, SimdIndex_12, A_1); SimdIndex_12 = SimdIndex_12 + 1U; } return R_1; } #else TLaneVector_2 TLaneVector_Const_1(float A) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SIMD_SIZE; SimdIndex++) { R.SetElement(SimdIndex, A); } TLaneVector_2 Result; Result.toSlang(R); return Result; } #endif TLaneVector_0 TAccumulatorMax_PreprocessNeighborSample_0(TLaneVector_0 Sample_0, TLaneVector_2 InWeight_0) { return Sample_0; } TLaneVector_0 TAccumulatorMin_PreprocessNeighborSample_0(TLaneVector_0 Sample_1, TLaneVector_2 InWeight_1) { return Sample_1; } TLaneVector_2 TAccumulatorMin_PreprocessNeighborSample_1(TLaneVector_2 Sample_2, TLaneVector_2 InWeight_2) { return Sample_2; } TLaneVector_1 TAccumulatorAvg_PreprocessNeighborSample_0(TLaneVector_1 Sample_3, TLaneVector_2 InWeight_3) { return Sample_3; } TLaneVector_0 TAccumulatorAvg_PreprocessNeighborSample_1(TLaneVector_0 Sample_4, TLaneVector_2 InWeight_4) { return Sample_4; } struct TAccumulatorData_0 { TLaneVector_0 Value_0; TLaneVector_2 Weight_0; }; void TAccumulatorMax_Finish_0(inout TAccumulatorData_0 Data_0, uint SampleCount_0) { return; } void TAccumulatorMin_Finish_0(inout TAccumulatorData_0 Data_1, uint SampleCount_1) { return; } struct TAccumulatorData_1 { TLaneVector_2 Value_0; TLaneVector_2 Weight_0; }; void TAccumulatorMin_Finish_1(inout TAccumulatorData_1 Data_2, uint SampleCount_2) { return; } template TLaneVector rcp( TLaneVector A) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, rcp (A.GetElement(SimdIndex))); } return R; }; template TLaneVector saturate( TLaneVector A) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, saturate (A.GetElement(SimdIndex))); } return R; }; template TLaneVector abs( TLaneVector A) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, abs (A.GetElement(SimdIndex))); } return R; }; #ifndef M_rcp_0 TLaneVector_0 rcp_0(TLaneVector_0 A_2) { TLaneVector_0 R_2; uint SimdIndex_13 = 0U; [unroll] for(;;) { if(SimdIndex_13 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_2, SimdIndex_13, rcp(TLaneVector_GetElement_0(A_2, SimdIndex_13))); SimdIndex_13 = SimdIndex_13 + 1U; } return R_2; } #else TLaneVector_0 rcp_0(TLaneVector_0 A_2) { typedef TLaneVector FSampleType; FSampleType tmp = rcp(A_2.fromSlang()); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_rcp_1 TLaneVector_2 rcp_1(TLaneVector_2 A_3) { TLaneVector_2 R_3; uint SimdIndex_14 = 0U; [unroll] for(;;) { if(SimdIndex_14 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_3, SimdIndex_14, rcp(TLaneVector_GetElement_2(A_3, SimdIndex_14))); SimdIndex_14 = SimdIndex_14 + 1U; } return R_3; } #else TLaneVector_2 rcp_1(TLaneVector_2 A_3) { typedef TLaneVector FSampleType; FSampleType tmp = rcp(A_3.fromSlang()); TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_TLaneVector_Vectorize_0 TLaneVector_0 TLaneVector_Vectorize_0(TLaneVector_2 A_4) { TLaneVector_0 R_4; uint SimdIndex_15 = 0U; [unroll] for(;;) { if(SimdIndex_15 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_4, SimdIndex_15, (float3)TLaneVector_GetElement_2(A_4, SimdIndex_15)); SimdIndex_15 = SimdIndex_15 + 1U; } return R_4; } #else TLaneVector_0 TLaneVector_Vectorize_0(TLaneVector_2 A_4) { typedef TLaneVector FSampleType; FSampleType tmp = FSampleType::Vectorize(A_4.fromSlang()); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef N_TLaneVector_Vectorize_1 TLaneVector_1 TLaneVector_Vectorize_1(TLaneVector_2 A_5) { TLaneVector_1 R_5; uint SimdIndex_16 = 0U; [unroll] for(;;) { if(SimdIndex_16 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_1(R_5, SimdIndex_16, (float4)TLaneVector_GetElement_2(A_5, SimdIndex_16)); SimdIndex_16 = SimdIndex_16 + 1U; } return R_5; } #else TLaneVector_1 TLaneVector_Vectorize_1(TLaneVector_2 A_5) { typedef TLaneVector FSampleType; FSampleType tmp = FSampleType::Vectorize(A_5.fromSlang()); TLaneVector_1 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_TLaneVector_OPERATOR_MULTIPLY_0 TLaneVector_0 TLaneVector_OPERATOR_MULTIPLY_0(TLaneVector_0 this_6, TLaneVector_0 B_0) { TLaneVector_0 R_6; uint SimdIndex_17 = 0U; [unroll] for(;;) { if(SimdIndex_17 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_6, SimdIndex_17, TLaneVector_GetElement_0(this_6, SimdIndex_17) * TLaneVector_GetElement_0(B_0, SimdIndex_17)); SimdIndex_17 = SimdIndex_17 + 1U; } return R_6; } #else TLaneVector_0 TLaneVector_OPERATOR_MULTIPLY_0(TLaneVector_0 this_6, TLaneVector_0 B_0) { typedef TLaneVector FSampleType; FSampleType lhs = this_6.fromSlang(); FSampleType rhs = B_0.fromSlang(); FSampleType tmp = lhs * rhs; TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_TLaneVector_OPERATOR_MULTIPLY_1 TLaneVector_1 TLaneVector_OPERATOR_MULTIPLY_1(TLaneVector_1 this_7, TLaneVector_1 B_1) { TLaneVector_1 R_7; uint SimdIndex_18 = 0U; [unroll] for(;;) { if(SimdIndex_18 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_1(R_7, SimdIndex_18, TLaneVector_GetElement_1(this_7, SimdIndex_18) * TLaneVector_GetElement_1(B_1, SimdIndex_18)); SimdIndex_18 = SimdIndex_18 + 1U; } return R_7; } #else TLaneVector_1 TLaneVector_OPERATOR_MULTIPLY_1(TLaneVector_1 this_7, TLaneVector_1 B_1) { typedef TLaneVector FSampleType; FSampleType lhs = this_7.fromSlang(); FSampleType rhs = B_1.fromSlang(); FSampleType tmp = lhs * rhs; TLaneVector_1 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_TLaneVector_OPERATOR_MULTIPLY_2 TLaneVector_2 TLaneVector_OPERATOR_MULTIPLY_2(TLaneVector_2 this_8, TLaneVector_2 B_2) { TLaneVector_2 R_8; uint SimdIndex_19 = 0U; [unroll] for(;;) { if(SimdIndex_19 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_8, SimdIndex_19, TLaneVector_GetElement_2(this_8, SimdIndex_19) * TLaneVector_GetElement_2(B_2, SimdIndex_19)); SimdIndex_19 = SimdIndex_19 + 1U; } return R_8; } #else TLaneVector_2 TLaneVector_OPERATOR_MULTIPLY_2(TLaneVector_2 this_8, TLaneVector_2 B_2) { typedef TLaneVector FSampleType; FSampleType lhs = this_8.fromSlang(); FSampleType rhs = B_2.fromSlang(); FSampleType tmp = lhs * rhs; TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_x2A_0 TLaneVector_0 x2A_0(TLaneVector_0 lhs_0, TLaneVector_0 rhs_0) { return TLaneVector_OPERATOR_MULTIPLY_0(lhs_0, rhs_0); } #else TLaneVector_0 x2A_0(TLaneVector_0 lhs_0, TLaneVector_0 rhs_0) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_0.fromSlang(); FSampleType rhs = rhs_0.fromSlang(); FSampleType tmp = lhs * rhs; TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_x2A_1 TLaneVector_1 x2A_1(TLaneVector_1 lhs_1, TLaneVector_1 rhs_1) { return TLaneVector_OPERATOR_MULTIPLY_1(lhs_1, rhs_1); } #else TLaneVector_1 x2A_1(TLaneVector_1 lhs_1, TLaneVector_1 rhs_1) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_1.fromSlang(); FSampleType rhs = rhs_1.fromSlang(); FSampleType tmp = lhs * rhs; TLaneVector_1 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_x2A_2 TLaneVector_2 x2A_2(TLaneVector_2 lhs_2, TLaneVector_2 rhs_2) { return TLaneVector_OPERATOR_MULTIPLY_2(lhs_2, rhs_2); } #else TLaneVector_2 x2A_2(TLaneVector_2 lhs_2, TLaneVector_2 rhs_2) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_2.fromSlang(); FSampleType rhs = rhs_2.fromSlang(); FSampleType tmp = lhs * rhs; TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif struct TAccumulatorData_2 { TLaneVector_1 Value_0; TLaneVector_2 Weight_0; }; void TAccumulatorAvg_Finish_0(inout TAccumulatorData_2 Data_3, uint SampleCount_3) { Data_3.Value_0 = x2A_1(Data_3.Value_0, TLaneVector_Vectorize_1(rcp_1(Data_3.Weight_0))); return; } void TAccumulatorAvg_Finish_1(inout TAccumulatorData_0 Data_4, uint SampleCount_4) { Data_4.Value_0 = x2A_0(Data_4.Value_0, TLaneVector_Vectorize_0(rcp_1(Data_4.Weight_0))); return; } template TLaneVector max( TLaneVector A, TLaneVector B) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, max (A.GetElement(SimdIndex), B.GetElement(SimdIndex))); } return R; }; #ifndef M_max_0 TLaneVector_0 max_0(TLaneVector_0 A_6, TLaneVector_0 B_3) { TLaneVector_0 R_9; uint SimdIndex_20 = 0U; [unroll] for(;;) { if(SimdIndex_20 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_9, SimdIndex_20, max(TLaneVector_GetElement_0(A_6, SimdIndex_20), TLaneVector_GetElement_0(B_3, SimdIndex_20))); SimdIndex_20 = SimdIndex_20 + 1U; } return R_9; } #else TLaneVector_0 max_0(TLaneVector_0 A_6, TLaneVector_0 B_3) { typedef TLaneVector FSampleType; FSampleType lhs = A_6.fromSlang(); FSampleType rhs = B_3.fromSlang(); FSampleType tmp = max(lhs, rhs); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_max_1 TLaneVector_2 max_1(TLaneVector_2 A_7, TLaneVector_2 B_4) { TLaneVector_2 R_10; uint SimdIndex_21 = 0U; [unroll] for(;;) { if(SimdIndex_21 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_10, SimdIndex_21, max(TLaneVector_GetElement_2(A_7, SimdIndex_21), TLaneVector_GetElement_2(B_4, SimdIndex_21))); SimdIndex_21 = SimdIndex_21 + 1U; } return R_10; } #else TLaneVector_2 max_1(TLaneVector_2 A, TLaneVector_2 B) { typedef TLaneVector FSampleType; FSampleType lhs = A.fromSlang(); FSampleType rhs = B.fromSlang(); FSampleType tmp = max(lhs, rhs); TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif void TAccumulatorMax_Accumulate_0(inout TAccumulatorData_0 Data_5, int2 Offset_3, TLaneVector_0 Sample_5, TLaneVector_2 InWeight_5) { Data_5.Value_0 = max_0(Data_5.Value_0, Sample_5); return; } template TLaneVector min( TLaneVector A, TLaneVector B) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, min (A.GetElement(SimdIndex), B.GetElement(SimdIndex))); } return R; }; template TLaneVector dot( TLaneVector A, TLaneVector B) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, dot (A.GetElement(SimdIndex), B.GetElement(SimdIndex))); } return R; }; #ifndef M_min_0 TLaneVector_0 min_0(TLaneVector_0 A_8, TLaneVector_0 B_5) { TLaneVector_0 R_11; uint SimdIndex_22 = 0U; [unroll] for(;;) { if(SimdIndex_22 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_11, SimdIndex_22, min(TLaneVector_GetElement_0(A_8, SimdIndex_22), TLaneVector_GetElement_0(B_5, SimdIndex_22))); SimdIndex_22 = SimdIndex_22 + 1U; } return R_11; } #else TLaneVector_0 min_0(TLaneVector_0 A, TLaneVector_0 B) { typedef TLaneVector FSampleType; FSampleType lhs = A.fromSlang(); FSampleType rhs = B.fromSlang(); FSampleType tmp = min(lhs, rhs); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_min_1 TLaneVector_2 min_1(TLaneVector_2 A_9, TLaneVector_2 B_6) { TLaneVector_2 R_12; uint SimdIndex_23 = 0U; [unroll] for(;;) { if(SimdIndex_23 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_12, SimdIndex_23, min(TLaneVector_GetElement_2(A_9, SimdIndex_23), TLaneVector_GetElement_2(B_6, SimdIndex_23))); SimdIndex_23 = SimdIndex_23 + 1U; } return R_12; } #else TLaneVector_2 min_1(TLaneVector_2 A, TLaneVector_2 B) { typedef TLaneVector FSampleType; FSampleType lhs = A.fromSlang(); FSampleType rhs = B.fromSlang(); FSampleType tmp = min(lhs, rhs); TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif void TAccumulatorMin_Accumulate_0(inout TAccumulatorData_0 Data_6, int2 Offset_4, TLaneVector_0 Sample_6, TLaneVector_2 InWeight_6) { Data_6.Value_0 = min_0(Data_6.Value_0, Sample_6); return; } void TAccumulatorMin_Accumulate_1(inout TAccumulatorData_1 Data_7, int2 Offset_5, TLaneVector_2 Sample_7, TLaneVector_2 InWeight_7) { Data_7.Value_0 = min_1(Data_7.Value_0, Sample_7); return; } #ifndef N_TLaneVector_OPERATOR_ADD_0 TLaneVector_0 TLaneVector_OPERATOR_ADD_0(TLaneVector_0 this_9, TLaneVector_0 B_7) { TLaneVector_0 R_13; uint SimdIndex_24 = 0U; [unroll] for(;;) { if(SimdIndex_24 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_13, SimdIndex_24, TLaneVector_GetElement_0(this_9, SimdIndex_24) + TLaneVector_GetElement_0(B_7, SimdIndex_24)); SimdIndex_24 = SimdIndex_24 + 1U; } return R_13; } #else TLaneVector_0 TLaneVector_OPERATOR_ADD_0(TLaneVector_0 this_9, TLaneVector_0 B_7) { typedef TLaneVector FSampleType; FSampleType lhs = this_9.fromSlang(); FSampleType rhs = B_7.fromSlang(); FSampleType tmp = lhs + rhs; TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_TLaneVector_OPERATOR_ADD_1 TLaneVector_2 TLaneVector_OPERATOR_ADD_1(TLaneVector_2 this_10, TLaneVector_2 B_8) { TLaneVector_2 R_14; uint SimdIndex_25 = 0U; [unroll] for(;;) { if(SimdIndex_25 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_14, SimdIndex_25, TLaneVector_GetElement_2(this_10, SimdIndex_25) + TLaneVector_GetElement_2(B_8, SimdIndex_25)); SimdIndex_25 = SimdIndex_25 + 1U; } return R_14; } #else TLaneVector_2 TLaneVector_OPERATOR_ADD_1(TLaneVector_2 this_10, TLaneVector_2 B_8) { typedef TLaneVector FSampleType; FSampleType lhs = this_10.fromSlang(); FSampleType rhs = B_8.fromSlang(); FSampleType tmp = lhs + rhs; TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_TLaneVector_OPERATOR_ADD_2 TLaneVector_1 TLaneVector_OPERATOR_ADD_2(TLaneVector_1 this_11, TLaneVector_1 B_9) { TLaneVector_1 R_15; uint SimdIndex_26 = 0U; [unroll] for(;;) { if(SimdIndex_26 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_1(R_15, SimdIndex_26, TLaneVector_GetElement_1(this_11, SimdIndex_26) + TLaneVector_GetElement_1(B_9, SimdIndex_26)); SimdIndex_26 = SimdIndex_26 + 1U; } return R_15; } #else TLaneVector_1 TLaneVector_OPERATOR_ADD_2(TLaneVector_1 this_11, TLaneVector_1 B_9) { typedef TLaneVector FSampleType; FSampleType lhs = this_11.fromSlang(); FSampleType rhs = B_9.fromSlang(); FSampleType tmp = lhs + rhs; TLaneVector_1 Result; Result.toSlang(tmp); return Result; } #endif #ifndef N_x2B_0 TLaneVector_0 x2B_0(TLaneVector_0 lhs_3, TLaneVector_0 rhs_3) { return TLaneVector_OPERATOR_ADD_0(lhs_3, rhs_3); } #else TLaneVector_0 x2B_0(TLaneVector_0 lhs_3, TLaneVector_0 rhs_3) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_3.fromSlang(); FSampleType rhs = rhs_3.fromSlang(); FSampleType tmp = lhs + rhs; TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_x2B_1 TLaneVector_2 x2B_1(TLaneVector_2 lhs_4, TLaneVector_2 rhs_4) { return TLaneVector_OPERATOR_ADD_1(lhs_4, rhs_4); } #else TLaneVector_2 x2B_1(TLaneVector_2 lhs_4, TLaneVector_2 rhs_4) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_4.fromSlang(); FSampleType rhs = rhs_4.fromSlang(); FSampleType tmp = lhs + rhs; TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_x2B_2 TLaneVector_1 x2B_2(TLaneVector_1 lhs_5, TLaneVector_1 rhs_5) { return TLaneVector_OPERATOR_ADD_2(lhs_5, rhs_5); } #else TLaneVector_1 x2B_2(TLaneVector_1 lhs_5, TLaneVector_1 rhs_5) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_5.fromSlang(); FSampleType rhs = rhs_5.fromSlang(); FSampleType tmp = lhs + rhs; TLaneVector_1 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_TLaneVector_OPERATOR_MULTIPLY_3 TLaneVector_0 TLaneVector_OPERATOR_MULTIPLY_3(TLaneVector_0 this_12, float3 B_10) { TLaneVector_0 R_16; uint SimdIndex_27 = 0U; [unroll] for(;;) { if(SimdIndex_27 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_16, SimdIndex_27, TLaneVector_GetElement_0(this_12, SimdIndex_27) * B_10); SimdIndex_27 = SimdIndex_27 + 1U; } return R_16; } #else TLaneVector_0 TLaneVector_OPERATOR_MULTIPLY_3(TLaneVector_0 this_12, float3 B_10) { typedef TLaneVector FSampleType; FSampleType lhs = this_12.fromSlang(); FSampleType tmp = lhs * B_10; TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_TLaneVector_OPERATOR_MULTIPLY_4 TLaneVector_2 TLaneVector_OPERATOR_MULTIPLY_4(TLaneVector_2 this_13, float B_11) { TLaneVector_2 R_17; uint SimdIndex_28 = 0U; [unroll] for(;;) { if(SimdIndex_28 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_17, SimdIndex_28, TLaneVector_GetElement_2(this_13, SimdIndex_28) * B_11); SimdIndex_28 = SimdIndex_28 + 1U; } return R_17; } #else TLaneVector_2 TLaneVector_OPERATOR_MULTIPLY_4(TLaneVector_2 this_13, float B_11) { typedef TLaneVector FSampleType; FSampleType lhs = this_13.fromSlang(); FSampleType tmp = lhs * B_11; TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_x2A_3 TLaneVector_0 x2A_3(TLaneVector_0 lhs_6, float3 rhs_6) { return TLaneVector_OPERATOR_MULTIPLY_3(lhs_6, rhs_6); } #else TLaneVector_0 x2A_3(TLaneVector_0 lhs_6, float3 rhs_6) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_6.fromSlang(); FSampleType tmp = lhs * rhs_6; TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef N_x2A_4 TLaneVector_2 x2A_4(TLaneVector_2 lhs_7, float rhs_7) { return TLaneVector_OPERATOR_MULTIPLY_4(lhs_7, rhs_7); } #else TLaneVector_2 x2A_4(TLaneVector_2 lhs_7, float rhs_7) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_7.fromSlang(); FSampleType tmp = lhs * rhs_7; TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif void TAccumulatorAvg_Accumulate_0(inout TAccumulatorData_2 Data_8, int2 Offset_6, TLaneVector_1 Sample_8, TLaneVector_2 InWeight_8) { float _S20 = rcp(abs(float(Offset_6.x)) + 1.0) * rcp(abs(float(Offset_6.y)) + 1.0); Data_8.Value_0 = x2B_2(Data_8.Value_0, x2A_1(Sample_8, TLaneVector_Vectorize_1(x2A_4(InWeight_8, _S20)))); Data_8.Weight_0 = x2B_1(Data_8.Weight_0, x2A_2(InWeight_8, TLaneVector_Const_1(_S20))); return; } void TAccumulatorAvg_Accumulate_1(inout TAccumulatorData_0 Data_9, int2 Offset_7, TLaneVector_0 Sample_9, TLaneVector_2 InWeight_9) { float _S21 = rcp(abs(float(Offset_7.x)) + 1.0) * rcp(abs(float(Offset_7.y)) + 1.0); Data_9.Value_0 = x2B_0(Data_9.Value_0, x2A_0(Sample_9, TLaneVector_Vectorize_0(x2A_4(InWeight_9, _S21)))); Data_9.Weight_0 = x2B_1(Data_9.Weight_0, x2A_2(InWeight_9, TLaneVector_Const_1(_S21))); return; } void TAccumulatorMax_Start_0(inout TAccumulatorData_0 Data_10, TLaneVector_0 CenterSample_0) { Data_10.Value_0 = CenterSample_0; return; } void TAccumulatorMin_Start_0(inout TAccumulatorData_0 Data_11, TLaneVector_0 CenterSample_1) { Data_11.Value_0 = CenterSample_1; return; } void TAccumulatorMin_Start_1(inout TAccumulatorData_1 Data_12, TLaneVector_2 CenterSample_2) { Data_12.Value_0 = CenterSample_2; return; } void TAccumulatorAvg_Start_0(inout TAccumulatorData_2 Data_13, TLaneVector_1 CenterSample_3) { Data_13.Value_0 = CenterSample_3; Data_13.Weight_0 = TLaneVector_Const_1(1.0); return; } void TAccumulatorAvg_Start_1(inout TAccumulatorData_0 Data_14, TLaneVector_0 CenterSample_4) { Data_14.Value_0 = CenterSample_4; Data_14.Weight_0 = TLaneVector_Const_1(1.0); return; } template FAccumulator Convole3x1(FSampleType Color, TLaneVector Weight, const int2 Offset, uint GroupThreadIndex) { FAccumulator Accumulator; Accumulator.Start(Color); FSampleType PreprocessedNeighborColor = FAccumulator::PreprocessNeighborSample(Color, Weight); FSampleType Sample0 = AccessNeighborTexel(PreprocessedNeighborColor, Offset, GroupThreadIndex); TLaneVector Weight0 = TLaneVector ::Const(float(1.0)); if (FAccumulator::NeedWeightInAccumulate()) { Weight0 = AccessNeighborTexel(Weight, Offset, GroupThreadIndex); } Accumulator.Accumulate(+Offset, Sample0, Weight0); const int2 OffsetN = int2(-int2(Offset)); FSampleType Sample1 = AccessNeighborTexel(PreprocessedNeighborColor, OffsetN, GroupThreadIndex); TLaneVector Weight1 = TLaneVector ::Const(float(1.0)); if (FAccumulator::NeedWeightInAccumulate()) { Weight1 = AccessNeighborTexel(Weight, OffsetN, GroupThreadIndex); } Accumulator.Accumulate(OffsetN, Sample1, Weight1); Accumulator.Finish(3); return Accumulator; } #ifndef M_Convole3x1_0 TLaneVector_1 Convole3x1_0(TLaneVector_1 Color_0, TLaneVector_2 Weight_1, int2 Offset_8, uint GroupThreadIndex_4) { TAccumulatorData_2 AccumulatorData_0; TAccumulatorAvg_Start_0(AccumulatorData_0, Color_0); TLaneVector_1 _S22 = TAccumulatorAvg_PreprocessNeighborSample_0(Color_0, Weight_1); TLaneVector_1 Sample0_0 = AccessNeighborTexel_0(_S22, Offset_8, GroupThreadIndex_4); TLaneVector_2 _S23 = TLaneVector_Const_1(1.0); bool _S24 = TAccumulatorAvg_NeedWeightInAccumulate_0(); TLaneVector_2 Weight0_0; if(_S24) { TLaneVector_2 _S25 = AccessNeighborTexel_1(Weight_1, Offset_8, GroupThreadIndex_4); Weight0_0 = _S25; } else { Weight0_0 = _S23; } TAccumulatorAvg_Accumulate_0(AccumulatorData_0, Offset_8, Sample0_0, Weight0_0); int2 OffsetN_0 = - Offset_8; TLaneVector_1 Sample1_0 = AccessNeighborTexel_0(_S22, OffsetN_0, GroupThreadIndex_4); TLaneVector_2 _S26 = TLaneVector_Const_1(1.0); TLaneVector_2 Weight1_0; if(_S24) { TLaneVector_2 _S27 = AccessNeighborTexel_1(Weight_1, OffsetN_0, GroupThreadIndex_4); Weight1_0 = _S27; } else { Weight1_0 = _S26; } TAccumulatorAvg_Accumulate_0(AccumulatorData_0, OffsetN_0, Sample1_0, Weight1_0); TAccumulatorAvg_Finish_0(AccumulatorData_0, 3U); return AccumulatorData_0.Value_0; } #else TLaneVector_1 Convole3x1_0(TLaneVector_1 Color_0, TLaneVector_2 Weight_1, int2 Offset_8, uint GroupThreadIndex_4) { typedef TLaneVector FSampleType; typedef TAccumulatorAvg FAccumulator; FAccumulator Accumulator = Convole3x1(Color_0.fromSlang(), Weight_1.fromSlang(), Offset_8, GroupThreadIndex_4); TLaneVector_1 Result; Result.toSlang(Accumulator.Value); return Result; } #endif #ifndef M_Convole3x1_1 TLaneVector_0 Convole3x1_1(TLaneVector_0 Color_1, TLaneVector_2 Weight_2, int2 Offset_9, uint GroupThreadIndex_5) { TAccumulatorData_0 AccumulatorData_1; TAccumulatorAvg_Start_1(AccumulatorData_1, Color_1); TLaneVector_0 _S28 = TAccumulatorAvg_PreprocessNeighborSample_1(Color_1, Weight_2); TLaneVector_0 Sample0_1 = AccessNeighborTexel_2(_S28, Offset_9, GroupThreadIndex_5); TLaneVector_2 _S29 = TLaneVector_Const_1(1.0); bool _S30 = TAccumulatorAvg_NeedWeightInAccumulate_1(); TLaneVector_2 Weight0_1; if(_S30) { TLaneVector_2 _S31 = AccessNeighborTexel_1(Weight_2, Offset_9, GroupThreadIndex_5); Weight0_1 = _S31; } else { Weight0_1 = _S29; } TAccumulatorAvg_Accumulate_1(AccumulatorData_1, Offset_9, Sample0_1, Weight0_1); int2 OffsetN_1 = - Offset_9; TLaneVector_0 Sample1_1 = AccessNeighborTexel_2(_S28, OffsetN_1, GroupThreadIndex_5); TLaneVector_2 _S32 = TLaneVector_Const_1(1.0); TLaneVector_2 Weight1_1; if(_S30) { TLaneVector_2 _S33 = AccessNeighborTexel_1(Weight_2, OffsetN_1, GroupThreadIndex_5); Weight1_1 = _S33; } else { Weight1_1 = _S32; } TAccumulatorAvg_Accumulate_1(AccumulatorData_1, OffsetN_1, Sample1_1, Weight1_1); TAccumulatorAvg_Finish_1(AccumulatorData_1, 3U); return AccumulatorData_1.Value_0; } #else TLaneVector_0 Convole3x1_1(TLaneVector_0 Color_1, TLaneVector_2 Weight_2, int2 Offset_9, uint GroupThreadIndex_5) { typedef TLaneVector FSampleType; typedef TAccumulatorAvg FAccumulator; FAccumulator Accumulator = Convole3x1(Color_1.fromSlang(), Weight_2.fromSlang(), Offset_9, GroupThreadIndex_5); TLaneVector_0 Result; Result.toSlang(Accumulator.Value); return Result; } #endif #ifndef M_Convole3x1_2 TLaneVector_0 Convole3x1_2(TLaneVector_0 Color_2, TLaneVector_2 Weight_3, int2 Offset_10, uint GroupThreadIndex_6) { TAccumulatorData_0 AccumulatorData_2; TAccumulatorMin_Start_0(AccumulatorData_2, Color_2); TLaneVector_0 _S34 = TAccumulatorMin_PreprocessNeighborSample_0(Color_2, Weight_3); TLaneVector_0 Sample0_2 = AccessNeighborTexel_2(_S34, Offset_10, GroupThreadIndex_6); TLaneVector_2 _S35 = TLaneVector_Const_1(1.0); bool _S36 = TAccumulatorMin_NeedWeightInAccumulate_0(); TLaneVector_2 Weight0_2; if(_S36) { TLaneVector_2 _S37 = AccessNeighborTexel_1(Weight_3, Offset_10, GroupThreadIndex_6); Weight0_2 = _S37; } else { Weight0_2 = _S35; } TAccumulatorMin_Accumulate_0(AccumulatorData_2, Offset_10, Sample0_2, Weight0_2); int2 OffsetN_2 = - Offset_10; TLaneVector_0 Sample1_2 = AccessNeighborTexel_2(_S34, OffsetN_2, GroupThreadIndex_6); TLaneVector_2 _S38 = TLaneVector_Const_1(1.0); TLaneVector_2 Weight1_2; if(_S36) { TLaneVector_2 _S39 = AccessNeighborTexel_1(Weight_3, OffsetN_2, GroupThreadIndex_6); Weight1_2 = _S39; } else { Weight1_2 = _S38; } TAccumulatorMin_Accumulate_0(AccumulatorData_2, OffsetN_2, Sample1_2, Weight1_2); TAccumulatorMin_Finish_0(AccumulatorData_2, 3U); return AccumulatorData_2.Value_0; } #else TLaneVector_0 Convole3x1_2(TLaneVector_0 Color_2, TLaneVector_2 Weight_3, int2 Offset_10, uint GroupThreadIndex_6) { typedef TLaneVector FSampleType; typedef TAccumulatorMin FAccumulator; FAccumulator Accumulator = Convole3x1(Color_2.fromSlang(), Weight_3.fromSlang(), Offset_10, GroupThreadIndex_6); TLaneVector_0 Result; Result.toSlang(Accumulator.Value); return Result; } #endif #ifndef M_Convole3x1_3 TLaneVector_2 Convole3x1_3(TLaneVector_2 Color_3, TLaneVector_2 Weight_4, int2 Offset_11, uint GroupThreadIndex_7) { TAccumulatorData_1 AccumulatorData_3; TAccumulatorMin_Start_1(AccumulatorData_3, Color_3); TLaneVector_2 _S40 = TAccumulatorMin_PreprocessNeighborSample_1(Color_3, Weight_4); TLaneVector_2 Sample0_3 = AccessNeighborTexel_1(_S40, Offset_11, GroupThreadIndex_7); TLaneVector_2 _S41 = TLaneVector_Const_1(1.0); bool _S42 = TAccumulatorMin_NeedWeightInAccumulate_1(); TLaneVector_2 Weight0_3; if(_S42) { TLaneVector_2 _S43 = AccessNeighborTexel_1(Weight_4, Offset_11, GroupThreadIndex_7); Weight0_3 = _S43; } else { Weight0_3 = _S41; } TAccumulatorMin_Accumulate_1(AccumulatorData_3, Offset_11, Sample0_3, Weight0_3); int2 OffsetN_3 = - Offset_11; TLaneVector_2 Sample1_3 = AccessNeighborTexel_1(_S40, OffsetN_3, GroupThreadIndex_7); TLaneVector_2 _S44 = TLaneVector_Const_1(1.0); TLaneVector_2 Weight1_3; if(_S42) { TLaneVector_2 _S45 = AccessNeighborTexel_1(Weight_4, OffsetN_3, GroupThreadIndex_7); Weight1_3 = _S45; } else { Weight1_3 = _S44; } TAccumulatorMin_Accumulate_1(AccumulatorData_3, OffsetN_3, Sample1_3, Weight1_3); TAccumulatorMin_Finish_1(AccumulatorData_3, 3U); return AccumulatorData_3.Value_0; } #else TLaneVector_2 Convole3x1_3(TLaneVector_2 Color_3, TLaneVector_2 Weight_4, int2 Offset_11, uint GroupThreadIndex_7) { typedef TLaneVector FSampleType; typedef TAccumulatorMin FAccumulator; FAccumulator Accumulator = Convole3x1(Color_3.fromSlang(), Weight_4.fromSlang(), Offset_11, GroupThreadIndex_7); TLaneVector_2 Result; Result.toSlang(Accumulator.Value); return Result; } #endif #ifndef M_Convole3x1_4 TLaneVector_0 Convole3x1_4(TLaneVector_0 Color_4, TLaneVector_2 Weight_5, int2 Offset_12, uint GroupThreadIndex_8) { TAccumulatorData_0 AccumulatorData_4; TAccumulatorMax_Start_0(AccumulatorData_4, Color_4); TLaneVector_0 _S46 = TAccumulatorMax_PreprocessNeighborSample_0(Color_4, Weight_5); TLaneVector_0 Sample0_4 = AccessNeighborTexel_2(_S46, Offset_12, GroupThreadIndex_8); TLaneVector_2 _S47 = TLaneVector_Const_1(1.0); bool _S48 = TAccumulatorMax_NeedWeightInAccumulate_0(); TLaneVector_2 Weight0_4; if(_S48) { TLaneVector_2 _S49 = AccessNeighborTexel_1(Weight_5, Offset_12, GroupThreadIndex_8); Weight0_4 = _S49; } else { Weight0_4 = _S47; } TAccumulatorMax_Accumulate_0(AccumulatorData_4, Offset_12, Sample0_4, Weight0_4); int2 OffsetN_4 = - Offset_12; TLaneVector_0 Sample1_4 = AccessNeighborTexel_2(_S46, OffsetN_4, GroupThreadIndex_8); TLaneVector_2 _S50 = TLaneVector_Const_1(1.0); TLaneVector_2 Weight1_4; if(_S48) { TLaneVector_2 _S51 = AccessNeighborTexel_1(Weight_5, OffsetN_4, GroupThreadIndex_8); Weight1_4 = _S51; } else { Weight1_4 = _S50; } TAccumulatorMax_Accumulate_0(AccumulatorData_4, OffsetN_4, Sample1_4, Weight1_4); TAccumulatorMax_Finish_0(AccumulatorData_4, 3U); return AccumulatorData_4.Value_0; } #else TLaneVector_0 Convole3x1_4(TLaneVector_0 Color, TLaneVector_2 Weight, int2 Offset, uint GroupThreadIndex) { typedef TLaneVector FSampleType; typedef TAccumulatorMax FAccumulator; FAccumulator Accumulator = Convole3x1(Color.fromSlang(), Weight.fromSlang(), Offset, GroupThreadIndex); TLaneVector_0 Result; Result.toSlang(Accumulator.Value); return Result; } #endif template FSampleType Convolve3x3HV(FSampleType Color, TLaneVector Weight, uint GroupThreadIndex) { FSampleType HorizontalColor = Convole3x1(Color, Weight, int2(1, 0), GroupThreadIndex).Value; return Convole3x1(HorizontalColor, Weight, int2(0, 1), GroupThreadIndex).Value; } #ifndef M_Convolve3x3HV_0 TLaneVector_1 Convolve3x3HV_0(TLaneVector_1 Color_5, TLaneVector_2 Weight_6, uint GroupThreadIndex_9) { TLaneVector_1 HorizontalColor_0 = Convole3x1_0(Color_5, Weight_6, int2(int(1), int(0)), GroupThreadIndex_9); TLaneVector_1 _S52 = Convole3x1_0(HorizontalColor_0, Weight_6, int2(int(0), int(1)), GroupThreadIndex_9); return _S52; } #else TLaneVector_1 Convolve3x3HV_0(TLaneVector_1 Color_5, TLaneVector_2 Weight_6, uint GroupThreadIndex_9) { typedef TLaneVector FSampleType; typedef TAccumulatorAvg FAccumulator; FSampleType tmp = Convolve3x3HV(Color_5.fromSlang(), Weight_6.fromSlang(), GroupThreadIndex_9); TLaneVector_1 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_Convolve3x3HV_1 TLaneVector_0 Convolve3x3HV_1(TLaneVector_0 Color_6, TLaneVector_2 Weight_7, uint GroupThreadIndex_10) { TLaneVector_0 HorizontalColor_1 = Convole3x1_1(Color_6, Weight_7, int2(int(1), int(0)), GroupThreadIndex_10); TLaneVector_0 _S53 = Convole3x1_1(HorizontalColor_1, Weight_7, int2(int(0), int(1)), GroupThreadIndex_10); return _S53; } #else TLaneVector_0 Convolve3x3HV_1(TLaneVector_0 Color, TLaneVector_2 Weight, uint GroupThreadIndex) { typedef TLaneVector FSampleType; typedef TAccumulatorAvg FAccumulator; FSampleType tmp = Convolve3x3HV(Color.fromSlang(), Weight.fromSlang(), GroupThreadIndex); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_Convolve3x3HV_2 TLaneVector_0 Convolve3x3HV_2(TLaneVector_0 Color_7, TLaneVector_2 Weight_8, uint GroupThreadIndex_11) { TLaneVector_0 HorizontalColor_2 = Convole3x1_2(Color_7, Weight_8, int2(int(1), int(0)), GroupThreadIndex_11); TLaneVector_0 _S54 = Convole3x1_2(HorizontalColor_2, Weight_8, int2(int(0), int(1)), GroupThreadIndex_11); return _S54; } #else TLaneVector_0 Convolve3x3HV_2(TLaneVector_0 Color, TLaneVector_2 Weight, uint GroupThreadIndex) { typedef TLaneVector FSampleType; typedef TAccumulatorMin FAccumulator; FSampleType tmp = Convolve3x3HV(Color.fromSlang(), Weight.fromSlang(), GroupThreadIndex); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_Convolve3x3HV_3 TLaneVector_2 Convolve3x3HV_3(TLaneVector_2 Color_8, TLaneVector_2 Weight_9, uint GroupThreadIndex_12) { TLaneVector_2 HorizontalColor_3 = Convole3x1_3(Color_8, Weight_9, int2(int(1), int(0)), GroupThreadIndex_12); TLaneVector_2 _S55 = Convole3x1_3(HorizontalColor_3, Weight_9, int2(int(0), int(1)), GroupThreadIndex_12); return _S55; } #else TLaneVector_2 Convolve3x3HV_3(TLaneVector_2 Color, TLaneVector_2 Weight, uint GroupThreadIndex) { typedef TLaneVector FSampleType; typedef TAccumulatorMin FAccumulator; FSampleType tmp = Convolve3x3HV(Color.fromSlang(), Weight.fromSlang(), GroupThreadIndex); TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_Convolve3x3HV_4 TLaneVector_0 Convolve3x3HV_4(TLaneVector_0 Color_9, TLaneVector_2 Weight_10, uint GroupThreadIndex_13) { TLaneVector_0 HorizontalColor_4 = Convole3x1_4(Color_9, Weight_10, int2(int(1), int(0)), GroupThreadIndex_13); TLaneVector_0 _S56 = Convole3x1_4(HorizontalColor_4, Weight_10, int2(int(0), int(1)), GroupThreadIndex_13); return _S56; } #else TLaneVector_0 Convolve3x3HV_4(TLaneVector_0 Color, TLaneVector_2 Weight, uint GroupThreadIndex) { typedef TLaneVector FSampleType; typedef TAccumulatorMax FAccumulator; FSampleType tmp = Convolve3x3HV(Color.fromSlang(), Weight.fromSlang(), GroupThreadIndex); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif template FSampleType Min3x3(FSampleType Center, uint GroupThreadIndex) { return Convolve3x3HV, FSampleType>(Center, TLaneVector ::Const(1.0), GroupThreadIndex); } #ifndef M_Min3x3_0 TLaneVector_0 Min3x3_0(TLaneVector_0 Center_0, uint GroupThreadIndex_14) { TLaneVector_0 _S57 = Convolve3x3HV_2(Center_0, TLaneVector_Const_1(1.0), GroupThreadIndex_14); return _S57; } #else TLaneVector_0 Min3x3_0(TLaneVector_0 Center, uint GroupThreadIndex) { typedef TLaneVector FSampleType; FSampleType tmp = Min3x3(Center.fromSlang(), GroupThreadIndex); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_Min3x3_1 TLaneVector_2 Min3x3_1(TLaneVector_2 Center_1, uint GroupThreadIndex_15) { TLaneVector_2 _S58 = Convolve3x3HV_3(Center_1, TLaneVector_Const_1(1.0), GroupThreadIndex_15); return _S58; } #else TLaneVector_2 Min3x3_1(TLaneVector_2 Center, uint GroupThreadIndex) { typedef TLaneVector FSampleType; FSampleType tmp = Min3x3(Center.fromSlang(), GroupThreadIndex); TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif template FSampleType Max3x3(FSampleType Center, uint GroupThreadIndex) { return Convolve3x3HV, FSampleType>(Center, TLaneVector ::Const(1.0), GroupThreadIndex); } #ifndef M_Max3x3_0 TLaneVector_0 Max3x3_0(TLaneVector_0 Center_2, uint GroupThreadIndex_16) { TLaneVector_0 _S59 = Convolve3x3HV_4(Center_2, TLaneVector_Const_1(1.0), GroupThreadIndex_16); return _S59; } #else TLaneVector_0 Max3x3_0(TLaneVector_0 Center, uint GroupThreadIndex) { typedef TLaneVector FSampleType; FSampleType tmp = Min3x3(Center.fromSlang(), GroupThreadIndex); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif template TLaneVector clamp( TLaneVector A, TLaneVector B, TLaneVector C) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, clamp (A.GetElement(SimdIndex), B.GetElement(SimdIndex), C.GetElement(SimdIndex))); } return R; }; template TLaneVector min3( TLaneVector A, TLaneVector B, TLaneVector C) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, min3 (A.GetElement(SimdIndex), B.GetElement(SimdIndex), C.GetElement(SimdIndex))); } return R; }; template TLaneVector max3( TLaneVector A, TLaneVector B, TLaneVector C) { TLaneVector R; [unroll] for (uint SimdIndex = 0; SimdIndex < SimdSize; SimdIndex++) { R.SetElement(SimdIndex, max3 (A.GetElement(SimdIndex), B.GetElement(SimdIndex), C.GetElement(SimdIndex))); } return R; }; #ifndef N_clamp_0 TLaneVector_0 clamp_0(TLaneVector_0 A_10, TLaneVector_0 B_12, TLaneVector_0 C_0) { TLaneVector_0 R_18; uint SimdIndex_29 = 0U; [unroll] for(;;) { if(SimdIndex_29 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_18, SimdIndex_29, clamp(TLaneVector_GetElement_0(A_10, SimdIndex_29), TLaneVector_GetElement_0(B_12, SimdIndex_29), TLaneVector_GetElement_0(C_0, SimdIndex_29))); SimdIndex_29 = SimdIndex_29 + 1U; } return R_18; } #else TLaneVector_0 clamp_0(TLaneVector_0 A, TLaneVector_0 B, TLaneVector_0 C) { typedef TLaneVector FSampleType; FSampleType tmp = clamp(A.fromSlang(), B.fromSlang(), C.fromSlang()); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif TLaneVector ClampFireFliersWithGuide(TLaneVector ToClamp, TLaneVector Guide, uint GroupThreadIndex) { TLaneVector ToClampMin = Min3x3(ToClamp, GroupThreadIndex); TLaneVector ToClampMax = Max3x3(ToClamp, GroupThreadIndex); TLaneVector ClampedGuide = clamp(Guide, ToClampMin, ToClampMax); TLaneVector ClampedGuideMin = Min3x3(ClampedGuide, GroupThreadIndex); TLaneVector ClampedGuideMax = Max3x3(ClampedGuide, GroupThreadIndex); return clamp(ToClamp, ClampedGuideMin, ClampedGuideMax); } #ifndef M_ClampFireFliersWithGuide_0 TLaneVector_0 ClampFireFliersWithGuide_0(TLaneVector_0 ToClamp_0, TLaneVector_0 Guide_0, uint GroupThreadIndex_17) { TLaneVector_0 ToClampMin_0 = Min3x3_0(ToClamp_0, GroupThreadIndex_17); TLaneVector_0 ToClampMax_0 = Max3x3_0(ToClamp_0, GroupThreadIndex_17); TLaneVector_0 ClampedGuide_0 = clamp_0(Guide_0, ToClampMin_0, ToClampMax_0); TLaneVector_0 ClampedGuideMin_0 = Min3x3_0(ClampedGuide_0, GroupThreadIndex_17); TLaneVector_0 ClampedGuideMax_0 = Max3x3_0(ClampedGuide_0, GroupThreadIndex_17); return clamp_0(ToClamp_0, ClampedGuideMin_0, ClampedGuideMax_0); } #else TLaneVector_0 ClampFireFliersWithGuide_0(TLaneVector_0 ToClamp, TLaneVector_0 Guide, uint GroupThreadIndex) { typedef TLaneVector FSampleType; FSampleType tmp = ClampFireFliersWithGuide(ToClamp.fromSlang(), Guide.fromSlang(), GroupThreadIndex); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif float MeasureBackbufferLDRQuantizationError_0() { return 0.00048828125; } #ifndef M_TLaneVector_OPERATOR_SUBTRACT_0 TLaneVector_0 TLaneVector_OPERATOR_SUBTRACT_0(TLaneVector_0 this_14, TLaneVector_0 B_13) { TLaneVector_0 R_19; uint SimdIndex_30 = 0U; [unroll] for(;;) { if(SimdIndex_30 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_19, SimdIndex_30, TLaneVector_GetElement_0(this_14, SimdIndex_30) - TLaneVector_GetElement_0(B_13, SimdIndex_30)); SimdIndex_30 = SimdIndex_30 + 1U; } return R_19; } #else TLaneVector_0 TLaneVector_OPERATOR_SUBTRACT_0(TLaneVector_0 this_14, TLaneVector_0 B_13) { typedef TLaneVector FSampleType; FSampleType lhs = this_14.fromSlang(); FSampleType rhs = B_13.fromSlang(); FSampleType tmp = lhs - rhs; TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_TLaneVector_OPERATOR_SUBTRACT_1 TLaneVector_2 TLaneVector_OPERATOR_SUBTRACT_1(TLaneVector_2 this_15, TLaneVector_2 B_14) { TLaneVector_2 R_20; uint SimdIndex_31 = 0U; [unroll] for(;;) { if(SimdIndex_31 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_20, SimdIndex_31, TLaneVector_GetElement_2(this_15, SimdIndex_31) - TLaneVector_GetElement_2(B_14, SimdIndex_31)); SimdIndex_31 = SimdIndex_31 + 1U; } return R_20; } #else TLaneVector_2 TLaneVector_OPERATOR_SUBTRACT_1(TLaneVector_2 this_15, TLaneVector_2 B_14) { typedef TLaneVector FSampleType; FSampleType lhs = this_15.fromSlang(); FSampleType rhs = B_14.fromSlang(); FSampleType tmp = lhs - rhs; TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_x2D_0 TLaneVector_0 x2D_0(TLaneVector_0 lhs_8, TLaneVector_0 rhs_8) { return TLaneVector_OPERATOR_SUBTRACT_0(lhs_8, rhs_8); } #else TLaneVector_0 x2D_0(TLaneVector_0 lhs_8, TLaneVector_0 rhs_8) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_8.fromSlang(); FSampleType rhs = rhs_8.fromSlang(); FSampleType tmp = lhs - rhs; TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_x2D_1 TLaneVector_2 x2D_1(TLaneVector_2 lhs_9, TLaneVector_2 rhs_9) { return TLaneVector_OPERATOR_SUBTRACT_1(lhs_9, rhs_9); } #else TLaneVector_2 x2D_1(TLaneVector_2 lhs_9, TLaneVector_2 rhs_9) { typedef TLaneVector FSampleType; FSampleType lhs = lhs_9.fromSlang(); FSampleType rhs = rhs_9.fromSlang(); FSampleType tmp = lhs - rhs; TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_abs_0 TLaneVector_0 abs_0(TLaneVector_0 A_11) { TLaneVector_0 R_21; uint SimdIndex_32 = 0U; [unroll] for(;;) { if(SimdIndex_32 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_21, SimdIndex_32, abs(TLaneVector_GetElement_0(A_11, SimdIndex_32))); SimdIndex_32 = SimdIndex_32 + 1U; } return R_21; } #else TLaneVector_0 abs_0(TLaneVector_0 A_11) { typedef TLaneVector FSampleType; FSampleType tmp = abs(A_11.fromSlang()); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif template void LMHOperator(FSampleType A, FSampleType B, FSampleType C, out FSampleType L, out FSampleType M, out FSampleType H) { FSampleType X = min(B, C); FSampleType Y = max(B, C); L = min(A, X); FSampleType Z = max(A, X); M = min(Z, Y); H = max(Z, Y); } #ifndef M_LMHOperator_0 void LMHOperator_0(TLaneVector_0 A_12, TLaneVector_0 B_15, TLaneVector_0 C_1, out TLaneVector_0 L_0, out TLaneVector_0 M_0, out TLaneVector_0 H_0) { TLaneVector_0 X_0 = min_0(B_15, C_1); TLaneVector_0 Y_0 = max_0(B_15, C_1); L_0 = min_0(A_12, X_0); TLaneVector_0 Z_0 = max_0(A_12, X_0); M_0 = min_0(Z_0, Y_0); H_0 = max_0(Z_0, Y_0); return; } #else void LMHOperator_0(TLaneVector_0 A_12, TLaneVector_0 B_15, TLaneVector_0 C_1, out TLaneVector_0 L_0, out TLaneVector_0 M_0, out TLaneVector_0 H_0) { typedef TLaneVector FSampleType; FSampleType A = A_12.fromSlang(); FSampleType B = B_15.fromSlang(); FSampleType C = C_1.fromSlang(); FSampleType L, M, H; LMHOperator(A, B, C, L, M, H); L_0.toSlang(L); M_0.toSlang(M); H_0.toSlang(H); } #endif #ifndef M_LMHOperator_1 void LMHOperator_1(TLaneVector_2 A_13, TLaneVector_2 B_16, TLaneVector_2 C_2, out TLaneVector_2 L_1, out TLaneVector_2 M_1, out TLaneVector_2 H_1) { TLaneVector_2 X_1 = min_1(B_16, C_2); TLaneVector_2 Y_1 = max_1(B_16, C_2); L_1 = min_1(A_13, X_1); TLaneVector_2 Z_1 = max_1(A_13, X_1); M_1 = min_1(Z_1, Y_1); H_1 = max_1(Z_1, Y_1); return; } #else void LMHOperator_1(TLaneVector_2 A_13, TLaneVector_2 B_16, TLaneVector_2 C_2, out TLaneVector_2 L_1, out TLaneVector_2 M_1, out TLaneVector_2 H_1) { typedef TLaneVector FSampleType; FSampleType A = A_13.fromSlang(); FSampleType B = B_16.fromSlang(); FSampleType C = C_2.fromSlang(); FSampleType L, M, H; LMHOperator(A, B, C, L, M, H); L_1.toSlang(L); M_1.toSlang(M); H_1.toSlang(H); } #endif template FSampleType Median(FSampleType A, FSampleType B, FSampleType C) { FSampleType L, M, H; LMHOperator(A, B, C, L, M, H); return M; } #ifndef M_Median_0 TLaneVector_0 Median_0(TLaneVector_0 A_14, TLaneVector_0 B_17, TLaneVector_0 C_3) { TLaneVector_0 L_2; TLaneVector_0 M_2; TLaneVector_0 H_2; LMHOperator_0(A_14, B_17, C_3, L_2, M_2, H_2); return M_2; } #else TLaneVector_0 Median_0(TLaneVector_0 A_14, TLaneVector_0 B_17, TLaneVector_0 C_3) { typedef TLaneVector FSampleType; FSampleType tmp = Median(A_14.fromSlang(), B_17.fromSlang(), C_3.fromSlang()); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_Median_1 TLaneVector_2 Median_1(TLaneVector_2 A_15, TLaneVector_2 B_18, TLaneVector_2 C_4) { TLaneVector_2 L_3; TLaneVector_2 M_3; TLaneVector_2 H_3; LMHOperator_1(A_15, B_18, C_4, L_3, M_3, H_3); return M_3; } #else TLaneVector_2 Median_1(TLaneVector_2 A_15, TLaneVector_2 B_18, TLaneVector_2 C_4) { typedef TLaneVector FSampleType; FSampleType tmp = Median(A_15.fromSlang(), B_18.fromSlang(), C_4.fromSlang()); TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif template void WriteToLDSForAccessNeighborTexel(TLaneVector Input, uint GroupThreadIndex) { } template FSampleType Median3x3(FSampleType Center, uint GroupThreadIndex) { WriteToLDSForAccessNeighborTexel(Center, GroupThreadIndex); FSampleType C0 = Center; FSampleType C1 = AccessNeighborTexel(Center, int2( 1, 0), GroupThreadIndex); FSampleType C2 = AccessNeighborTexel(Center, int2(-1, 0), GroupThreadIndex); FSampleType M0L0; FSampleType M0M0; FSampleType M0H0; LMHOperator(C0, C1, C2, M0L0, M0M0, M0H0); WriteToLDSForAccessNeighborTexel(M0L0, GroupThreadIndex); FSampleType M0L1 = AccessNeighborTexel(M0L0, int2(0, 1), GroupThreadIndex); FSampleType M0L2 = AccessNeighborTexel(M0L0, int2(0, -1), GroupThreadIndex); WriteToLDSForAccessNeighborTexel(M0M0, GroupThreadIndex); FSampleType M0M1 = AccessNeighborTexel(M0M0, int2(0, 1), GroupThreadIndex); FSampleType M0M2 = AccessNeighborTexel(M0M0, int2(0, -1), GroupThreadIndex); WriteToLDSForAccessNeighborTexel(M0H0, GroupThreadIndex); FSampleType M0H1 = AccessNeighborTexel(M0H0, int2(0, 1), GroupThreadIndex); FSampleType M0H2 = AccessNeighborTexel(M0H0, int2(0, -1), GroupThreadIndex); FSampleType M1[3]; M1[0] = max(max(M0L0, M0L1), M0L2); M1[1] = Median(M0M0, M0M1, M0M2); M1[2] = min(min(M0H0, M0H1), M0H2); return Median(M1[0], M1[1], M1[2]); } #ifndef M_Median3x3_0 TLaneVector_0 Median3x3_0(TLaneVector_0 Center_3, uint GroupThreadIndex_18) { TLaneVector_0 C1_0 = AccessNeighborTexel_2(Center_3, int2(int(1), int(0)), GroupThreadIndex_18); TLaneVector_0 C2_0 = AccessNeighborTexel_2(Center_3, int2(int(-1), int(0)), GroupThreadIndex_18); TLaneVector_0 M0L0_0; TLaneVector_0 M0M0_0; TLaneVector_0 M0H0_0; LMHOperator_0(Center_3, C1_0, C2_0, M0L0_0, M0M0_0, M0H0_0); TLaneVector_0 M0L1_0 = AccessNeighborTexel_2(M0L0_0, int2(int(0), int(1)), GroupThreadIndex_18); TLaneVector_0 M0L2_0 = AccessNeighborTexel_2(M0L0_0, int2(int(0), int(-1)), GroupThreadIndex_18); TLaneVector_0 M0M1_0 = AccessNeighborTexel_2(M0M0_0, int2(int(0), int(1)), GroupThreadIndex_18); TLaneVector_0 M0M2_0 = AccessNeighborTexel_2(M0M0_0, int2(int(0), int(-1)), GroupThreadIndex_18); TLaneVector_0 M0H1_0 = AccessNeighborTexel_2(M0H0_0, int2(int(0), int(1)), GroupThreadIndex_18); TLaneVector_0 M0H2_0 = AccessNeighborTexel_2(M0H0_0, int2(int(0), int(-1)), GroupThreadIndex_18); TLaneVector_0 M1_0[int(3)]; M1_0[int(0)] = max_0(max_0(M0L0_0, M0L1_0), M0L2_0); M1_0[int(1)] = Median_0(M0M0_0, M0M1_0, M0M2_0); M1_0[int(2)] = min_0(min_0(M0H0_0, M0H1_0), M0H2_0); return Median_0(M1_0[int(0)], M1_0[int(1)], M1_0[int(2)]); } #else TLaneVector_0 Median3x3_0(TLaneVector_0 Center_3, uint GroupThreadIndex_18) { typedef TLaneVector FSampleType; FSampleType tmp = Median3x3(Center_3.fromSlang(), GroupThreadIndex_18); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_Median3x3_1 TLaneVector_2 Median3x3_1(TLaneVector_2 Center_4, uint GroupThreadIndex_19) { TLaneVector_2 C1_1 = AccessNeighborTexel_1(Center_4, int2(int(1), int(0)), GroupThreadIndex_19); TLaneVector_2 C2_1 = AccessNeighborTexel_1(Center_4, int2(int(-1), int(0)), GroupThreadIndex_19); TLaneVector_2 M0L0_1; TLaneVector_2 M0M0_1; TLaneVector_2 M0H0_1; LMHOperator_1(Center_4, C1_1, C2_1, M0L0_1, M0M0_1, M0H0_1); TLaneVector_2 M0L1_1 = AccessNeighborTexel_1(M0L0_1, int2(int(0), int(1)), GroupThreadIndex_19); TLaneVector_2 M0L2_1 = AccessNeighborTexel_1(M0L0_1, int2(int(0), int(-1)), GroupThreadIndex_19); TLaneVector_2 M0M1_1 = AccessNeighborTexel_1(M0M0_1, int2(int(0), int(1)), GroupThreadIndex_19); TLaneVector_2 M0M2_1 = AccessNeighborTexel_1(M0M0_1, int2(int(0), int(-1)), GroupThreadIndex_19); TLaneVector_2 M0H1_1 = AccessNeighborTexel_1(M0H0_1, int2(int(0), int(1)), GroupThreadIndex_19); TLaneVector_2 M0H2_1 = AccessNeighborTexel_1(M0H0_1, int2(int(0), int(-1)), GroupThreadIndex_19); TLaneVector_2 M1_1[int(3)]; M1_1[int(0)] = max_1(max_1(M0L0_1, M0L1_1), M0L2_1); M1_1[int(1)] = Median_1(M0M0_1, M0M1_1, M0M2_1); M1_1[int(2)] = min_1(min_1(M0H0_1, M0H1_1), M0H2_1); return Median_1(M1_1[int(0)], M1_1[int(1)], M1_1[int(2)]); } #else TLaneVector_2 Median3x3_1(TLaneVector_2 Center_4, uint GroupThreadIndex_19) { typedef TLaneVector FSampleType; FSampleType tmp = Median3x3(Center_4.fromSlang(), GroupThreadIndex_19); TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_saturate_0 TLaneVector_0 saturate_0(TLaneVector_0 A_16) { TLaneVector_0 R_22; uint SimdIndex_33 = 0U; [unroll] for(;;) { if(SimdIndex_33 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_0(R_22, SimdIndex_33, saturate(TLaneVector_GetElement_0(A_16, SimdIndex_33))); SimdIndex_33 = SimdIndex_33 + 1U; } return R_22; } #else TLaneVector_0 saturate_0(TLaneVector_0 A_16) { typedef TLaneVector FSampleType; FSampleType tmp = saturate(A_16.fromSlang()); TLaneVector_0 Result; Result.toSlang(tmp); return Result; } #endif #ifndef M_saturate_1 TLaneVector_2 saturate_1(TLaneVector_2 A_17) { TLaneVector_2 R_23; uint SimdIndex_34 = 0U; [unroll] for(;;) { if(SimdIndex_34 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_23, SimdIndex_34, saturate(TLaneVector_GetElement_2(A_17, SimdIndex_34))); SimdIndex_34 = SimdIndex_34 + 1U; } return R_23; } #else TLaneVector_2 saturate_1(TLaneVector_2 A_17) { typedef TLaneVector FSampleType; FSampleType tmp = saturate(A_17.fromSlang()); TLaneVector_2 Result; Result.toSlang(tmp); return Result; } #endif TLaneVector_2 TLaneVector_operatorx5Bx5D_get_0(TLaneVector_0 this_16, uint ComponentIndex_0) { TLaneVector_2 R_24; uint SimdIndex_35 = 0U; [unroll] for(;;) { if(SimdIndex_35 < SIMD_SIZE) { } else { break; } TLaneVector_SetElement_2(R_24, SimdIndex_35, TLaneVector_GetElement_0(this_16, SimdIndex_35)[ComponentIndex_0]); SimdIndex_35 = SimdIndex_35 + 1U; } return R_24; } bool x24init_0(bool v_3) { return v_3; } float x24init_1(float v_4) { return v_4; } #ifndef M_or_internal_0 bool or_internal_0(bool a_1, bool b_1) { bool _S60; if(a_1) { _S60 = true; } else { _S60 = b_1; } return _S60; } #else bool or_internal_0(bool a, bool b) { return bool(a || b); } #endif #ifndef M_select_internal_1 float select_internal_1(bool c_1, float a_2, float b_2) { float _S61; if(c_1) { _S61 = a_2; } else { _S61 = b_2; } return _S61; } #else float select_internal_1(bool c_1, float a_2, float b_2) { return select_internal(c_1, a_2, b_2); } #endif bool and_internal(bool a, bool b) { return bool(a && b); } bool2 and_internal(bool2 a, bool2 b) { return bool2(a.x && b.x, a.y && b.y); } bool3 and_internal(bool3 a, bool3 b) { return bool3(a.x && b.x, a.y && b.y, a.z && b.z); } bool4 and_internal(bool4 a, bool4 b) { return bool4(a.x && b.x, a.y && b.y, a.z && b.z, a.w && b.w); } #ifndef N_and_internal_0 vector and_internal_0(vector a_3, vector b_3) { bool _S62; if(a_3.x) { _S62 = b_3.x; } else { _S62 = false; } bool _S63; if(a_3.y) { _S63 = b_3.y; } else { _S63 = false; } return vector(_S62, _S63); } #else vector and_internal_0(vector a_3, vector b_3) { return and_internal(a_3, b_3); } #endif int2 InvalidateOutputPixelPos_0(int2 PixelPos_0, uint2 ViewportMax_0) { int2 _S64 = PixelPos_0; int2 Subtract_0 = int2(ViewportMax_0 - 1U) - PixelPos_0; _S64[int(0)] = PixelPos_0.x | - int((uint(Subtract_0.x | Subtract_0.y) & 2147483648U) >> int(31)); return _S64; } #ifndef M_select_internal_2 int select_internal_2(bool c_2, int a_4, int b_4) { int _S65; if(c_2) { _S65 = a_4; } else { _S65 = b_4; } return _S65; } #else int select_internal_2(bool c_2, int a_4, int b_4) { return select_internal(c_2, a_4, b_4); } #endif uint3 Rand3DPCG16_0(int3 p_0) { uint3 _S66 = uint3(p_0) * 1664525U + 1013904223U; uint3 v_5 = _S66; v_5[int(0)] = _S66.x + _S66.y * _S66.z; v_5[int(1)] = v_5.y + v_5.z * v_5.x; v_5[int(2)] = v_5.z + v_5.x * v_5.y; v_5[int(0)] = v_5.x + v_5.y * v_5.z; v_5[int(1)] = v_5.y + v_5.z * v_5.x; v_5[int(2)] = v_5.z + v_5.x * v_5.y; return v_5 >> 16U; } float2 Hammersley16_0(uint Index_0, uint NumSamples_0, uint2 Random_0) { return float2(frac(float(Index_0) / float(NumSamples_0) + float(Random_0.x) * 0.0000152587890625), float(reversebits(Index_0) >> int(16) ^ Random_0.y) * 0.0000152587890625); } float2 dpv_interleave_registers( float lo, float hi) { return float2(lo, hi); } float dpv_lo( float2 x) { return x[0]; } float dpv_hi( float2 x) { return x[1]; } float dpv_access_pixel( float2 x, const uint DualPixelId) { return x[DualPixelId]; } uint2 dpv_interleave_registers( uint lo, uint hi) { return uint2(lo, hi); } uint dpv_lo( uint2 x) { return x[0]; } uint dpv_hi( uint2 x) { return x[1]; } uint dpv_access_pixel( uint2 x, const uint DualPixelId) { return x[DualPixelId]; } int2 dpv_interleave_registers( int lo, int hi) { return int2(lo, hi); } int dpv_lo( int2 x) { return x[0]; } int dpv_hi( int2 x) { return x[1]; } int dpv_access_pixel( int2 x, const uint DualPixelId) { return x[DualPixelId]; } float2x2 dpv_interleave_registers( float2 lo, float2 hi) { return transpose( float2x2 (lo, hi)); } float2 dpv_lo( float2x2 x) { return transpose(x)[0]; } float2 dpv_hi( float2x2 x) { return transpose(x)[1]; } float2 dpv_access_pixel( float2x2 x, const uint DualPixelId) { return transpose(x)[DualPixelId]; } float3x2 dpv_interleave_registers( float3 lo, float3 hi) { return transpose( float2x3 (lo, hi)); } float3 dpv_lo( float3x2 x) { return transpose(x)[0]; } float3 dpv_hi( float3x2 x) { return transpose(x)[1]; } float3 dpv_access_pixel( float3x2 x, const uint DualPixelId) { return transpose(x)[DualPixelId]; } float4x2 dpv_interleave_registers( float4 lo, float4 hi) { return transpose( float2x4 (lo, hi)); } float4 dpv_lo( float4x2 x) { return transpose(x)[0]; } float4 dpv_hi( float4x2 x) { return transpose(x)[1]; } float4 dpv_access_pixel( float4x2 x, const uint DualPixelId) { return transpose(x)[DualPixelId]; } uint2x2 dpv_interleave_registers( uint2 lo, uint2 hi) { return transpose( uint2x2 (lo, hi)); } uint2 dpv_lo( uint2x2 x) { return transpose(x)[0]; } uint2 dpv_hi( uint2x2 x) { return transpose(x)[1]; } uint2 dpv_access_pixel( uint2x2 x, const uint DualPixelId) { return transpose(x)[DualPixelId]; } int2x2 dpv_interleave_registers( int2 lo, int2 hi) { return transpose( int2x2 (lo, hi)); } int2 dpv_lo( int2x2 x) { return transpose(x)[0]; } int2 dpv_hi( int2x2 x) { return transpose(x)[1]; } int2 dpv_access_pixel( int2x2 x, const uint DualPixelId) { return transpose(x)[DualPixelId]; } uint3x2 dpv_interleave_registers( uint3 lo, uint3 hi) { return transpose( uint2x3 (lo, hi)); } uint3 dpv_lo( uint3x2 x) { return transpose(x)[0]; } uint3 dpv_hi( uint3x2 x) { return transpose(x)[1]; } uint3 dpv_access_pixel( uint3x2 x, const uint DualPixelId) { return transpose(x)[DualPixelId]; } int3x2 dpv_interleave_registers( int3 lo, int3 hi) { return transpose( int2x3 (lo, hi)); } int3 dpv_lo( int3x2 x) { return transpose(x)[0]; } int3 dpv_hi( int3x2 x) { return transpose(x)[1]; } int3 dpv_access_pixel( int3x2 x, const uint DualPixelId) { return transpose(x)[DualPixelId]; } uint4x2 dpv_interleave_registers( uint4 lo, uint4 hi) { return transpose( uint2x4 (lo, hi)); } uint4 dpv_lo( uint4x2 x) { return transpose(x)[0]; } uint4 dpv_hi( uint4x2 x) { return transpose(x)[1]; } uint4 dpv_access_pixel( uint4x2 x, const uint DualPixelId) { return transpose(x)[DualPixelId]; } int4x2 dpv_interleave_registers( int4 lo, int4 hi) { return transpose( int2x4 (lo, hi)); } int4 dpv_lo( int4x2 x) { return transpose(x)[0]; } int4 dpv_hi( int4x2 x) { return transpose(x)[1]; } int4 dpv_access_pixel( int4x2 x, const uint DualPixelId) { return transpose(x)[DualPixelId]; } #ifndef M_dpv_interleave_registers_0 matrix dpv_interleave_registers_0(float3 lo_0, float3 hi_0) { return transpose(matrix (lo_0, hi_0)); } #else matrix dpv_interleave_registers_0(float3 lo_0, float3 hi_0) { return dpv_interleave_registers(lo_0, hi_0); } #endif float2 dpv_interleave_mono_registers( float lo) { return dpv_interleave_registers(lo, lo); } uint2 dpv_interleave_mono_registers( uint lo) { return dpv_interleave_registers(lo, lo); } int2 dpv_interleave_mono_registers( int lo) { return dpv_interleave_registers(lo, lo); } float2x2 dpv_interleave_mono_registers( float2 lo) { return dpv_interleave_registers(lo, lo); } float3x2 dpv_interleave_mono_registers( float3 lo) { return dpv_interleave_registers(lo, lo); } float4x2 dpv_interleave_mono_registers( float4 lo) { return dpv_interleave_registers(lo, lo); } uint2x2 dpv_interleave_mono_registers( uint2 lo) { return dpv_interleave_registers(lo, lo); } int2x2 dpv_interleave_mono_registers( int2 lo) { return dpv_interleave_registers(lo, lo); } uint3x2 dpv_interleave_mono_registers( uint3 lo) { return dpv_interleave_registers(lo, lo); } int3x2 dpv_interleave_mono_registers( int3 lo) { return dpv_interleave_registers(lo, lo); } uint4x2 dpv_interleave_mono_registers( uint4 lo) { return dpv_interleave_registers(lo, lo); } int4x2 dpv_interleave_mono_registers( int4 lo) { return dpv_interleave_registers(lo, lo); } #ifndef M_dpv_interleave_mono_registers_0 matrix dpv_interleave_mono_registers_0(float3 lo_1) { return dpv_interleave_registers_0(lo_1, lo_1); } #else matrix dpv_interleave_mono_registers_0(float3 lo_1) { return dpv_interleave_mono_registers(lo_1); } #endif float3x2 QuantizeForUNormRenderTarget(float3x2 Color, float E, const float3 QuantizationError) { return Color + dpv_interleave_mono_registers(float3(QuantizationError)) * (E - float(0.5)); } #ifndef M_QuantizeForUNormRenderTarget_0 matrix QuantizeForUNormRenderTarget_0(matrix Color_10, float E_0, float3 QuantizationError_0) { return Color_10 + dpv_interleave_mono_registers_0(QuantizationError_0) * (E_0 - 0.5); } #else matrix QuantizeForUNormRenderTarget_0(matrix Color_10, float E_0, float3 QuantizationError_0) { return QuantizeForUNormRenderTarget(Color_10, E_0, QuantizationError_0); } #endif float3 dpv_lo_0(matrix x_1) { return transpose(x_1)[int(0)]; } float3 QuantizeForUNormRenderTarget(float3 Color, float E, const float3 QuantizationError) { return dpv_lo(QuantizeForUNormRenderTarget(dpv_interleave_mono_registers(Color), E, QuantizationError)); } #ifndef M_QuantizeForUNormRenderTarget_1 float3 QuantizeForUNormRenderTarget_1(float3 Color_11, float E_1, float3 QuantizationError_1) { return dpv_lo_0(QuantizeForUNormRenderTarget_0(dpv_interleave_mono_registers_0(Color_11), E_1, QuantizationError_1)); } #else float3 QuantizeForUNormRenderTarget_1(float3 Color_11, float E_1, float3 QuantizationError_1) { return QuantizeForUNormRenderTarget(Color_11, E_1, QuantizationError_1); } #endif [shader("compute")][WaveSize(LANE_COUNT)] [numthreads(LANE_COUNT, 1, 1)] void MainCS(uint2 GroupId_0 : SV_GroupID, uint GroupThreadIndex_20 : SV_GroupIndex) { int2 _S67 = InputPixelPosMin + int2(GroupId_0) * int2(int(12), int(12)) + (int2)int(-2); TLaneVector_0 OriginalOpaqueInput_0; TLaneVector_1 OriginalTranslucencyInput_0; TLaneVector_0 OriginalHistory_0; TLaneVector_2 bIsValid_0; uint SimdIndex_36 = 0U; [unroll] for(;;) { int2 ClampedFetchPixelPos_0 = _S67 + GetLaneSimdPixelOffset_0(GroupThreadIndex_20, SimdIndex_36); int2 ClampedFetchPixelPos_1 = ClampPixelOffset_0(ClampedFetchPixelPos_0, InputPixelPosMin, InputPixelPosMax); float2 TranslucencyTextureUV_0 = clamp(ApplyScreenTransform_0(float2(ClampedFetchPixelPos_0), InputPixelPosToTranslucencyTextureUV), TranslucencyTextureUVMin, TranslucencyTextureUVMax); TLaneVector_SetElement_0(OriginalOpaqueInput_0, SimdIndex_36, InputTexture[uint2(ClampedFetchPixelPos_1)]); TLaneVector_SetElement_1(OriginalTranslucencyInput_0, SimdIndex_36, InputSceneTranslucencyTexture.SampleLevel(D3DStaticBilinearClampedSampler, TranslucencyTextureUV_0, 0.0)); TLaneVector_SetElement_0(OriginalHistory_0, SimdIndex_36, ReprojectedHistoryGuideTexture[uint2(ClampedFetchPixelPos_1)]); float _S68; if(ParallaxRejectionMaskTexture[uint2(ClampedFetchPixelPos_1)] > 0.5) { _S68 = 1.0; } else { _S68 = 0.0; } TLaneVector_SetElement_2(bIsValid_0, SimdIndex_36, _S68); uint SimdIndex_37 = SimdIndex_36 + 1U; if(int(SimdIndex_37) < int(SIMD_SIZE)) { } else { break; } SimdIndex_36 = SimdIndex_37; } TLaneVector_2 CenterLumaLDR_0; SimdIndex_36 = 0U; [unroll] for(;;) { float3 _S69 = TLaneVector_GetElement_0(OriginalOpaqueInput_0, SimdIndex_36).xyz; float3 Color_12 = _S69; float4 Translucency_0 = TLaneVector_GetElement_1(OriginalTranslucencyInput_0, SimdIndex_36); Color_12.xyz = _S69.xyz * Translucency_0.w + Translucency_0.xyz; float CenterLuma_0 = dot(Color_12, float3(0.29899999499320984, 0.58700001239776611, 0.11400000005960464)); TLaneVector_SetElement_2(CenterLumaLDR_0, SimdIndex_36, CenterLuma_0 / (0.5 + CenterLuma_0)); uint SimdIndex_38 = SimdIndex_36 + 1U; if(int(SimdIndex_38) < int(SIMD_SIZE)) { } else { break; } SimdIndex_36 = SimdIndex_38; } TLaneVector_0 OriginalInput_0 = OriginalOpaqueInput_0; TLaneVector_1 _S70 = Convolve3x3HV_0(OriginalTranslucencyInput_0, bIsValid_0, GroupThreadIndex_20); SimdIndex_36 = 0U; [unroll] for(;;) { float3 _S71 = TLaneVector_GetElement_0(OriginalOpaqueInput_0, SimdIndex_36); float3 Color_13 = _S71; float4 Translucency_1 = TLaneVector_GetElement_1(_S70, SimdIndex_36); Color_13.xyz = _S71.xyz * Translucency_1.w + Translucency_1.xyz; TLaneVector_SetElement_0(OriginalInput_0, SimdIndex_36, Color_13); uint SimdIndex_39 = SimdIndex_36 + 1U; if(int(SimdIndex_39) < int(SIMD_SIZE)) { } else { break; } SimdIndex_36 = SimdIndex_39; } TLaneVector_0 _S72 = min_0(OriginalInput_0, TLaneVector_Const_0((float3)16376.0)); OriginalOpaqueInput_0 = x2A_0(OriginalOpaqueInput_0, rcp_0(x2B_0(OriginalOpaqueInput_0, TLaneVector_Const_0((float3)1.0)))); TLaneVector_0 _S73 = x2A_0(_S72, rcp_0(x2B_0(_S72, TLaneVector_Const_0((float3)1.0)))); OriginalInput_0 = _S73; TLaneVector_0 ClampedInput_0 = ClampFireFliersWithGuide_0(_S73, OriginalHistory_0, GroupThreadIndex_20); TLaneVector_0 ClampedHistory_0 = ClampFireFliersWithGuide_0(OriginalHistory_0, _S73, GroupThreadIndex_20); TLaneVector_0 FilteredInput_0 = Convolve3x3HV_1(ClampedInput_0, bIsValid_0, GroupThreadIndex_20); TLaneVector_0 FilteredHistory_0 = Convolve3x3HV_1(ClampedHistory_0, bIsValid_0, GroupThreadIndex_20); float FilteringWeight_0 = rcp(4.0); TLaneVector_0 BackbufferError_0 = TLaneVector_Const_0((float3)MeasureBackbufferLDRQuantizationError_0()); TLaneVector_0 _S74 = Min3x3_0(FilteredInput_0, GroupThreadIndex_20); TLaneVector_0 FilteredBoxMin_0 = x2D_0(_S74, BackbufferError_0); TLaneVector_0 _S75 = Max3x3_0(FilteredInput_0, GroupThreadIndex_20); TLaneVector_0 FlickeringClampedFilteredHistory_0 = clamp_0(FilteredHistory_0, FilteredBoxMin_0, x2B_0(_S75, BackbufferError_0)); TLaneVector_0 OriginalBoxMin_0 = Min3x3_0(_S73, GroupThreadIndex_20); TLaneVector_0 OriginalBoxMax_0 = Max3x3_0(_S73, GroupThreadIndex_20); TLaneVector_0 BoxSize_0 = x2A_3(x2B_0(x2D_0(OriginalBoxMax_0, OriginalBoxMin_0), x2B_0(BackbufferError_0, BackbufferError_0)), (float3)FilteringWeight_0); TLaneVector_0 BackbufferQuantizationErrorVector_0 = TLaneVector_Const_0((float3)MeasureBackbufferLDRQuantizationError_0()); TLaneVector_0 RawClampedEnergy_0 = abs_0(x2D_0(FlickeringClampedFilteredHistory_0, FilteredHistory_0)); TLaneVector_0 FilteredClampedEnergy_0 = Median3x3_0(RawClampedEnergy_0, GroupThreadIndex_20); TLaneVector_0 FilteredClampedEnergy_1 = Max3x3_0(FilteredClampedEnergy_0, GroupThreadIndex_20); TLaneVector_0 Delta_0 = abs_0(x2D_0(FilteredInput_0, FilteredHistory_0)); TLaneVector_0 ClampError_0 = max_0(x2A_0(BoxSize_0, TLaneVector_Const_0((float3)0.25)), BackbufferQuantizationErrorVector_0); TLaneVector_0 RawFactor_0 = saturate_0(x2D_0(TLaneVector_Const_0((float3)1.0), x2A_0(max_0(x2D_0(RawClampedEnergy_0, ClampError_0), TLaneVector_Const_0((float3)0.0)), rcp_0(max_0(Delta_0, BoxSize_0))))); TLaneVector_0 FilteredFactor_0 = saturate_0(x2D_0(TLaneVector_Const_0((float3)1.0), x2A_0(max_0(x2D_0(FilteredClampedEnergy_1, ClampError_0), TLaneVector_Const_0((float3)0.0)), rcp_0(max_0(Delta_0, BoxSize_0))))); TLaneVector_2 _S76 = saturate_1(x2D_1(x2B_1(min_1(TLaneVector_operatorx5Bx5D_get_0(FilteredFactor_0, 0U), min_1(TLaneVector_operatorx5Bx5D_get_0(FilteredFactor_0, 1U), TLaneVector_operatorx5Bx5D_get_0(FilteredFactor_0, 2U))), TLaneVector_Const_1(1.0)), bIsValid_0)); TLaneVector_2 RejectionClampBlend_0 = Median3x3_1(min_1(TLaneVector_operatorx5Bx5D_get_0(RawFactor_0, 0U), min_1(TLaneVector_operatorx5Bx5D_get_0(RawFactor_0, 1U), TLaneVector_operatorx5Bx5D_get_0(RawFactor_0, 2U))), GroupThreadIndex_20); TLaneVector_2 _S77 = Min3x3_1(saturate_1(x2D_1(x2B_1(RejectionClampBlend_0, TLaneVector_Const_1(1.0)), bIsValid_0)), GroupThreadIndex_20); TLaneVector_2 BlendFinal_0; SimdIndex_36 = 0U; [unroll] for(;;) { float LocalRejectionBlendFinal_0 = x24init_1(TLaneVector_GetElement_2(_S76, SimdIndex_36)); TLaneVector_SetElement_2(BlendFinal_0, SimdIndex_36, max(max(TheoricBlendFactor, 1.0 - LocalRejectionBlendFinal_0), select_internal_1(or_internal_0(false, x24init_0(TLaneVector_GetElement_2(bIsValid_0, SimdIndex_36) == 0.0)), 1.0, saturate(1.0 - LocalRejectionBlendFinal_0 * 4.0)))); uint SimdIndex_40 = SimdIndex_36 + 1U; if(int(SimdIndex_40) < int(SIMD_SIZE)) { } else { break; } SimdIndex_36 = SimdIndex_40; } TLaneVector_0 _S78 = x2D_0(x2A_0(OriginalInput_0, TLaneVector_Vectorize_0(BlendFinal_0)), x2A_0(OriginalHistory_0, TLaneVector_Vectorize_0(x2D_1(BlendFinal_0, TLaneVector_Const_1(1.0))))); SimdIndex_36 = 0U; [unroll] for(;;) { int2 LaneSimdPixelOffset_0 = GetLaneSimdPixelOffset_0(GroupThreadIndex_20, SimdIndex_36); bool bIsNonOverscanPixel_0 = all(and_internal_0(LaneSimdPixelOffset_0 >= int(2), LaneSimdPixelOffset_0 < int(14))); int2 _S79 = InvalidateOutputPixelPos_0(_S67 + LaneSimdPixelOffset_0, InputInfo_ViewportMax); int2 OutputPixelPos_0 = _S79; OutputPixelPos_0[int(0)] = select_internal_2(bIsNonOverscanPixel_0, _S79.x, int(-1)); float LocalRejectionBlendFinal_1 = x24init_1(TLaneVector_GetElement_2(_S76, SimdIndex_36)); float LocalRejectionClampBlend_0 = x24init_1(TLaneVector_GetElement_2(_S77, SimdIndex_36)); float3 _S80 = TLaneVector_GetElement_0(_S78, SimdIndex_36); float3 FinalGuideColor_0 = _S80; float LocalRejectionBlendFinal_2 = LocalRejectionBlendFinal_1 - 0.5 * rcp(256.0); float LocalRejectionClampBlend_1 = LocalRejectionClampBlend_0 - 0.5 * rcp(256.0); FinalGuideColor_0.xyz = QuantizeForUNormRenderTarget_1(_S80.xyz, Hammersley16_0(0U, 1U, Rand3DPCG16_0(int3(LaneSimdPixelOffset_0, int(UniformBufferConstants_View.View_StateFrameIndexMod8))).xy).x, HistoryGuideQuantizationError); HistoryGuideOutput[uint2(OutputPixelPos_0)] = FinalGuideColor_0; HistoryRejectionOutput[uint2(OutputPixelPos_0)] = float2(LocalRejectionBlendFinal_2, LocalRejectionClampBlend_1); InputSceneColorLdrLumaOutput[uint2(OutputPixelPos_0)] = x24init_1(TLaneVector_GetElement_2(CenterLumaLDR_0, SimdIndex_36)); uint SimdIndex_41 = SimdIndex_36 + 1U; if(int(SimdIndex_41) < int(SIMD_SIZE)) { } else { break; } SimdIndex_36 = SimdIndex_41; } return; }