diff --git a/amd_lib/shared/common/inc/AMD_Types.h b/amd_lib/shared/common/inc/AMD_Types.h index 18643a9..3bb5b42 100644 --- a/amd_lib/shared/common/inc/AMD_Types.h +++ b/amd_lib/shared/common/inc/AMD_Types.h @@ -156,11 +156,7 @@ namespace AMD #define AMD_SAFE_DELETE_ARRAY(p) { delete [] (p); (p) = nullptr; } #endif #ifndef AMD_SAFE_RELEASE -#ifndef VULKAN #define AMD_SAFE_RELEASE(p) { if (p) { (p)->Release(); } (p) = nullptr; } -#else -#define AMD_SAFE_RELEASE(object, releaseFunction, device) if (object != nullptr) releaseFunction(device, object, nullptr); -#endif #endif #define AMD_FUNCTION_WIDEN2(x) L ## x diff --git a/amd_tressfx/inc/AMD_TressFX.h b/amd_tressfx/inc/AMD_TressFX.h index 3de38ff..dd194c2 100644 --- a/amd_tressfx/inc/AMD_TressFX.h +++ b/amd_tressfx/inc/AMD_TressFX.h @@ -24,8 +24,12 @@ #define AMD_TRESSFX_H #include -#ifdef VULKAN +#if AMD_TRESSFX_VULKAN #include +#elif AMD_TRESSFX_DIRECT3D11 +#include +#else +#error #endif #include @@ -184,18 +188,17 @@ struct TressFX_HairBlob struct TressFX_SceneMesh { -#ifndef VULKAN +#if AMD_TRESSFX_VULKAN + VkBufferView pMeshVertices; // untransformed vertices + VkBufferView pTransformedVerts; // untransformed vertices +#elif AMD_TRESSFX_DIRECT3D11 ID3D11ShaderResourceView* pMeshVertices; // untransformed vertices + ID3D11ShaderResourceView* pTransformedVerts; // transformed vertices #else - VkBufferView pMeshVertices; // untransformed vertices +#error #endif unsigned numMeshes; // number of meshes unsigned* meshOffsets; // offset to the start of each mesh -#ifndef VULKAN - ID3D11ShaderResourceView* pTransformedVerts; // transformed vertices -#else - VkBufferView pTransformedVerts; // untransformed vertices -#endif }; struct TressFX_HairTransform @@ -252,52 +255,42 @@ struct TressFX_Desc // Buffer of transformations (one transform per strand) for hair skinning // This UAV is used as a structured buffer where each element is a TressFX_HairTransform. // The number of elements in the buffer is numTotalHairStrands. -#ifndef VULKAN - ID3D11UnorderedAccessView* pSkinningTransformationsUAV; -#else +#if AMD_TRESSFX_VULKAN VkBufferView pSkinningTransformationsUAV; -#endif - // hair shadow map -#ifndef VULKAN - ID3D11ShaderResourceView* pHairShadowMapSRV; -#else VkImageView pHairShadowMapSRV; -#endif - -#ifndef VULKAN + VkDevice pvkDevice; + VkPhysicalDeviceMemoryProperties memoryProperties; + VkImageView pvkDepthSRV; + uint32_t maxConstantBuffers; + VkFormat depthStencilFormat; + VkFormat colorFormat; +#elif AMD_TRESSFX_DIRECT3D11 + ID3D11UnorderedAccessView* pSkinningTransformationsUAV; + // hair shadow map + ID3D11ShaderResourceView* pHairShadowMapSRV; ID3D11Device* pd3dDevice; ID3D11DeviceContext* pd3dDeviceContext; ID3D11ShaderResourceView* pd3dDepthSRV; ID3D11RenderTargetView* pd3dOutputRTV; #else - VkDevice pvkDevice; - uint32_t memoryIndexDeviceLocal; - uint32_t memoryIndexHostVisible; - VkImageView pvkDepthSRV; - uint32_t maxConstantBuffers; - VkFormat depthStencilFormat; - VkFormat colorFormat; -#endif // !VULKAN +#error +#endif }; extern "C" { AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_GetVersion(uint* major, uint* minor, uint* patch); -#ifdef VULKAN + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_LoadRawAsset(TressFX_Desc & desc, const TressFX_GuideFollowParams& guideFollowParams, TressFX_HairBlob *pRawHairBlob); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_End(TressFX_Desc & desc); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_GenerateTransforms(TressFX_Desc & desc, TressFX_SceneMesh &sceneMesh); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_ApplyRigidTransforms(TressFX_Desc & desc); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Release(TressFX_Desc & desc); +#if AMD_TRESSFX_VULKAN AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Initialize( TressFX_Desc &desc, VkImageView depthTexture, VkImageView colorTexture, VkCommandBuffer commandBuffer, VkDeviceMemory scratchMemory, VkBuffer scratchBuffer, size_t &offsetInScratchBuffer); -#else - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Initialize(TressFX_Desc &desc); -#endif - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_LoadRawAsset(TressFX_Desc & desc, const TressFX_GuideFollowParams& guideFollowParams, TressFX_HairBlob *pRawHairBlob); -#ifndef VULKAN - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_LoadProcessedAsset(TressFX_Desc & desc, TressFX_HairBlob *pHairBlob, TressFX_SceneMesh *sceneMesh, ID3D11ShaderResourceView *pTextureSRV); - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_CreateProcessedAsset(TressFX_Desc & desc, TressFX_HairBlob **ppHairBlob, TressFX_SceneMesh *sceneMesh, ID3D11ShaderResourceView *pTextureSRV); - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Begin(TressFX_Desc & desc); -#else AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_LoadProcessedAsset( TressFX_Desc &desc, TressFX_HairBlob *pHairBlob, TressFX_SceneMesh *sceneMesh, VkImageView pTextureSRV, @@ -309,24 +302,24 @@ extern "C" VkCommandBuffer uploadCmdBuffer, VkBuffer scratchBuffer, VkDeviceMemory scratchMemory); AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Begin(TressFX_Desc & desc, uint32_t uniformBufferIndex); -#endif - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_End(TressFX_Desc & desc); - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_GenerateTransforms(TressFX_Desc & desc, TressFX_SceneMesh &sceneMesh); - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_ApplyRigidTransforms(TressFX_Desc & desc); -#ifndef VULKAN - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Simulate(TressFX_Desc & desc, float elapsedTime); - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_RenderShadowMap(TressFX_Desc & desc); - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Render(TressFX_Desc & desc); - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Resize(TressFX_Desc &desc); -#else AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Simulate(TressFX_Desc & desc, VkCommandBuffer commandBuffer, float elapsedTime, uint32_t uniformBufferIndex); AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_RenderShadowMap(TressFX_Desc & desc, VkCommandBuffer commandBuffer, uint32_t uniformBufferIndex); AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Render(TressFX_Desc &desc, VkCommandBuffer commandBuffer, uint32_t uniformBufferIndex); AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE - TressFX_Resize(TressFX_Desc &desc, uint32_t texture_memory_index); + TressFX_Resize(TressFX_Desc &desc, VkPhysicalDeviceMemoryProperties memProperties); +#elif AMD_TRESSFX_DIRECT3D11 + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Initialize(TressFX_Desc &desc); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_LoadProcessedAsset(TressFX_Desc & desc, TressFX_HairBlob *pHairBlob, TressFX_SceneMesh *sceneMesh, ID3D11ShaderResourceView *pTextureSRV); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_CreateProcessedAsset(TressFX_Desc & desc, TressFX_HairBlob **ppHairBlob, TressFX_SceneMesh *sceneMesh, ID3D11ShaderResourceView *pTextureSRV); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Begin(TressFX_Desc & desc); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Render(TressFX_Desc & desc); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Resize(TressFX_Desc &desc); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_RenderShadowMap(TressFX_Desc & desc); + AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Simulate(TressFX_Desc & desc, float elapsedTime); +#else +#error #endif - AMD_TRESSFX_DLL_API TRESSFX_RETURN_CODE TressFX_Release(TressFX_Desc & desc); } } // namespace AMD diff --git a/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2012.vcxproj b/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2012.vcxproj index 4e7fe13..a8a1c69 100644 --- a/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2012.vcxproj +++ b/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2012.vcxproj @@ -224,7 +224,7 @@ NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) EditAndContinue Disabled @@ -252,7 +252,7 @@ xcopy "..\lib\VS2012\Win32\DLL_Debug\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) ProgramDatabase Disabled @@ -280,7 +280,7 @@ xcopy "..\lib\VS2012\x64\DLL_Debug\$(TargetName).lib" "..\lib" /H /R /Y > nu NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -313,7 +313,7 @@ xcopy "..\lib\VS2012\Win32\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -346,7 +346,7 @@ xcopy "..\lib\VS2012\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) EditAndContinue Disabled @@ -367,7 +367,7 @@ xcopy "..\lib\VS2012\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) ProgramDatabase Disabled @@ -388,7 +388,7 @@ xcopy "..\lib\VS2012\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -414,7 +414,7 @@ xcopy "..\lib\VS2012\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -440,7 +440,7 @@ xcopy "..\lib\VS2012\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -474,7 +474,7 @@ xcopy "..\lib\VS2012\Win32\DLL_Release_MT\$(TargetName).lib" "..\lib" /H /R /Y NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true diff --git a/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2013.vcxproj b/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2013.vcxproj index 85cfdab..9c7fc12 100644 --- a/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2013.vcxproj +++ b/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2013.vcxproj @@ -225,7 +225,7 @@ NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) EditAndContinue Disabled @@ -253,7 +253,7 @@ xcopy "..\lib\VS2013\Win32\DLL_Debug\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) ProgramDatabase Disabled @@ -281,7 +281,7 @@ xcopy "..\lib\VS2013\x64\DLL_Debug\$(TargetName).lib" "..\lib" /H /R /Y > nu NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -314,7 +314,7 @@ xcopy "..\lib\VS2013\Win32\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -347,7 +347,7 @@ xcopy "..\lib\VS2013\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) EditAndContinue Disabled @@ -368,7 +368,7 @@ xcopy "..\lib\VS2013\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) ProgramDatabase Disabled @@ -389,7 +389,7 @@ xcopy "..\lib\VS2013\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -415,7 +415,7 @@ xcopy "..\lib\VS2013\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -441,7 +441,7 @@ xcopy "..\lib\VS2013\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -475,7 +475,7 @@ xcopy "..\lib\VS2013\Win32\DLL_Release_MT\$(TargetName).lib" "..\lib" /H /R /Y NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true diff --git a/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2015.vcxproj b/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2015.vcxproj index 60a35dc..40fc07b 100644 --- a/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2015.vcxproj +++ b/amd_tressfx_vulkan/build/AMD_TressFX_Vulkan_2015.vcxproj @@ -216,7 +216,7 @@ NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) EditAndContinue Disabled @@ -244,7 +244,7 @@ xcopy "..\lib\VS2015\Win32\DLL_Debug\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) ProgramDatabase Disabled @@ -272,7 +272,7 @@ xcopy "..\lib\VS2015\x64\DLL_Debug\$(TargetName).lib" "..\lib" /H /R /Y > nu NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -305,7 +305,7 @@ xcopy "..\lib\VS2015\Win32\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -338,7 +338,7 @@ xcopy "..\lib\VS2015\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) EditAndContinue Disabled @@ -359,7 +359,7 @@ xcopy "..\lib\VS2015\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;_DEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) ProgramDatabase Disabled @@ -380,7 +380,7 @@ xcopy "..\lib\VS2015\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -406,7 +406,7 @@ xcopy "..\lib\VS2015\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_LIB;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=0;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -432,7 +432,7 @@ xcopy "..\lib\VS2015\x64\DLL_Release\$(TargetName).lib" "..\lib" /H /R /Y > NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true @@ -466,7 +466,7 @@ xcopy "..\lib\VS2015\Win32\DLL_Release_MT\$(TargetName).lib" "..\lib" /H /R /Y NotUsing Level4 true - VULKAN;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + AMD_TRESSFX_VULKAN=1;_USRDLL;AMD_TRESSFX_COMPILE_DYNAMIC_LIB=1;WIN32;NDEBUG;_WINDOWS;_WIN32_WINNT=0x0601;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) ..\inc;..\..\amd_lib\shared\common\inc;..\..\amd_tressfx\inc;..\..\amd_tressfx\src;$(VULKAN_SDK)\Include;%(AdditionalIncludeDirectories) Full true diff --git a/amd_tressfx_vulkan/premake/premake5.lua b/amd_tressfx_vulkan/premake/premake5.lua index 3797848..11efec6 100644 --- a/amd_tressfx_vulkan/premake/premake5.lua +++ b/amd_tressfx_vulkan/premake/premake5.lua @@ -45,7 +45,7 @@ project ("AMD_" .. _AMD_LIBRARY_NAME .. "_Vulkan") -- Specify WindowsTargetPlatformVersion here for VS2015 windowstarget (_AMD_WIN_SDK_VERSION) - defines { "VULKAN"} + defines { "AMD_TRESSFX_VULKAN=1"} files { "../inc/**.h", "../src/**.h", "../src/**.cpp", "../src/Shaders/**.glsl", "../src/Shaders/**.comp", "../src/Shaders/**.vert", "../src/Shaders/**.frag", "../../amd_tressfx/src/TressFXAsset.cpp", "../../amd_tressfx/src/Util.cpp", "../../amd_tressfx/src/Math/**.cpp" } includedirs { "../inc", "../../amd_lib/shared/common/inc", "../../amd_tressfx/inc", "../../amd_tressfx/src", "$(VULKAN_SDK)/Include" } libdirs { "$(VULKAN_SDK)/Bin"} diff --git a/amd_tressfx_vulkan/shader_builder/shader_builder/shader_builder.py b/amd_tressfx_vulkan/shader_builder/shader_builder/shader_builder.py index 1f70c86..f0a4ec3 100644 --- a/amd_tressfx_vulkan/shader_builder/shader_builder/shader_builder.py +++ b/amd_tressfx_vulkan/shader_builder/shader_builder/shader_builder.py @@ -57,7 +57,8 @@ def load_array(name, filename): output.write(load_array("pass2_fragment", "TressFXRender_pass2.frag")) output.write(load_array("global_constraints", "GlobalConstraints.comp")) output.write(load_array("local_constraints", "LocalConstraints.comp")) -output.write(load_array("length_wind_tangent_compute", "LengthWindTangentComputation.comp")) +output.write(load_array("compute_tangents", "ComputeTangents.comp")) +output.write(load_array("length_wind_collision", "LengthWindCollision.comp")) output.write(load_array("prepare_follow_hair", "PrepareFollowHair.comp")) output.write(load_array("update_follow_hair", "UpdateFollowHair.comp")) output.write(load_array("depth_hair_data", "FS_Depth_Hair_Data.frag")) diff --git a/amd_tressfx_vulkan/src/Shaders/TressFXRender_pass2.vert b/amd_tressfx_vulkan/src/Shaders/TressFXRender_pass2.vert index 946d661..fac5ddd 100644 --- a/amd_tressfx_vulkan/src/Shaders/TressFXRender_pass2.vert +++ b/amd_tressfx_vulkan/src/Shaders/TressFXRender_pass2.vert @@ -2,19 +2,36 @@ #extension GL_ARB_separate_shader_objects : enable #extension GL_ARB_shading_language_420pack : enable - -layout(location = 0) in vec4 Position; -layout(location = 1) in vec4 Texcoord; - layout(location = 0) out vec2 vTex; out gl_PerVertex { vec4 gl_Position; }; +vec4 getPosition(uint index) +{ + switch (index) + { + case 0: return vec4(-1, 1, 0, 1); + case 1: return vec4(3, 1, 0, 1); + case 2: return vec4(-1, -3, 0, 1); + default: return vec4(0.); + } +} + +vec2 getTC(uint index) +{ + switch (index) + { + case 0: return vec2(0., 0.); + case 1: return vec2(0., 2.); + case 2: return vec2(2., 0.); + default: return vec2(0.); + } +} void main() { - gl_Position = vec4(Position.xyz, 1.0); - vTex = Texcoord.xy; + gl_Position = getPosition(gl_VertexIndex); + vTex = getTC(gl_VertexIndex); } diff --git a/amd_tressfx_vulkan/src/TressFXMeshVulkan.cpp b/amd_tressfx_vulkan/src/TressFXMeshVulkan.cpp index 12b5b5a..028d453 100644 --- a/amd_tressfx_vulkan/src/TressFXMeshVulkan.cpp +++ b/amd_tressfx_vulkan/src/TressFXMeshVulkan.cpp @@ -33,17 +33,6 @@ #include #include -#ifndef AMD_V_RETURN -#define AMD_V_RETURN(x) \ - { \ - vr = (x); \ - if (vr != VK_SUCCESS) \ - { \ - return vr; \ - } \ - } -#endif - using namespace std; using namespace DirectX; @@ -57,8 +46,8 @@ namespace AMD // Used for initializing member variables to default values. //-------------------------------------------------------------------------------------- TressFXMesh::TressFXMesh(void) - : m_pIndexBuffer(NULL), m_pTriangleIndexBuffer(NULL), m_pThicknessCoeffsBuffer(NULL), - m_pTriangleIndexMemory(NULL), m_pThicknessCoeffsView(NULL) + : m_pIndexBuffer(NULL), m_pTriangleIndexBuffer(NULL), m_pThicknessCoeffsBuffer(NULL), m_pThicknessIndexTriangleIndexMemory(NULL), + m_pThicknessCoeffsView(NULL) { m_HairVertexPositionsBuffer = NULL; m_HairVertexPositionsView = NULL; @@ -129,10 +118,13 @@ TressFXMesh::~TressFXMesh(void) { OnDestroy(); } // and stores the hair data into these resources. // //-------------------------------------------------------------------------------------- -VkResult TressFXMesh::OnCreate(VkDevice pvkDevice, TressFX_HairBlob *pHairBlob, - TressFX_SceneMesh *sceneMesh, VkImageView pTexture, - uint32_t texture_buffer_memory_index, - VkCommandBuffer upload_cmd_buffer, VkBuffer scratchBuffer, +VkResult TressFXMesh::OnCreate(VkDevice pvkDevice, + TressFX_HairBlob *pHairBlob, + TressFX_SceneMesh *sceneMesh, + VkImageView pTexture, + VkPhysicalDeviceMemoryProperties memProperties, + VkCommandBuffer upload_cmd_buffer, + VkBuffer scratchBuffer, VkDeviceMemory scratchMemory, VkDescriptorSetLayout GlobalConstraintsSetLayout, VkDescriptorSetLayout LocalConstraintsSetLayout, @@ -141,9 +133,10 @@ VkResult TressFXMesh::OnCreate(VkDevice pvkDevice, TressFX_HairBlob *pHairBlob, VkDescriptorSetLayout UpdateFollowHaitSetLayout, VkDescriptorSetLayout computeTangentSetLayout, VkDescriptorSetLayout Pass1SetLayout, - VkDescriptorSetLayout ShadowSetLayout) + VkDescriptorSetLayout ShadowSetLayout, const DebugMarkerPointer& markerCallbacks) { VkResult vr; + size_t offsetInUploadBuffer = 0; // load the binary file if (!Deserialize(pHairBlob)) @@ -151,26 +144,71 @@ VkResult TressFXMesh::OnCreate(VkDevice pvkDevice, TressFX_HairBlob *pHairBlob, return VK_ERROR_INITIALIZATION_FAILED; } - size_t sizeToUpload = m_HairAsset.m_NumTotalHairVertices * sizeof(float); - - void *uploadBuffer; - size_t offsetInUploadBuffer = 0; - vkMapMemory(pvkDevice, scratchMemory, 0, sizeToUpload, 0, &uploadBuffer); - - // thickness coeff buffer + // Create Buffers { + // thickness coeff buffer VkBufferCreateInfo bd{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; bd.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; bd.size = sizeof(float) * m_HairAsset.m_NumTotalHairVertices; + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bd, nullptr, &m_pThicknessCoeffsBuffer)); + + //----------------------------------- + // Index buffer (lines and triangles) + //----------------------------------- + + // Line index buffer + m_TotalIndexCount = (int)m_HairAsset.m_LineIndices.size(); + bd.size = (UINT)(sizeof(unsigned int) * m_TotalIndexCount); + bd.usage = VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bd, nullptr, &m_pIndexBuffer)); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bd, nullptr, &m_pThicknessCoeffsBuffer)); - m_pThicknessCoeffsMemory = allocBufferMemory(pvkDevice, m_pThicknessCoeffsBuffer, - texture_buffer_memory_index); + // Triangle index buffer + m_TotalTriangleIndexCount = (int)m_HairAsset.m_TriangleIndices.size(); + bd.size = (UINT)(sizeof(unsigned int) * m_TotalTriangleIndexCount); + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bd, nullptr, &m_pTriangleIndexBuffer)); + + VkMemoryRequirements thicknessBufferMemReq; + vkGetBufferMemoryRequirements(pvkDevice, m_pThicknessCoeffsBuffer, &thicknessBufferMemReq); + VkMemoryRequirements indexBufferMemReq; + vkGetBufferMemoryRequirements(pvkDevice, m_pIndexBuffer, &indexBufferMemReq); + VkMemoryRequirements triangleIndexBufferMemReq; + vkGetBufferMemoryRequirements(pvkDevice, m_pTriangleIndexBuffer, &triangleIndexBufferMemReq); + + uint32_t memoryType = getMemoryTypeIndex(indexBufferMemReq.memoryTypeBits & triangleIndexBufferMemReq.memoryTypeBits & thicknessBufferMemReq.memoryTypeBits, + memProperties, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + + if (memoryType == -1) return VK_ERROR_INITIALIZATION_FAILED; + + VkDeviceSize indexBufferOffset = align(thicknessBufferMemReq.size, indexBufferMemReq.alignment); + VkDeviceSize triangleIndexBufferOffset = align(indexBufferOffset + indexBufferMemReq.size, triangleIndexBufferMemReq.alignment); + VkDeviceSize totalSize = triangleIndexBufferOffset + triangleIndexBufferMemReq.size; + + VkMemoryAllocateInfo allocateInfo{VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO}; + allocateInfo.allocationSize = totalSize; + allocateInfo.memoryTypeIndex = memoryType; + vkAllocateMemory(pvkDevice, &allocateInfo, nullptr, &m_pThicknessIndexTriangleIndexMemory); + + vkBindBufferMemory(pvkDevice, m_pThicknessCoeffsBuffer, m_pThicknessIndexTriangleIndexMemory, 0); + vkBindBufferMemory(pvkDevice, m_pIndexBuffer, m_pThicknessIndexTriangleIndexMemory, indexBufferOffset); + vkBindBufferMemory(pvkDevice, m_pTriangleIndexBuffer, m_pThicknessIndexTriangleIndexMemory, triangleIndexBufferOffset); + + // Fill them + void *uploadBuffer; + vkMapMemory(pvkDevice, scratchMemory, 0, totalSize, 0, &uploadBuffer); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pThicknessCoeffs, m_pThicknessCoeffsBuffer, - offsetInUploadBuffer, bd.size); + offsetInUploadBuffer, sizeof(float) * m_HairAsset.m_NumTotalHairVertices); + + fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, + &m_HairAsset.m_LineIndices[0], m_pIndexBuffer, offsetInUploadBuffer, + sizeof(unsigned int) * m_TotalIndexCount); + + fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, + &m_HairAsset.m_TriangleIndices[0], m_pTriangleIndexBuffer, + offsetInUploadBuffer, sizeof(unsigned int) * m_TotalTriangleIndexCount); + vkUnmapMemory(pvkDevice, scratchMemory); } // thickness coeff buffer srv @@ -180,53 +218,21 @@ VkResult TressFXMesh::OnCreate(VkDevice pvkDevice, TressFX_HairBlob *pHairBlob, SRVDesc.range = m_HairAsset.m_NumTotalHairVertices * sizeof(float); SRVDesc.buffer = m_pThicknessCoeffsBuffer; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBufferView(pvkDevice, &SRVDesc, nullptr, &m_pThicknessCoeffsView)); } - //----------------------------------- - // Index buffer (lines and triangles) - //----------------------------------- - - // Line index buffer - m_TotalIndexCount = (int)m_HairAsset.m_LineIndices.size(); - - VkBufferCreateInfo bd{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; - bd.size = (UINT)(sizeof(unsigned int) * m_HairAsset.m_LineIndices.size()); - bd.usage = VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bd, nullptr, &m_pIndexBuffer)); - m_pIndexMemory = - allocBufferMemory(pvkDevice, m_pIndexBuffer, texture_buffer_memory_index); - - fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, - &m_HairAsset.m_LineIndices[0], m_pIndexBuffer, offsetInUploadBuffer, - bd.size); - - // Triangle index buffer - m_TotalTriangleIndexCount = (int)m_HairAsset.m_TriangleIndices.size(); - bd.size = (UINT)(sizeof(unsigned int) * m_HairAsset.m_TriangleIndices.size()); - - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bd, nullptr, &m_pTriangleIndexBuffer)); - m_pTriangleIndexMemory = - allocBufferMemory(pvkDevice, m_pTriangleIndexBuffer, texture_buffer_memory_index); - - fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, - &m_HairAsset.m_TriangleIndices[0], m_pTriangleIndexBuffer, - offsetInUploadBuffer, bd.size); - - vkUnmapMemory(pvkDevice, scratchMemory); - m_pHairTextureSRV = pTexture; - vr = CreateBufferAndViews(pvkDevice, sceneMesh, texture_buffer_memory_index, - upload_cmd_buffer, scratchBuffer, scratchMemory, - offsetInUploadBuffer); - vr = - AllocateDescriptorsSets(pvkDevice, GlobalConstraintsSetLayout, + AMD_CHECKED_VULKAN_CALL(CreateBufferAndViews(pvkDevice, sceneMesh, + memProperties, + upload_cmd_buffer, scratchBuffer, + scratchMemory, + offsetInUploadBuffer, markerCallbacks )); + AMD_CHECKED_VULKAN_CALL(AllocateDescriptorsSets(pvkDevice, GlobalConstraintsSetLayout, LocalConstraintsSetLayout, LenghtWindCollisionSetLayout, PrepareFollowHairSetLayout, UpdateFollowHaitSetLayout, - computeTangentSetLayout, Pass1SetLayout, ShadowSetLayout); + computeTangentSetLayout, Pass1SetLayout, ShadowSetLayout)); VkBufferMemoryBarrier bufferBarrier[] = { getBufferBarrier(m_pThicknessCoeffsBuffer, VK_ACCESS_TRANSFER_WRITE_BIT, @@ -268,9 +274,11 @@ VkResult TressFXMesh::OnCreate(VkDevice pvkDevice, TressFX_HairBlob *pHairBlob, // //-------------------------------------------------------------------------------------- VkResult TressFXMesh::CreateBufferAndViews( - VkDevice pvkDevice, TressFX_SceneMesh *sceneMesh, - uint32_t texture_buffer_memory_index, VkCommandBuffer upload_cmd_buffer, - VkBuffer scratchBuffer, VkDeviceMemory scratchMemory, size_t &offsetInUploadBuffer) + VkDevice pvkDevice, + TressFX_SceneMesh *sceneMesh, + VkPhysicalDeviceMemoryProperties memProp, + VkCommandBuffer upload_cmd_buffer, + VkBuffer scratchBuffer, VkDeviceMemory scratchMemory, size_t &offsetInUploadBuffer, const DebugMarkerPointer& markerCallbacks) { VkResult vr; m_pvkDevice = pvkDevice; @@ -307,19 +315,21 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDesc.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; bufferDesc.size = m_HairAsset.m_NumTotalHairStrands * sizeof(int); - // AMD_SAFE_RELEASE(m_HairStrandTypeBuffer); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, &m_HairStrandTypeBuffer)); + markerCallbacks.nameObject(m_HairStrandTypeBuffer, "HairStrandTypeBuffer"); + m_HairStrandTypeMemory = allocBufferMemory(pvkDevice, m_HairStrandTypeBuffer, - texture_buffer_memory_index); + memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_HairStrandTypeMemory, "HairStrandTypeMemory"); VkBufferViewCreateInfo SRVDesc{VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO}; SRVDesc.format = VK_FORMAT_R32_SINT; SRVDesc.range = m_HairAsset.m_NumTotalHairStrands * sizeof(int32_t); SRVDesc.buffer = m_HairStrandTypeBuffer; - // AMD_SAFE_RELEASE(m_HairStrandTypeSRV); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBufferView(pvkDevice, &SRVDesc, nullptr, &m_HairStrandTypeView)); + markerCallbacks.nameObject(m_HairStrandTypeView, "HairStrandTypeView"); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pHairStrandType, m_HairStrandTypeBuffer, offsetInUploadBuffer, bufferDesc.size); @@ -334,19 +344,20 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDesc.size = m_HairAsset.m_NumTotalHairVertices * sizeof(XMFLOAT4); bufferDesc.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - // AMD_SAFE_RELEASE(m_InitialHairPositionsBuffer); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, &m_InitialHairPositionsBuffer)); + markerCallbacks.nameObject(m_InitialHairPositionsBuffer, "InitialHairPositionBuffer"); m_InitialHairPositionsMemory = allocBufferMemory( - pvkDevice, m_InitialHairPositionsBuffer, texture_buffer_memory_index); + pvkDevice, m_InitialHairPositionsBuffer, memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_InitialHairPositionsMemory, "InitialHairPositionsMemory"); VkBufferViewCreateInfo desc{VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO}; desc.format = VK_FORMAT_R32G32B32A32_SFLOAT; desc.range = m_HairAsset.m_NumTotalHairVertices * 4 * sizeof(float); desc.buffer = m_InitialHairPositionsBuffer; - // AMD_SAFE_RELEASE(m_InitialHairPositionsSRV); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBufferView(pvkDevice, &desc, nullptr, &m_InitialHairPositionsView)); + markerCallbacks.nameObject(m_InitialHairPositionsView, "InitialHairPositionsView"); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pVertices, m_InitialHairPositionsBuffer, offsetInUploadBuffer, bufferDesc.size); @@ -361,17 +372,19 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDescUA.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - // AMD_SAFE_RELEASE(m_HairVertexPositionsUAB); - // AMD_SAFE_RELEASE(m_HairVertexPositionsPrevUAB); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, &m_HairVertexPositionsBuffer)); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, + markerCallbacks.nameObject(m_HairVertexPositionsBuffer, "HairVertexPositionsBuffer"); + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, &m_HairVertexPositionsPrevBuffer)); + markerCallbacks.nameObject(m_HairVertexPositionsPrevBuffer, "HairVertexPositionsPrevBuffer"); m_HairVertexPositionsMemory = allocBufferMemory( - pvkDevice, m_HairVertexPositionsBuffer, texture_buffer_memory_index); + pvkDevice, m_HairVertexPositionsBuffer, memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_HairVertexPositionsMemory, "HairVertexPositionsMemory"); m_HairVertexPositionsPrevMemory = allocBufferMemory( - pvkDevice, m_HairVertexPositionsPrevBuffer, texture_buffer_memory_index); + pvkDevice, m_HairVertexPositionsPrevBuffer, memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_HairVertexPositionsPrevMemory, "HairVertexPositionsPrevMemory"); // TODO: We could write only once to uploadBuffer and share data between // the // 3 buffers @@ -392,11 +405,12 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDescUA.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - // AMD_SAFE_RELEASE(m_HairVertexTangentsUAB); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, &m_HairVertexTangentsBuffer)); + markerCallbacks.nameObject(m_HairVertexTangentsBuffer, "HairVertexTangentsBuffer"); m_HairVertexTangentsMemory = allocBufferMemory( - pvkDevice, m_HairVertexTangentsBuffer, texture_buffer_memory_index); + pvkDevice, m_HairVertexTangentsBuffer, memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_HairVertexTangentsMemory, "HairVertexTangentsMemory"); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pTangents, m_HairVertexTangentsBuffer, offsetInUploadBuffer, bufferDescUA.size); @@ -410,9 +424,9 @@ VkResult TressFXMesh::CreateBufferAndViews( sbSRVDesc.range = m_HairAsset.m_NumTotalHairVertices * 4 * sizeof(float); sbSRVDesc.format = VK_FORMAT_R32G32B32A32_SFLOAT; sbSRVDesc.buffer = m_HairVertexPositionsBuffer; - // AMD_SAFE_RELEASE(m_HairVertexPositionsSRV); - AMD_V_RETURN(vkCreateBufferView(pvkDevice, &sbSRVDesc, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBufferView(pvkDevice, &sbSRVDesc, nullptr, &m_HairVertexPositionsView)); + markerCallbacks.nameObject(m_HairVertexPositionsView, "HairVertexPositionsView"); } //----------------------- @@ -423,9 +437,9 @@ VkResult TressFXMesh::CreateBufferAndViews( sbSRVDesc.range = m_HairAsset.m_NumTotalHairVertices * 4 * sizeof(float); sbSRVDesc.format = VK_FORMAT_R32G32B32A32_SFLOAT; sbSRVDesc.buffer = m_HairVertexTangentsBuffer; - // AMD_SAFE_RELEASE(m_HairVertexTangentsSRV); - AMD_V_RETURN(vkCreateBufferView(pvkDevice, &sbSRVDesc, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBufferView(pvkDevice, &sbSRVDesc, nullptr, &m_HairVertexTangentsView)); + markerCallbacks.nameObject(m_HairVertexTangentsView, "HairVertexTangentsView"); } //----------------------- @@ -436,10 +450,9 @@ VkResult TressFXMesh::CreateBufferAndViews( sbUAVDesc.range = m_HairAsset.m_NumTotalHairVertices * 4 * sizeof(float); sbUAVDesc.format = VK_FORMAT_R32G32B32A32_SFLOAT; sbUAVDesc.buffer = m_HairVertexPositionsPrevBuffer; - // AMD_SAFE_RELEASE(m_HairVertexPositionsUAV); - // AMD_SAFE_RELEASE(m_HairVertexPositionsPrevUAV); - AMD_V_RETURN(vkCreateBufferView(pvkDevice, &sbUAVDesc, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBufferView(pvkDevice, &sbUAVDesc, nullptr, &m_HairVertexPositionsPrevView)); + markerCallbacks.nameObject(m_HairVertexPositionsPrevView, "HairVertexPositionsPrevView"); } //--------------------------- @@ -451,10 +464,12 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDesc.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; // AMD_SAFE_RELEASE(m_HairLengthBuffer); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, &m_HairLengthBuffer)); + markerCallbacks.nameObject(m_HairLengthBuffer, "HairLengthBuffer"); m_HairLengthMemory = - allocBufferMemory(pvkDevice, m_HairLengthBuffer, texture_buffer_memory_index); + allocBufferMemory(pvkDevice, m_HairLengthBuffer, memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_HairLengthMemory, "HairLengthMemory"); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pRestLengths, m_HairLengthBuffer, @@ -464,8 +479,8 @@ VkResult TressFXMesh::CreateBufferAndViews( desc.format = VK_FORMAT_R32_SFLOAT; desc.range = m_HairAsset.m_NumTotalHairVertices * sizeof(float); desc.buffer = m_HairLengthBuffer; - // AMD_SAFE_RELEASE(m_HairRestLengthSRV); - AMD_V_RETURN(vkCreateBufferView(pvkDevice, &desc, nullptr, &m_HairRestLengthSRV)); + AMD_CHECKED_VULKAN_CALL(vkCreateBufferView(pvkDevice, &desc, nullptr, &m_HairRestLengthSRV)); + markerCallbacks.nameObject(m_HairRestLengthSRV, "HairRestLengthSRV"); } //----------------------------------- @@ -477,11 +492,12 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDesc.size = m_HairAsset.m_NumTotalHairVertices * sizeof(XMFLOAT4); bufferDesc.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - // AMD_SAFE_RELEASE(m_HairRefVectorsBuffer); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, &m_HairRefVectorsBuffer)); + markerCallbacks.nameObject(m_HairRefVectorsBuffer, "HairRefVectorsBuffer"); m_HairRefVectorsMemory = allocBufferMemory(pvkDevice, m_HairRefVectorsBuffer, - texture_buffer_memory_index); + memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_HairRefVectorsMemory, "HairRefVectorsMemory"); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pRefVectors, m_HairRefVectorsBuffer, @@ -491,9 +507,9 @@ VkResult TressFXMesh::CreateBufferAndViews( desc.format = VK_FORMAT_R32G32B32A32_SFLOAT; desc.range = m_HairAsset.m_NumTotalHairVertices * 4 * sizeof(float); desc.buffer = m_HairRefVectorsBuffer; - // AMD_SAFE_RELEASE(m_HairRefVecsInLocalFrameSRV); - AMD_V_RETURN(vkCreateBufferView(pvkDevice, &desc, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBufferView(pvkDevice, &desc, nullptr, &m_HairRefVecsInLocalFrameView)); + markerCallbacks.nameObject(m_HairRefVecsInLocalFrameView, "HairRefVecsInLocalFrameView"); } //----------------------------------- @@ -505,10 +521,12 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDesc.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; // AMD_SAFE_RELEASE(m_FollowHairRootOffsetBuffer); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, &m_FollowHairRootOffsetBuffer)); + markerCallbacks.nameObject(m_FollowHairRootOffsetBuffer, "FollowHairRootOffsetBuffer"); m_FollowHairRootOffsetMemory = allocBufferMemory( - pvkDevice, m_FollowHairRootOffsetBuffer, texture_buffer_memory_index); + pvkDevice, m_FollowHairRootOffsetBuffer, memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_FollowHairRootOffsetMemory, "FollowHaitRootOffsetMemory"); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pFollowRootOffset, m_FollowHairRootOffsetBuffer, @@ -518,9 +536,9 @@ VkResult TressFXMesh::CreateBufferAndViews( desc.format = VK_FORMAT_R32G32B32A32_SFLOAT; desc.range = m_HairAsset.m_NumTotalHairStrands * 4 * sizeof(float); desc.buffer = m_FollowHairRootOffsetBuffer; - // AMD_SAFE_RELEASE(m_FollowHairRootOffsetSRV); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBufferView(pvkDevice, &desc, nullptr, &m_FollowHairRootOffsetView)); + markerCallbacks.nameObject(m_FollowHairRootOffsetView, "FollowHairRootOffsetView"); } // -------------------------------------------- @@ -531,11 +549,12 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDescUA.size = m_HairAsset.m_NumTotalHairVertices * sizeof(XMFLOAT4); bufferDescUA.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - // AMD_SAFE_RELEASE(m_GlobalRotationsUAB); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, &m_GlobalRotationsBuffer)); + markerCallbacks.nameObject(m_GlobalRotationsBuffer, "GlobalRotationsBuffer"); m_GlobalRotationsMemory = allocBufferMemory(pvkDevice, m_GlobalRotationsBuffer, - texture_buffer_memory_index); + memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_GlobalRotationsMemory, "GlobalRotationsMemory"); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pGlobalRotations, m_GlobalRotationsBuffer, @@ -545,9 +564,9 @@ VkResult TressFXMesh::CreateBufferAndViews( sbUAVDesc.range = m_HairAsset.m_NumTotalHairVertices * sizeof(XMFLOAT4); sbUAVDesc.format = VK_FORMAT_R32G32B32A32_SFLOAT; sbUAVDesc.buffer = m_GlobalRotationsBuffer; - // AMD_SAFE_RELEASE(m_GlobalRotationsUAV); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBufferView(pvkDevice, &sbUAVDesc, nullptr, &m_GlobalRotationsView)); + markerCallbacks.nameObject(m_GlobalRotationsView, "GlobalRotationsView"); } // -------------------------------------------- @@ -558,11 +577,12 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDescUA.size = m_HairAsset.m_NumTotalHairVertices * sizeof(XMFLOAT4); bufferDescUA.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - // AMD_SAFE_RELEASE(m_LocalRotationsUAB); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, &m_LocalRotationsBuffer)); + markerCallbacks.nameObject(m_LocalRotationsBuffer, "LocalROtationsBuffer"); m_LocalRotationsMemory = allocBufferMemory(pvkDevice, m_LocalRotationsBuffer, - texture_buffer_memory_index); + memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_LocalRotationsMemory, "LocalRotationMemory"); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pLocalRotations, m_LocalRotationsBuffer, @@ -573,7 +593,7 @@ VkResult TressFXMesh::CreateBufferAndViews( sbUAVDesc.format = VK_FORMAT_R32G32B32A32_SFLOAT; sbUAVDesc.buffer = m_LocalRotationsBuffer; // AMD_SAFE_RELEASE(m_LocalRotationsUAV); - // AMD_V_RETURN( + // AMD_CHECKED_VULKAN_CALL( // vkCreateBufferView(pvkDevice, &sbUAVDesc, nullptr, // &m_LocalRotationsView)); } @@ -598,18 +618,18 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDesc.size = m_HairAsset.m_NumTotalHairStrands * sizeof(HairToTriangleMapping); bufferDesc.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; - // AMD_SAFE_RELEASE(m_HairSkinMappingBuffer); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, &m_HairSkinMappingBuffer)); + markerCallbacks.nameObject(m_HairSkinMappingBuffer, "HairSkinMappingBuffer"); VkBufferViewCreateInfo desc{VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO}; desc.format = VK_FORMAT_UNDEFINED; desc.range = m_HairAsset.m_NumTotalHairStrands * sizeof(HairToTriangleMapping); desc.buffer = m_HairSkinMappingBuffer; - // AMD_SAFE_RELEASE(m_HairSkinMappingSRV); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBufferView(pvkDevice, &desc, nullptr, &m_HairSkinMappingView)); + markerCallbacks.nameObject(m_HairSkinMappingView, "HairSkinMappingView"); } // -------------------------------------------- @@ -644,25 +664,22 @@ VkResult TressFXMesh::CreateBufferAndViews( } } - // D3D11_SUBRESOURCE_DATA initialData; - // initialData.pSysMem = (void *)pTransforms; - VkBufferCreateInfo bufferDescUA{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; bufferDescUA.size = m_HairAsset.m_NumTotalHairStrands * sizeof(TressFX_HairTransform); bufferDescUA.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; - // AMD_SAFE_RELEASE(m_HairTransformsBuffer); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bufferDescUA, nullptr, &m_HairTransformsBuffer)); + markerCallbacks.nameObject(m_HairTransformsBuffer, "HairTransformsBuffer"); VkBufferViewCreateInfo desc{VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO}; desc.range = m_HairAsset.m_NumTotalHairStrands * sizeof(TressFX_HairTransform); desc.format = VK_FORMAT_UNDEFINED; desc.buffer = m_HairTransformsBuffer; - // AMD_SAFE_RELEASE(m_HairTransformsSRV); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBufferView(pvkDevice, &desc, nullptr, &m_HairTransformsView)); + markerCallbacks.nameObject(m_HairTransformsView, "HairTransformView"); AMD_SAFE_DELETE_ARRAY(pTransforms); } @@ -678,11 +695,12 @@ VkResult TressFXMesh::CreateBufferAndViews( bufferDesc.size = m_HairAsset.m_NumTotalHairStrands * sizeof(float) * 2; bufferDesc.usage = VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - // AMD_SAFE_RELEASE(m_pStrandTexCoordBuffer); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &bufferDesc, nullptr, &m_pStrandTexCoordBuffer)); + markerCallbacks.nameObject(m_pStrandTexCoordBuffer, "StrandTexCoordBuffer"); m_pStrandTexCoordMemory = allocBufferMemory( - pvkDevice, m_pStrandTexCoordBuffer, texture_buffer_memory_index); + pvkDevice, m_pStrandTexCoordBuffer, memProp, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + markerCallbacks.nameObject(m_pStrandTexCoordMemory, "StrandTexCoordMemory"); fillInitialData(upload_cmd_buffer, scratchBuffer, uploadBuffer, m_HairAsset.m_pStrandTexCoords, m_pStrandTexCoordBuffer, @@ -693,8 +711,9 @@ VkResult TressFXMesh::CreateBufferAndViews( desc.range = m_HairAsset.m_NumTotalHairStrands * sizeof(float) * 2; desc.buffer = m_pStrandTexCoordBuffer; // AMD_SAFE_RELEASE(m_pStrandTexCoordSRV); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBufferView(pvkDevice, &desc, nullptr, &m_pStrandTexCoordView)); + markerCallbacks.nameObject(m_pStrandTexCoordView, "StrandTexCoordView"); } } vkUnmapMemory(pvkDevice, scratchMemory); @@ -717,7 +736,7 @@ VkResult TressFXMesh::AllocateDescriptorsSets( info.poolSizeCount = AMD_ARRAY_SIZE(poolSizes); info.pPoolSizes = poolSizes; VkResult vr; - AMD_V_RETURN(vkCreateDescriptorPool(pvkDevice, &info, nullptr, &m_descriptorPool)); + AMD_CHECKED_VULKAN_CALL(vkCreateDescriptorPool(pvkDevice, &info, nullptr, &m_descriptorPool)); const VkDescriptorSetLayout setLayouts[] = {GlobalConstraintsSetLayout, LocalConstraintsSetLayout, @@ -735,7 +754,7 @@ VkResult TressFXMesh::AllocateDescriptorsSets( VkDescriptorSet sets[AMD_ARRAY_SIZE(setLayouts)]{}; - AMD_V_RETURN(vkAllocateDescriptorSets(pvkDevice, &allocateInfo, sets)); + AMD_CHECKED_VULKAN_CALL(vkAllocateDescriptorSets(pvkDevice, &allocateInfo, sets)); m_GlobalConstraintsSet = sets[0]; m_LocalConstraintsSet = sets[1]; m_LenghtWindCollisionSet = sets[2]; @@ -835,10 +854,6 @@ VkResult TressFXMesh::AllocateDescriptorsSets( return VK_SUCCESS; } -#define AMD_SAFE_RELEASE(object, releaseFunction, device) \ - if (object != nullptr) \ - releaseFunction(device, object, nullptr); - //-------------------------------------------------------------------------------------- // // OnDestroy @@ -849,14 +864,12 @@ VkResult TressFXMesh::AllocateDescriptorsSets( void TressFXMesh::OnDestroy() { AMD_SAFE_RELEASE(m_pTriangleIndexBuffer, vkDestroyBuffer, m_pvkDevice); - AMD_SAFE_RELEASE(m_pTriangleIndexMemory, vkFreeMemory, m_pvkDevice); AMD_SAFE_RELEASE(m_pIndexBuffer, vkDestroyBuffer, m_pvkDevice); - AMD_SAFE_RELEASE(m_pIndexMemory, vkFreeMemory, m_pvkDevice); AMD_SAFE_RELEASE(m_pThicknessCoeffsView, vkDestroyBufferView, m_pvkDevice); AMD_SAFE_RELEASE(m_pThicknessCoeffsBuffer, vkDestroyBuffer, m_pvkDevice); - AMD_SAFE_RELEASE(m_pThicknessCoeffsMemory, vkFreeMemory, m_pvkDevice); + AMD_SAFE_RELEASE(m_pThicknessIndexTriangleIndexMemory, vkFreeMemory, m_pvkDevice); // compute shader variables AMD_SAFE_RELEASE(m_HairVertexPositionsView, vkDestroyBufferView, m_pvkDevice); diff --git a/amd_tressfx_vulkan/src/TressFXMeshVulkan.h b/amd_tressfx_vulkan/src/TressFXMeshVulkan.h index eed8992..480a29f 100644 --- a/amd_tressfx_vulkan/src/TressFXMeshVulkan.h +++ b/amd_tressfx_vulkan/src/TressFXMeshVulkan.h @@ -29,6 +29,7 @@ #pragma once #include "TressFXAsset.h" #include "Util.h" +#include "UtilVulkan.h" namespace AMD { @@ -38,11 +39,13 @@ class TressFXMesh private: VkDevice m_pvkDevice; // private member function - VkResult CreateBufferAndViews(VkDevice pvkDevice, TressFX_SceneMesh *sceneMesh, - uint32_t texture_buffer_memory_index, + VkResult CreateBufferAndViews(VkDevice pvkDevice, + TressFX_SceneMesh *sceneMesh, + VkPhysicalDeviceMemoryProperties memProperties, VkCommandBuffer upload_cmd_buffer, - VkBuffer scratchBuffer, VkDeviceMemory scratchMemory, - size_t &offsetInUploadBuffer); + VkBuffer scratchBuffer, + VkDeviceMemory scratchMemory, + size_t &offsetInUploadBuffer, const DebugMarkerPointer& markerCallbacks); VkResult AllocateDescriptorsSets(VkDevice pvkDevice, VkDescriptorSetLayout GlobalConstraintsSetLayout, @@ -58,11 +61,10 @@ class TressFXMesh public: VkBuffer m_pIndexBuffer; - VkDeviceMemory m_pIndexMemory; VkBuffer m_pTriangleIndexBuffer; - VkDeviceMemory m_pTriangleIndexMemory; VkBuffer m_pThicknessCoeffsBuffer; - VkDeviceMemory m_pThicknessCoeffsMemory; + // Store thickness, index and triangle index buffer + VkDeviceMemory m_pThicknessIndexTriangleIndexMemory; VkBufferView m_pThicknessCoeffsView; int m_TotalIndexCount; int m_TotalTriangleIndexCount; @@ -149,18 +151,29 @@ class TressFXMesh TressFXMesh(void); ~TressFXMesh(void); - VkResult OnCreate(VkDevice pvkDevice, TressFX_HairBlob *pHairBlob, - TressFX_SceneMesh *sceneMesh, VkImageView pTexture, - uint32_t MemoryIndexGPU, VkCommandBuffer upload_cmd_buffer, - VkBuffer scratchBuffer, VkDeviceMemory scratchMemory, + VkResult OnCreate(VkDevice pvkDevice, + TressFX_HairBlob *pHairBlob, + TressFX_SceneMesh *sceneMesh, + VkImageView pTexture, + VkPhysicalDeviceMemoryProperties memProperties, + VkCommandBuffer upload_cmd_buffer, + VkBuffer scratchBuffer, + VkDeviceMemory scratchMemory, + VkDescriptorSetLayout GlobalConstraintsSetLayout, + VkDescriptorSetLayout LocalConstraintsSetLayout, + VkDescriptorSetLayout LenghtWindCollisiontSetLayout, + VkDescriptorSetLayout PrepareFollowHairSetLayout, + VkDescriptorSetLayout UpdateFollowHaitSetLayout, + VkDescriptorSetLayout ComputeTangetSetLayout, + VkDescriptorSetLayout Pass1SetLayout, - VkDescriptorSetLayout ShadowSetLayout); + VkDescriptorSetLayout ShadowSetLayout, const DebugMarkerPointer& markerCallbacks); void OnDestroy(); void DestroyAsset(); diff --git a/amd_tressfx_vulkan/src/TressFXOpaqueVulkan.cpp b/amd_tressfx_vulkan/src/TressFXOpaqueVulkan.cpp index 69891e7..441c1e0 100644 --- a/amd_tressfx_vulkan/src/TressFXOpaqueVulkan.cpp +++ b/amd_tressfx_vulkan/src/TressFXOpaqueVulkan.cpp @@ -24,26 +24,26 @@ namespace AMD { -void TressFX_OpaqueDesc::Initialize(TressFX_Desc &desc, VkImageView depthTexture, +void TressFX_OpaqueDesc::Initialize(TressFX_Desc &desc, + VkImageView depthTexture, VkImageView colorTexture, VkCommandBuffer commandBuffer, - VkDeviceMemory scratchMemory, VkBuffer scratchBuffer, + VkDeviceMemory scratchMemory, + VkBuffer scratchBuffer, size_t &offsetInScratchBuffer, - uint32_t cpu_memory_index, uint32_t gpu_memory_index) + VkPhysicalDeviceMemoryProperties memProperties) { - if (initialized == false) - { - refCount = 0; - tressFXSimulation.OnCreateDevice(desc.pvkDevice, &desc.collisionCapsule, - desc.maxConstantBuffers, cpu_memory_index, - gpu_memory_index); - tressFXRenderer.OnCreateDevice( - desc.pvkDevice, desc.backBufferWidth, desc.backBufferHeight, desc.bShortCutOn, - desc.maxConstantBuffers, cpu_memory_index, desc.memoryIndexDeviceLocal, - depthTexture, colorTexture, commandBuffer, scratchMemory, scratchBuffer, - offsetInScratchBuffer); - initialized = true; - } + refCount = 0; + markerCallbacks.init(desc.pvkDevice); + tressFXSimulation.OnCreateDevice(desc.pvkDevice, + &desc.collisionCapsule, + desc.maxConstantBuffers, memProperties, + markerCallbacks); + tressFXRenderer.OnCreateDevice( + desc.pvkDevice, desc.backBufferWidth, desc.backBufferHeight, desc.bShortCutOn, + desc.maxConstantBuffers, memProperties, + depthTexture, colorTexture, commandBuffer, scratchMemory, scratchBuffer, + offsetInScratchBuffer, desc.depthStencilFormat, desc.colorFormat); refCount++; } @@ -52,7 +52,6 @@ void TressFX_OpaqueDesc::Release(VkDevice pvkDevice) refCount--; if (refCount <= 0) { - initialized = false; tressFXRenderer.OnDestroy(); tressFXSimulation.OnDestroy(pvkDevice); refCount = 0; @@ -68,7 +67,7 @@ bool TressFX_OpaqueDesc::LoadAppendAsset( bool TressFX_OpaqueDesc::CreateProcessedAsset( TressFX_Desc &desc, TressFX_HairBlob **ppHairBlob, TressFX_SceneMesh *sceneMesh, - VkImageView hairTexture, uint32_t texture_buffer_memory_index, + VkImageView hairTexture, VkPhysicalDeviceMemoryProperties memProperties, VkCommandBuffer uploadCmdBuffer, VkBuffer scratchBuffer, VkDeviceMemory scratchMemory) { tressFXAssetLoader.GenerateFollowHairs(); @@ -89,16 +88,20 @@ bool TressFX_OpaqueDesc::CreateProcessedAsset( delete pTressFXMesh; } pTressFXMesh = new TressFXMesh(); - pTressFXMesh->OnCreate(desc.pvkDevice, &desc.tressFXHair, sceneMesh, hairTexture, - texture_buffer_memory_index, uploadCmdBuffer, scratchBuffer, - scratchMemory, tressFXSimulation.m_GlobalConstraintsSetLayout, + pTressFXMesh->OnCreate(desc.pvkDevice, &desc.tressFXHair, sceneMesh, + hairTexture, + memProperties, uploadCmdBuffer, + scratchBuffer, + scratchMemory, + tressFXSimulation.m_GlobalConstraintsSetLayout, tressFXSimulation.m_LocalConstraintsSetLayout, tressFXSimulation.m_LenghtWindTangentSetLayout, tressFXSimulation.m_PrepareFollowHairSetLayout, tressFXSimulation.m_UpdateFollowHaitSetLayout, desc.pOpaque->tressFXSimulation.m_ComputeTangentSetLayout, tressFXRenderer.m_pass1_hair_set_layout, - tressFXRenderer.m_shadow_pass_hair_set_layout); + tressFXRenderer.m_shadow_pass_hair_set_layout, + desc.pOpaque->markerCallbacks); desc.numTotalHairStrands = pTressFXMesh->m_HairAsset.m_NumTotalHairStrands; desc.numTotalHairVertices = pTressFXMesh->m_HairAsset.m_NumTotalHairVertices; @@ -129,8 +132,9 @@ bool TressFX_OpaqueDesc::Simulate(TressFX_Desc &desc, VkCommandBuffer commandBuf windDir.z = desc.simulationParams.windDir.z; VkResult vr = tressFXSimulation.Simulate( desc.pvkDevice, commandBuffer, elapsedTime, desc.hairParams.density, windDir, - desc.simulationParams.windMag, &desc.modelTransformForHead, nullptr, - desc.targetFrameRate, desc.bSingleHeadTransform, false, uniformBufferIndex); + desc.simulationParams.windMag, &desc.modelTransformForHead, + desc.targetFrameRate, desc.bSingleHeadTransform, false, uniformBufferIndex, + markerCallbacks); return vr == VK_SUCCESS; } @@ -155,8 +159,10 @@ bool TressFX_OpaqueDesc::RenderShadowMap(TressFX_Desc &desc, VkCommandBuffer commandBuffer, uint32_t uniformBufferIndex) { - tressFXRenderer.GenerateShadowMap(desc.pvkDevice, commandBuffer, - desc.hairParams.density, uniformBufferIndex); + tressFXRenderer.GenerateShadowMap(desc.pvkDevice, + commandBuffer, + desc.hairParams.density, uniformBufferIndex, + markerCallbacks); desc.pHairShadowMapSRV = tressFXRenderer.GetShadowMapSRV(); return true; } @@ -166,14 +172,18 @@ bool TressFX_OpaqueDesc::RenderHair(TressFX_Desc &desc, VkCommandBuffer commandB { if (desc.bShortCutOn) { - tressFXRenderer.RenderHairShortcut(desc.pvkDevice, commandBuffer, - desc.backBufferWidth, desc.backBufferHeight, - uniformBufferIndex); + tressFXRenderer.RenderHairShortcut(desc.pvkDevice, + commandBuffer, + desc.backBufferWidth, + desc.backBufferHeight, + uniformBufferIndex, markerCallbacks); } else { - tressFXRenderer.RenderHair(desc.pvkDevice, commandBuffer, desc.backBufferWidth, - desc.backBufferHeight, uniformBufferIndex); + tressFXRenderer.RenderHair(desc.pvkDevice, commandBuffer, + desc.backBufferWidth, + desc.backBufferHeight, uniformBufferIndex, + markerCallbacks); } return true; } @@ -184,11 +194,11 @@ bool TressFX_OpaqueDesc::End(TressFX_Desc &desc) return true; } -bool TressFX_OpaqueDesc::Resize(TressFX_Desc &desc, uint32_t texture_memory_index) +bool TressFX_OpaqueDesc::Resize(TressFX_Desc &desc, VkPhysicalDeviceMemoryProperties memProperties) { VkResult vr = tressFXRenderer.OnResizedSwapChain( desc.pvkDevice, desc.backBufferWidth, desc.backBufferHeight, desc.bShortCutOn, - texture_memory_index); + memProperties); return (vr == VK_SUCCESS); } diff --git a/amd_tressfx_vulkan/src/TressFXOpaqueVulkan.h b/amd_tressfx_vulkan/src/TressFXOpaqueVulkan.h index ce10d73..aaa44cc 100644 --- a/amd_tressfx_vulkan/src/TressFXOpaqueVulkan.h +++ b/amd_tressfx_vulkan/src/TressFXOpaqueVulkan.h @@ -34,19 +34,21 @@ namespace AMD struct TressFX_OpaqueDesc { public: - TressFX_OpaqueDesc() : initialized(false), refCount(0) {} - void Initialize(TressFX_Desc &desc, VkImageView depthTexture, - VkImageView colorTexture, VkCommandBuffer commandBuffer, - VkDeviceMemory scratchMemory, VkBuffer scratchBuffer, - size_t &offsetInScratchBuffer, uint32_t cpu_memory_index, - uint32_t gpu_memory_index); + TressFX_OpaqueDesc() : refCount(0) {} + void Initialize(TressFX_Desc &desc, + VkImageView depthTexture, + VkImageView colorTexture, + VkCommandBuffer commandBuffer, + VkDeviceMemory scratchMemory, + VkBuffer scratchBuffer, + size_t &offsetInScratchBuffer, VkPhysicalDeviceMemoryProperties memProperties); void Release(VkDevice pvkDevice); bool LoadAppendAsset(TressFX_HairBlob *pRawHairBlob, const TressFX_GuideFollowParams &guideFollowParams, int groupId); bool CreateProcessedAsset(TressFX_Desc &desc, TressFX_HairBlob **ppHairBlob, TressFX_SceneMesh *sceneMesh, VkImageView hairTexture, - uint32_t texture_buffer_memory_index, + VkPhysicalDeviceMemoryProperties memProperties, VkCommandBuffer uploadCmdBuffer, VkBuffer scratchBuffer, VkDeviceMemory scratchMemor); @@ -60,14 +62,16 @@ struct TressFX_OpaqueDesc uint32_t uniformBufferIndex); bool GenerateTransforms(TressFX_Desc &desc, TressFX_SceneMesh &sceneMesh); bool ApplyRigidTransforms(TressFX_Desc &desc); - bool Resize(TressFX_Desc &desc, uint32_t texture_memory_index); + bool Resize(TressFX_Desc &desc, VkPhysicalDeviceMemoryProperties memProperties); TressFXSimulation tressFXSimulation; // Hair simulation class TressFXRenderer tressFXRenderer; // Hair rendering class + DebugMarkerPointer markerCallbacks; private: - bool initialized; // only initialize this structure once TressFXAssetLoader tressFXAssetLoader; // Hair asset loading class int refCount; // reference count - delete allocations when 0 + TressFX_OpaqueDesc(const TressFX_OpaqueDesc&) {} + TressFX_OpaqueDesc& operator=(const TressFX_OpaqueDesc&) {} }; } // namespace AMD diff --git a/amd_tressfx_vulkan/src/TressFXPrecompiledShadersVulkan.h b/amd_tressfx_vulkan/src/TressFXPrecompiledShadersVulkan.h index 8824d61..7f680f6 100644 --- a/amd_tressfx_vulkan/src/TressFXPrecompiledShadersVulkan.h +++ b/amd_tressfx_vulkan/src/TressFXPrecompiledShadersVulkan.h @@ -2,7 +2,7 @@ const std::vector hair_shadow_vertex = {119734787, 65536, 524289, -40, +41, 0, 131089, 1, @@ -625,10 +625,10 @@ const std::vector hair_shadow_vertex = {119734787, 1, 262187, 6, -32, +33, 1065353216, 262176, -38, +39, 3, 7, 327734, @@ -655,54 +655,58 @@ const std::vector hair_shadow_vertex = {119734787, 11, 29, 28, +262244, +22, +30, +26, 327775, 7, +31, 30, -26, 29, 524367, 14, +32, +31, 31, -30, -30, 0, 1, 2, 327761, 6, -33, -31, +34, +32, 0, 327761, 6, -34, -31, +35, +32, 1, 327761, 6, -35, -31, +36, +32, 2, 458832, 7, -36, -33, +37, 34, 35, -32, +36, +33, 327825, 7, -37, +38, 21, -36, +37, 327745, -38, 39, +40, 10, 12, 196670, -39, -37, +40, +38, 65789, 65592, }; @@ -773,7 +777,7 @@ const std::vector hair_shadow_fragment = {119734787, const std::vector render_hair_vertex = {119734787, 65536, 524289, -228, +232, 0, 131089, 1, @@ -794,11 +798,11 @@ const std::vector render_hair_vertex = {119734787, 1852399981, 0, 65, -164, -199, -206, -213, -227, +167, +202, +209, +216, +231, 196611, 2, 450, @@ -886,11 +890,11 @@ const std::vector render_hair_vertex = {119734787, 1684949368, 30821, 262149, -72, +73, 1735287124, 7630437, 524293, -73, +74, 1632132967, 1700164201, 2019914866, @@ -898,35 +902,35 @@ const std::vector render_hair_vertex = {119734787, 1937010277, 0, 262149, -79, +81, 1769234802, 111, 327685, -82, +84, 1936617283, 1953390964, 115, 393222, -82, +84, 0, 1466785639, 1684828783, 0, 393222, -82, +84, 1, 1450008423, 1350002025, 6975346, 458758, -82, +84, 2, 1231904615, 1767274094, 1917876069, 27247, 524294, -82, +84, 3, 1450008423, 1350002025, @@ -934,17 +938,17 @@ const std::vector render_hair_vertex = {119734787, 1952999273, 0, 327686, -82, +84, 4, 1165385575, 25977, 327686, -82, +84, 5, 1986420583, 7761734, 524294, -82, +84, 6, 1833000807, 1852139874, @@ -952,7 +956,7 @@ const std::vector render_hair_vertex = {119734787, 1866691688, 7499628, 524294, -82, +84, 7, 1867538279, 1282698857, @@ -960,34 +964,34 @@ const std::vector render_hair_vertex = {119734787, 1869377347, 114, 458758, -82, +84, 8, 1867538279, 1282698857, 1952999273, 7565136, 458758, -82, +84, 9, 1632460647, 1935753844, 1819231077, 29295, 393222, -82, +84, 10, 1632460647, 1633045364, 6649196, 458758, -82, +84, 11, 1766219623, 1098016098, 1634234476, 0, 524294, -82, +84, 12, 1632132967, 1750299241, @@ -995,80 +999,80 @@ const std::vector render_hair_vertex = {119734787, 1752198209, 97, 458758, -82, +84, 13, 1164074855, 1851879544, 2020167780, 7564389, 458758, -82, +84, 14, 1766219623, 1383228770, 1969841249, 115, 393222, -82, +84, 15, 1767333735, 2053722990, 101, 458758, -82, +84, 16, 1766219623, 1400005986, 1768120688, 26478, 393222, -82, +84, 17, 1415733095, 1416522088, 28777, 458758, -82, +84, 18, 1315331943, 1282564453, 1952999273, 0, 393222, -82, +84, 19, 1181114215, 1766617697, 7628903, 393222, -82, +84, 20, 1416191847, 1399350117, 77, 458758, -82, +84, 21, 1432510311, 1866687859, 1634887030, 25959, 458758, -82, +84, 22, 1399414631, 1851880052, 1886339940, 7562601, 458758, -82, +84, 23, 1298751335, 1917220961, 1701668705, 7566446, 524294, -82, +84, 24, 1818320743, 1415669872, @@ -1076,19 +1080,19 @@ const std::vector render_hair_vertex = {119734787, 1684828008, 0, 393222, -82, +84, 25, 1214668647, 1265789281, 12915, 393222, -82, +84, 26, 1214668647, 1165125985, 12920, 589830, -82, +84, 27, 1231904615, 1767274094, @@ -1097,10 +1101,10 @@ const std::vector render_hair_vertex = {119734787, 1869641573, 29810, 196613, -84, +86, 0, 524293, -92, +94, 1632132967, 1750364777, 1852531561, @@ -1108,66 +1112,66 @@ const std::vector render_hair_vertex = {119734787, 1717986671, 115, 262149, -103, +106, 1751607666, 116, 262149, -113, +116, 1634886000, 109, 327685, -115, +118, 1785688688, 1734963807, 29800, 262149, -126, +129, 1634886000, 109, 393221, -129, +132, 1634760805, 1766876270, 1936483704, 0, 327685, -140, +143, 1919501414, 1701080649, 120, 262149, -150, +153, 1886217588, 0, 393221, -162, +165, 1348430951, 1700164197, 2019914866, 0, 393222, -162, +165, 0, 1348430951, 1953067887, 7237481, 196613, -164, +167, 0, 262149, -199, +202, 1953523044, 104, 262149, -206, +209, 1735287156, 7630437, 262149, -213, +216, 829436016, 0, 327685, -227, +231, 1634890867, 1866687598, 7499628, @@ -1184,239 +1188,239 @@ const std::vector render_hair_vertex = {119734787, 11, 42, 262215, -73, +74, 34, 1, 262215, -73, +74, 33, 8, 262216, -82, +84, 0, 5, 327752, -82, +84, 0, 35, 0, 327752, -82, +84, 0, 7, 16, 262216, -82, +84, 1, 5, 327752, -82, +84, 1, 35, 64, 327752, -82, +84, 1, 7, 16, 262216, -82, +84, 2, 5, 327752, -82, +84, 2, 35, 128, 327752, -82, +84, 2, 7, 16, 262216, -82, +84, 3, 5, 327752, -82, +84, 3, 35, 192, 327752, -82, +84, 3, 7, 16, 327752, -82, +84, 4, 35, 256, 327752, -82, +84, 5, 35, 268, 327752, -82, +84, 6, 35, 272, 327752, -82, +84, 7, 35, 288, 327752, -82, +84, 8, 35, 304, 327752, -82, +84, 9, 35, 320, 327752, -82, +84, 10, 35, 336, 327752, -82, +84, 11, 35, 352, 327752, -82, +84, 12, 35, 356, 327752, -82, +84, 13, 35, 360, 327752, -82, +84, 14, 35, 364, 327752, -82, +84, 15, 35, 368, 327752, -82, +84, 16, 35, 384, 327752, -82, +84, 17, 35, 388, 327752, -82, +84, 18, 35, 392, 327752, -82, +84, 19, 35, 396, 327752, -82, +84, 20, 35, 400, 327752, -82, +84, 21, 35, 404, 327752, -82, +84, 22, 35, 408, 327752, -82, +84, 23, 35, 412, 327752, -82, +84, 24, 35, 416, 327752, -82, +84, 25, 35, 420, 327752, -82, +84, 26, 35, 424, 262216, -82, +84, 27, 5, 327752, -82, +84, 27, 35, 432, 327752, -82, +84, 27, 7, 16, 196679, -82, +84, 2, 262215, -84, +86, 34, 0, 262215, -84, +86, 33, 16, 262215, -92, +94, 34, 1, 262215, -92, +94, 33, 6, 327752, -162, +165, 0, 11, 0, 196679, -162, +165, 2, 262215, -199, +202, 30, 0, 262215, -206, +209, 30, 2, 262215, -213, +216, 30, 1, 262215, -227, +231, 30, 3, 131091, @@ -1513,35 +1517,35 @@ const std::vector render_hair_vertex = {119734787, 67, 2, 262167, -69, +70, 6, 4, 262203, 60, -73, +74, 0, 262168, -81, -69, +83, +70, 4, 1966110, -82, -81, -81, -81, -81, +84, +83, +83, +83, +83, 13, 6, -69, -69, -69, -69, -69, +70, +70, +70, +70, +70, 6, 6, 6, 6, -69, +70, 6, 6, 6, @@ -1553,125 +1557,125 @@ const std::vector render_hair_vertex = {119734787, 6, 6, 6, -81, -262176, 83, +262176, +85, 2, -82, -262203, -83, 84, +262203, +85, +86, 2, 262187, 63, -85, +87, 17, 262176, -86, +88, 2, 6, 262203, 60, -92, +94, 0, 262165, -97, +100, 32, 0, 262187, -97, -98, +100, +101, 0, 262187, 6, -101, +104, 1065353216, 262187, 63, -106, +109, 4, 262176, -107, +110, 2, 13, 262187, 63, -116, +119, 1, 262176, -117, +120, 2, -81, +83, 262187, 63, -131, +134, 13, 262187, 6, -138, +141, 1060487823, 262187, 6, -147, +150, 3212836864, 262187, 63, -157, +160, 14, 196638, -162, -69, +165, +70, 262176, -163, +166, 3, -162, +165, 262203, -163, -164, +166, +167, 3, 262187, 63, -165, +168, 0, 262176, -174, +177, 3, -69, +70, 262187, 63, -182, +185, 15, 262187, -97, -183, +100, +186, 1, 262187, -97, -192, +100, +195, 3, 262176, -193, +196, 3, 6, 262203, -193, -199, +196, +202, 3, 262187, -97, -200, +100, +203, 2, 262203, -174, -206, +177, +209, 3, 262203, -174, -213, +177, +216, 3, 262203, -174, -227, +177, +231, 3, 327734, 2, @@ -1686,51 +1690,51 @@ const std::vector render_hair_vertex = {119734787, 7, 262203, 14, -72, +73, 7, 262203, 19, -79, +81, 7, 262203, 19, -80, +82, 7, 262203, 14, -103, +106, 7, 262203, 14, -113, +116, 7, 262203, 8, -115, +118, 7, 262203, 8, -126, +129, 7, 262203, 19, -129, +132, 7, 262203, 19, -130, +133, 7, 262203, 19, -140, +143, 7, 262203, 19, -141, +144, 7, 262203, 14, -150, +153, 7, 262205, 59, @@ -1745,634 +1749,650 @@ const std::vector render_hair_vertex = {119734787, 68, 66, 67, -327775, +262244, +58, 69, -70, 62, +327775, +70, +71, +69, 68, 524367, 13, +72, +71, 71, -70, -70, 0, 1, 2, 196670, 57, -71, +72, 262205, 59, +75, 74, -73, 262205, 63, -75, +76, 65, 327815, 63, +77, 76, -75, 67, +262244, +58, +78, +75, 327775, -69, +70, +79, +78, 77, -74, -76, 524367, 13, -78, -77, -77, +80, +79, +79, 0, 1, 2, 196670, -72, -78, +73, +80, 327745, +88, +89, 86, 87, -84, -85, 262205, 6, -88, -87, +90, +89, 327866, 26, -89, -88, +91, +90, 35, 196855, -91, +93, 0, 262394, -89, -90, -100, +91, +92, +103, 131320, -90, +92, 262205, 59, -93, -92, +95, +94, 262205, 63, -94, +96, 65, 327815, 63, -95, -94, -67, -327775, -69, +97, 96, -93, +67, +262244, +58, +98, 95, +327775, +70, +99, +98, +97, 327761, 6, +102, 99, -96, 0, 196670, -80, -99, +82, +102, 131321, -91, +93, 131320, -100, +103, 196670, -80, -101, +82, +104, 131321, -91, +93, 131320, -91, +93, 262205, 6, -102, -80, +105, +82, 196670, -79, -102, +81, +105, 262205, 13, -104, -72, +107, +73, 262205, 13, -105, +108, 57, 327745, -107, -108, -84, -106, +110, +111, +86, +109, 262205, 13, -109, -108, +112, +111, 327811, 13, -110, -105, -109, +113, +108, +112, 393228, 13, -111, +114, 1, 69, -110, +113, 458764, 13, -112, +115, 1, 68, -104, -111, +107, +114, 196670, -113, -112, +116, +115, 327737, 13, -114, +117, 17, -113, +116, 196670, -103, -114, -327745, +106, 117, -118, -84, -116, -262205, -81, +327745, +120, +121, +86, 119, -118, +262205, +83, +122, +121, 262205, 13, -120, -103, +123, +106, 327761, 6, -121, -120, +124, +123, 0, 327761, 6, -122, -120, +125, +123, 1, 327761, 6, +126, 123, -120, 2, 458832, -69, +70, +127, 124, -121, -122, -123, +125, +126, 35, 327825, -69, -125, -119, -124, +70, +128, +122, +127, 458831, 7, -127, -125, -125, +130, +128, +128, 0, 1, 196670, -126, -127, +129, +130, 327737, 7, -128, +131, 11, -126, +129, 196670, -115, -128, +118, +131, 327745, +88, +135, 86, -132, -84, -131, +134, 262205, 6, -133, -132, +136, +135, 327864, 26, -134, -133, +137, +136, 35, 196855, -136, +139, 0, 262394, -134, -135, 137, +138, +140, 131320, -135, +138, 196670, -130, +133, 35, 131321, -136, +139, 131320, -137, +140, 196670, -130, -138, +133, +141, 131321, -136, +139, 131320, -136, +139, 262205, 6, -139, -130, +142, +133, 196670, -129, -139, +132, +142, 262205, 63, -142, +145, 65, 327819, 63, -143, -142, +146, +145, 67, 327850, 26, -144, -143, -116, -196855, +147, 146, +119, +196855, +149, 0, 262394, -144, -145, +147, 148, +151, 131320, -145, +148, 196670, -141, -147, +144, +150, 131321, -146, +149, 131320, -148, +151, 196670, -141, -101, +144, +104, 131321, -146, +149, 131320, -146, +149, 262205, 6, -149, -141, +152, +144, 196670, -140, -149, +143, +152, 262205, 13, -151, +154, 57, 262205, 6, -152, -140, +155, +143, 262205, 13, -153, -103, +156, +106, 327822, 13, -154, -153, -152, +157, +156, +155, 262205, 6, -155, -79, +158, +81, 327822, 13, -156, -154, -155, +159, +157, +158, 327745, +88, +161, 86, -158, -84, -157, +160, 262205, 6, -159, -158, +162, +161, 327822, 13, -160, -156, +163, 159, +162, 327809, 13, -161, -151, -160, +164, +154, +163, 196670, -150, -161, +153, +164, 327745, -117, -166, -84, -116, +120, +169, +86, +119, 262205, -81, -167, -166, +83, +170, +169, 262205, 13, -168, -150, +171, +153, 327761, 6, -169, -168, +172, +171, 0, 327761, 6, -170, -168, +173, +171, 1, 327761, 6, +174, 171, -168, 2, 458832, -69, +70, +175, 172, -169, -170, -171, -101, -327825, -69, 173, -167, -172, -327745, 174, +104, +327825, +70, +176, +170, 175, -164, -165, -196670, -175, -173, 327745, -174, -176, -164, -165, -262205, -69, 177, +178, +167, +168, +196670, +178, 176, +327745, +177, +179, +167, +168, +262205, +70, +180, +179, 262205, 6, -178, -140, +181, +143, 262205, 7, -179, -115, +182, +118, 262205, 6, -180, -129, +183, +132, 327822, 7, -181, -179, -180, -393281, -86, 184, -84, 182, 183, +393281, +88, +187, +86, +185, +186, 262205, 6, -185, -184, +188, +187, 327760, 7, -186, -185, -185, +189, +188, +188, 327816, 7, -187, -181, -186, +190, +184, +189, 327761, 6, -188, -187, +191, +190, 0, 327761, 6, -189, -187, +192, +190, 1, 458832, -69, -190, -188, -189, +70, +193, +191, +192, 35, 35, 327822, -69, -191, -190, -178, -393281, -193, +70, 194, -164, -165, -192, +193, +181, +393281, +196, +197, +167, +168, +195, 262205, 6, -195, -194, +198, +197, 327822, -69, -196, -191, -195, +70, +199, +194, +198, 327809, -69, -197, -177, -196, +70, +200, +180, +199, 327745, -174, -198, -164, -165, +177, +201, +167, +168, 196670, -198, -197, -393281, -193, 201, -164, -165, 200, -262205, -6, -202, -201, 393281, -193, +196, +204, +167, +168, 203, -164, -165, -192, 262205, 6, +205, 204, -203, +393281, +196, +206, +167, +168, +195, +262205, +6, +207, +206, 327816, 6, +208, 205, -202, -204, +207, 196670, -199, -205, +202, +208, 262205, 13, -207, -72, +210, +73, 262205, 6, -208, -79, +211, +81, 327761, 6, -209, -207, +212, +210, 0, 327761, 6, +213, 210, -207, 1, 327761, 6, -211, -207, +214, +210, 2, 458832, -69, +70, +215, 212, -209, -210, +213, +214, 211, -208, 196670, -206, -212, +209, +215, 262205, 13, -214, +217, 57, 458831, 7, -215, -214, -214, +218, +217, +217, 0, 1, 262205, 59, -216, +219, 61, 262205, 63, -217, +220, 65, 327815, 63, -218, -217, +221, +220, 67, 327808, 63, +222, +221, +119, +262244, +58, +223, 219, -218, -116, 327775, -69, -220, -216, -219, +70, +224, +223, +222, 458831, 7, -221, -220, -220, +225, +224, +224, 0, 1, 327761, 6, -222, -215, +226, +218, 0, 327761, 6, -223, -215, +227, +218, 1, 327761, 6, -224, -221, +228, +225, 0, 327761, 6, +229, 225, -221, 1, 458832, -69, +70, +230, 226, -222, -223, -224, -225, +227, +228, +229, 196670, -213, -226, +216, +230, 65789, 65592, 327734, @@ -2556,7 +2576,7 @@ const std::vector render_hair_vertex = {119734787, const std::vector render_hair_aa_vertex = {119734787, 65536, 524289, -252, +255, 0, 131089, 1, @@ -2577,11 +2597,11 @@ const std::vector render_hair_aa_vertex = {119734787, 1852399981, 0, 65, -201, -230, -234, -241, -251, +204, +233, +237, +244, +254, 196611, 2, 450, @@ -2669,11 +2689,11 @@ const std::vector render_hair_aa_vertex = {119734787, 1684949368, 30821, 262149, -72, +73, 1735287124, 7630437, 524293, -73, +74, 1632132967, 1700164201, 2019914866, @@ -2681,35 +2701,35 @@ const std::vector render_hair_aa_vertex = {119734787, 1937010277, 0, 262149, -79, +81, 1769234802, 111, 327685, -82, +84, 1936617283, 1953390964, 115, 393222, -82, +84, 0, 1466785639, 1684828783, 0, 393222, -82, +84, 1, 1450008423, 1350002025, 6975346, 458758, -82, +84, 2, 1231904615, 1767274094, 1917876069, 27247, 524294, -82, +84, 3, 1450008423, 1350002025, @@ -2717,17 +2737,17 @@ const std::vector render_hair_aa_vertex = {119734787, 1952999273, 0, 327686, -82, +84, 4, 1165385575, 25977, 327686, -82, +84, 5, 1986420583, 7761734, 524294, -82, +84, 6, 1833000807, 1852139874, @@ -2735,7 +2755,7 @@ const std::vector render_hair_aa_vertex = {119734787, 1866691688, 7499628, 524294, -82, +84, 7, 1867538279, 1282698857, @@ -2743,34 +2763,34 @@ const std::vector render_hair_aa_vertex = {119734787, 1869377347, 114, 458758, -82, +84, 8, 1867538279, 1282698857, 1952999273, 7565136, 458758, -82, +84, 9, 1632460647, 1935753844, 1819231077, 29295, 393222, -82, +84, 10, 1632460647, 1633045364, 6649196, 458758, -82, +84, 11, 1766219623, 1098016098, 1634234476, 0, 524294, -82, +84, 12, 1632132967, 1750299241, @@ -2778,80 +2798,80 @@ const std::vector render_hair_aa_vertex = {119734787, 1752198209, 97, 458758, -82, +84, 13, 1164074855, 1851879544, 2020167780, 7564389, 458758, -82, +84, 14, 1766219623, 1383228770, 1969841249, 115, 393222, -82, +84, 15, 1767333735, 2053722990, 101, 458758, -82, +84, 16, 1766219623, 1400005986, 1768120688, 26478, 393222, -82, +84, 17, 1415733095, 1416522088, 28777, 458758, -82, +84, 18, 1315331943, 1282564453, 1952999273, 0, 393222, -82, +84, 19, 1181114215, 1766617697, 7628903, 393222, -82, +84, 20, 1416191847, 1399350117, 77, 458758, -82, +84, 21, 1432510311, 1866687859, 1634887030, 25959, 458758, -82, +84, 22, 1399414631, 1851880052, 1886339940, 7562601, 458758, -82, +84, 23, 1298751335, 1917220961, 1701668705, 7566446, 524294, -82, +84, 24, 1818320743, 1415669872, @@ -2859,19 +2879,19 @@ const std::vector render_hair_aa_vertex = {119734787, 1684828008, 0, 393222, -82, +84, 25, 1214668647, 1265789281, 12915, 393222, -82, +84, 26, 1214668647, 1165125985, 12920, 589830, -82, +84, 27, 1231904615, 1767274094, @@ -2880,10 +2900,10 @@ const std::vector render_hair_aa_vertex = {119734787, 1869641573, 29810, 196613, -84, +86, 0, 524293, -92, +94, 1632132967, 1750364777, 1852531561, @@ -2891,76 +2911,76 @@ const std::vector render_hair_aa_vertex = {119734787, 1717986671, 115, 262149, -103, +106, 1751607666, 116, 262149, -113, +116, 1634886000, 109, 327685, -115, +118, 1785688688, 1734963807, 29800, 262149, -126, +129, 1634886000, 109, 458757, -130, +133, 1919508840, 1701274693, 1769172816, 1852795252, 12403, 458757, -145, +148, 1919508840, 1701274693, 1769172816, 1852795252, 12659, 393221, -178, +181, 1634760805, 1766876270, 1936483704, 0, 327685, -189, +192, 1919501414, 1701080649, 120, 393221, -199, +202, 1348430951, 1700164197, 2019914866, 0, 393222, -199, +202, 0, 1348430951, 1953067887, 7237481, 196613, -201, +204, 0, 262149, -230, +233, 1953523044, 104, 262149, -234, +237, 1735287156, 7630437, 262149, -241, +244, 829436016, 0, 327685, -251, +254, 1634890867, 1866687598, 7499628, @@ -2977,239 +2997,239 @@ const std::vector render_hair_aa_vertex = {119734787, 11, 42, 262215, -73, +74, 34, 1, 262215, -73, +74, 33, 8, 262216, -82, +84, 0, 5, 327752, -82, +84, 0, 35, 0, 327752, -82, +84, 0, 7, 16, 262216, -82, +84, 1, 5, 327752, -82, +84, 1, 35, 64, 327752, -82, +84, 1, 7, 16, 262216, -82, +84, 2, 5, 327752, -82, +84, 2, 35, 128, 327752, -82, +84, 2, 7, 16, 262216, -82, +84, 3, 5, 327752, -82, +84, 3, 35, 192, 327752, -82, +84, 3, 7, 16, 327752, -82, +84, 4, 35, 256, 327752, -82, +84, 5, 35, 268, 327752, -82, +84, 6, 35, 272, 327752, -82, +84, 7, 35, 288, 327752, -82, +84, 8, 35, 304, 327752, -82, +84, 9, 35, 320, 327752, -82, +84, 10, 35, 336, 327752, -82, +84, 11, 35, 352, 327752, -82, +84, 12, 35, 356, 327752, -82, +84, 13, 35, 360, 327752, -82, +84, 14, 35, 364, 327752, -82, +84, 15, 35, 368, 327752, -82, +84, 16, 35, 384, 327752, -82, +84, 17, 35, 388, 327752, -82, +84, 18, 35, 392, 327752, -82, +84, 19, 35, 396, 327752, -82, +84, 20, 35, 400, 327752, -82, +84, 21, 35, 404, 327752, -82, +84, 22, 35, 408, 327752, -82, +84, 23, 35, 412, 327752, -82, +84, 24, 35, 416, 327752, -82, +84, 25, 35, 420, 327752, -82, +84, 26, 35, 424, 262216, -82, +84, 27, 5, 327752, -82, +84, 27, 35, 432, 327752, -82, +84, 27, 7, 16, 196679, -82, +84, 2, 262215, -84, +86, 34, 0, 262215, -84, +86, 33, 16, 262215, -92, +94, 34, 1, 262215, -92, +94, 33, 6, 327752, -199, +202, 0, 11, 0, 196679, -199, +202, 2, 262215, -230, +233, 30, 0, 262215, -234, +237, 30, 2, 262215, -241, +244, 30, 1, 262215, -251, +254, 30, 3, 131091, @@ -3306,35 +3326,35 @@ const std::vector render_hair_aa_vertex = {119734787, 67, 2, 262167, -69, +70, 6, 4, 262203, 60, -73, +74, 0, 262168, -81, -69, +83, +70, 4, 1966110, -82, -81, -81, -81, -81, +84, +83, +83, +83, +83, 13, 6, -69, -69, -69, -69, -69, +70, +70, +70, +70, +70, 6, 6, 6, 6, -69, +70, 6, 6, 6, @@ -3346,129 +3366,129 @@ const std::vector render_hair_aa_vertex = {119734787, 6, 6, 6, -81, -262176, 83, +262176, +85, 2, -82, -262203, -83, 84, +262203, +85, +86, 2, 262187, 63, -85, +87, 17, 262176, -86, +88, 2, 6, 262203, 60, -92, +94, 0, 262165, -97, +100, 32, 0, 262187, -97, -98, +100, +101, 0, 262187, 6, -101, +104, 1065353216, 262187, 63, -106, +109, 4, 262176, -107, +110, 2, 13, 262187, 63, -116, +119, 1, 262176, -117, +120, 2, -81, +83, 262176, -129, +132, 7, -69, +70, 262187, 63, -136, +139, 14, 262187, -97, -168, +100, +171, 3, 262187, 63, -180, +183, 13, 262187, 6, -187, +190, 1060487823, 262187, 6, -196, +199, 3212836864, 196638, -199, -69, +202, +70, 262176, -200, +203, 3, -199, +202, 262203, -200, -201, +203, +204, 3, 262187, 63, -202, +205, 0, 262187, 63, -216, +219, 15, 262187, -97, -217, +100, +220, 1, 262176, -227, +230, 3, -69, +70, 262176, -229, +232, 3, 6, 262203, -229, -230, +232, +233, 3, 262187, -97, -231, +100, +234, 2, 262203, -227, -234, +230, +237, 3, 262203, -227, -241, +230, +244, 3, 262203, -227, -251, +230, +254, 3, 327734, 2, @@ -3483,59 +3503,59 @@ const std::vector render_hair_aa_vertex = {119734787, 7, 262203, 14, -72, +73, 7, 262203, 19, -79, +81, 7, 262203, 19, -80, +82, 7, 262203, 14, -103, +106, 7, 262203, 14, -113, +116, 7, 262203, 8, -115, +118, 7, 262203, 8, -126, +129, 7, 262203, -129, -130, +132, +133, 7, 262203, -129, -145, +132, +148, 7, 262203, 19, -178, +181, 7, 262203, 19, -179, +182, 7, 262203, 19, -189, +192, 7, 262203, 19, -190, +193, 7, 262203, -129, -203, +132, +206, 7, 262205, 59, @@ -3550,754 +3570,766 @@ const std::vector render_hair_aa_vertex = {119734787, 68, 66, 67, -327775, +262244, +58, 69, -70, 62, +327775, +70, +71, +69, 68, 524367, 13, +72, +71, 71, -70, -70, 0, 1, 2, 196670, 57, -71, +72, 262205, 59, +75, 74, -73, 262205, 63, -75, +76, 65, 327815, 63, +77, 76, -75, 67, +262244, +58, +78, +75, 327775, -69, +70, +79, +78, 77, -74, -76, 524367, 13, -78, -77, -77, +80, +79, +79, 0, 1, 2, 196670, -72, -78, +73, +80, 327745, +88, +89, 86, 87, -84, -85, 262205, 6, -88, -87, +90, +89, 327866, 26, -89, -88, +91, +90, 35, 196855, -91, +93, 0, 262394, -89, -90, -100, +91, +92, +103, 131320, -90, +92, 262205, 59, -93, -92, +95, +94, 262205, 63, -94, +96, 65, 327815, 63, -95, -94, -67, -327775, -69, +97, 96, -93, +67, +262244, +58, +98, 95, +327775, +70, +99, +98, +97, 327761, 6, +102, 99, -96, 0, 196670, -80, -99, +82, +102, 131321, -91, +93, 131320, -100, +103, 196670, -80, -101, +82, +104, 131321, -91, +93, 131320, -91, +93, 262205, 6, -102, -80, +105, +82, 196670, -79, -102, +81, +105, 262205, 13, -104, -72, +107, +73, 262205, 13, -105, +108, 57, 327745, -107, -108, -84, -106, +110, +111, +86, +109, 262205, 13, -109, -108, +112, +111, 327811, 13, -110, -105, -109, +113, +108, +112, 393228, 13, -111, +114, 1, 69, -110, +113, 458764, 13, -112, +115, 1, 68, -104, -111, +107, +114, 196670, -113, -112, +116, +115, 327737, 13, -114, +117, 17, -113, +116, 196670, -103, -114, -327745, +106, 117, -118, -84, -116, -262205, -81, +327745, +120, +121, +86, 119, -118, +262205, +83, +122, +121, 262205, 13, -120, -103, +123, +106, 327761, 6, -121, -120, +124, +123, 0, 327761, 6, -122, -120, +125, +123, 1, 327761, 6, +126, 123, -120, 2, 458832, -69, +70, +127, 124, -121, -122, -123, +125, +126, 35, 327825, -69, -125, -119, -124, +70, +128, +122, +127, 458831, 7, -127, -125, -125, +130, +128, +128, 0, 1, 196670, -126, -127, +129, +130, 327737, 7, -128, +131, 11, -126, +129, 196670, -115, -128, +118, +131, 262205, 13, -131, +134, 57, 262205, 13, -132, -103, +135, +106, 327822, 13, -133, -132, -101, +136, +135, +104, 262205, 6, -134, -79, +137, +81, 327822, 13, -135, -133, -134, +138, +136, +137, 327745, +88, +140, 86, -137, -84, -136, +139, 262205, 6, -138, -137, +141, +140, 327822, 13, -139, -135, +142, 138, +141, 327811, 13, -140, -131, -139, +143, +134, +142, 327761, 6, -141, -140, +144, +143, 0, 327761, 6, -142, -140, +145, +143, 1, 327761, 6, +146, 143, -140, 2, 458832, -69, +70, +147, 144, -141, -142, -143, -101, +145, +146, +104, 196670, -130, -144, +133, +147, 262205, 13, -146, +149, 57, 262205, 13, -147, -103, +150, +106, 327822, 13, -148, -147, -101, +151, +150, +104, 262205, 6, -149, -79, +152, +81, 327822, 13, -150, -148, -149, +153, +151, +152, 327745, +88, +154, 86, -151, -84, -136, +139, 262205, 6, -152, -151, +155, +154, 327822, 13, +156, 153, -150, -152, +155, 327809, 13, -154, -146, -153, +157, +149, +156, 327761, 6, -155, -154, +158, +157, 0, 327761, 6, -156, -154, +159, +157, 1, 327761, 6, +160, 157, -154, 2, 458832, -69, -158, -155, -156, -157, -101, -196670, -145, +70, +161, 158, -327745, -117, -159, -84, -116, -262205, -81, -160, 159, -262205, -69, -161, -130, -327825, -69, -162, 160, -161, +104, 196670, -130, -162, +148, +161, 327745, -117, -163, -84, -116, +120, +162, +86, +119, 262205, -81, -164, +83, 163, +162, 262205, -69, -165, -145, -327825, -69, -166, +70, 164, +133, +327825, +70, 165, +163, +164, 196670, -145, +133, +165, +327745, +120, 166, +86, +119, 262205, -69, +83, 167, -130, -327745, -19, +166, +262205, +70, +168, +148, +327825, +70, 169, -130, +167, 168, -262205, -6, -170, +196670, +148, 169, -458832, -69, -171, -170, -170, -170, +262205, +70, 170, -327816, -69, +133, +327745, +19, 172, -167, +133, 171, -196670, -130, -172, 262205, -69, +6, 173, -145, +172, +458832, +70, +174, +173, +173, +173, +173, +327816, +70, +175, +170, +174, +196670, +133, +175, +262205, +70, +176, +148, 327745, 19, -174, -145, -168, +177, +148, +171, 262205, 6, -175, -174, +178, +177, 458832, -69, -176, -175, -175, -175, -175, +70, +179, +178, +178, +178, +178, 327816, -69, -177, -173, +70, +180, 176, +179, 196670, -145, -177, +148, +180, 327745, +88, +184, 86, -181, -84, -180, +183, 262205, 6, -182, -181, +185, +184, 327864, 26, -183, -182, +186, +185, 35, 196855, -185, +188, 0, 262394, -183, -184, 186, +187, +189, 131320, -184, +187, 196670, -179, +182, 35, 131321, -185, +188, 131320, -186, +189, 196670, -179, -187, +182, +190, 131321, -185, +188, 131320, -185, +188, 262205, 6, -188, -179, +191, +182, 196670, -178, -188, +181, +191, 262205, 63, -191, +194, 65, 327819, 63, -192, -191, +195, +194, 67, 327850, 26, -193, -192, -116, -196855, +196, 195, +119, +196855, +198, 0, 262394, -193, -194, +196, 197, +200, 131320, -194, +197, 196670, -190, -196, +193, +199, 131321, -195, +198, 131320, -197, +200, 196670, -190, -101, +193, +104, 131321, -195, +198, 131320, -195, +198, 262205, 6, -198, -190, +201, +193, 196670, -189, -198, +192, +201, 262205, 6, -204, -189, +207, +192, 327860, 26, -205, -204, -196, -196855, +208, 207, +199, +196855, +210, 0, 262394, -205, -206, +208, 209, +212, 131320, -206, +209, 262205, -69, -208, -130, +70, +211, +133, 196670, -203, -208, +206, +211, 131321, -207, +210, 131320, -209, +212, 262205, -69, -210, -145, +70, +213, +148, 196670, -203, -210, +206, +213, 131321, -207, +210, 131320, -207, +210, 262205, -69, -211, -203, +70, +214, +206, 262205, 6, -212, -189, +215, +192, 262205, 7, -213, -115, +216, +118, 262205, 6, -214, -178, +217, +181, 327822, 7, -215, -213, -214, -393281, -86, 218, -84, 216, 217, +393281, +88, +221, +86, +219, +220, 262205, 6, -219, -218, +222, +221, 327760, 7, -220, -219, -219, +223, +222, +222, 327816, 7, -221, -215, -220, +224, +218, +223, 327761, 6, -222, -221, +225, +224, 0, 327761, 6, -223, -221, +226, +224, 1, 458832, -69, -224, -222, -223, +70, +227, +225, +226, 35, 35, 327822, -69, -225, -224, -212, -327809, -69, -226, -211, -225, -327745, +70, +228, 227, +215, +327809, +70, +229, +214, 228, -201, -202, +327745, +230, +231, +204, +205, 196670, -228, -226, -393281, +231, 229, +393281, 232, -201, -202, -231, +235, +204, +205, +234, 262205, 6, -233, -232, +236, +235, 196670, -230, 233, +236, 262205, 13, -235, -72, +238, +73, 262205, 6, -236, -79, +239, +81, 327761, 6, -237, -235, +240, +238, 0, 327761, 6, +241, 238, -235, 1, 327761, 6, -239, -235, +242, +238, 2, 458832, -69, +70, +243, 240, -237, -238, +241, +242, 239, -236, 196670, -234, -240, +237, +243, 262205, -69, -242, -130, +70, +245, +133, 458831, 7, -243, -242, -242, +246, +245, +245, 0, 1, 262205, -69, -244, -145, +70, +247, +148, 458831, 7, -245, -244, -244, +248, +247, +247, 0, 1, 327761, 6, +249, 246, -243, 0, 327761, 6, -247, -243, +250, +246, 1, 327761, 6, +251, 248, -245, 0, 327761, 6, -249, -245, +252, +248, 1, 458832, -69, -250, -246, -247, -248, +70, +253, 249, -196670, -241, 250, +251, +252, +196670, +244, +253, 65789, 65592, 327734, @@ -4481,7 +4513,7 @@ const std::vector render_hair_aa_vertex = {119734787, const std::vector render_hair_strand_copies_vertex = {119734787, 65536, 524289, -285, +289, 0, 131089, 1, @@ -4503,11 +4535,11 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 0, 61, 66, -218, -253, -260, -267, -284, +221, +256, +263, +270, +288, 196611, 2, 450, @@ -4640,10 +4672,10 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 1937010277, 0, 196613, -127, +128, 118, 524293, -129, +130, 1632132967, 1700164201, 2019914866, @@ -4651,35 +4683,35 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 1852795252, 115, 262149, -136, +138, 1769234802, 111, 327685, -139, +141, 1936617283, 1953390964, 115, 393222, -139, +141, 0, 1466785639, 1684828783, 0, 393222, -139, +141, 1, 1450008423, 1350002025, 6975346, 458758, -139, +141, 2, 1231904615, 1767274094, 1917876069, 27247, 524294, -139, +141, 3, 1450008423, 1350002025, @@ -4687,17 +4719,17 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 1952999273, 0, 327686, -139, +141, 4, 1165385575, 25977, 327686, -139, +141, 5, 1986420583, 7761734, 524294, -139, +141, 6, 1833000807, 1852139874, @@ -4705,7 +4737,7 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 1866691688, 7499628, 524294, -139, +141, 7, 1867538279, 1282698857, @@ -4713,34 +4745,34 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 1869377347, 114, 458758, -139, +141, 8, 1867538279, 1282698857, 1952999273, 7565136, 458758, -139, +141, 9, 1632460647, 1935753844, 1819231077, 29295, 393222, -139, +141, 10, 1632460647, 1633045364, 6649196, 458758, -139, +141, 11, 1766219623, 1098016098, 1634234476, 0, 524294, -139, +141, 12, 1632132967, 1750299241, @@ -4748,80 +4780,80 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 1752198209, 97, 458758, -139, +141, 13, 1164074855, 1851879544, 2020167780, 7564389, 458758, -139, +141, 14, 1766219623, 1383228770, 1969841249, 115, 393222, -139, +141, 15, 1767333735, 2053722990, 101, 458758, -139, +141, 16, 1766219623, 1400005986, 1768120688, 26478, 393222, -139, +141, 17, 1415733095, 1416522088, 28777, 458758, -139, +141, 18, 1315331943, 1282564453, 1952999273, 0, 393222, -139, +141, 19, 1181114215, 1766617697, 7628903, 393222, -139, +141, 20, 1416191847, 1399350117, 77, 458758, -139, +141, 21, 1432510311, 1866687859, 1634887030, 25959, 458758, -139, +141, 22, 1399414631, 1851880052, 1886339940, 7562601, 458758, -139, +141, 23, 1298751335, 1917220961, 1701668705, 7566446, 524294, -139, +141, 24, 1818320743, 1415669872, @@ -4829,19 +4861,19 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 1684828008, 0, 393222, -139, +141, 25, 1214668647, 1265789281, 12915, 393222, -139, +141, 26, 1214668647, 1165125985, 12920, 589830, -139, +141, 27, 1231904615, 1767274094, @@ -4850,10 +4882,10 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 1869641573, 29810, 196613, -141, +143, 0, 524293, -149, +151, 1632132967, 1750364777, 1852531561, @@ -4861,66 +4893,66 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 1717986671, 115, 262149, -158, +161, 1751607666, 116, 262149, -168, +171, 1634886000, 109, 327685, -170, +173, 1785688688, 1734963807, 29800, 262149, -180, +183, 1634886000, 109, 393221, -183, +186, 1634760805, 1766876270, 1936483704, 0, 327685, -194, +197, 1919501414, 1701080649, 120, 262149, -204, +207, 1886217588, 0, 393221, -216, +219, 1348430951, 1700164197, 2019914866, 0, 393222, -216, +219, 0, 1348430951, 1953067887, 7237481, 196613, -218, +221, 0, 262149, -253, +256, 1953523044, 104, 262149, -260, +263, 1735287156, 7630437, 262149, -267, +270, 829436016, 0, 327685, -284, +288, 1634890867, 1866687598, 7499628, @@ -4957,239 +4989,239 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 33, 8, 262215, -129, +130, 34, 1, 262215, -129, +130, 33, 7, 262216, -139, +141, 0, 5, 327752, -139, +141, 0, 35, 0, 327752, -139, +141, 0, 7, 16, 262216, -139, +141, 1, 5, 327752, -139, +141, 1, 35, 64, 327752, -139, +141, 1, 7, 16, 262216, -139, +141, 2, 5, 327752, -139, +141, 2, 35, 128, 327752, -139, +141, 2, 7, 16, 262216, -139, +141, 3, 5, 327752, -139, +141, 3, 35, 192, 327752, -139, +141, 3, 7, 16, 327752, -139, +141, 4, 35, 256, 327752, -139, +141, 5, 35, 268, 327752, -139, +141, 6, 35, 272, 327752, -139, +141, 7, 35, 288, 327752, -139, +141, 8, 35, 304, 327752, -139, +141, 9, 35, 320, 327752, -139, +141, 10, 35, 336, 327752, -139, +141, 11, 35, 352, 327752, -139, +141, 12, 35, 356, 327752, -139, +141, 13, 35, 360, 327752, -139, +141, 14, 35, 364, 327752, -139, +141, 15, 35, 368, 327752, -139, +141, 16, 35, 384, 327752, -139, +141, 17, 35, 388, 327752, -139, +141, 18, 35, 392, 327752, -139, +141, 19, 35, 396, 327752, -139, +141, 20, 35, 400, 327752, -139, +141, 21, 35, 404, 327752, -139, +141, 22, 35, 408, 327752, -139, +141, 23, 35, 412, 327752, -139, +141, 24, 35, 416, 327752, -139, +141, 25, 35, 420, 327752, -139, +141, 26, 35, 424, 262216, -139, +141, 27, 5, 327752, -139, +141, 27, 35, 432, 327752, -139, +141, 27, 7, 16, 196679, -139, +141, 2, 262215, -141, +143, 34, 0, 262215, -141, +143, 33, 16, 262215, -149, +151, 34, 1, 262215, -149, +151, 33, 6, 327752, -216, +219, 0, 11, 0, 196679, -216, +219, 2, 262215, -253, +256, 30, 0, 262215, -260, +263, 30, 2, 262215, -267, +270, 30, 1, 262215, -284, +288, 30, 3, 131091, @@ -5365,18 +5397,18 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 0, 262203, 120, -129, +130, 0, 262168, -138, +140, 107, 4, 1966110, -139, -138, -138, -138, -138, +141, +140, +140, +140, +140, 13, 6, 107, @@ -5400,113 +5432,113 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 6, 6, 6, -138, -262176, 140, +262176, +142, 2, -139, -262203, -140, 141, +262203, +142, +143, 2, 262187, 57, -142, +144, 17, 262176, -143, +145, 2, 6, 262203, 120, -149, +151, 0, 262187, 68, -154, +157, 0, 262187, 57, -161, +164, 4, 262176, -162, +165, 2, 13, 262176, -171, +174, 2, -138, +140, 262187, 57, -185, +188, 13, 262187, 6, -192, +195, 1060487823, 262187, 6, -201, +204, 3212836864, 262187, 57, -211, +214, 14, 196638, -216, +219, 107, 262176, -217, +220, 3, -216, +219, 262203, -217, -218, +220, +221, 3, 262187, 57, -219, +222, 0, 262176, -228, +231, 3, 107, 262187, 57, -236, +239, 15, 262187, 68, -237, +240, 1, 262187, 68, -246, +249, 3, 262176, -247, +250, 3, 6, 262203, -247, -253, +250, +256, 3, 262187, 68, -254, +257, 2, 262203, -228, -260, +231, +263, 3, 262203, -228, -267, +231, +270, 3, 262203, -228, -284, +231, +288, 3, 327734, 2, @@ -5541,51 +5573,51 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 7, 262203, 14, -127, +128, 7, 262203, 19, -136, +138, 7, 262203, 19, -137, +139, 7, 262203, 14, -158, +161, 7, 262203, 14, -168, +171, 7, 262203, 8, -170, +173, 7, 262203, 8, -180, +183, 7, 262203, 19, -183, +186, 7, 262203, 19, -184, +187, 7, 262203, 19, -194, +197, 7, 262203, 19, -195, +198, 7, 262203, 14, -204, +207, 7, 262205, 57, @@ -5769,659 +5801,675 @@ const std::vector render_hair_strand_copies_vertex = {119734787, 124, 123, 63, +262244, +118, +125, +122, 327775, 107, +126, 125, -122, 124, 524367, 13, +127, +126, 126, -125, -125, 0, 1, 2, 196670, 117, -126, +127, 262205, 13, -128, +129, 93, 262205, 119, +131, 130, -129, 262205, 57, -131, +132, 61, 327815, 57, +133, 132, -131, 63, +262244, +118, +134, +131, 327775, 107, +135, +134, 133, -130, -132, 524367, 13, -134, -133, -133, +136, +135, +135, 0, 1, 2, 327809, 13, -135, -128, -134, +137, +129, +136, 196670, -127, -135, +128, +137, 327745, +145, +146, 143, 144, -141, -142, 262205, 6, -145, -144, +147, +146, 327866, 26, -146, -145, +148, +147, 35, 196855, -148, +150, 0, 262394, -146, -147, -156, +148, +149, +159, 131320, -147, +149, 262205, 119, -150, -149, +152, +151, 262205, 57, -151, +153, 61, 327815, 57, -152, -151, +154, +153, 63, +262244, +118, +155, +152, 327775, 107, -153, -150, -152, +156, +155, +154, 327761, 6, -155, -153, +158, +156, 0, 196670, -137, -155, +139, +158, 131321, -148, +150, 131320, -156, +159, 196670, -137, +139, 114, 131321, -148, +150, 131320, -148, +150, 262205, 6, -157, -137, +160, +139, 196670, -136, -157, +138, +160, 262205, 13, -159, +162, 117, 262205, 13, -160, -127, -327745, -162, 163, -141, -161, +128, +327745, +165, +166, +143, +164, 262205, 13, -164, -163, +167, +166, 327811, 13, -165, -160, -164, +168, +163, +167, 393228, 13, -166, +169, 1, 69, -165, +168, 458764, 13, -167, +170, 1, 68, -159, -166, +162, +169, 196670, -168, -167, +171, +170, 327737, 13, -169, +172, 17, -168, -196670, -158, -169, -327745, 171, +196670, +161, 172, -141, +327745, +174, +175, +143, 74, 262205, -138, -173, -172, +140, +176, +175, 262205, 13, -174, -158, +177, +161, 327761, 6, -175, -174, +178, +177, 0, 327761, 6, -176, -174, +179, +177, 1, 327761, 6, +180, 177, -174, 2, 458832, 107, +181, 178, -175, -176, -177, +179, +180, 35, 327825, 107, -179, -173, -178, +182, +176, +181, 458831, 7, -181, -179, -179, +184, +182, +182, 0, 1, 196670, -180, -181, +183, +184, 327737, 7, -182, +185, 11, -180, +183, 196670, -170, -182, +173, +185, 327745, +145, +189, 143, -186, -141, -185, +188, 262205, 6, -187, -186, +190, +189, 327864, 26, -188, -187, +191, +190, 35, 196855, -190, +193, 0, 262394, -188, -189, 191, +192, +194, 131320, -189, +192, 196670, -184, +187, 35, 131321, -190, +193, 131320, -191, +194, 196670, -184, -192, +187, +195, 131321, -190, +193, 131320, -190, +193, 262205, 6, -193, -184, +196, +187, 196670, -183, -193, +186, +196, 262205, 57, -196, +199, 61, 327819, 57, -197, -196, +200, +199, 63, 327850, 26, -198, -197, +201, +200, 74, 196855, -200, +203, 0, 262394, -198, -199, +201, 202, +205, 131320, -199, +202, 196670, -195, -201, +198, +204, 131321, -200, +203, 131320, -202, +205, 196670, -195, +198, 114, 131321, -200, +203, 131320, -200, +203, 262205, 6, -203, -195, +206, +198, 196670, -194, -203, +197, +206, 262205, 13, -205, -127, -262205, +208, +128, +262205, 6, -206, -194, +209, +197, 262205, 13, -207, -158, +210, +161, 327822, 13, -208, -207, -206, +211, +210, +209, 262205, 6, -209, -136, +212, +138, 327822, 13, -210, -208, -209, +213, +211, +212, 327745, +145, +215, 143, -212, -141, -211, +214, 262205, 6, -213, -212, +216, +215, 327822, 13, -214, -210, +217, 213, +216, 327809, 13, -215, -205, -214, +218, +208, +217, 196670, -204, -215, +207, +218, 327745, -171, -220, -141, +174, +223, +143, 74, 262205, -138, -221, -220, +140, +224, +223, 262205, 13, -222, -204, +225, +207, 327761, 6, -223, -222, +226, +225, 0, 327761, 6, -224, -222, +227, +225, 1, 327761, 6, +228, 225, -222, 2, 458832, 107, +229, 226, -223, -224, -225, +227, +228, 114, 327825, 107, -227, -221, -226, -327745, -228, -229, -218, -219, -196670, +230, +224, 229, -227, 327745, -228, +231, +232, +221, +222, +196670, +232, 230, -218, -219, +327745, +231, +233, +221, +222, 262205, 107, -231, -230, +234, +233, 262205, 6, -232, -194, +235, +197, 262205, 7, -233, -170, +236, +173, 262205, 6, -234, -183, +237, +186, 327822, 7, -235, -233, -234, -393281, -143, 238, -141, 236, 237, +393281, +145, +241, +143, +239, +240, 262205, 6, -239, -238, +242, +241, 327760, 7, -240, -239, -239, +243, +242, +242, 327816, 7, -241, -235, -240, +244, +238, +243, 327761, 6, -242, -241, +245, +244, 0, 327761, 6, -243, -241, +246, +244, 1, 458832, 107, -244, -242, -243, +247, +245, +246, 35, 35, 327822, 107, -245, -244, -232, -393281, -247, 248, -218, -219, -246, +247, +235, +393281, +250, +251, +221, +222, +249, 262205, 6, -249, -248, +252, +251, 327822, 107, -250, -245, -249, +253, +248, +252, 327809, 107, -251, -231, -250, +254, +234, +253, 327745, -228, -252, -218, -219, +231, +255, +221, +222, 196670, -252, -251, -393281, -247, 255, -218, -219, 254, -262205, -6, -256, -255, 393281, -247, +250, +258, +221, +222, 257, -218, -219, -246, 262205, 6, +259, 258, -257, +393281, +250, +260, +221, +222, +249, +262205, +6, +261, +260, 327816, 6, +262, 259, -256, -258, +261, 196670, -253, -259, +256, +262, 262205, 13, -261, +264, 117, 262205, 6, -262, -136, +265, +138, 327761, 6, -263, -261, +266, +264, 0, 327761, 6, +267, 264, -261, 1, 327761, 6, -265, -261, +268, +264, 2, 458832, 107, +269, 266, -263, -264, +267, +268, 265, -262, 196670, -260, -266, +263, +269, 262205, 13, -268, -127, +271, +128, 458831, 7, -269, -268, -268, +272, +271, +271, 0, 1, 262205, 13, -270, +273, 93, 458831, 7, -271, -270, -270, +274, +273, +273, 0, 1, 262205, 119, -272, -129, +275, +130, 262205, 57, -273, +276, 61, 327815, 57, -274, -273, +277, +276, 63, 327808, 57, -275, -274, +278, +277, 74, +262244, +118, +279, +275, 327775, 107, -276, -272, -275, +280, +279, +278, 458831, 7, -277, -276, -276, +281, +280, +280, 0, 1, 327809, 7, -278, -271, -277, +282, +274, +281, 327761, 6, -279, -269, +283, +272, 0, 327761, 6, -280, -269, +284, +272, 1, 327761, 6, -281, -278, +285, +282, 0, 327761, 6, +286, 282, -278, 1, 458832, 107, +287, 283, -279, -280, -281, -282, +284, +285, +286, 196670, -267, -283, +270, +287, 65789, 65592, 327734, @@ -6605,7 +6653,7 @@ const std::vector render_hair_strand_copies_vertex = {119734787, const std::vector render_hair_aa_strand_copies_vertex = {119734787, 65536, 524289, -321, +324, 0, 131089, 1, @@ -6627,11 +6675,11 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 0, 61, 66, -244, -286, -293, -300, -320, +247, +289, +296, +303, +323, 196611, 2, 450, @@ -6764,10 +6812,10 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 1937010277, 0, 196613, -127, +128, 118, 524293, -129, +130, 1632132967, 1700164201, 2019914866, @@ -6775,35 +6823,35 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 1852795252, 115, 262149, -136, +138, 1769234802, 111, 327685, -139, +141, 1936617283, 1953390964, 115, 393222, -139, +141, 0, 1466785639, 1684828783, 0, 393222, -139, +141, 1, 1450008423, 1350002025, 6975346, 458758, -139, +141, 2, 1231904615, 1767274094, 1917876069, 27247, 524294, -139, +141, 3, 1450008423, 1350002025, @@ -6811,17 +6859,17 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 1952999273, 0, 327686, -139, +141, 4, 1165385575, 25977, 327686, -139, +141, 5, 1986420583, 7761734, 524294, -139, +141, 6, 1833000807, 1852139874, @@ -6829,7 +6877,7 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 1866691688, 7499628, 524294, -139, +141, 7, 1867538279, 1282698857, @@ -6837,34 +6885,34 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 1869377347, 114, 458758, -139, +141, 8, 1867538279, 1282698857, 1952999273, 7565136, 458758, -139, +141, 9, 1632460647, 1935753844, 1819231077, 29295, 393222, -139, +141, 10, 1632460647, 1633045364, 6649196, 458758, -139, +141, 11, 1766219623, 1098016098, 1634234476, 0, 524294, -139, +141, 12, 1632132967, 1750299241, @@ -6872,80 +6920,80 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 1752198209, 97, 458758, -139, +141, 13, 1164074855, 1851879544, 2020167780, 7564389, 458758, -139, +141, 14, 1766219623, 1383228770, 1969841249, 115, 393222, -139, +141, 15, 1767333735, 2053722990, 101, 458758, -139, +141, 16, 1766219623, 1400005986, 1768120688, 26478, 393222, -139, +141, 17, 1415733095, 1416522088, 28777, 458758, -139, +141, 18, 1315331943, 1282564453, 1952999273, 0, 393222, -139, +141, 19, 1181114215, 1766617697, 7628903, 393222, -139, +141, 20, 1416191847, 1399350117, 77, 458758, -139, +141, 21, 1432510311, 1866687859, 1634887030, 25959, 458758, -139, +141, 22, 1399414631, 1851880052, 1886339940, 7562601, 458758, -139, +141, 23, 1298751335, 1917220961, 1701668705, 7566446, 524294, -139, +141, 24, 1818320743, 1415669872, @@ -6953,19 +7001,19 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 1684828008, 0, 393222, -139, +141, 25, 1214668647, 1265789281, 12915, 393222, -139, +141, 26, 1214668647, 1165125985, 12920, 589830, -139, +141, 27, 1231904615, 1767274094, @@ -6974,10 +7022,10 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 1869641573, 29810, 196613, -141, +143, 0, 524293, -149, +151, 1632132967, 1750364777, 1852531561, @@ -6985,76 +7033,76 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 1717986671, 115, 262149, -158, +161, 1751607666, 116, 262149, -168, +171, 1634886000, 109, 327685, -170, +173, 1785688688, 1734963807, 29800, 262149, -180, +183, 1634886000, 109, 393221, -183, +186, 1634760805, 1766876270, 1936483704, 0, 458757, -195, +198, 1919508840, 1701274693, 1769172816, 1852795252, 12403, 458757, -210, +213, 1919508840, 1701274693, 1769172816, 1852795252, 12659, 327685, -232, +235, 1919501414, 1701080649, 120, 393221, -242, +245, 1348430951, 1700164197, 2019914866, 0, 393222, -242, +245, 0, 1348430951, 1953067887, 7237481, 196613, -244, +247, 0, 262149, -286, +289, 1953523044, 104, 262149, -293, +296, 1735287156, 7630437, 262149, -300, +303, 829436016, 0, 327685, -320, +323, 1634890867, 1866687598, 7499628, @@ -7091,239 +7139,239 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 33, 8, 262215, -129, +130, 34, 1, 262215, -129, +130, 33, 7, 262216, -139, +141, 0, 5, 327752, -139, +141, 0, 35, 0, 327752, -139, +141, 0, 7, 16, 262216, -139, +141, 1, 5, 327752, -139, +141, 1, 35, 64, 327752, -139, +141, 1, 7, 16, 262216, -139, +141, 2, 5, 327752, -139, +141, 2, 35, 128, 327752, -139, +141, 2, 7, 16, 262216, -139, +141, 3, 5, 327752, -139, +141, 3, 35, 192, 327752, -139, +141, 3, 7, 16, 327752, -139, +141, 4, 35, 256, 327752, -139, +141, 5, 35, 268, 327752, -139, +141, 6, 35, 272, 327752, -139, +141, 7, 35, 288, 327752, -139, +141, 8, 35, 304, 327752, -139, +141, 9, 35, 320, 327752, -139, +141, 10, 35, 336, 327752, -139, +141, 11, 35, 352, 327752, -139, +141, 12, 35, 356, 327752, -139, +141, 13, 35, 360, 327752, -139, +141, 14, 35, 364, 327752, -139, +141, 15, 35, 368, 327752, -139, +141, 16, 35, 384, 327752, -139, +141, 17, 35, 388, 327752, -139, +141, 18, 35, 392, 327752, -139, +141, 19, 35, 396, 327752, -139, +141, 20, 35, 400, 327752, -139, +141, 21, 35, 404, 327752, -139, +141, 22, 35, 408, 327752, -139, +141, 23, 35, 412, 327752, -139, +141, 24, 35, 416, 327752, -139, +141, 25, 35, 420, 327752, -139, +141, 26, 35, 424, 262216, -139, +141, 27, 5, 327752, -139, +141, 27, 35, 432, 327752, -139, +141, 27, 7, 16, 196679, -139, +141, 2, 262215, -141, +143, 34, 0, 262215, -141, +143, 33, 16, 262215, -149, +151, 34, 1, 262215, -149, +151, 33, 6, 327752, -242, +245, 0, 11, 0, 196679, -242, +245, 2, 262215, -286, +289, 30, 0, 262215, -293, +296, 30, 2, 262215, -300, +303, 30, 1, 262215, -320, +323, 30, 3, 131091, @@ -7499,18 +7547,18 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 0, 262203, 120, -129, +130, 0, 262168, -138, +140, 107, 4, 1966110, -139, -138, -138, -138, -138, +141, +140, +140, +140, +140, 13, 6, 107, @@ -7534,117 +7582,117 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 6, 6, 6, -138, -262176, 140, +262176, +142, 2, -139, -262203, -140, 141, +262203, +142, +143, 2, 262187, 57, -142, +144, 17, 262176, -143, +145, 2, 6, 262203, 120, -149, +151, 0, 262187, 68, -154, +157, 0, 262187, 57, -161, +164, 4, 262176, -162, +165, 2, 13, 262176, -171, +174, 2, -138, +140, 262187, 57, -185, +188, 13, 262187, 6, -192, +195, 1060487823, 262176, -194, +197, 7, 107, 262187, 57, -201, +204, 14, 262187, 6, -239, +242, 3212836864, 196638, -242, +245, 107, 262176, -243, +246, 3, -242, +245, 262203, -243, -244, +246, +247, 3, 262187, 57, -245, +248, 0, 262187, 57, -259, +262, 15, 262187, 68, -260, +263, 1, 262187, 68, -274, +277, 3, 262176, -283, +286, 3, 107, 262176, -285, +288, 3, 6, 262203, -285, -286, +288, +289, 3, 262187, 68, -287, +290, 2, 262203, -283, -293, +286, +296, 3, 262203, -283, -300, +286, +303, 3, 262203, -283, -320, +286, +323, 3, 327734, 2, @@ -7679,63 +7727,63 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 7, 262203, 14, -127, +128, 7, 262203, 19, -136, +138, 7, 262203, 19, -137, +139, 7, 262203, 14, -158, +161, 7, 262203, 14, -168, +171, 7, 262203, 8, -170, +173, 7, 262203, 8, -180, +183, 7, 262203, 19, -183, +186, 7, 262203, 19, -184, +187, 7, 262203, -194, -195, +197, +198, 7, 262203, -194, -210, +197, +213, 7, 262203, 19, -232, +235, 7, 262203, 19, -233, +236, 7, 262203, -194, -246, +197, +249, 7, 262203, 19, -269, +272, 7, 262205, 57, @@ -7919,833 +7967,845 @@ const std::vector render_hair_aa_strand_copies_vertex = {119734787, 124, 123, 63, +262244, +118, +125, +122, 327775, 107, +126, 125, -122, 124, 524367, 13, +127, +126, 126, -125, -125, 0, 1, 2, 196670, 117, -126, +127, 262205, 13, -128, +129, 93, 262205, 119, +131, 130, -129, 262205, 57, -131, +132, 61, 327815, 57, +133, 132, -131, 63, +262244, +118, +134, +131, 327775, 107, +135, +134, 133, -130, -132, 524367, 13, -134, -133, -133, +136, +135, +135, 0, 1, 2, 327809, 13, -135, -128, -134, +137, +129, +136, 196670, -127, -135, +128, +137, 327745, +145, +146, 143, 144, -141, -142, 262205, 6, -145, -144, +147, +146, 327866, 26, -146, -145, +148, +147, 35, 196855, -148, +150, 0, 262394, -146, -147, -156, +148, +149, +159, 131320, -147, +149, 262205, 119, -150, -149, +152, +151, 262205, 57, -151, +153, 61, 327815, 57, -152, -151, +154, +153, 63, +262244, +118, +155, +152, 327775, 107, -153, -150, -152, +156, +155, +154, 327761, 6, -155, -153, +158, +156, 0, 196670, -137, -155, +139, +158, 131321, -148, +150, 131320, -156, +159, 196670, -137, +139, 114, 131321, -148, +150, 131320, -148, +150, 262205, 6, -157, -137, +160, +139, 196670, -136, -157, +138, +160, 262205, 13, -159, +162, 117, 262205, 13, -160, -127, -327745, -162, 163, -141, -161, +128, +327745, +165, +166, +143, +164, 262205, 13, -164, -163, +167, +166, 327811, 13, -165, -160, -164, +168, +163, +167, 393228, 13, -166, +169, 1, 69, -165, +168, 458764, 13, -167, +170, 1, 68, -159, -166, +162, +169, 196670, -168, -167, +171, +170, 327737, 13, -169, +172, 17, -168, -196670, -158, -169, -327745, 171, +196670, +161, 172, -141, +327745, +174, +175, +143, 74, 262205, -138, -173, -172, +140, +176, +175, 262205, 13, -174, -158, +177, +161, 327761, 6, -175, -174, +178, +177, 0, 327761, 6, -176, -174, +179, +177, 1, 327761, 6, +180, 177, -174, 2, 458832, 107, +181, 178, -175, -176, -177, +179, +180, 35, 327825, 107, -179, -173, -178, +182, +176, +181, 458831, 7, -181, -179, -179, +184, +182, +182, 0, 1, 196670, -180, -181, +183, +184, 327737, 7, -182, +185, 11, -180, +183, 196670, -170, -182, +173, +185, 327745, +145, +189, 143, -186, -141, -185, +188, 262205, 6, -187, -186, +190, +189, 327864, 26, -188, -187, +191, +190, 35, 196855, -190, +193, 0, 262394, -188, -189, 191, +192, +194, 131320, -189, +192, 196670, -184, +187, 35, 131321, -190, +193, 131320, -191, +194, 196670, -184, -192, +187, +195, 131321, -190, +193, 131320, -190, +193, 262205, 6, -193, -184, +196, +187, 196670, -183, -193, +186, +196, 262205, 13, -196, -127, +199, +128, 262205, 13, -197, -158, +200, +161, 327822, 13, -198, -197, +201, +200, 114, 262205, 6, -199, -136, +202, +138, 327822, 13, -200, -198, -199, +203, +201, +202, 327745, +145, +205, 143, -202, -141, -201, +204, 262205, 6, -203, -202, +206, +205, 327822, 13, -204, -200, +207, 203, +206, 327811, 13, -205, -196, -204, +208, +199, +207, 327761, 6, -206, -205, +209, +208, 0, 327761, 6, -207, -205, +210, +208, 1, 327761, 6, +211, 208, -205, 2, 458832, 107, +212, 209, -206, -207, -208, +210, +211, 114, 196670, -195, -209, +198, +212, 262205, 13, -211, -127, +214, +128, 262205, 13, -212, -158, +215, +161, 327822, 13, -213, -212, +216, +215, 114, 262205, 6, -214, -136, +217, +138, 327822, 13, -215, -213, -214, +218, +216, +217, 327745, +145, +219, 143, -216, -141, -201, +204, 262205, 6, -217, -216, +220, +219, 327822, 13, +221, 218, -215, -217, +220, 327809, 13, -219, -211, -218, +222, +214, +221, 327761, 6, -220, -219, +223, +222, 0, 327761, 6, -221, -219, +224, +222, 1, 327761, 6, +225, 222, -219, 2, 458832, 107, +226, 223, -220, -221, -222, +224, +225, 114, 196670, -210, -223, +213, +226, 327745, -171, -224, -141, +174, +227, +143, 74, 262205, -138, -225, -224, +140, +228, +227, 262205, 107, -226, -195, +229, +198, 327825, 107, -227, -225, -226, +230, +228, +229, 196670, -195, -227, +198, +230, 327745, -171, -228, -141, +174, +231, +143, 74, 262205, -138, -229, -228, +140, +232, +231, 262205, 107, -230, -210, +233, +213, 327825, 107, -231, -229, -230, +234, +232, +233, 196670, -210, -231, +213, +234, 262205, 57, -234, +237, 61, 327819, 57, -235, -234, +238, +237, 63, 327850, 26, -236, -235, +239, +238, 74, 196855, -238, +241, 0, 262394, -236, -237, +239, 240, +243, 131320, -237, +240, 196670, -233, -239, +236, +242, 131321, -238, +241, 131320, -240, +243, 196670, -233, +236, 114, 131321, -238, +241, 131320, -238, +241, 262205, 6, -241, -233, +244, +236, 196670, -232, -241, +235, +244, 262205, 6, -247, -232, +250, +235, 327860, 26, -248, -247, -239, -196855, +251, 250, +242, +196855, +253, 0, 262394, -248, -249, +251, 252, +255, 131320, -249, +252, 262205, 107, -251, -195, +254, +198, 196670, -246, -251, +249, +254, 131321, -250, +253, 131320, -252, +255, 262205, 107, -253, -210, +256, +213, 196670, -246, -253, +249, +256, 131321, -250, +253, 131320, -250, +253, 262205, 107, -254, -246, +257, +249, 262205, 6, -255, -232, +258, +235, 262205, 7, -256, -170, +259, +173, 262205, 6, -257, -183, +260, +186, 327822, 7, -258, -256, -257, -393281, -143, 261, -141, 259, 260, +393281, +145, +264, +143, +262, +263, 262205, 6, -262, -261, +265, +264, 327760, 7, -263, -262, -262, +266, +265, +265, 327816, 7, -264, -258, -263, +267, +261, +266, 327761, 6, -265, -264, +268, +267, 0, 327761, 6, -266, -264, +269, +267, 1, 458832, 107, -267, -265, -266, +270, +268, +269, 35, 35, 327822, 107, -268, -267, -255, +271, +270, +258, 262205, 6, -270, -232, +273, +235, 327860, 26, -271, -270, -239, -196855, +274, 273, +242, +196855, +276, 0, 262394, -271, -272, -277, +274, +275, +280, 131320, -272, +275, 327745, 19, -275, -195, -274, +278, +198, +277, 262205, 6, -276, -275, +279, +278, 196670, -269, -276, +272, +279, 131321, -273, +276, 131320, -277, +280, 327745, 19, -278, -210, -274, +281, +213, +277, 262205, 6, -279, -278, +282, +281, 196670, -269, -279, +272, +282, 131321, -273, +276, 131320, -273, +276, 262205, 6, -280, -269, +283, +272, 327822, 107, -281, -268, -280, +284, +271, +283, 327809, 107, -282, -254, -281, -327745, -283, +285, +257, 284, -244, -245, +327745, +286, +287, +247, +248, 196670, -284, -282, -393281, +287, 285, +393281, 288, -244, -245, -287, +291, +247, +248, +290, 262205, 6, -289, -288, +292, +291, 393281, -285, -290, -244, -245, -274, +288, +293, +247, +248, +277, 262205, 6, -291, -290, +294, +293, 327816, 6, +295, 292, -289, -291, +294, 196670, -286, -292, +289, +295, 262205, 13, -294, +297, 117, 262205, 6, -295, -136, +298, +138, 327761, 6, -296, -294, +299, +297, 0, 327761, 6, +300, 297, -294, 1, 327761, 6, -298, -294, +301, +297, 2, 458832, 107, +302, 299, -296, -297, +300, +301, 298, -295, 196670, -293, -299, +296, +302, 262205, 107, -301, -195, +304, +198, 458831, 7, -302, -301, -301, +305, +304, +304, 0, 1, 327745, 19, -303, -195, -274, +306, +198, +277, 262205, 6, -304, -303, +307, +306, 458764, 6, -305, +308, 1, 40, -304, +307, 25, 327760, 7, -306, -305, -305, +309, +308, +308, 327816, 7, -307, -302, -306, +310, +305, +309, 262205, 107, -308, -210, +311, +213, 458831, 7, -309, -308, -308, +312, +311, +311, 0, 1, 327745, 19, -310, -210, -274, +313, +213, +277, 262205, 6, -311, -310, +314, +313, 458764, 6, -312, +315, 1, 40, -311, +314, 25, 327760, 7, -313, -312, -312, +316, +315, +315, 327816, 7, -314, -309, -313, +317, +312, +316, 327761, 6, -315, -307, -0, +318, +310, +0, 327761, 6, -316, -307, +319, +310, 1, 327761, 6, +320, 317, -314, 0, 327761, 6, -318, -314, +321, +317, 1, 458832, 107, -319, -315, -316, -317, +322, 318, -196670, -300, 319, +320, +321, +196670, +303, +322, 65789, 65592, 327734, @@ -11440,7 +11500,7 @@ const std::vector pass1_fragment = {119734787, const std::vector pass2_vertex = {119734787, 65536, 524289, -31, +75, 0, 131089, 1, @@ -11453,15 +11513,14 @@ const std::vector pass2_vertex = {119734787, 196622, 0, 1, -589839, +524303, 0, 4, 1852399981, 0, -10, -14, -27, -28, +58, +62, +70, 196611, 2, 450, @@ -11488,121 +11547,211 @@ const std::vector pass2_vertex = {119734787, 1852399981, 0, 393221, -8, +12, +1349805415, +1953067887, +678326121, +3879285, +262149, +11, +1701080681, +120, +327685, +17, +1416914279, +829761603, +59, +262149, +16, +1701080681, +120, +393221, +56, 1348430951, 1700164197, 2019914866, 0, 393222, -8, +56, 0, 1348430951, 1953067887, 7237481, 196613, -10, -0, -327685, -14, -1769172816, -1852795252, +58, 0, +393221, +62, +1449094247, +1702130277, +1684949368, +30821, 262149, -27, +65, +1634886000, +109, +262149, +70, 2019906678, 0, -327685, -28, -1668834644, -1685221231, -0, +262149, +73, +1634886000, +109, 327752, -8, +56, 0, 11, 0, 196679, -8, +56, 2, 262215, -14, -30, -0, +62, +11, +42, 262215, -27, +70, 30, 0, -262215, -28, -30, -1, 131091, 2, 196641, 3, 2, -196630, +262165, 6, 32, -262167, +0, +262176, +7, 7, 6, +196630, +8, +32, +262167, +9, +8, 4, -196638, +262177, +10, +9, +7, +262167, +14, 8, +2, +262177, +15, +14, 7, -262176, +262187, +8, +25, +3212836864, +262187, +8, +26, +1065353216, +262187, +8, +27, +0, +458796, 9, -3, +28, +25, +26, +27, +26, +262187, 8, -262203, +30, +1077936128, +458796, 9, -10, +31, +30, +26, +27, +26, +262187, +8, +33, +3225419776, +458796, +9, +34, +25, +33, +27, +26, +458796, +9, +36, +27, +27, +27, +27, +327724, +14, +46, +27, +27, +262187, +8, +48, +1073741824, +327724, +14, +49, +27, +48, +327724, +14, +51, +48, +27, +196638, +56, +9, +262176, +57, +3, +56, +262203, +57, +58, 3, 262165, -11, +59, 32, 1, 262187, -11, -12, +59, +60, 0, 262176, -13, +61, 1, -7, +59, 262203, -13, -14, +61, +62, 1, -262167, -15, -6, -3, -262187, -6, -18, -1065353216, 262176, -23, +67, 3, -7, -262167, -25, -6, -2, +9, 262176, -26, +69, 3, -25, +14, 262203, -26, -27, +69, +70, 3, -262203, -13, -28, -1, 327734, 2, 4, @@ -11610,63 +11759,158 @@ const std::vector pass2_vertex = {119734787, 3, 131320, 5, -262205, +262203, 7, -16, +65, +7, +262203, +7, +73, +7, +262205, +59, +63, +62, +262268, +6, +64, +63, +196670, +65, +64, +327737, +9, +66, +12, +65, +327745, +67, +68, +58, +60, +196670, +68, +66, +262205, +59, +71, +62, +262268, +6, +72, +71, +196670, +73, +72, +327737, 14, -524367, -15, +74, 17, -16, -16, +73, +196670, +70, +74, +65789, +65592, +327734, +9, +12, 0, -1, -2, -327761, +10, +196663, +7, +11, +131320, +13, +262205, 6, 19, -17, +11, +196855, +24, +0, +590075, +19, +23, 0, -327761, -6, 20, -17, 1, -327761, -6, 21, -17, 2, -458832, -7, 22, -19, +131320, +23, +131326, +36, +131320, 20, +131326, +28, +131320, 21, -18, -327745, -23, -24, -10, -12, -196670, -24, +131326, +31, +131320, 22, -262205, +131326, +34, +131320, +24, +196609, +9, +39, +131326, +39, +65592, +327734, +14, +17, +0, +15, +196663, 7, -29, -28, -458831, -25, -30, -29, -29, +16, +131320, +18, +262205, +6, +40, +16, +196855, +45, +0, +590075, +40, +44, 0, +41, 1, -196670, -27, -30, -65789, +42, +2, +43, +131320, +44, +131326, +46, +131320, +41, +131326, +46, +131320, +42, +131326, +49, +131320, +43, +131326, +51, +131320, +45, +196609, +14, +55, +131326, +55, 65592, }; const std::vector pass2_fragment = {119734787, @@ -18231,7 +18475,7 @@ const std::vector pass2_fragment = {119734787, const std::vector global_constraints = {119734787, 65536, 524289, -511, +516, 0, 131089, 1, @@ -18251,8 +18495,8 @@ const std::vector global_constraints = {119734787, 4, 1852399981, 0, -266, -267, +270, +271, 393232, 4, 17, @@ -18926,12 +19170,12 @@ const std::vector global_constraints = {119734787, 1701869908, 0, 327685, -204, +208, 1886680431, 1867543669, 115, 524293, -247, +251, 1953067639, 1818386789, 1701990501, @@ -18939,7 +19183,7 @@ const std::vector global_constraints = {119734787, 1869182057, 29550, 655366, -247, +251, 0, 1632132967, 1700164201, @@ -18949,17 +19193,17 @@ const std::vector global_constraints = {119734787, 1701990515, 118, 196613, -249, +253, 0, 458757, -257, +261, 1953067639, 1818386789, 1936674917, 1869182057, 29550, 589830, -257, +261, 0, 1632132967, 1700164201, @@ -18968,10 +19212,10 @@ const std::vector global_constraints = {119734787, 1852795252, 115, 196613, -259, +263, 0, 524293, -266, +270, 1281322087, 1818321775, 1870032457, @@ -18979,41 +19223,41 @@ const std::vector global_constraints = {119734787, 1145663087, 0, 393221, -267, +271, 1465871463, 1198223983, 1886744434, 17481, 458757, -268, +272, 1651469415, 1951624289, 1684955506, 1701080649, 120, 458757, -269, +273, 1633906540, 1920226156, 1231318625, 2019910766, 0, 458757, -270, +274, 1651469415, 1700162657, 2019914866, 1701080649, 120, 458757, -271, +275, 1633906540, 1919243884, 1232627060, 2019910766, 0, 524293, -272, +276, 1450014062, 1769239141, 1232299363, @@ -19021,31 +19265,23 @@ const std::vector global_constraints = {119734787, 1634890835, 25710, 458757, -273, +277, 1701080681, 1919895160, 1918986323, 1699570789, 109, 327685, -274, +278, 1634890867, 2035573870, 25968, 262149, -275, -1634886000, -109, -262149, 279, 1634886000, 109, 262149, -282, -1634886000, -109, -262149, -284, +283, 1634886000, 109, 262149, @@ -19068,18 +19304,26 @@ const std::vector global_constraints = {119734787, 294, 1634886000, 109, +262149, +296, +1634886000, +109, +262149, +298, +1634886000, +109, 327685, -304, +308, 1920103779, 1349807717, 29551, 327685, -306, +310, 1953066601, 1349280105, 29551, 524293, -310, +314, 1850302311, 1634301033, 1767983212, @@ -19087,13 +19331,13 @@ const std::vector global_constraints = {119734787, 1869182057, 29550, 393221, -316, +321, 1684104520, 1851880020, 1919903347, 109, 589830, -316, +321, 0, 1867341671, 1416389988, @@ -19102,7 +19346,7 @@ const std::vector global_constraints = {119734787, 1215459142, 6578533, 589830, -316, +321, 1, 1867341671, 1382835556, @@ -19111,7 +19355,7 @@ const std::vector global_constraints = {119734787, 1684104520, 0, 589830, -316, +321, 2, 1852396386, 1214606439, @@ -19120,69 +19364,69 @@ const std::vector global_constraints = {119734787, 1836216166, 0, 327686, -316, +321, 3, 1684300144, 6778473, 196613, -318, +323, 0, 262149, -341, +346, 1349545332, 29551, 393221, -345, +350, 1886216548, 1130851945, 1717986671, 0, 262149, -384, +389, 1348758639, 29551, 262149, -390, +395, 1668444006, 101, 262149, -391, +396, 1634886000, 109, 262149, -398, +403, 1634886000, 109, 262149, -400, +405, 1634886000, 109, 262149, -402, +407, 1634886000, 109, 262149, -404, +409, 1634886000, 109, 262149, -406, +411, 1634886000, 109, 262149, -407, +412, 1634886000, 109, 262149, -409, +414, 1634886000, 109, 262149, -411, +416, 1634886000, 109, 655365, -416, +421, 1718187123, 1936027238, 1919895155, @@ -19192,7 +19436,7 @@ const std::vector global_constraints = {119734787, 1751348321, 6778473, 720901, -417, +422, 1651469415, 1750297697, 1298493537, @@ -19203,34 +19447,34 @@ const std::vector global_constraints = {119734787, 1735287122, 101, 262149, -468, +473, 1634886000, 109, 262149, -482, +487, 1952670054, 29295, 196613, -485, +490, 7103844, 262149, -500, +505, 1634886000, 109, 262149, -502, +507, 1634886000, 109, 262149, -504, +509, 1634886000, 109, 262149, -505, +510, 1634886000, 109, 262149, -507, +512, 1634886000, 109, 327752, @@ -19398,107 +19642,107 @@ const std::vector global_constraints = {119734787, 33, 22, 262215, -246, +250, 6, 16, 327752, -247, +251, 0, 35, 0, 196679, -247, +251, 3, 262215, -249, +253, 34, 1, 262215, -249, +253, 33, 20, 262215, -256, +260, 6, 16, 327752, -257, +261, 0, 35, 0, 196679, -257, +261, 3, 262215, -259, +263, 34, 1, 262215, -259, +263, 33, 7, 262215, -266, +270, 11, 27, 262215, -267, +271, 11, 26, 262215, -310, +314, 34, 1, 262215, -310, +314, 33, 21, 262215, -315, +320, 6, 16, 262216, -316, +321, 0, 5, 327752, -316, +321, 0, 35, 0, 327752, -316, +321, 0, 7, 16, 327752, -316, +321, 1, 35, 64, 327752, -316, +321, 2, 35, 80, 327752, -316, +321, 3, 35, 96, 196679, -316, +321, 3, 262215, -318, +323, 34, 0, 262215, -318, +323, 33, 27, 262215, -510, +515, 11, 25, 131091, @@ -19680,112 +19924,112 @@ const std::vector global_constraints = {119734787, 122, 0, 262167, -126, +127, 14, 4, 262187, 14, -128, +129, 0, 262187, 16, -182, +185, 64, 262187, 16, -206, +210, 6, 262176, -207, +211, 2, 6, 262167, -210, +214, 6, 3, 262187, 6, -211, +215, 3212836864, 393260, -210, -212, +214, +216, 82, -211, +215, 82, 262187, 6, -221, +225, 1065353216, 262187, 16, -233, +237, 7, 196637, -246, +250, 7, 196638, -247, -246, +251, +250, 262176, -248, +252, 2, -247, +251, 262203, -248, -249, +252, +253, 2, 262187, 16, -250, +254, 0, 262176, -254, +258, 2, 7, 196637, -256, +260, 7, 196638, -257, -256, +261, +260, 262176, -258, +262, 2, -257, +261, 262203, -258, -259, +262, +263, 2, 262167, -264, +268, 14, 3, 262176, -265, +269, 1, -264, +268, 262203, -265, -266, +269, +270, 1, 262203, -265, -267, +269, +271, 1, 262176, -276, +280, 1, 14, 458796, 7, -305, +309, 82, 82, 82, 82, 589849, -307, +311, 6, 5, 0, @@ -19794,113 +20038,113 @@ const std::vector global_constraints = {119734787, 1, 0, 196635, -308, -307, +312, +311, 262176, -309, +313, 0, -308, +312, 262203, -309, -310, +313, +314, 0, 262168, -314, +319, 7, 4, 262172, -315, +320, 6, 79, 393246, -316, -314, +321, +319, 7, 16, -315, +320, 262176, -317, +322, 2, -316, +321, 262203, -317, -318, +322, +323, 2, 262176, -319, +324, 2, -314, +319, 262187, 16, -332, +337, 27, 262176, -333, +338, 2, 16, 262187, 6, -346, +351, 1022739087, 262187, 16, -351, +356, 8, 262187, 16, -359, +364, 12, 262187, 14, -364, +369, 2, 262187, 16, -368, +373, 16, 262187, 16, -376, +381, 20, 262187, 16, -422, +427, 10, 262187, 16, -425, +430, 11, 262187, 16, -433, +438, 14, 262187, 16, -436, +441, 15, 262187, 16, -444, +449, 18, 262187, 16, -447, +452, 19, 262187, 16, -455, +460, 22, 262187, 16, -458, +463, 23, 262176, -484, +489, 7, -210, +214, 393260, -264, -510, +268, +515, 87, 109, 109, @@ -19913,1206 +20157,1210 @@ const std::vector global_constraints = {119734787, 5, 262203, 15, -268, +272, 7, 262203, 15, -269, +273, 7, 262203, 17, -270, +274, 7, 262203, 15, -271, +275, 7, 262203, 15, -272, +276, 7, 262203, 15, -273, +277, 7, 262203, 15, -274, +278, 7, 262203, 15, -275, +279, 7, 262203, 15, -279, +283, 7, 262203, 15, -282, +286, 7, 262203, 15, -284, +288, 7, 262203, 17, -286, +290, 7, 262203, 15, -288, +292, 7, 262203, 15, -290, +294, 7, 262203, 15, -292, +296, 7, 262203, 15, -294, +298, 7, 262203, 8, -304, +308, 7, 262203, 8, -306, +310, 7, 262203, 8, -341, +346, 7, 262203, 59, -345, +350, 7, 262203, 8, -384, +389, 7, 262203, 8, -390, +395, 7, 262203, 8, -391, +396, 7, 262203, 8, -398, +403, 7, 262203, 8, -400, +405, 7, 262203, 8, -402, +407, 7, 262203, 8, -404, +409, 7, 262203, 15, -406, +411, 7, 262203, 15, -407, +412, 7, 262203, 15, -409, +414, 7, 262203, 59, -411, +416, 7, 262203, 59, -416, +421, 7, 262203, 59, -417, +422, 7, 262203, 8, -468, +473, 7, 262203, 59, -482, +487, 7, 262203, -484, -485, +489, +490, 7, 262203, 8, -500, +505, 7, 262203, 8, -502, +507, 7, 262203, 15, -504, +509, 7, 262203, 15, -505, +510, 7, 262203, 15, -507, +512, 7, 327745, -276, -277, -266, -128, -262205, -14, -278, -277, -196670, -275, -278, -327745, -276, 280, -267, -128, +281, +270, +129, 262205, 14, +282, 281, -280, 196670, 279, -281, -262205, -14, -283, -268, -196670, 282, -283, +327745, +280, +284, +271, +129, 262205, 14, 285, -269, -196670, 284, +196670, +283, 285, 262205, -16, +14, 287, -270, +272, 196670, 286, 287, 262205, 14, 289, -271, +273, 196670, 288, 289, 262205, -14, +16, 291, -272, +274, 196670, 290, 291, 262205, 14, 293, -273, +275, 196670, 292, 293, 262205, 14, 295, -274, +276, 196670, 294, 295, -852025, -2, -296, -28, -275, -279, -282, -284, -286, -288, -290, -292, -294, 262205, 14, 297, -282, +277, 196670, -268, +296, 297, 262205, 14, -298, -284, -196670, -269, -298, -262205, -16, 299, -286, +278, 196670, -270, +298, 299, -262205, -14, +852025, +2, 300, +28, +279, +283, +286, 288, -196670, -271, -300, +290, +292, +294, +296, +298, 262205, 14, 301, -290, +286, 196670, 272, 301, 262205, 14, 302, -292, +288, 196670, 273, 302, 262205, -14, +16, 303, -294, +290, 196670, 274, 303, -196670, +262205, +14, 304, -305, +292, 196670, -306, +275, +304, +262205, +14, +305, +294, +196670, +276, 305, 262205, +14, +306, +296, +196670, +277, +306, +262205, +14, +307, +298, +196670, +278, +307, +196670, 308, -311, +309, +196670, 310, +309, 262205, -16, 312, -270, +315, +314, +262205, +16, +316, +274, +262244, +311, +317, +315, 327775, 7, -313, -311, -312, +318, +317, +316, 196670, -306, -313, -327745, -319, -320, +310, 318, -250, +327745, +324, +325, +323, +254, 262205, -314, -321, -320, +319, +326, +325, 262205, 7, -322, -306, +327, +310, 524367, -210, -323, -322, -322, +214, +328, +327, +327, 0, 1, 2, 327761, 6, -324, -323, +329, +328, 0, 327761, 6, -325, -323, +330, +328, 1, 327761, 6, -326, -323, +331, +328, 2, 458832, 7, -327, -324, -325, -326, -221, +332, +329, +330, +331, +225, 327825, 7, -328, -321, -327, +333, +326, +332, 524367, -210, -329, -328, -328, +214, +334, +333, +333, 0, 1, 2, 262205, 7, -330, -306, +335, +310, 589903, 7, -331, -330, -329, +336, +335, +334, 4, 5, 6, 3, 196670, -306, -331, +310, +336, 327745, -333, -334, +338, +339, 90, -332, +337, 262205, 16, -335, -334, +340, +339, 327851, 9, -336, -335, -250, +341, +340, +254, 196855, -338, +343, 0, 262394, -336, -337, -340, +341, +342, +345, 131320, -337, +342, 262205, 7, -339, -306, +344, +310, 196670, -304, -339, +308, +344, 131321, -338, +343, 131320, -340, +345, 262205, 16, -342, -270, +347, +274, 393281, +258, +348, +263, 254, -343, -259, -250, -342, +347, 262205, 7, -344, -343, +349, +348, 196670, -341, -344, +346, +349, 196670, -304, -344, +308, +349, 131321, -338, +343, 131320, -338, +343, 196670, -345, -346, +350, +351, 262205, 14, -347, -274, +352, +278, 327850, 9, -348, -347, -128, +353, +352, +129, 196855, -350, +355, 0, 262394, -348, -349, +353, 354, +359, 131320, -349, +354, 327745, -207, -352, +211, +357, 90, -351, +356, 262205, 6, -353, -352, +358, +357, 196670, -345, -353, -131321, 350, +358, +131321, +355, 131320, -354, +359, 262205, 14, -355, -274, +360, +278, 327850, 9, -356, -355, +361, +360, 109, 196855, -358, +363, 0, 262394, -356, -357, +361, 362, +367, 131320, -357, +362, 327745, -207, -360, +211, +365, 90, -359, +364, 262205, 6, -361, -360, +366, +365, 196670, -345, -361, +350, +366, 131321, -358, +363, 131320, -362, +367, 262205, 14, -363, -274, +368, +278, 327850, 9, -365, -363, -364, +370, +368, +369, 196855, -367, +372, 0, 262394, -365, -366, +370, 371, +376, 131320, -366, +371, 327745, -207, -369, +211, +374, 90, -368, +373, 262205, 6, -370, -369, +375, +374, 196670, -345, -370, +350, +375, 131321, -367, +372, 131320, -371, +376, 262205, 14, -372, -274, +377, +278, 327850, 9, -373, -372, +378, +377, 79, 196855, -375, +380, 0, 262394, -373, -374, -375, +378, +379, +380, 131320, -374, +379, 327745, -207, -377, +211, +382, 90, -376, +381, 262205, 6, -378, -377, +383, +382, 196670, -345, -378, +350, +383, 131321, -375, +380, 131320, -375, +380, 131321, -367, +372, 131320, -367, +372, 131321, -358, +363, 131320, -358, +363, 131321, -350, +355, 131320, -350, +355, 327745, -333, -379, +338, +384, 90, -332, +337, 262205, 16, -380, -379, +385, +384, 327851, 9, -381, -380, -250, +386, +385, +254, 196855, -383, +388, 0, 262394, -381, -382, 386, +387, +391, 131320, -382, +387, 262205, 7, -385, -304, +390, +308, 196670, -384, -385, +389, +390, 131321, -383, +388, 131320, -386, +391, 262205, 16, -387, -270, +392, +274, 393281, +258, +393, +253, 254, -388, -249, -250, -387, +392, 262205, 7, -389, -388, +394, +393, 196670, -384, 389, +394, 131321, -383, +388, 131320, -383, +388, 196670, -390, -305, +395, +309, 262205, 7, -392, -304, +397, +308, 196670, -391, -392, +396, +397, 327737, 9, -393, +398, 12, -391, +396, 196855, -395, +400, 0, 262394, -393, -394, -414, +398, +399, +419, 131320, -394, +399, 262205, 16, -396, -270, +401, +274, 262268, 14, -397, -396, -262205, -7, -399, -304, -196670, -398, -399, -262205, -7, -401, -384, -196670, -400, +402, 401, 262205, 7, -403, -306, +404, +308, 196670, -402, 403, +404, 262205, 7, -405, -390, +406, +389, 196670, -404, 405, -196670, 406, -397, 262205, -14, +7, 408, -271, +310, 196670, 407, 408, 262205, -14, +7, 410, -272, +395, 196670, 409, 410, -262205, -6, -412, -345, 196670, 411, -412, -786489, -7, -413, -69, -398, -400, 402, -404, -406, -407, -409, -411, +262205, +14, +413, +275, 196670, -341, +412, 413, -131321, -395, -131320, -414, 262205, -7, +14, 415, -306, +276, 196670, -341, +414, 415, -131321, -395, -131320, -395, +262205, +6, +417, +350, 196670, 416, +417, +786489, +7, +418, +69, +403, +405, +407, +409, +411, +412, +414, +416, +196670, +346, +418, +131321, +400, +131320, +419, +262205, +7, +420, +310, +196670, +346, +420, +131321, +400, +131320, +400, +196670, +421, 82, 196670, -417, +422, 82, 262205, 14, -418, -274, +423, +278, 327850, 9, -419, -418, -128, +424, +423, +129, 196855, -421, +426, 0, 262394, -419, -420, -428, +424, +425, +433, 131320, -420, +425, 327745, -207, -423, +211, +428, 90, -422, +427, 262205, 6, -424, -423, +429, +428, 196670, -416, -424, +421, +429, 327745, -207, -426, +211, +431, 90, -425, +430, 262205, 6, -427, -426, +432, +431, 196670, -417, -427, +422, +432, 131321, -421, +426, 131320, -428, +433, 262205, 14, -429, -274, +434, +278, 327850, 9, -430, -429, +435, +434, 109, 196855, -432, +437, 0, 262394, -430, -431, -439, +435, +436, +444, 131320, -431, +436, 327745, -207, -434, +211, +439, 90, -433, +438, 262205, 6, -435, -434, +440, +439, 196670, -416, -435, +421, +440, 327745, -207, -437, +211, +442, 90, -436, +441, 262205, 6, -438, -437, +443, +442, 196670, -417, -438, +422, +443, 131321, -432, +437, 131320, -439, +444, 262205, 14, -440, -274, +445, +278, 327850, 9, -441, -440, -364, +446, +445, +369, 196855, -443, +448, 0, 262394, -441, -442, -450, +446, +447, +455, 131320, -442, +447, 327745, -207, -445, +211, +450, 90, -444, +449, 262205, 6, -446, -445, +451, +450, 196670, -416, -446, +421, +451, 327745, -207, -448, +211, +453, 90, -447, +452, 262205, 6, -449, -448, +454, +453, 196670, -417, -449, +422, +454, 131321, -443, +448, 131320, -450, +455, 262205, 14, -451, -274, +456, +278, 327850, 9, -452, -451, +457, +456, 79, 196855, -454, +459, 0, 262394, -452, -453, -454, +457, +458, +459, 131320, -453, +458, 327745, -207, -456, +211, +461, 90, -455, +460, 262205, 6, -457, -456, +462, +461, 196670, -416, -457, +421, +462, 327745, -207, -459, +211, +464, 90, -458, +463, 262205, 6, -460, -459, +465, +464, 196670, -417, -460, +422, +465, 131321, -454, +459, 131320, -454, +459, 131321, -443, +448, 131320, -443, +448, 131321, -432, +437, 131320, -432, +437, 131321, -421, +426, 131320, -421, +426, 262205, 6, -461, -416, +466, +421, 327866, 9, -462, -461, +467, +466, 82, 262205, 6, -463, -417, +468, +422, 327862, 9, -464, -463, +469, +468, 82, 327847, 9, -465, -462, -464, -196855, +470, 467, +469, +196855, +472, 0, 262394, -465, -466, -467, +470, +471, +472, 131320, -466, +471, 262205, 7, -469, -341, +474, +346, 196670, -468, -469, +473, +474, 327737, 9, -470, +475, 12, -468, +473, 196855, -472, +477, 0, 262394, -470, -471, -472, +475, +476, +477, 131320, -471, +476, 262205, 14, -473, -271, +478, +275, 262256, 6, -474, -473, +479, +478, 262205, 6, -475, -417, +480, +422, 262205, 14, -476, -272, +481, +276, 262256, 6, -477, -476, +482, +481, 327813, 6, -478, -475, -477, +483, +480, +482, 327864, 9, +484, 479, -474, -478, +483, 196855, -481, +486, 0, 262394, -479, -480, -481, +484, +485, +486, 131320, -480, +485, 262205, 6, -483, -416, +488, +421, 196670, -482, -483, +487, +488, 262205, 6, -486, -482, +491, +487, 262205, 7, -487, -306, +492, +310, 262205, 7, -488, -341, +493, +346, 327811, 7, -489, -487, -488, +494, +492, +493, 524367, -210, -490, -489, -489, +214, +495, +494, +494, 0, 1, 2, 327822, -210, +214, +496, +495, 491, -490, -486, 196670, -485, -491, +490, +496, 262205, -210, -492, -485, +214, +497, +490, 262205, 7, -493, -341, +498, +346, 524367, -210, -494, -493, -493, +214, +499, +498, +498, 0, 1, 2, 327809, -210, -495, -494, -492, +214, +500, +499, +497, 262205, 7, -496, -341, +501, +346, 589903, 7, -497, -496, -495, +502, +501, +500, 4, 5, 6, 3, 196670, -341, -497, +346, +502, 131321, -481, +486, 131320, -481, +486, 131321, -472, +477, 131320, -472, +477, 131321, -467, +472, 131320, -467, +472, 262205, 16, -498, -270, +503, +274, 262268, 14, -499, -498, +504, +503, 262205, 7, -501, -304, +506, +308, 196670, -500, -501, +505, +506, 262205, 7, -503, -341, +508, +346, 196670, -502, -503, +507, +508, 196670, +509, 504, -499, 262205, 14, -506, -271, +511, +275, 196670, -505, -506, +510, +511, 262205, 14, -508, -272, +513, +276, 196670, -507, -508, +512, +513, 589881, 2, -509, +514, 77, -500, -502, -504, 505, 507, +509, +510, +512, 65789, 65592, 327734, @@ -21319,48 +21567,52 @@ const std::vector global_constraints = {119734787, 16, 125, 124, -327775, +262244, +119, 126, -127, 123, +327775, +127, +128, +126, 125, 327761, 14, -129, -127, +130, +128, 0, 196670, 27, -129, +130, 262205, 14, -130, +131, 21, 262205, 14, -131, +132, 25, 327812, 14, -132, -130, +133, 131, +132, 262205, 14, -133, +134, 24, 327808, 14, -134, -132, +135, 133, +134, 262268, 16, +136, 135, -134, 196670, 23, -135, +136, 65789, 65592, 327734, @@ -21399,163 +21651,167 @@ const std::vector global_constraints = {119734787, 40, 262205, 14, -136, +137, 30, 196670, 37, -136, +137, 327745, 92, -137, +138, 90, 91, 262205, 14, +139, 138, -137, 327814, 14, -139, +140, 87, -138, +139, 196670, 36, -139, +140, 262205, 14, -140, +141, 30, 327745, 92, -141, +142, 90, 91, 262205, 14, +143, 142, -141, 327817, 14, +144, +141, 143, -140, -142, 196670, 33, -143, +144, 262205, 14, -144, +145, 31, 327745, 92, -145, +146, 90, 91, 262205, 14, +147, 146, -145, 327812, 14, +148, +145, 147, -144, -146, 262205, 14, -148, +149, 33, 327808, 14, -149, -147, +150, 148, +149, 196670, 32, -149, +150, 262205, 14, -150, +151, 30, 262205, 14, -151, +152, 33, 327810, 14, -152, -150, +153, 151, +152, 327745, 92, -153, +154, 90, 91, 262205, 14, +155, 154, -153, 327814, 14, +156, +153, 155, -152, -154, 196670, 35, -155, +156, 262205, 120, -156, +157, 122, 262205, 14, -157, +158, 32, 262268, 16, +159, 158, +262244, +119, +160, 157, 327775, -126, +127, +161, +160, 159, -156, -158, 327761, 14, -160, -159, +162, +161, 0, 196670, 38, -160, +162, 262205, 14, -161, +163, 32, 262205, 14, -162, +164, 36, 327812, 14, +165, 163, -161, -162, +164, 262205, 14, -164, +166, 35, 327808, 14, +167, 165, -163, -164, +166, 262268, 16, -166, -165, +168, +167, 196670, 34, -166, +168, 65789, 65592, 327734, @@ -21585,83 +21841,87 @@ const std::vector global_constraints = {119734787, 49, 262205, 14, -167, +169, 43, 327812, 14, -168, +170, 87, -167, +169, 262205, 14, -169, +171, 42, 327808, 14, +172, 170, -168, -169, +171, 196670, 44, -170, +172, 327745, 92, -171, +173, 90, 91, 262205, 14, -172, -171, +174, +173, 327814, 14, -173, +175, 87, -172, +174, 196670, 45, -173, +175, 262205, 120, -174, +176, 122, 262205, 14, -175, +177, 44, 262268, 16, -176, -175, -327775, -126, +178, 177, -174, +262244, +119, +179, 176, +327775, +127, +180, +179, +178, 327761, 14, -178, -177, +181, +180, 0, 196670, 47, -178, +181, 262205, 14, -179, +182, 44, 262205, 14, -180, +183, 45, 327812, 14, -181, -179, -180, +184, +182, +183, 196670, 46, -181, +184, 65789, 65592, 327734, @@ -21691,113 +21951,117 @@ const std::vector global_constraints = {119734787, 58, 262205, 16, -183, +186, 52, 327812, 16, -184, -182, -183, +187, +185, +186, 262205, 16, -185, +188, 51, 327808, 16, -186, -184, -185, +189, +187, +188, 196670, 53, -186, +189, 327745, 92, -187, +190, 90, 106, 262205, 14, -188, -187, +191, +190, 327808, 14, -189, -188, +192, +191, 109, 262268, 16, -190, -189, +193, +192, 262205, 16, -191, +194, 53, 327812, 16, -192, -191, -190, +195, +194, +193, 196670, 53, -192, +195, 327745, 92, -193, +196, 90, 91, 262205, 14, -194, -193, +197, +196, 327814, 14, -195, +198, 87, -194, +197, 196670, 54, -195, +198, 262205, 120, -196, +199, 122, 262205, 16, -197, +200, 53, +262244, +119, +201, +199, 327775, -126, -198, -196, -197, +127, +202, +201, +200, 327761, 14, -199, -198, +203, +202, 0, 196670, 56, -199, +203, 262205, 16, -200, +204, 53, 262205, 14, -201, +205, 54, 262268, 16, -202, -201, +206, +205, 327812, 16, -203, -200, -202, +207, +204, +206, 196670, 55, -203, +207, 65789, 65592, 327734, @@ -21833,189 +22097,189 @@ const std::vector global_constraints = {119734787, 70, 262203, 8, -204, +208, 7, 262205, 7, -205, +209, 61, 196670, -204, -205, -327745, -207, 208, +209, +327745, +211, +212, 90, -206, +210, 262205, 6, -209, -208, -327822, -210, 213, 212, -209, +327822, +214, +217, +216, +213, 262205, 7, -214, +218, 64, 524367, -210, -215, -214, 214, +219, +218, +218, 0, 1, 2, 327809, -210, -216, -215, -213, +214, +220, +219, +217, 262205, 7, -217, +221, 64, 589903, 7, -218, -217, -216, +222, +221, +220, 4, 5, 6, 3, 196670, 64, -218, +222, 262205, 7, -219, +223, 61, 524367, -210, -220, -219, -219, +214, +224, +223, +223, 0, 1, 2, 262205, 6, -222, +226, 68, 327811, 6, -223, -221, -222, +227, +225, +226, 262205, 7, -224, +228, 61, 524367, -210, -225, -224, -224, +214, +229, +228, +228, 0, 1, 2, 262205, 7, -226, +230, 62, 524367, -210, -227, -226, -226, +214, +231, +230, +230, 0, 1, 2, 327811, -210, -228, -225, -227, -327822, -210, +214, +232, 229, -228, -223, +231, +327822, +214, +233, +232, +227, 327809, -210, -230, -220, -229, +214, +234, +224, +233, 262205, 7, -231, +235, 64, 524367, -210, -232, -231, -231, +214, +236, +235, +235, 0, 1, 2, 327745, -207, -234, +211, +238, 90, -233, +237, 262205, 6, -235, -234, +239, +238, 327822, -210, +214, +240, 236, -232, -235, +239, 327745, -207, -237, +211, +241, 90, -233, +237, 262205, 6, -238, -237, +242, +241, 327822, -210, -239, -236, -238, -327809, -210, +214, +243, 240, -230, -239, +242, +327809, +214, +244, +234, +243, 262205, 7, -241, -204, +245, +208, 589903, 7, -242, -241, -240, +246, +245, +244, 4, 5, 6, 3, 196670, -204, -242, +208, +246, 262205, 7, -243, -204, +247, +208, 131326, -243, +247, 65592, 327734, 2, @@ -22041,53 +22305,53 @@ const std::vector global_constraints = {119734787, 78, 262205, 14, -251, +255, 74, 262268, 16, -252, -251, +256, +255, 262205, 7, -253, +257, 72, 393281, +258, +259, +253, 254, -255, -249, -250, -252, +256, 196670, -255, -253, +259, +257, 262205, 14, -260, +264, 74, 262268, 16, -261, -260, +265, +264, 262205, 7, -262, +266, 73, 393281, -254, +258, +267, 263, -259, -250, -261, +254, +265, 196670, -263, -262, +267, +266, 65789, 65592, }; const std::vector local_constraints = {119734787, 65536, 524289, -701, +707, 0, 131089, 1, @@ -22107,8 +22371,8 @@ const std::vector local_constraints = {119734787, 4, 1852399981, 0, -417, -422, +421, +426, 393232, 4, 17, @@ -22741,39 +23005,39 @@ const std::vector local_constraints = {119734787, 1701869908, 0, 196613, -206, +210, 113, 262149, -307, +311, 1667593841, 0, 196613, -315, +319, 30325, 196613, -319, +323, 7763317, 327685, -338, +342, 1718378856, 1818717761, 101, 262149, -342, +346, 1215195507, 6712417, 327685, -345, +349, 1952544113, 1768845925, 28271, 327685, -357, +361, 1735288172, 1901291636, 114, 524293, -417, +421, 1281322087, 1818321775, 1870032457, @@ -22781,20 +23045,20 @@ const std::vector local_constraints = {119734787, 1145663087, 0, 393221, -422, +426, 1465871463, 1198223983, 1886744434, 17481, 458757, -426, +430, 1651469415, 1951624289, 1684955506, 1701080649, 120, 524293, -427, +431, 1450014062, 1769239141, 1232299363, @@ -22802,7 +23066,7 @@ const std::vector local_constraints = {119734787, 1634890835, 25710, 524293, -428, +432, 1651469415, 1867672673, 1700164719, @@ -22810,36 +23074,36 @@ const std::vector local_constraints = {119734787, 1701080649, 120, 327685, -429, +433, 1634890867, 2035573870, 25968, 262149, -430, +434, 1634886000, 109, 262149, -431, +435, 1634886000, 109, 262149, -432, +436, 1634886000, 109, 262149, -434, +438, 1634886000, 109, 262149, -436, +440, 1634886000, 109, 262149, -438, +442, 1634886000, 109, 655365, -445, +449, 1718187123, 1936027238, 1919895155, @@ -22849,34 +23113,34 @@ const std::vector local_constraints = {119734787, 1768448884, 26478, 458757, -483, +487, 1651469415, 1700162657, 2019914866, 1701080649, 120, 458757, -485, +489, 1633906540, 1919243884, 1232627060, 2019910766, 0, 393221, -501, +505, 1918986355, 1951622245, 1684955506, 7565136, 458757, -504, +508, 1953067639, 1818386789, 1936674917, 1869182057, 29550, 589830, -504, +508, 0, 1632132967, 1700164201, @@ -22885,55 +23149,55 @@ const std::vector local_constraints = {119734787, 1852795252, 115, 196613, -506, +510, 0, 327685, -515, +519, 1919251561, 1869182049, 29550, 196613, -527, +531, 7565168, 327685, -530, +534, 1198813042, 1633841004, 108, 458757, -534, +538, 1816616807, 1818321519, 1635020626, 1852795252, 115, 458757, -538, +543, 1633906540, 1919243884, 1232627060, 2019910766, 0, 393221, -552, +557, 1601400688, 1937075312, 1701736287, 0, 393221, -557, +562, 1198813042, 1633841004, 1919899500, 25708, 393221, -560, +565, 1684104520, 1851880020, 1919903347, 109, 589830, -560, +565, 0, 1867341671, 1416389988, @@ -22942,7 +23206,7 @@ const std::vector local_constraints = {119734787, 1215459142, 6578533, 589830, -560, +565, 1, 1867341671, 1382835556, @@ -22951,7 +23215,7 @@ const std::vector local_constraints = {119734787, 1684104520, 0, 589830, -560, +565, 2, 1852396386, 1214606439, @@ -22960,23 +23224,23 @@ const std::vector local_constraints = {119734787, 1836216166, 0, 327686, -560, +565, 3, 1684300144, 6778473, 196613, -562, +567, 0, 262149, -563, +568, 1634886000, 109, 262149, -566, +571, 1634886000, 109, 655365, -569, +574, 1348956783, 1767863151, 1970040927, @@ -22986,7 +23250,7 @@ const std::vector local_constraints = {119734787, 1701667186, 26975, 589829, -570, +575, 1632132967, 1699902057, 1667585638, @@ -22995,7 +23259,7 @@ const std::vector local_constraints = {119734787, 1835102790, 101, 655365, -576, +582, 1348956783, 1767863151, 1970040927, @@ -23005,89 +23269,89 @@ const std::vector local_constraints = {119734787, 1835102790, 101, 262149, -577, +583, 1634886000, 109, 262149, -579, +585, 1634886000, 109, 196613, -585, +591, 7103844, 262149, -592, +598, 1634886000, 109, 262149, -603, +609, 1634886000, 109, 458757, -614, +620, 1383493225, 1816622191, 1818321519, 1819438935, 100, 262149, -615, +621, 1634886000, 109, 196613, -618, +624, 6514038, 458757, -625, +631, 1600741240, 1937075312, 1717514591, 1701667186, 26975, 262149, -626, +632, 1634886000, 109, 262149, -628, +634, 1634886000, 109, 196613, -632, +638, 101, 262149, -634, +640, 1098149746, 7563640, 393221, -643, +649, 1818717793, 1634885477, 1851877732, 0, 327685, -650, +656, 1633906540, 1953452652, 0, 262149, -651, +657, 1634886000, 109, 262149, -653, +659, 1634886000, 109, 262149, -656, +662, 1634886000, 109, 262149, -658, +664, 1634886000, 109, 458757, -679, +685, 1633906540, 1919243884, 1232627060, @@ -23258,95 +23522,95 @@ const std::vector local_constraints = {119734787, 33, 22, 262215, -417, +421, 11, 27, 262215, -422, +426, 11, 26, 262215, -503, +507, 6, 16, 327752, -504, +508, 0, 35, 0, 196679, -504, +508, 3, 262215, -506, +510, 34, 1, 262215, -506, +510, 33, 7, 262215, -534, +538, 34, 1, 262215, -534, +538, 33, 23, 262215, -559, +564, 6, 16, 262216, -560, +565, 0, 5, 327752, -560, +565, 0, 35, 0, 327752, -560, +565, 0, 7, 16, 327752, -560, +565, 1, 35, 64, 327752, -560, +565, 2, 35, 80, 327752, -560, +565, 3, 35, 96, 196679, -560, +565, 3, 262215, -562, +567, 34, 0, 262215, -562, +567, 33, 27, 262215, -570, +575, 34, 1, 262215, -570, +575, 33, 24, 262215, -700, +706, 11, 25, 131091, @@ -23536,140 +23800,140 @@ const std::vector local_constraints = {119734787, 124, 0, 262167, -128, +129, 14, 4, 262187, 14, -130, +131, 0, 262187, 16, -184, +187, 64, 262187, 14, -224, +228, 2, 262187, 6, -323, +327, 1073741824, 262187, 6, -339, +343, 1056964608, 262187, 6, -382, +386, 981668463, 262187, 6, -386, +390, 1065353216, 458796, 7, -387, +391, 84, 84, 84, -386, +390, 262167, -415, +419, 14, 3, 262176, -416, +420, 1, -415, +419, 262203, -416, -417, +420, +421, 1, 262176, -418, +422, 1, 14, 262203, -416, -422, +420, +426, 1, 262187, 6, -446, +450, 1053609165, 262187, 16, -451, +455, 17, 262176, -452, +456, 2, 6, 262187, 16, -460, +464, 21, 262187, 16, -468, +472, 13, 262187, 16, -476, +480, 9, 262187, 6, -480, +484, 1064514355, 262187, 16, -484, +488, 0, 262187, 14, -498, +502, 16, 262172, -499, +503, 7, -498, +502, 262176, -500, +504, 7, -499, -196637, 503, +196637, +507, 7, 196638, -504, -503, +508, +507, 262176, -505, +509, 2, -504, +508, 262203, -505, -506, +509, +510, 2, 262176, -508, +512, 2, 7, 262187, 16, -513, +517, 1, 262187, 16, -522, +526, 28, 262176, -523, +527, 2, 16, 589849, -531, +535, 6, 5, 0, @@ -23678,51 +23942,51 @@ const std::vector local_constraints = {119734787, 1, 0, 196635, -532, -531, +536, +535, 262176, -533, +537, 0, -532, +536, 262203, -533, -534, +537, +538, 0, 262168, -558, +563, 7, 4, 262172, -559, +564, 6, 81, 393246, -560, -558, +565, +563, 7, 16, -559, +564, 262176, -561, +566, 2, -560, +565, 262203, -561, -562, +566, +567, 2, 262203, -533, -570, +537, +575, 0, 393260, 64, -633, -386, +639, +390, 84, 84, 393260, -415, -700, +419, +706, 89, 111, 111, @@ -23735,198 +23999,185 @@ const std::vector local_constraints = {119734787, 5, 262203, 17, -426, +430, 7, 262203, 15, -427, +431, 7, 262203, 17, -428, +432, 7, 262203, 15, -429, +433, 7, 262203, 17, -430, +434, 7, 262203, 17, -431, +435, 7, 262203, 17, -432, +436, 7, 262203, 15, -434, +438, 7, 262203, 17, -436, +440, 7, 262203, 15, -438, +442, 7, 262203, 71, -445, +449, 7, 262203, 17, -483, +487, 7, 262203, 17, -485, +489, 7, 262203, -500, -501, +504, +505, 7, 262203, 17, -515, +519, 7, 262203, 8, -527, +531, 7, 262203, 8, -530, +534, 7, 262203, 17, -538, +543, 7, 262203, 8, -552, +557, 7, 262203, 8, -557, +562, 7, 262203, 8, -563, +568, 7, 262203, 8, -566, +571, 7, 262203, 65, -569, +574, 7, 262203, 65, -576, +582, 7, 262203, 8, -577, +583, 7, 262203, 65, -579, +585, 7, 262203, 65, -585, +591, 7, 262203, 8, -592, +598, 7, 262203, 8, -603, +609, 7, 262203, 8, -614, +620, 7, 262203, 8, -615, +621, 7, 262203, 65, -618, +624, 7, 262203, 65, -625, +631, 7, 262203, 8, -626, +632, 7, 262203, 65, -628, +634, 7, 262203, 65, -632, +638, 7, 262203, 65, -634, +640, 7, 262203, 71, -643, +649, 7, 262203, 8, -650, +656, 7, 262203, 71, -651, +657, 7, 262203, 65, -653, +659, 7, 262203, 8, -656, +662, 7, 262203, 8, -658, +664, 7, 262203, 17, -679, +685, 7, 327745, -418, -419, -417, -130, -262205, -14, -420, -419, -262268, -16, -421, -420, -327745, -418, -423, 422, -130, +423, +421, +131, 262205, 14, 424, @@ -23935,1190 +24186,1211 @@ const std::vector local_constraints = {119734787, 16, 425, 424, -196670, -430, -421, -196670, -431, -425, -262205, -16, -433, +327745, +422, +427, 426, -196670, -432, -433, +131, 262205, 14, -435, +428, 427, +262268, +16, +429, +428, 196670, 434, +425, +196670, 435, +429, 262205, 16, 437, -428, +430, 196670, 436, 437, 262205, 14, 439, -429, +431, 196670, 438, 439, -655417, -2, -440, -57, -430, -431, -432, -434, -436, -438, 262205, 16, 441, 432, 196670, -426, +440, 441, 262205, 14, +443, +433, +196670, 442, +443, +655417, +2, +444, +57, 434, -196670, -427, +435, +436, +438, +440, 442, 262205, 16, -443, +445, 436, 196670, -428, -443, +430, +445, 262205, 14, -444, +446, 438, 196670, -429, -444, -196670, -445, +431, 446, 262205, -14, +16, 447, -429, +440, +196670, +432, +447, +262205, +14, +448, +442, +196670, +433, +448, +196670, +449, +450, +262205, +14, +451, +433, 327850, 9, -448, -447, -224, +452, +451, +228, 196855, -450, +454, 0, 262394, -448, -449, -455, -131320, -449, -327745, 452, 453, +459, +131320, +453, +327745, +456, +457, 92, -451, +455, 262205, 6, -454, -453, +458, +457, 196670, -445, -454, +449, +458, 131321, -450, +454, 131320, -455, +459, 262205, 14, -456, -429, +460, +433, 327850, 9, -457, -456, +461, +460, 81, 196855, -459, +463, 0, 262394, -457, -458, -463, +461, +462, +467, 131320, -458, +462, 327745, -452, -461, +456, +465, 92, -460, +464, 262205, 6, -462, -461, +466, +465, 196670, -445, -462, +449, +466, 131321, -459, -131320, 463, +131320, +467, 262205, 14, -464, -429, +468, +433, 327850, 9, -465, -464, +469, +468, 111, 196855, -467, +471, 0, 262394, -465, -466, -471, +469, +470, +475, 131320, -466, +470, 327745, -452, -469, +456, +473, 92, -468, +472, 262205, 6, -470, -469, +474, +473, 196670, -445, -470, +449, +474, 131321, -467, -131320, 471, +131320, +475, 262205, 14, -472, -429, +476, +433, 327850, 9, -473, -472, -130, +477, +476, +131, 196855, -475, +479, 0, 262394, -473, -474, -475, +477, +478, +479, 131320, -474, +478, 327745, -452, -477, +456, +481, 92, -476, +480, 262205, 6, -478, -477, +482, +481, 196670, -445, -478, +449, +482, 131321, -475, +479, 131320, -475, +479, 131321, -467, +471, 131320, -467, +471, 131321, -459, +463, 131320, -459, +463, 131321, -450, +454, 131320, -450, +454, 262205, 6, -479, -445, +483, +449, 458764, 6, -481, +485, 1, 37, -479, -480, +483, +484, 327813, 6, -482, -339, -481, +486, +343, +485, 196670, -445, -482, +449, +486, 196670, -483, -484, +487, +488, 196670, -485, -484, +489, +488, 131321, -486, +490, 131320, -486, +490, 262390, -488, -489, +492, +493, 0, 131321, -490, +494, 131320, -490, +494, 262205, 16, -491, -485, +495, +489, 262268, 14, -492, -491, +496, +495, 262205, 14, -493, -427, +497, +431, 327856, 9, -494, -492, -493, +498, +496, +497, 262394, -494, -487, -488, +498, +491, +492, 131320, -487, +491, 262205, 16, -495, -428, +499, +432, 262205, 16, -496, -485, +500, +489, 327808, 16, -497, -495, -496, +501, +499, +500, 196670, -483, -497, +487, +501, 262205, 16, -502, -485, +506, +489, 262205, 16, -507, -483, +511, +487, 393281, -508, -509, -506, -484, -507, +512, +513, +510, +488, +511, 262205, 7, -510, -509, +514, +513, 327745, 8, -511, -501, -502, +515, +505, +506, 196670, -511, -510, +515, +514, 131321, -489, +493, 131320, -489, +493, 262205, 16, -512, -485, +516, +489, 327808, 16, -514, -512, -513, +518, +516, +517, 196670, -485, -514, +489, +518, 131321, -486, +490, 131320, -488, +492, 196670, -515, -484, +519, +488, 131321, -516, +520, 131320, -516, +520, 262390, -518, -519, +522, +523, 0, 131321, -520, +524, 131320, -520, +524, 262205, 16, -521, -515, +525, +519, 327745, -523, -524, +527, +528, 92, -522, +526, 262205, 16, -525, -524, +529, +528, 327857, 9, -526, -521, +530, 525, +529, 262394, -526, -517, -518, +530, +521, +522, 131320, -517, +521, 327745, 8, -528, -501, -513, +532, +505, +517, 262205, 7, -529, -528, +533, +532, 196670, -527, -529, +531, +533, 262205, -532, -535, -534, +536, +539, +538, 262205, 16, -536, -428, +540, +432, +262244, +535, +541, +539, 327775, 7, -537, -535, -536, +542, +541, +540, 196670, -530, -537, +534, +542, 196670, -538, -513, +543, +517, 131321, -539, +544, 131320, -539, +544, 262390, -541, -542, +546, +547, 0, 131321, -543, +548, 131320, -543, +548, 262205, 16, -544, -538, +549, +543, 262268, 14, -545, -544, +550, +549, 262205, 14, -546, -427, +551, +431, 327810, 14, -547, -546, +552, +551, 111, 327856, 9, -548, -545, -547, +553, +550, +552, 262394, -548, -540, -541, +553, +545, +546, 131320, -540, +545, 262205, 16, -549, -428, +554, +432, 262205, 16, -550, -538, +555, +543, 327808, 16, -551, -549, -550, +556, +554, +555, 196670, -483, -551, +487, +556, 262205, 16, -553, -538, +558, +543, 327808, 16, -554, -553, -513, +559, +558, +517, 327745, 8, -555, -501, -554, +560, +505, +559, 262205, 7, -556, -555, +561, +560, 196670, -552, -556, +557, +561, 327745, -508, -564, -562, -513, +512, +569, +567, +517, 262205, 7, -565, -564, +570, +569, 196670, -563, -565, +568, +570, 262205, 7, -567, -530, +572, +534, 196670, -566, -567, +571, +572, 393273, 7, -568, +573, 62, -563, -566, -196670, -557, 568, -262205, -532, 571, -570, +196670, +562, +573, +262205, +536, +576, +575, 262205, 16, -572, -483, +577, +487, 327808, 16, -573, -572, -513, +578, +577, +517, +262244, +535, +579, +576, 327775, 7, -574, -571, -573, +580, +579, +578, 524367, 64, -575, -574, -574, -0, +581, +580, +580, +0, 1, 2, 196670, -569, -575, +574, +581, 262205, 7, -578, -557, +584, +562, 196670, -577, -578, +583, +584, 262205, 64, -580, -569, +586, +574, 196670, -579, -580, +585, +586, 393273, 64, -581, +587, 69, -577, -579, +583, +585, 262205, 7, -582, -527, +588, +531, 524367, 64, -583, -582, -582, +589, +588, +588, 0, 1, 2, 327809, 64, -584, -581, -583, +590, +587, +589, 196670, -576, -584, +582, +590, 262205, 6, -586, -445, +592, +449, 262205, 64, -587, -576, +593, +582, 262205, 7, -588, -552, +594, +557, 524367, 64, -589, -588, -588, +595, +594, +594, 0, 1, 2, 327811, 64, -590, -587, -589, +596, +593, +595, 327822, 64, -591, -590, -586, +597, +596, +592, 196670, -585, 591, +597, 262205, 7, -593, -527, +599, +531, 196670, -592, -593, +598, +599, 327737, 9, -594, +600, 12, -592, +598, 196855, -596, +602, 0, 262394, -594, -595, -596, +600, +601, +602, 131320, -595, +601, 262205, 64, -597, -585, +603, +591, 262205, 7, -598, -527, +604, +531, 524367, 64, -599, -598, -598, +605, +604, +604, 0, 1, 2, 327811, 64, -600, -599, -597, +606, +605, +603, 262205, 7, -601, -527, +607, +531, 589903, 7, -602, -601, -600, +608, +607, +606, 4, 5, 6, 3, 196670, -527, -602, +531, +608, 131321, -596, +602, 131320, -596, +602, 262205, 7, -604, -552, +610, +557, 196670, -603, -604, +609, +610, 327737, 9, -605, +611, 12, -603, +609, 196855, -607, +613, 0, 262394, -605, -606, -607, +611, +612, +613, 131320, -606, +612, 262205, 64, -608, -585, +614, +591, 262205, 7, -609, -552, +615, +557, 524367, 64, -610, -609, -609, +616, +615, +615, 0, 1, 2, 327809, 64, -611, -610, -608, +617, +616, +614, 262205, 7, -612, -552, +618, +557, 589903, 7, -613, -612, -611, +619, +618, +617, 4, 5, 6, 3, 196670, -552, -613, +557, +619, 131321, -607, +613, 131320, -607, +613, 262205, 7, -616, -557, +622, +562, 196670, -615, -616, +621, +622, 327737, 7, -617, +623, 79, -615, +621, 196670, -614, -617, +620, +623, 262205, 7, -619, -552, +625, +557, 524367, 64, -620, -619, -619, +626, +625, +625, 0, 1, 2, 262205, 7, -621, -527, +627, +531, 524367, 64, -622, -621, -621, +628, +627, +627, 0, 1, 2, 327811, 64, -623, -620, -622, +629, +626, +628, 393228, 64, -624, +630, 1, 69, -623, +629, 196670, -618, 624, +630, 262205, 7, -627, -614, +633, +620, 196670, -626, -627, +632, +633, 262205, 64, -629, -618, +635, +624, 196670, -628, -629, +634, +635, 393273, 64, -630, +636, 69, -626, -628, +632, +634, 393228, 64, -631, +637, 1, 69, -630, +636, 196670, -625, 631, +637, 196670, -632, -633, +638, +639, 262205, 64, -635, -632, +641, +638, 262205, 64, -636, -625, +642, +631, 458764, 64, -637, +643, 1, 68, -635, -636, +641, +642, 196670, -634, -637, +640, +643, 262205, 64, -638, -634, +644, +640, 393228, 6, -639, +645, 1, 66, -638, +644, 327866, 9, -640, -639, -382, +646, +645, +386, 196855, -642, +648, 0, 262394, -640, -641, -642, +646, +647, +648, 131320, -641, +647, 262205, 64, -644, -632, +650, +638, 262205, 64, -645, -625, +651, +631, 327828, 6, -646, -644, -645, +652, +650, +651, 393228, 6, -647, +653, 1, 17, -646, +652, 196670, -643, -647, +649, +653, 262205, 64, -648, -634, +654, +640, 393228, 64, -649, +655, 1, 69, -648, +654, 196670, -634, -649, +640, +655, 262205, 6, -652, -643, +658, +649, 196670, -651, -652, +657, +658, 262205, 64, -654, -634, +660, +640, 196670, -653, -654, +659, +660, 393273, 7, -655, +661, 75, -651, -653, +657, +659, 196670, -650, -655, +656, +661, 262205, 7, -657, -530, +663, +534, 196670, -656, -657, +662, +663, 262205, 7, -659, -650, +665, +656, 196670, -658, -659, +664, +665, 393273, 7, -660, +666, 62, -656, -658, +662, +664, 196670, -530, -660, +534, +666, 131321, -642, +648, 131320, -642, +648, 262205, 16, -661, -538, +667, +543, 262205, 7, -662, -527, +668, +531, 524367, 64, -663, -662, -662, +669, +668, +668, 0, 1, 2, 327745, 8, -664, -501, -661, +670, +505, +667, 262205, 7, -665, -664, +671, +670, 589903, 7, -666, -665, -663, +672, +671, +669, 4, 5, 6, 3, 196670, -664, -666, +670, +672, 262205, 16, -667, -538, +673, +543, 327808, 16, -668, -667, -513, +674, +673, +517, 262205, 7, -669, -552, +675, +557, 524367, 64, -670, -669, -669, +676, +675, +675, 0, 1, 2, 327745, 8, -671, -501, -668, +677, +505, +674, 262205, 7, -672, -671, +678, +677, 589903, 7, -673, -672, -670, +679, +678, +676, 4, 5, 6, 3, 196670, -671, -673, +677, +679, 262205, 7, -674, -552, +680, +557, 196670, -527, -674, +531, +680, 131321, -542, +547, 131320, -542, +547, 262205, 16, -675, -538, +681, +543, 327808, 16, -676, -675, -513, +682, +681, +517, 196670, -538, -676, +543, +682, 131321, -539, +544, 131320, -541, +546, 131321, -519, +523, 131320, -519, +523, 262205, 16, -677, -515, +683, +519, 327808, 16, -678, -677, -513, +684, +683, +517, 196670, -515, -678, +519, +684, 131321, -516, +520, 131320, -518, +522, 196670, -679, -484, +685, +488, 131321, -680, +686, 131320, -680, +686, 262390, -682, -683, +688, +689, 0, 131321, -684, +690, 131320, -684, +690, 262205, 16, +691, 685, -679, 262268, 14, -686, -685, +692, +691, 262205, 14, -687, -427, +693, +431, 327856, 9, -688, -686, -687, +694, +692, +693, 262394, +694, +687, 688, -681, -682, 131320, -681, +687, 262205, 16, -689, -428, +695, +432, 262205, 16, -690, -679, +696, +685, 327808, 16, -691, -689, -690, +697, +695, +696, 196670, -483, -691, +487, +697, 262205, 16, -692, -483, +698, +487, 262205, 16, -693, -679, +699, +685, 327745, 8, -694, -501, -693, +700, +505, +699, 262205, 7, -695, -694, +701, +700, 393281, -508, -696, -506, -484, -692, +512, +702, +510, +488, +698, 196670, -696, -695, +702, +701, 131321, -683, +689, 131320, -683, +689, 262205, 16, -697, -679, +703, +685, 327808, 16, -698, -697, -513, +704, +703, +517, 196670, -679, -698, +685, +704, 131321, -680, +686, 131320, -682, +688, 65789, 65592, 327734, @@ -25325,48 +25597,52 @@ const std::vector local_constraints = {119734787, 16, 127, 126, -327775, +262244, +121, 128, -129, 125, +327775, +129, +130, +128, 127, 327761, 14, -131, -129, +132, +130, 0, 196670, 27, -131, +132, 262205, 14, -132, +133, 21, 262205, 14, -133, +134, 25, 327812, 14, -134, -132, +135, 133, +134, 262205, 14, -135, +136, 24, 327808, 14, -136, -134, +137, 135, +136, 262268, 16, +138, 137, -136, 196670, 23, -137, +138, 65789, 65592, 327734, @@ -25405,163 +25681,167 @@ const std::vector local_constraints = {119734787, 40, 262205, 14, -138, +139, 30, 196670, 37, -138, +139, 327745, 94, -139, +140, 92, 93, 262205, 14, +141, 140, -139, 327814, 14, -141, +142, 89, -140, +141, 196670, 36, -141, +142, 262205, 14, -142, +143, 30, 327745, 94, -143, +144, 92, 93, 262205, 14, +145, 144, -143, 327817, 14, +146, +143, 145, -142, -144, 196670, 33, -145, +146, 262205, 14, -146, +147, 31, 327745, 94, -147, +148, 92, 93, 262205, 14, +149, 148, -147, 327812, 14, +150, +147, 149, -146, -148, 262205, 14, -150, +151, 33, 327808, 14, -151, -149, +152, 150, +151, 196670, 32, -151, +152, 262205, 14, -152, +153, 30, 262205, 14, -153, +154, 33, 327810, 14, -154, -152, +155, 153, +154, 327745, 94, -155, +156, 92, 93, 262205, 14, +157, 156, -155, 327814, 14, +158, +155, 157, -154, -156, 196670, 35, -157, +158, 262205, 122, -158, +159, 124, 262205, 14, -159, +160, 32, 262268, 16, +161, 160, +262244, +121, +162, 159, 327775, -128, +129, +163, +162, 161, -158, -160, 327761, 14, -162, -161, +164, +163, 0, 196670, 38, -162, +164, 262205, 14, -163, +165, 32, 262205, 14, -164, +166, 36, 327812, 14, +167, 165, -163, -164, +166, 262205, 14, -166, +168, 35, 327808, 14, +169, 167, -165, -166, +168, 262268, 16, -168, -167, +170, +169, 196670, 34, -168, +170, 65789, 65592, 327734, @@ -25591,83 +25871,87 @@ const std::vector local_constraints = {119734787, 49, 262205, 14, -169, +171, 43, 327812, 14, -170, +172, 89, -169, +171, 262205, 14, -171, +173, 42, 327808, 14, +174, 172, -170, -171, +173, 196670, 44, -172, +174, 327745, 94, -173, +175, 92, 93, 262205, 14, -174, -173, +176, +175, 327814, 14, -175, +177, 89, -174, +176, 196670, 45, -175, +177, 262205, 122, -176, +178, 124, 262205, 14, -177, +179, 44, 262268, 16, -178, -177, -327775, -128, +180, 179, -176, +262244, +121, +181, 178, +327775, +129, +182, +181, +180, 327761, 14, -180, -179, +183, +182, 0, 196670, 47, -180, +183, 262205, 14, -181, +184, 44, 262205, 14, -182, +185, 45, 327812, 14, -183, -181, -182, +186, +184, +185, 196670, 46, -183, +186, 65789, 65592, 327734, @@ -25697,113 +25981,117 @@ const std::vector local_constraints = {119734787, 58, 262205, 16, -185, +188, 52, 327812, 16, -186, -184, -185, +189, +187, +188, 262205, 16, -187, +190, 51, 327808, 16, -188, -186, -187, +191, +189, +190, 196670, 53, -188, +191, 327745, 94, -189, +192, 92, 108, 262205, 14, -190, -189, +193, +192, 327808, 14, -191, -190, +194, +193, 111, 262268, 16, -192, -191, +195, +194, 262205, 16, -193, +196, 53, 327812, 16, -194, -193, -192, +197, +196, +195, 196670, 53, -194, +197, 327745, 94, -195, +198, 92, 93, 262205, 14, -196, -195, +199, +198, 327814, 14, -197, +200, 89, -196, +199, 196670, 54, -197, +200, 262205, 122, -198, +201, 124, 262205, 16, -199, +202, 53, +262244, +121, +203, +201, 327775, -128, -200, -198, -199, +129, +204, +203, +202, 327761, 14, -201, -200, +205, +204, 0, 196670, 56, -201, +205, 262205, 16, -202, +206, 53, 262205, 14, -203, +207, 54, 262268, 16, -204, -203, +208, +207, 327812, 16, -205, -202, -204, +209, +206, +208, 196670, 55, -205, +209, 65789, 65592, 327734, @@ -25821,474 +26109,474 @@ const std::vector local_constraints = {119734787, 63, 262203, 8, -206, +210, 7, 327745, 71, -207, +211, 60, 81, 262205, 6, -208, -207, +212, +211, 327745, 71, -209, +213, 61, 81, 262205, 6, -210, -209, +214, +213, 327813, 6, -211, -208, -210, +215, +212, +214, 327745, 71, -212, +216, 60, -130, +131, 262205, 6, -213, -212, +217, +216, 327745, 71, -214, +218, 61, -130, +131, 262205, 6, -215, -214, +219, +218, 327813, 6, -216, -213, -215, +220, +217, +219, 327811, 6, -217, -211, -216, +221, +215, +220, 327745, 71, -218, +222, 60, 111, 262205, 6, -219, -218, +223, +222, 327745, 71, -220, +224, 61, 111, 262205, 6, -221, -220, +225, +224, 327813, 6, -222, -219, -221, +226, +223, +225, 327811, 6, -223, -217, -222, +227, +221, +226, 327745, 71, -225, +229, 60, -224, +228, 262205, 6, -226, -225, +230, +229, 327745, 71, -227, +231, 61, -224, +228, 262205, 6, -228, -227, +232, +231, 327813, 6, -229, -226, -228, +233, +230, +232, 327811, 6, -230, -223, -229, +234, +227, +233, 327745, 71, -231, -206, +235, +210, 81, 196670, -231, -230, +235, +234, 327745, 71, -232, +236, 60, 81, 262205, 6, -233, -232, +237, +236, 327745, 71, -234, +238, 61, -130, +131, 262205, 6, -235, -234, +239, +238, 327813, 6, -236, -233, -235, +240, +237, +239, 327745, 71, -237, +241, 60, -130, +131, 262205, 6, -238, -237, +242, +241, 327745, 71, -239, +243, 61, 81, 262205, 6, -240, -239, +244, +243, 327813, 6, -241, -238, -240, +245, +242, +244, 327809, 6, -242, -236, -241, +246, +240, +245, 327745, 71, -243, +247, 60, 111, 262205, 6, -244, -243, +248, +247, 327745, 71, -245, +249, 61, -224, +228, 262205, 6, -246, -245, +250, +249, 327813, 6, -247, -244, -246, +251, +248, +250, 327809, 6, -248, -242, -247, +252, +246, +251, 327745, 71, -249, +253, 60, -224, +228, 262205, 6, -250, -249, +254, +253, 327745, 71, -251, +255, 61, 111, 262205, 6, -252, -251, +256, +255, 327813, 6, -253, -250, -252, +257, +254, +256, 327811, 6, -254, -248, -253, +258, +252, +257, 327745, 71, -255, -206, -130, +259, +210, +131, 196670, -255, -254, +259, +258, 327745, 71, -256, +260, 60, 81, 262205, 6, -257, -256, +261, +260, 327745, 71, -258, +262, 61, 111, 262205, 6, -259, -258, +263, +262, 327813, 6, -260, -257, -259, +264, +261, +263, 327745, 71, -261, +265, 60, 111, 262205, 6, -262, -261, +266, +265, 327745, 71, -263, +267, 61, 81, 262205, 6, -264, -263, +268, +267, 327813, 6, -265, -262, -264, +269, +266, +268, 327809, 6, -266, -260, -265, +270, +264, +269, 327745, 71, -267, +271, 60, -224, +228, 262205, 6, -268, -267, +272, +271, 327745, 71, -269, +273, 61, -130, +131, 262205, 6, -270, -269, +274, +273, 327813, 6, -271, -268, -270, +275, +272, +274, 327809, 6, -272, -266, -271, +276, +270, +275, 327745, 71, -273, +277, 60, -130, +131, 262205, 6, -274, -273, +278, +277, 327745, 71, -275, +279, 61, -224, +228, 262205, 6, -276, -275, +280, +279, 327813, 6, -277, -274, -276, +281, +278, +280, 327811, 6, -278, -272, -277, +282, +276, +281, 327745, 71, -279, -206, +283, +210, 111, 196670, -279, -278, +283, +282, 327745, 71, -280, +284, 60, 81, 262205, 6, -281, -280, +285, +284, 327745, 71, -282, +286, 61, -224, +228, 262205, 6, -283, -282, +287, +286, 327813, 6, -284, -281, -283, +288, +285, +287, 327745, 71, -285, +289, 60, -224, +228, 262205, 6, -286, -285, +290, +289, 327745, 71, -287, +291, 61, 81, 262205, 6, -288, -287, +292, +291, 327813, 6, -289, -286, -288, -327809, -6, +293, 290, -284, -289, +292, +327809, +6, +294, +288, +293, 327745, 71, -291, +295, 60, -130, +131, 262205, 6, -292, -291, +296, +295, 327745, 71, -293, +297, 61, 111, 262205, 6, -294, -293, +298, +297, 327813, 6, -295, -292, -294, +299, +296, +298, 327809, 6, -296, -290, -295, +300, +294, +299, 327745, 71, -297, +301, 60, 111, 262205, 6, -298, -297, +302, +301, 327745, 71, -299, +303, 61, -130, +131, 262205, 6, -300, -299, +304, +303, 327813, 6, -301, -298, -300, +305, +302, +304, 327811, 6, -302, -296, -301, +306, +300, +305, 327745, 71, -303, -206, -224, +307, +210, +228, 196670, -303, -302, +307, +306, 262205, 7, -304, -206, +308, +210, 131326, -304, +308, 65592, 327734, 64, @@ -26305,150 +26593,150 @@ const std::vector local_constraints = {119734787, 70, 262203, 65, -307, +311, 7, 262203, 65, -315, +319, 7, 262203, 65, -319, +323, 7, 327745, 71, -308, +312, 67, -130, +131, 262205, 6, -309, -308, +313, +312, 327745, 71, -310, +314, 67, 111, 262205, 6, -311, -310, +315, +314, 327745, 71, -312, +316, 67, -224, +228, 262205, 6, -313, -312, +317, +316, 393296, 64, -314, -309, -311, +318, 313, +315, +317, 196670, -307, -314, +311, +318, 262205, 64, -316, -307, +320, +311, 262205, 64, -317, +321, 68, 458764, 64, -318, +322, 1, 68, -316, -317, +320, +321, 196670, -315, -318, +319, +322, 262205, 64, -320, -307, +324, +311, 262205, 64, -321, -315, +325, +319, 458764, 64, -322, +326, 1, 68, -320, -321, +324, +325, 196670, -319, -322, +323, +326, 327745, 71, -324, +328, 67, 81, 262205, 6, -325, -324, +329, +328, 327813, 6, -326, -323, -325, +330, +327, +329, 262205, 64, -327, -315, +331, +319, 327822, 64, -328, -327, -326, +332, +331, +330, 196670, -315, -328, +319, +332, 262205, 64, -329, -319, +333, +323, 327822, 64, -330, -329, -323, +334, +333, +327, 196670, -319, -330, +323, +334, 262205, 64, -331, +335, 68, 262205, 64, -332, -315, +336, +319, 327809, 64, -333, -331, -332, +337, +335, +336, 262205, 64, -334, -319, +338, +323, 327809, 64, -335, -333, -334, +339, +337, +338, 131326, -335, +339, 65592, 327734, 7, @@ -26465,94 +26753,94 @@ const std::vector local_constraints = {119734787, 76, 262203, 71, -338, +342, 7, 262203, 71, -342, +346, 7, 262203, 8, -345, +349, 7, 262205, 6, -340, +344, 73, 327813, 6, -341, -339, -340, +345, +343, +344, 196670, -338, -341, +342, +345, 262205, 6, -343, -338, +347, +342, 393228, 6, -344, +348, 1, 13, -343, +347, 196670, -342, -344, +346, +348, 262205, 6, -346, -338, +350, +342, 393228, 6, -347, +351, 1, 14, -346, +350, 327745, 71, -348, -345, +352, +349, 81, 196670, -348, -347, +352, +351, 262205, 6, -349, -342, +353, +346, 262205, 64, -350, +354, 74, 327822, 64, -351, -350, -349, +355, +354, +353, 262205, 7, -352, -345, +356, +349, 589903, 7, -353, -352, -351, +357, +356, +355, 4, 5, 6, 3, 196670, -345, -353, +349, +357, 262205, 7, -354, -345, +358, +349, 131326, -354, +358, 65592, 327734, 7, @@ -26566,268 +26854,268 @@ const std::vector local_constraints = {119734787, 80, 262203, 71, -357, +361, 7, 327745, 71, -358, +362, 78, -130, +131, 262205, 6, -359, -358, +363, +362, 327745, 71, -360, +364, 78, -130, +131, 262205, 6, -361, -360, +365, +364, 327813, 6, -362, -359, -361, +366, +363, +365, 327745, 71, -363, +367, 78, 111, 262205, 6, -364, -363, +368, +367, 327745, 71, -365, +369, 78, 111, 262205, 6, -366, -365, +370, +369, 327813, 6, -367, -364, -366, +371, +368, +370, 327809, 6, -368, -362, -367, +372, +366, +371, 327745, 71, -369, +373, 78, -224, +228, 262205, 6, -370, -369, +374, +373, 327745, 71, -371, +375, 78, -224, +228, 262205, 6, -372, -371, +376, +375, 327813, 6, -373, -370, -372, +377, +374, +376, 327809, 6, -374, -368, -373, +378, +372, +377, 327745, 71, -375, +379, 78, 81, 262205, 6, -376, -375, +380, +379, 327745, 71, -377, +381, 78, 81, 262205, 6, -378, -377, +382, +381, 327813, 6, -379, -376, -378, +383, +380, +382, 327809, 6, -380, -374, -379, +384, +378, +383, 196670, -357, -380, +361, +384, 262205, 6, -381, -357, +385, +361, 327864, 9, -383, -381, -382, -196855, +387, 385, +386, +196855, +389, 0, 262394, -383, -384, -385, +387, +388, +389, 131320, -384, +388, 131326, -387, +391, 131320, -385, +389, 327745, 71, -389, +393, 78, -130, +131, 262205, 6, -390, -389, +394, +393, 262271, 6, -391, -390, +395, +394, 262205, 6, -392, -357, +396, +361, 327816, 6, -393, -391, -392, +397, +395, +396, 327745, 71, -394, +398, 78, -130, +131, 196670, -394, -393, +398, +397, 327745, 71, -395, +399, 78, 111, 262205, 6, -396, -395, +400, +399, 262271, 6, -397, -396, +401, +400, 262205, 6, -398, -357, +402, +361, 327816, 6, -399, -397, -398, +403, +401, +402, 327745, 71, -400, +404, 78, 111, 196670, -400, -399, +404, +403, 327745, 71, -401, +405, 78, -224, +228, 262205, 6, -402, -401, +406, +405, 262271, 6, -403, -402, +407, +406, 262205, 6, -404, -357, +408, +361, 327816, 6, -405, -403, -404, +409, +407, +408, 327745, 71, -406, +410, 78, -224, +228, 196670, -406, -405, +410, +409, 327745, 71, -407, +411, 78, 81, 262205, 6, -408, -407, +412, +411, 262205, 6, -409, -357, +413, +361, 327816, 6, -410, -408, -409, +414, +412, +413, 327745, 71, -411, +415, 78, 81, 196670, -411, -410, +415, +414, 262205, 7, -412, +416, 78, 131326, -412, +416, 65592, }; -const std::vector length_wind_collision = {119734787, +const std::vector compute_tangents = {119734787, 65536, 524289, -582, +302, 0, 131089, 1, @@ -26847,8 +27135,8 @@ const std::vector length_wind_collision = {119734787, 4, 1852399981, 0, -279, -280, +191, +192, 393232, 4, 17, @@ -27129,84 +27417,33 @@ const std::vector length_wind_collision = {119734787, 1634890867, 2035573870, 25968, -655365, -63, -1936617283, -1767993972, -1968010350, -1885959276, -1919248748, -879130152, -879130171, -59, 327685, -61, -1953653104, -1701602153, -48, -327685, -62, -1953653104, -1701602153, -49, -786437, -71, -1819308097, -1936278649, -1668178292, -1852785509, -1634890867, -678719081, -993289846, -993289846, -1715155302, -15153, -262149, -67, -812871536, -0, -262149, -68, -829648752, -0, -393221, 69, -1735549300, -1766093925, -1851880563, -25955, -327685, -70, -1718187123, -1936027238, -115, -327685, -82, 1936617283, 1953390964, 115, 327686, -82, +69, 0, 1767333735, 25710, 327686, -82, +69, 1, 1767333735, 3236974, 327686, -82, +69, 2, 1767333735, 3302510, 327686, -82, +69, 3, 1767333735, 3368046, 720902, -82, +69, 4, 1968070503, 1852132461, @@ -27217,14 +27454,14 @@ const std::vector length_wind_collision = {119734787, 1769234802, 7564911, 458758, -82, +69, 5, 1130520423, 1768713327, 1852795251, 0, 524294, -82, +69, 6, 1917280103, 1953068641, @@ -27232,19 +27469,19 @@ const std::vector length_wind_collision = {119734787, 1970563438, 25956, 393222, -82, +69, 7, 1767137127, 1951622509, 28773, 393222, -82, +69, 8, 1631870823, 1852403821, 12391, 786438, -82, +69, 9, 1951620967, 1852204649, @@ -27256,7 +27493,7 @@ const std::vector length_wind_collision = {119734787, 1735289192, 48, 786438, -82, +69, 10, 1951620967, 1852204649, @@ -27268,7 +27505,7 @@ const std::vector length_wind_collision = {119734787, 1852401763, 12391, 851974, -82, +69, 11, 1816616807, 1818321519, @@ -27281,13 +27518,13 @@ const std::vector length_wind_collision = {119734787, 811951982, 0, 393222, -82, +69, 12, 1631870823, 1852403821, 12647, 786438, -82, +69, 13, 1951620967, 1852204649, @@ -27299,7 +27536,7 @@ const std::vector length_wind_collision = {119734787, 1735289192, 49, 786438, -82, +69, 14, 1951620967, 1852204649, @@ -27311,7 +27548,7 @@ const std::vector length_wind_collision = {119734787, 1852401763, 12647, 851974, -82, +69, 15, 1816616807, 1818321519, @@ -27324,13 +27561,13 @@ const std::vector length_wind_collision = {119734787, 828729198, 0, 393222, -82, +69, 16, 1631870823, 1852403821, 12903, 786438, -82, +69, 17, 1951620967, 1852204649, @@ -27342,7 +27579,7 @@ const std::vector length_wind_collision = {119734787, 1735289192, 50, 786438, -82, +69, 18, 1951620967, 1852204649, @@ -27354,7 +27591,7 @@ const std::vector length_wind_collision = {119734787, 1852401763, 12903, 851974, -82, +69, 19, 1816616807, 1818321519, @@ -27367,13 +27604,13 @@ const std::vector length_wind_collision = {119734787, 845506414, 0, 393222, -82, +69, 20, 1631870823, 1852403821, 13159, 786438, -82, +69, 21, 1951620967, 1852204649, @@ -27385,7 +27622,7 @@ const std::vector length_wind_collision = {119734787, 1735289192, 51, 786438, -82, +69, 22, 1951620967, 1852204649, @@ -27397,7 +27634,7 @@ const std::vector length_wind_collision = {119734787, 1852401763, 13159, 851974, -82, +69, 23, 1816616807, 1818321519, @@ -27410,7 +27647,7 @@ const std::vector length_wind_collision = {119734787, 862283630, 0, 720902, -82, +69, 24, 1968070503, 1399213933, @@ -27421,7 +27658,7 @@ const std::vector length_wind_collision = {119734787, 1886744434, 0, 720902, -82, +69, 25, 1968070503, 1819231853, @@ -27432,7 +27669,7 @@ const std::vector length_wind_collision = {119734787, 1919508808, 0, 589830, -82, +69, 26, 1767137127, 1885688688, @@ -27441,12 +27678,12 @@ const std::vector length_wind_collision = {119734787, 1869898593, 114, 327686, -82, +69, 27, 1466064743, 7369313, 786438, -82, +69, 28, 1968070503, 1668238445, @@ -27458,56 +27695,17 @@ const std::vector length_wind_collision = {119734787, 1852795252, 115, 196613, -84, +71, 0, 458757, -116, +103, 1632132967, 1951625833, 1684955506, 1701869908, 0, -262149, -198, -1634886000, -109, -262149, -203, -1634886000, -109, -262149, -216, -1634886000, -109, -262149, -229, -1953260900, -97, -327685, -235, -1953720676, -1701015137, -0, -327685, -240, -1701999731, -1768448884, -26478, -327685, -249, -1953265005, -1768714345, -29285, -262149, -250, -1634886000, -109, -262149, -252, -1634886000, -109, 524293, -279, +191, 1281322087, 1818321775, 1870032457, @@ -27515,41 +27713,41 @@ const std::vector length_wind_collision = {119734787, 1145663087, 0, 393221, -280, +192, 1465871463, 1198223983, 1886744434, 17481, 458757, -281, +193, 1651469415, 1951624289, 1684955506, 1701080649, 120, 458757, -282, +194, 1633906540, 1920226156, 1231318625, 2019910766, 0, 458757, -283, +195, 1651469415, 1700162657, 2019914866, 1701080649, 120, 458757, -284, +196, 1633906540, 1919243884, 1232627060, 2019910766, 0, 524293, -285, +197, 1450014062, 1769239141, 1232299363, @@ -27557,55 +27755,68 @@ const std::vector length_wind_collision = {119734787, 1634890835, 25710, 458757, -286, +198, 1701080681, 1919895160, 1918986323, 1699570789, 109, 327685, -287, +199, 1634890867, 2035573870, 25968, 262149, -288, +200, 1634886000, 109, 262149, -292, +204, 1634886000, 109, 262149, -295, +207, 1634886000, 109, 262149, -297, +209, 1634886000, 109, 262149, -299, +211, 1634886000, 109, 262149, -301, +213, 1634886000, 109, 262149, -303, +215, 1634886000, 109, 262149, -305, +217, 1634886000, 109, 262149, -307, +219, 1634886000, 109, +327685, +231, +1918986355, +1867539557, +115, +524293, +233, +1632132967, +1700164201, +2019914866, +1769172816, +1852795252, +115, 589829, -317, +242, 1332573550, 1920226150, 1935961697, @@ -27613,131 +27824,47 @@ const std::vector length_wind_collision = {119734787, 1634038376, 1869760356, 28789, -327685, -322, -1918986355, -1867539557, -115, +262149, +251, +1735287156, +7630437, 458757, -325, +264, 1953067639, 1818386789, 1936674917, 1869182057, 29550, 589830, -325, +264, 0, 1632132967, 1700164201, 2019914866, -1769172816, -1852795252, -115, +1735287124, +1937010277, +0, 196613, -327, +266, 0, 393221, -337, -1918986355, -1699505253, -1752459118, -0, -458757, -342, -1632132967, -1699902057, -1699509363, -1752459118, -5657171, -262149, -371, -1668444006, -101, -262149, -373, -1835102822, -101, -196613, -387, -97, -196613, -394, -119, -327685, -423, -1918986355, -1850303589, -7890276, -196613, -432, -118, -262149, -445, -1668444006, -101, -196613, -468, -97, -196613, -475, -98, -327685, -482, -1919251561, -1869182049, -17774, -327685, -494, -1918986355, -1850303589, -7890276, -262149, -516, -1634886000, -109, -262149, -519, -1634886000, -109, -262149, -522, -1634886000, -109, -262149, -525, -1634886000, -109, -262149, -550, -1634886000, -109, -262149, -553, -1634886000, -109, -262149, -556, -1634886000, -109, +276, +1953654134, +1834969439, +1937075817, +12639, 262149, -559, -1634886000, -109, -393221, -568, -1819231074, -1702126916, -1684370531, -0, +283, +1953654134, +26975, 393221, -578, +298, 1684104520, 1851880020, 1919903347, 109, 589830, -578, +298, 0, 1867341671, 1416389988, @@ -27746,7 +27873,7 @@ const std::vector length_wind_collision = {119734787, 1215459142, 6578533, 589830, -578, +298, 1, 1867341671, 1382835556, @@ -27755,7 +27882,7 @@ const std::vector length_wind_collision = {119734787, 1684104520, 0, 589830, -578, +298, 2, 1852396386, 1214606439, @@ -27764,259 +27891,259 @@ const std::vector length_wind_collision = {119734787, 1836216166, 0, 327686, -578, +298, 3, 1684300144, 6778473, 196613, -580, +300, 0, 327752, -82, +69, 0, 35, 0, 327752, -82, +69, 1, 35, 16, 327752, -82, +69, 2, 35, 32, 327752, -82, +69, 3, 35, 48, 327752, -82, +69, 4, 35, 64, 327752, -82, +69, 5, 35, 68, 327752, -82, +69, 6, 35, 72, 327752, -82, +69, 7, 35, 76, 327752, -82, +69, 8, 35, 80, 327752, -82, +69, 9, 35, 84, 327752, -82, +69, 10, 35, 88, 327752, -82, +69, 11, 35, 92, 327752, -82, +69, 12, 35, 96, 327752, -82, +69, 13, 35, 100, 327752, -82, +69, 14, 35, 104, 327752, -82, +69, 15, 35, 108, 327752, -82, +69, 16, 35, 112, 327752, -82, +69, 17, 35, 116, 327752, -82, +69, 18, 35, 120, 327752, -82, +69, 19, 35, 124, 327752, -82, +69, 20, 35, 128, 327752, -82, +69, 21, 35, 132, 327752, -82, +69, 22, 35, 136, 327752, -82, +69, 23, 35, 140, 327752, -82, +69, 24, 35, 144, 327752, -82, +69, 25, 35, 148, 327752, -82, +69, 26, 35, 152, 327752, -82, +69, 27, 35, 156, 327752, -82, +69, 28, 35, 160, 196679, -82, +69, 3, 262215, -84, +71, 34, 0, 262215, -84, +71, 33, 16, 262215, -116, +103, 34, 1, 262215, -116, +103, 33, 22, 262215, -279, +191, 11, 27, 262215, -280, +192, 11, 26, 262215, -324, +233, +34, +1, +262215, +233, +33, +7, +262215, +263, 6, 16, 327752, -325, +264, 0, 35, 0, 196679, -325, +264, 3, 262215, -327, -34, -1, -262215, -327, -33, -7, -262215, -342, +266, 34, 1, 262215, -342, +266, 33, -26, +8, 262215, -577, +297, 6, 16, 262216, -578, +298, 0, 5, 327752, -578, +298, 0, 35, 0, 327752, -578, +298, 0, 7, 16, 327752, -578, +298, 1, 35, 64, 327752, -578, +298, 2, 35, 80, 327752, -578, +298, 3, 35, 96, 196679, -578, +298, 3, 262215, -580, +300, 34, 0, 262215, -580, +300, 33, 27, 262215, -581, +301, 11, 25, 131091, @@ -28087,40 +28214,24 @@ const std::vector length_wind_collision = {119734787, 15, 17, 15, -262167, -59, -6, -2, -327713, -60, +262187, +14, 59, -8, -8, +3, 262176, -65, +60, 7, 6, -458785, -66, -2, -8, -8, -65, -65, -262187, -14, -73, -3, 262187, 6, -76, +63, 0, 262187, 14, -81, +68, 64, 2031646, -82, +69, 7, 7, 7, @@ -28151,31 +28262,31 @@ const std::vector length_wind_collision = {119734787, 16, 16, 262176, -83, +70, 2, -82, +69, 262203, -83, -84, +70, +71, 2, 262187, 16, -85, +72, 24, 262176, -86, +73, 2, 14, 262187, 16, -100, +87, 25, 262187, 14, -103, +90, 1, 589849, -113, +100, 14, 5, 0, @@ -28184,256 +28295,130 @@ const std::vector length_wind_collision = {119734787, 1, 0, 196635, -114, -113, +101, +100, 262176, -115, +102, 0, -114, +101, 262203, -115, -116, +102, +103, 0, 262167, -120, +108, 14, 4, 262187, 14, -122, +110, 0, 262187, 16, -176, +166, 64, -262187, -6, -208, -1056964608, -327724, -59, -209, -208, -208, -262187, -6, -212, -1065353216, -327724, -59, -213, -212, -76, -327724, -59, -221, -76, -212, -327724, -59, -224, -76, -76, -262167, -227, -6, -3, -262176, -228, -7, -227, -262187, -6, -238, -869711765, -262176, -248, -7, -59, 262167, -277, +189, 14, 3, 262176, -278, +190, 1, -277, +189, 262203, -278, -279, +190, +191, 1, 262203, -278, -280, +190, +192, 1, 262176, -289, +201, 1, 14, 262172, -320, +229, 7, -81, +68, 262176, -321, +230, 4, -320, +229, 262203, -321, -322, +230, +231, 4, -196637, -324, -7, -196638, -325, -324, -262176, -326, -2, -325, 262203, -326, -327, -2, -262187, -16, -328, +102, +233, 0, 262176, -330, -2, -7, -262176, -333, +239, 4, 7, -262172, -335, -6, -81, -262176, -336, -4, -335, -262203, -336, -337, -4, -589849, -339, -6, -5, -0, -0, -0, -1, -0, -196635, -340, -339, -262176, -341, -0, -340, -262203, -341, -342, -0, -262176, -347, -4, -6, -262187, -14, -349, -4062, -262176, -350, -2, -6, 262187, 14, -364, +241, 2, -458796, -7, -372, -76, -76, -76, -76, -262187, -14, -389, -20, -262187, +262167, +249, 6, -392, -1101004800, -262187, -16, -402, -1, -262187, -16, -409, -2, -262187, -16, -417, 3, -262187, -16, -454, +262176, +250, 7, -262187, -6, -471, -1073741824, -262187, -16, -489, -4, +249, +196637, +263, +7, +196638, +264, +263, 262176, -490, +265, 2, +264, +262203, +265, +266, +2, +262187, 16, +267, +0, 262176, -567, +271, +2, 7, -9, -196650, -9, -569, 262168, -576, +296, 7, 4, 262172, -577, +297, 6, -73, +59, 393246, -578, -576, +298, +296, 7, 16, -577, +297, 262176, -579, +299, 2, -578, +298, 262203, -579, -580, +299, +300, 2, 393260, -277, -581, -81, -103, -103, +189, +301, +68, +90, +90, 327734, 2, 4, @@ -28443,1843 +28428,942 @@ const std::vector length_wind_collision = {119734787, 5, 262203, 15, -281, +193, 7, 262203, 15, -282, +194, 7, 262203, 17, -283, +195, 7, 262203, 15, -284, +196, 7, 262203, 15, -285, +197, 7, 262203, 15, -286, +198, 7, 262203, 15, -287, +199, 7, 262203, 15, -288, +200, 7, 262203, 15, -292, +204, 7, 262203, 15, -295, +207, 7, 262203, 15, -297, +209, 7, 262203, 17, -299, +211, 7, 262203, 15, -301, +213, 7, 262203, 15, -303, +215, 7, 262203, 15, -305, +217, 7, 262203, 15, -307, +219, 7, 262203, 15, -317, -7, -262203, -8, -371, -7, -262203, -65, -373, -7, -262203, -65, -387, -7, -262203, -228, -394, -7, -262203, -17, -423, -7, -262203, -228, -432, -7, -262203, -228, -445, -7, -262203, -17, -468, -7, -262203, -17, -475, -7, -262203, -17, -482, -7, -262203, -17, -494, -7, -262203, -8, -516, -7, -262203, -8, -519, -7, -262203, -65, -522, -7, -262203, -65, -525, -7, -262203, -8, -550, -7, -262203, -8, -553, +242, 7, 262203, -65, -556, +250, +251, 7, 262203, -65, -559, +250, +276, 7, 262203, -567, -568, +250, +283, 7, 327745, -289, -290, -279, -122, +201, +202, +191, +110, 262205, 14, -291, -290, +203, +202, 196670, -288, -291, +200, +203, 327745, -289, -293, -280, -122, +201, +205, +192, +110, 262205, 14, -294, -293, +206, +205, 196670, -292, -294, +204, +206, 262205, 14, -296, -281, +208, +193, 196670, -295, -296, +207, +208, 262205, 14, -298, -282, +210, +194, 196670, -297, -298, +209, +210, 262205, 16, -300, -283, +212, +195, 196670, -299, -300, +211, +212, 262205, 14, -302, -284, +214, +196, 196670, -301, -302, +213, +214, 262205, 14, -304, -285, +216, +197, 196670, -303, -304, +215, +216, 262205, 14, -306, -286, +218, +198, 196670, -305, -306, +217, +218, 262205, 14, -308, -287, +220, +199, 196670, -307, -308, +219, +220, 852025, 2, -309, -28, -288, -292, -295, -297, -299, -301, -303, -305, -307, +221, +39, +200, +204, +207, +209, +211, +213, +215, +217, +219, 262205, 14, -310, -295, +222, +207, 196670, -281, -310, +193, +222, 262205, 14, -311, -297, +223, +209, 196670, -282, -311, +194, +223, 262205, 16, -312, -299, -196670, -283, -312, -262205, -14, -313, -301, -196670, -284, -313, -262205, -14, -314, -303, +224, +211, 196670, -285, -314, +195, +224, 262205, 14, -315, -305, +225, +213, 196670, -286, -315, +196, +225, 262205, 14, -316, -307, +226, +215, 196670, -287, -316, -327745, -86, -318, -84, -85, +197, +226, 262205, 14, -319, -318, +227, +217, 196670, -317, -319, +198, +227, 262205, 14, -323, -286, -262205, -16, -329, -283, -393281, -330, -331, -327, -328, -329, -262205, -7, -332, -331, -327745, -333, -334, -322, -323, +228, +219, 196670, -334, -332, +199, +228, 262205, 14, -338, -286, +232, +198, 262205, -340, -343, -342, +101, +234, +233, 262205, 16, -344, -283, +235, +195, +262244, +100, +236, +234, 327775, +108, +237, +236, +235, +262256, 7, -345, -343, -344, -327761, -6, -346, -345, -0, +238, +237, 327745, -347, -348, -337, -338, +239, +240, +231, +232, 196670, -348, -346, -196833, -103, -349, +240, +238, 262368, -103, -103, -122, -393281, -350, -351, -84, -328, -122, -262205, -6, -352, -351, -327862, -9, -353, -352, -76, -262312, -9, -354, -353, -196855, -356, -0, -262394, -354, -355, -356, -131320, -355, -393281, -350, -357, -84, -328, -103, -262205, -6, -358, -357, -327862, -9, -359, -358, -76, -131321, -356, -131320, -356, -458997, -9, -360, -353, -5, -359, -355, -262312, -9, -361, -360, -196855, -363, -0, -262394, -361, -362, -363, -131320, -362, -393281, -350, -365, -84, -328, -364, -262205, -6, -366, -365, -327862, -9, -367, -366, -76, -131321, -363, -131320, -363, -458997, -9, -368, -360, -356, -367, -362, -196855, -370, -0, -262394, -368, -369, -370, -131320, -369, -196670, -371, -372, -393281, -350, -374, -84, -328, +241, +90, +110, +327745, 73, +243, +71, +72, 262205, -6, -375, -374, +14, +244, +243, 196670, -373, -375, +242, +244, 262205, 14, -376, -284, -327854, +245, +196, +327850, 9, -377, -376, -364, +246, +245, +110, 196855, -379, +248, 0, 262394, -377, -378, -379, +246, +247, +275, 131320, -378, -262205, -14, -380, -284, +247, 262205, 14, -381, -285, -327810, -14, -382, -381, -103, -327856, -9, -383, -380, -382, -131321, -379, -131320, -379, -458997, -9, -384, -377, -369, -383, -378, -196855, -386, -0, -262394, -384, -385, -386, -131320, -385, +252, +198, 262205, 14, -388, -281, -327817, +253, +242, +327808, 14, -390, -388, -389, -262256, -6, -391, -390, -327816, -6, -393, -391, -392, -196670, -387, -393, -262205, -6, -395, -387, +254, +252, +253, 327745, -330, -396, -84, -328, +239, +255, +231, +254, 262205, 7, -397, -396, +256, +255, 524367, -227, -398, -397, -397, +249, +257, +256, +256, 0, 1, 2, -327822, -227, -399, -398, -395, 262205, -6, -400, -387, -327811, -6, -401, -212, -400, +14, +258, +198, 327745, -330, -403, -84, -402, +239, +259, +231, +258, 262205, 7, -404, -403, +260, +259, 524367, -227, -405, -404, -404, +249, +261, +260, +260, 0, 1, 2, -327822, -227, -406, -405, -401, -327809, -227, -407, -399, -406, +327811, +249, +262, +257, +261, +196670, +251, +262, +262205, +16, +268, +195, +262205, +249, +269, +251, +393228, +249, +270, +1, +69, +269, +393281, +271, +272, +266, +267, +268, 262205, +7, +273, +272, +589903, +7, +274, +273, +270, +4, +5, 6, -408, -387, +3, +196670, +272, +274, +131321, +248, +131320, +275, +262205, +14, +277, +198, +262205, +14, +278, +242, +327810, +14, +279, +277, +278, 327745, -330, -410, -84, -409, +239, +280, +231, +279, 262205, 7, -411, -410, +281, +280, 524367, -227, -412, -411, -411, -0, -1, -2, -327822, -227, -413, -412, -408, -327809, -227, -414, -407, -413, -262205, -6, -415, -387, -327811, -6, -416, -212, -415, -327745, -330, -418, -84, -417, -262205, -7, -419, -418, -524367, -227, -420, -419, -419, +249, +282, +281, +281, 0, 1, 2, -327822, -227, -421, -420, -416, -327809, -227, -422, -414, -421, 196670, -394, -422, -262205, -14, -424, -284, -262268, -16, -425, -424, -262205, -14, -426, -317, -262268, -16, -427, -426, -327812, -16, -428, -425, -427, -262205, -14, -429, +276, 282, -262268, -16, -430, -429, -327808, -16, -431, -428, -430, -196670, -423, -431, -262205, -16, -433, -423, -327745, -333, -434, -322, -433, -262205, -7, -435, -434, -524367, -227, -436, -435, -435, -0, -1, -2, -262205, -16, -437, -423, -262268, -14, -438, -437, 262205, 14, -439, -317, -327808, -14, -440, -438, -439, +284, +198, 327745, -333, -441, -322, -440, +239, +285, +231, +284, 262205, 7, -442, -441, +286, +285, 524367, -227, -443, -442, -442, +249, +287, +286, +286, 0, 1, 2, -327811, -227, -444, -436, -443, -196670, -432, -444, -262205, -227, -446, -432, -262205, -227, -447, -394, -458764, -227, -448, -1, -68, -446, -447, -262205, -227, -449, -432, -458764, -227, -450, -1, -68, -448, -449, -262271, -227, -451, -450, 196670, -445, -451, +283, +287, 262205, 16, -452, -423, -262205, -227, -453, -445, -327745, -350, -455, -84, -454, -262205, -6, -456, -455, -327822, -227, -457, -453, -456, -327745, -350, -458, -84, -454, +288, +195, 262205, -6, -459, -458, -327822, -227, -460, -457, -459, -327745, -333, -461, -322, -452, +249, +289, +283, 262205, -7, -462, -461, -524367, -227, -463, -462, -462, -0, +249, +290, +276, +327811, +249, +291, +289, +290, +393228, +249, +292, 1, -2, -327809, -227, -464, -463, -460, -327745, -333, -465, -322, -452, +69, +291, +393281, +271, +293, +266, +267, +288, 262205, 7, -466, -465, +294, +293, 589903, 7, -467, -466, -464, +295, +294, +292, 4, 5, 6, 3, 196670, -465, -467, -131321, -386, -131320, -386, -131321, -370, -131320, -370, -196833, -103, -349, -262368, -103, -103, -122, -262205, -14, -469, -285, -262256, -6, -470, -469, -327816, -6, -472, -470, -471, -393228, -6, -473, -1, -8, -472, -262254, -16, -474, -473, -196670, -468, -474, -262205, -14, -476, -285, -262256, -6, -477, -476, -327811, -6, -478, -477, -212, -327816, -6, -479, -478, -471, -393228, -6, -480, -1, -8, -479, -262254, -16, -481, -480, -196670, -475, -481, -196670, -482, -328, +293, +295, 131321, -483, +248, 131320, -483, -262390, -485, -486, +248, +65789, +65592, +327734, +9, +12, 0, -131321, -487, +10, +196663, +8, +11, 131320, -487, -262205, -16, -488, -482, +13, 327745, -490, -491, -84, -489, +60, +61, +11, +59, 262205, -16, -492, -491, -327857, +6, +62, +61, +327866, 9, -493, -488, -492, -262394, -493, -484, -485, +64, +62, +63, +131326, +64, +65592, +327734, +2, +28, +0, +18, +196663, +15, +19, +196663, +15, +20, +196663, +15, +21, +196663, +15, +22, +196663, +17, +23, +196663, +15, +24, +196663, +15, +25, +196663, +15, +26, +196663, +15, +27, 131320, -484, +29, 262205, 14, -495, -284, -262268, -16, -496, -495, -327812, -16, -497, -409, -496, +67, +19, +196670, +26, +67, +327745, +73, +74, +71, +72, 262205, 14, -498, -317, -262268, -16, -499, -498, -327812, -16, -500, -497, -499, -262205, +75, +74, +327814, 14, -501, -282, -262268, -16, -502, -501, -327808, -16, -503, -500, -502, +76, +68, +75, 196670, -494, -503, +25, +76, 262205, 14, -504, -284, -262205, -16, -505, -468, -262268, -14, -506, -505, -327856, -9, -507, -504, -506, -196855, -509, -0, -262394, -507, -508, -509, -131320, -508, -262205, -16, -510, -494, -262205, -16, -511, -494, -262268, -14, -512, -511, +77, +19, +327745, +73, +78, +71, +72, 262205, 14, -513, -317, -327808, +79, +78, +327817, 14, -514, -512, -513, -262205, -16, -515, -494, -327745, -333, -517, -322, -510, -262205, -7, -518, -517, +80, +77, +79, 196670, -516, -518, -327745, -333, -520, -322, -514, +22, +80, 262205, -7, -521, -520, -196670, -519, -521, +14, +81, +20, 327745, -347, -523, -337, -515, -262205, -6, -524, -523, -196670, -522, -524, -196670, -525, -212, -524345, -2, -526, +73, +82, 71, -516, -519, -522, -525, -262205, -7, -527, -516, -327745, -333, -528, -322, -510, -196670, -528, -527, -262205, -7, -529, -519, -327745, -333, -530, -322, -514, -196670, -530, -529, -131321, -509, -131320, -509, -196833, -103, -349, -262368, -103, -103, -122, -262205, -14, -531, -284, +72, 262205, -16, -532, -475, -262268, 14, -533, -532, -327856, -9, -534, -531, -533, -196855, -536, -0, -262394, -534, -535, -536, -131320, -535, -262205, -16, -537, -494, -262268, +83, +82, +327812, 14, -538, -537, +84, +81, +83, 262205, 14, -539, -317, +85, +22, 327808, 14, -540, -538, -539, +86, +84, +85, +196670, +21, +86, +327745, +73, +88, +71, +87, 262205, -16, -541, -494, -262268, 14, -542, -541, +89, +88, +327808, +14, +91, +89, +90, 262205, 14, -543, -317, +92, +21, 327812, 14, -544, -543, -364, -327808, -14, -545, -542, -544, +93, +92, +91, +196670, +21, +93, 262205, -16, -546, -494, -262268, 14, -547, -546, +94, +19, 262205, 14, -548, -317, -327808, +95, +22, +327810, 14, -549, -547, -548, -327745, -333, -551, -322, -540, -262205, -7, -552, -551, -196670, -550, -552, -327745, -333, -554, -322, -545, -262205, -7, -555, -554, -196670, -553, -555, +96, +94, +95, 327745, -347, -557, -337, -549, -262205, -6, -558, -557, -196670, -556, -558, -196670, -559, -212, -524345, -2, -560, +73, +97, 71, -550, -553, -556, -559, +72, 262205, -7, -561, -550, -327745, -333, -562, -322, -540, +14, +98, +97, +327814, +14, +99, +96, +98, 196670, -562, -561, +24, +99, 262205, -7, -563, -553, -327745, -333, -564, -322, -545, -196670, -564, -563, -131321, -536, -131320, -536, -196833, -103, -349, -262368, -103, +101, +104, 103, -122, -131321, -486, -131320, -486, 262205, +14, +105, +21, +262268, 16, -565, -482, -327808, -16, -566, -565, -402, -196670, -482, -566, -131321, -483, -131320, -485, +106, +105, +262244, +100, +107, +104, +327775, +108, +109, +107, +106, +327761, +14, +111, +109, +0, 196670, -568, -569, +27, +111, 262205, -16, -570, -283, +14, +112, +21, 262205, 14, -571, -286, -327745, -333, -572, -322, -571, +113, +25, +327812, +14, +114, +112, +113, 262205, -7, -573, -572, -393281, -330, -574, -327, -328, -570, +14, +115, +24, +327808, +14, +116, +114, +115, +262268, +16, +117, +116, 196670, -574, -573, +23, +117, 65789, 65592, 327734, -9, -12, -0, -10, -196663, -8, -11, -131320, -13, -327745, -65, -74, -11, -73, -262205, -6, -75, -74, -327866, -9, -77, -75, -76, -131326, -77, -65592, -327734, 2, -28, +39, 0, 18, 196663, 15, -19, +30, 196663, 15, -20, +31, 196663, 15, -21, +32, 196663, 15, -22, +33, 196663, 17, -23, +34, 196663, 15, -24, +35, 196663, 15, -25, +36, 196663, 15, -26, +37, 196663, 15, -27, +38, 131320, -29, +40, 262205, 14, -80, -19, +118, +30, 196670, -26, -80, +37, +118, 327745, -86, -87, -84, -85, +73, +119, +71, +72, 262205, 14, -88, -87, +120, +119, 327814, 14, -89, -81, -88, +121, +68, +120, 196670, -25, -89, +36, +121, 262205, 14, -90, -19, +122, +30, 327745, -86, -91, -84, -85, +73, +123, +71, +72, 262205, 14, -92, -91, +124, +123, 327817, 14, -93, -90, -92, -196670, -22, -93, -262205, -14, -94, -20, -327745, -86, -95, -84, -85, -262205, -14, -96, -95, -327812, -14, -97, -94, -96, -262205, -14, -98, -22, -327808, -14, -99, -97, -98, -196670, -21, -99, -327745, -86, -101, -84, -100, -262205, -14, -102, -101, -327808, -14, -104, -102, -103, -262205, -14, -105, -21, -327812, -14, -106, -105, -104, +125, +122, +124, 196670, -21, -106, -262205, -14, -107, -19, +33, +125, 262205, 14, -108, -22, -327810, -14, -109, -107, -108, +126, +31, 327745, -86, -110, -84, -85, -262205, -14, -111, -110, -327814, -14, -112, -109, -111, -196670, -24, -112, -262205, -114, -117, -116, -262205, -14, -118, -21, -262268, -16, -119, -118, -327775, -120, -121, -117, -119, -327761, -14, -123, -121, -0, -196670, -27, -123, -262205, -14, -124, -21, +73, +127, +71, +72, 262205, 14, -125, -25, +128, +127, 327812, 14, +129, 126, -124, -125, +128, 262205, 14, -127, -24, +130, +33, 327808, 14, -128, -126, -127, -262268, -16, -129, -128, -196670, -23, +131, 129, -65789, -65592, -327734, -2, -39, -0, -18, -196663, -15, -30, -196663, -15, -31, -196663, -15, -32, -196663, -15, -33, -196663, -17, -34, -196663, -15, -35, -196663, -15, -36, -196663, -15, -37, -196663, -15, -38, -131320, -40, -262205, -14, 130, -30, 196670, -37, -130, -327745, -86, +32, 131, -84, -85, 262205, 14, 132, -131, -327814, +30, +262205, 14, 133, -81, -132, -196670, -36, -133, -262205, +33, +327810, 14, 134, -30, +132, +133, 327745, -86, +73, 135, -84, -85, +71, +72, 262205, 14, 136, 135, -327817, +327814, 14, 137, 134, 136, 196670, -33, +35, 137, 262205, -14, +101, 138, -31, -327745, -86, -139, -84, -85, +103, 262205, 14, +139, +32, +262268, +16, 140, 139, -327812, -14, +262244, +100, 141, 138, -140, -262205, -14, +327775, +108, 142, -33, -327808, +141, +140, +327761, 14, 143, -141, 142, +0, 196670, -32, +38, 143, 262205, 14, 144, -30, +32, 262205, 14, 145, -33, -327810, +36, +327812, 14, 146, 144, 145, -327745, -86, -147, -84, -85, 262205, 14, -148, 147, -327814, -14, -149, -146, -148, -196670, -35, -149, -262205, -114, -150, -116, -262205, -14, -151, -32, -262268, -16, -152, -151, -327775, -120, -153, -150, -152, -327761, -14, -154, -153, -0, -196670, -38, -154, -262205, -14, -155, -32, -262205, -14, -156, -36, -327812, -14, -157, -155, -156, -262205, -14, -158, 35, 327808, 14, -159, -157, -158, +148, +146, +147, 262268, 16, -160, -159, +149, +148, 196670, 34, -160, +149, 65789, 65592, 327734, @@ -30309,83 +29393,87 @@ const std::vector length_wind_collision = {119734787, 49, 262205, 14, -161, +150, 43, 327812, 14, -162, -81, -161, +151, +68, +150, 262205, 14, -163, +152, 42, 327808, 14, -164, -162, -163, +153, +151, +152, 196670, 44, -164, +153, 327745, -86, -165, -84, -85, +73, +154, +71, +72, 262205, 14, -166, -165, +155, +154, 327814, 14, -167, -81, -166, +156, +68, +155, 196670, 45, -167, +156, 262205, -114, -168, -116, +101, +157, +103, 262205, 14, -169, +158, 44, 262268, 16, -170, -169, +159, +158, +262244, +100, +160, +157, 327775, -120, -171, -168, -170, +108, +161, +160, +159, 327761, 14, -172, -171, +162, +161, 0, 196670, 47, -172, +162, 262205, 14, -173, +163, 44, 262205, 14, -174, +164, 45, 327812, 14, -175, -173, -174, +165, +163, +164, 196670, 46, -175, +165, 65789, 65592, 327734, @@ -30415,515 +29503,124 @@ const std::vector length_wind_collision = {119734787, 58, 262205, 16, -177, +167, 52, 327812, 16, -178, -176, -177, +168, +166, +167, 262205, 16, -179, +169, 51, 327808, 16, -180, -178, -179, +170, +168, +169, 196670, 53, -180, +170, 327745, -86, -181, -84, -100, +73, +171, +71, +87, 262205, 14, -182, -181, +172, +171, 327808, 14, -183, -182, -103, +173, +172, +90, 262268, 16, -184, -183, +174, +173, 262205, 16, -185, +175, 53, 327812, 16, -186, -185, -184, +176, +175, +174, 196670, 53, -186, +176, 327745, -86, -187, -84, -85, +73, +177, +71, +72, 262205, 14, -188, -187, +178, +177, 327814, 14, -189, -81, -188, +179, +68, +178, 196670, 54, -189, +179, 262205, -114, -190, -116, +101, +180, +103, 262205, 16, -191, +181, 53, +262244, +100, +182, +180, 327775, -120, -192, -190, -191, +108, +183, +182, +181, 327761, 14, -193, -192, +184, +183, 0, 196670, 56, -193, +184, 262205, 16, -194, +185, 53, 262205, 14, -195, +186, 54, 262268, 16, -196, -195, +187, +186, 327812, 16, -197, -194, -196, +188, +185, +187, 196670, 55, -197, -65789, -65592, -327734, -59, -63, -0, -60, -196663, -8, -61, -196663, -8, -62, -131320, -64, -262203, -8, -198, -7, -262203, -8, -203, -7, -262203, -8, -216, -7, -262205, -7, -199, -61, -196670, -198, -199, -327737, -9, -200, -12, -198, -196855, -202, -0, -262394, -200, -201, -215, -131320, -201, -262205, -7, -204, -62, -196670, -203, -204, -327737, -9, -205, -12, -203, -196855, -207, -0, -262394, -205, -206, -211, -131320, -206, -131326, -209, -131320, -211, -131326, -213, -131320, -207, -131321, -202, -131320, -215, -262205, -7, -217, -62, -196670, -216, -217, -327737, -9, -218, -12, -216, -196855, -220, -0, -262394, -218, -219, -223, -131320, -219, -131326, -221, -131320, -223, -131326, -224, -131320, -220, -131321, -202, -131320, -202, -196609, -59, -226, -131326, -226, -65592, -327734, -2, -71, -0, -66, -196663, -8, -67, -196663, -8, -68, -196663, -65, -69, -196663, -65, -70, -131320, -72, -262203, -228, -229, -7, -262203, -65, -235, -7, -262203, -65, -240, -7, -262203, -248, -249, -7, -262203, -8, -250, -7, -262203, -8, -252, -7, -262205, -7, -230, -68, -524367, -227, -231, -230, -230, -0, -1, -2, -262205, -7, -232, -67, -524367, -227, -233, -232, -232, -0, -1, -2, -327811, -227, -234, -231, -233, -196670, -229, -234, -262205, -227, -236, -229, -393228, -6, -237, -1, -66, -236, -458764, -6, -239, -1, -40, -237, -238, -196670, -235, -239, -262205, -6, -241, -69, -262205, -6, -242, -235, -327816, -6, -243, -241, -242, -327811, -6, -244, -212, -243, -196670, -240, -244, -262205, -6, -245, -240, -262205, -227, -246, -229, -327822, -227, -247, -246, -245, -196670, -229, -247, -262205, -7, -251, -67, -196670, -250, -251, -262205, -7, -253, -68, -196670, -252, -253, -393273, -59, -254, -63, -250, -252, -196670, -249, -254, -327745, -65, -255, -249, -122, -262205, -6, -256, -255, -262205, -227, -257, -229, -327822, -227, -258, -257, -256, -262205, -6, -259, -70, -327822, -227, -260, -258, -259, -262205, -7, -261, -67, -524367, -227, -262, -261, -261, -0, -1, -2, -327809, -227, -263, -262, -260, -262205, -7, -264, -67, -589903, -7, -265, -264, -263, -4, -5, -6, -3, -196670, -67, -265, -327745, -65, -266, -249, -103, -262205, -6, -267, -266, -262205, -227, -268, -229, -327822, -227, -269, -268, -267, -262205, -6, -270, -70, -327822, -227, -271, -269, -270, -262205, -7, -272, -68, -524367, -227, -273, -272, -272, -0, -1, -2, -327811, -227, -274, -273, -271, -262205, -7, -275, -68, -589903, -7, -276, -275, -274, -4, -5, -6, -3, -196670, -68, -276, +188, 65789, 65592, }; -const std::vector compute_tangents = {119734787, +const std::vector length_wind_collision = {119734787, 65536, 524289, -297, +586, 0, 131089, 1, @@ -30943,8 +29640,8 @@ const std::vector compute_tangents = {119734787, 4, 1852399981, 0, -187, -188, +283, +284, 393232, 4, 17, @@ -31225,33 +29922,84 @@ const std::vector compute_tangents = {119734787, 1634890867, 2035573870, 25968, +655365, +63, +1936617283, +1767993972, +1968010350, +1885959276, +1919248748, +879130152, +879130171, +59, +327685, +61, +1953653104, +1701602153, +48, 327685, +62, +1953653104, +1701602153, +49, +786437, +71, +1819308097, +1936278649, +1668178292, +1852785509, +1634890867, +678719081, +993289846, +993289846, +1715155302, +15153, +262149, +67, +812871536, +0, +262149, +68, +829648752, +0, +393221, 69, +1735549300, +1766093925, +1851880563, +25955, +327685, +70, +1718187123, +1936027238, +115, +327685, +82, 1936617283, 1953390964, 115, 327686, -69, +82, 0, 1767333735, 25710, 327686, -69, +82, 1, 1767333735, 3236974, 327686, -69, +82, 2, 1767333735, 3302510, 327686, -69, +82, 3, 1767333735, 3368046, 720902, -69, +82, 4, 1968070503, 1852132461, @@ -31262,14 +30010,14 @@ const std::vector compute_tangents = {119734787, 1769234802, 7564911, 458758, -69, +82, 5, 1130520423, 1768713327, 1852795251, 0, 524294, -69, +82, 6, 1917280103, 1953068641, @@ -31277,19 +30025,19 @@ const std::vector compute_tangents = {119734787, 1970563438, 25956, 393222, -69, +82, 7, 1767137127, 1951622509, 28773, 393222, -69, +82, 8, 1631870823, 1852403821, 12391, 786438, -69, +82, 9, 1951620967, 1852204649, @@ -31301,7 +30049,7 @@ const std::vector compute_tangents = {119734787, 1735289192, 48, 786438, -69, +82, 10, 1951620967, 1852204649, @@ -31313,7 +30061,7 @@ const std::vector compute_tangents = {119734787, 1852401763, 12391, 851974, -69, +82, 11, 1816616807, 1818321519, @@ -31326,13 +30074,13 @@ const std::vector compute_tangents = {119734787, 811951982, 0, 393222, -69, +82, 12, 1631870823, 1852403821, 12647, 786438, -69, +82, 13, 1951620967, 1852204649, @@ -31344,7 +30092,7 @@ const std::vector compute_tangents = {119734787, 1735289192, 49, 786438, -69, +82, 14, 1951620967, 1852204649, @@ -31356,7 +30104,7 @@ const std::vector compute_tangents = {119734787, 1852401763, 12647, 851974, -69, +82, 15, 1816616807, 1818321519, @@ -31369,13 +30117,13 @@ const std::vector compute_tangents = {119734787, 828729198, 0, 393222, -69, +82, 16, 1631870823, 1852403821, 12903, 786438, -69, +82, 17, 1951620967, 1852204649, @@ -31387,7 +30135,7 @@ const std::vector compute_tangents = {119734787, 1735289192, 50, 786438, -69, +82, 18, 1951620967, 1852204649, @@ -31399,7 +30147,7 @@ const std::vector compute_tangents = {119734787, 1852401763, 12903, 851974, -69, +82, 19, 1816616807, 1818321519, @@ -31412,13 +30160,13 @@ const std::vector compute_tangents = {119734787, 845506414, 0, 393222, -69, +82, 20, 1631870823, 1852403821, 13159, 786438, -69, +82, 21, 1951620967, 1852204649, @@ -31430,7 +30178,7 @@ const std::vector compute_tangents = {119734787, 1735289192, 51, 786438, -69, +82, 22, 1951620967, 1852204649, @@ -31442,7 +30190,7 @@ const std::vector compute_tangents = {119734787, 1852401763, 13159, 851974, -69, +82, 23, 1816616807, 1818321519, @@ -31455,7 +30203,7 @@ const std::vector compute_tangents = {119734787, 862283630, 0, 720902, -69, +82, 24, 1968070503, 1399213933, @@ -31466,7 +30214,7 @@ const std::vector compute_tangents = {119734787, 1886744434, 0, 720902, -69, +82, 25, 1968070503, 1819231853, @@ -31477,7 +30225,7 @@ const std::vector compute_tangents = {119734787, 1919508808, 0, 589830, -69, +82, 26, 1767137127, 1885688688, @@ -31486,12 +30234,12 @@ const std::vector compute_tangents = {119734787, 1869898593, 114, 327686, -69, +82, 27, 1466064743, 7369313, 786438, -69, +82, 28, 1968070503, 1668238445, @@ -31503,17 +30251,56 @@ const std::vector compute_tangents = {119734787, 1852795252, 115, 196613, -71, +84, 0, 458757, -103, +116, 1632132967, 1951625833, 1684955506, 1701869908, 0, +262149, +202, +1634886000, +109, +262149, +207, +1634886000, +109, +262149, +220, +1634886000, +109, +262149, +233, +1953260900, +97, +327685, +239, +1953720676, +1701015137, +0, +327685, +244, +1701999731, +1768448884, +26478, +327685, +253, +1953265005, +1768714345, +29285, +262149, +254, +1634886000, +109, +262149, +256, +1634886000, +109, 524293, -187, +283, 1281322087, 1818321775, 1870032457, @@ -31521,41 +30308,41 @@ const std::vector compute_tangents = {119734787, 1145663087, 0, 393221, -188, +284, 1465871463, 1198223983, 1886744434, 17481, 458757, -189, +285, 1651469415, 1951624289, 1684955506, 1701080649, 120, 458757, -190, +286, 1633906540, 1920226156, 1231318625, 2019910766, 0, 458757, -191, +287, 1651469415, 1700162657, 2019914866, 1701080649, 120, 458757, -192, +288, 1633906540, 1919243884, 1232627060, 2019910766, 0, 524293, -193, +289, 1450014062, 1769239141, 1232299363, @@ -31563,68 +30350,55 @@ const std::vector compute_tangents = {119734787, 1634890835, 25710, 458757, -194, +290, 1701080681, 1919895160, 1918986323, 1699570789, 109, 327685, -195, +291, 1634890867, 2035573870, 25968, 262149, -196, +292, 1634886000, 109, 262149, -200, +296, 1634886000, 109, 262149, -203, +299, 1634886000, 109, 262149, -205, +301, 1634886000, 109, 262149, -207, +303, 1634886000, 109, 262149, -209, +305, 1634886000, 109, 262149, -211, +307, 1634886000, 109, 262149, -213, +309, 1634886000, 109, 262149, -215, +311, 1634886000, 109, -327685, -227, -1918986355, -1867539557, -115, -524293, -229, -1632132967, -1700164201, -2019914866, -1769172816, -1852795252, -115, 589829, -237, +321, 1332573550, 1920226150, 1935961697, @@ -31632,47 +30406,131 @@ const std::vector compute_tangents = {119734787, 1634038376, 1869760356, 28789, -262149, -246, -1735287156, -7630437, +327685, +326, +1918986355, +1867539557, +115, 458757, -259, +329, 1953067639, 1818386789, 1936674917, 1869182057, 29550, 589830, -259, +329, 0, 1632132967, 1700164201, 2019914866, -1735287124, -1937010277, -0, +1769172816, +1852795252, +115, 196613, -261, +331, 0, 393221, -271, -1953654134, -1834969439, -1937075817, -12639, +341, +1918986355, +1699505253, +1752459118, +0, +458757, +346, +1632132967, +1699902057, +1699509363, +1752459118, +5657171, 262149, -278, -1953654134, -26975, +375, +1668444006, +101, +262149, +377, +1835102822, +101, +196613, +391, +97, +196613, +398, +119, +327685, +427, +1918986355, +1850303589, +7890276, +196613, +436, +118, +262149, +449, +1668444006, +101, +196613, +472, +97, +196613, +479, +98, +327685, +486, +1919251561, +1869182049, +17774, +327685, +498, +1918986355, +1850303589, +7890276, +262149, +520, +1634886000, +109, +262149, +523, +1634886000, +109, +262149, +526, +1634886000, +109, +262149, +529, +1634886000, +109, +262149, +554, +1634886000, +109, +262149, +557, +1634886000, +109, +262149, +560, +1634886000, +109, +262149, +563, +1634886000, +109, 393221, -293, +572, +1819231074, +1702126916, +1684370531, +0, +393221, +582, 1684104520, 1851880020, 1919903347, 109, 589830, -293, +582, 0, 1867341671, 1416389988, @@ -31681,7 +30539,7 @@ const std::vector compute_tangents = {119734787, 1215459142, 6578533, 589830, -293, +582, 1, 1867341671, 1382835556, @@ -31690,7 +30548,7 @@ const std::vector compute_tangents = {119734787, 1684104520, 0, 589830, -293, +582, 2, 1852396386, 1214606439, @@ -31699,259 +30557,259 @@ const std::vector compute_tangents = {119734787, 1836216166, 0, 327686, -293, +582, 3, 1684300144, 6778473, 196613, -295, +584, 0, 327752, -69, +82, 0, 35, 0, 327752, -69, +82, 1, 35, 16, 327752, -69, +82, 2, 35, 32, 327752, -69, +82, 3, 35, 48, 327752, -69, +82, 4, 35, 64, 327752, -69, +82, 5, 35, 68, 327752, -69, +82, 6, 35, 72, 327752, -69, +82, 7, 35, 76, 327752, -69, +82, 8, 35, 80, 327752, -69, +82, 9, 35, 84, 327752, -69, +82, 10, 35, 88, 327752, -69, +82, 11, 35, 92, 327752, -69, +82, 12, 35, 96, 327752, -69, +82, 13, 35, 100, 327752, -69, +82, 14, 35, 104, 327752, -69, +82, 15, 35, 108, 327752, -69, +82, 16, 35, 112, 327752, -69, +82, 17, 35, 116, 327752, -69, +82, 18, 35, 120, 327752, -69, +82, 19, 35, 124, 327752, -69, +82, 20, 35, 128, 327752, -69, +82, 21, 35, 132, 327752, -69, +82, 22, 35, 136, 327752, -69, +82, 23, 35, 140, 327752, -69, +82, 24, 35, 144, 327752, -69, +82, 25, 35, 148, 327752, -69, +82, 26, 35, 152, 327752, -69, +82, 27, 35, 156, 327752, -69, +82, 28, 35, 160, 196679, -69, +82, 3, 262215, -71, +84, 34, 0, 262215, -71, +84, 33, 16, 262215, -103, +116, 34, 1, 262215, -103, +116, 33, 22, 262215, -187, +283, 11, 27, 262215, -188, +284, 11, 26, 262215, -229, -34, -1, -262215, -229, -33, -7, -262215, -258, +328, 6, 16, 327752, -259, +329, 0, 35, 0, 196679, -259, +329, 3, 262215, -261, +331, 34, 1, 262215, -261, +331, 33, -8, +7, 262215, -292, +346, +34, +1, +262215, +346, +33, +26, +262215, +581, 6, 16, 262216, -293, +582, 0, 5, 327752, -293, +582, 0, 35, 0, 327752, -293, +582, 0, 7, 16, 327752, -293, +582, 1, 35, 64, 327752, -293, +582, 2, 35, 80, 327752, -293, +582, 3, 35, 96, 196679, -293, +582, 3, 262215, -295, +584, 34, 0, 262215, -295, +584, 33, 27, 262215, -296, +585, 11, 25, 131091, @@ -32022,24 +30880,40 @@ const std::vector compute_tangents = {119734787, 15, 17, 15, -262187, -14, +262167, 59, -3, -262176, +6, +2, +327713, 60, +59, +8, +8, +262176, +65, 7, 6, +458785, +66, +2, +8, +8, +65, +65, +262187, +14, +73, +3, 262187, 6, -63, +76, 0, 262187, 14, -68, +81, 64, 2031646, -69, +82, 7, 7, 7, @@ -32070,31 +30944,31 @@ const std::vector compute_tangents = {119734787, 16, 16, 262176, -70, +83, 2, -69, +82, 262203, -70, -71, +83, +84, 2, 262187, 16, -72, +85, 24, 262176, -73, +86, 2, 14, 262187, 16, -87, +100, 25, 262187, 14, -90, +103, 1, 589849, -100, +113, 14, 5, 0, @@ -32103,130 +30977,252 @@ const std::vector compute_tangents = {119734787, 1, 0, 196635, -101, -100, +114, +113, 262176, -102, +115, 0, -101, +114, 262203, -102, -103, +115, +116, 0, 262167, -107, +121, 14, 4, 262187, 14, -109, +123, 0, 262187, 16, -163, +179, 64, +262187, +6, +212, +1056964608, +327724, +59, +213, +212, +212, +262187, +6, +216, +1065353216, +327724, +59, +217, +216, +76, +327724, +59, +225, +76, +216, +327724, +59, +228, +76, +76, 262167, -185, +231, +6, +3, +262176, +232, +7, +231, +262187, +6, +242, +869711765, +262176, +252, +7, +59, +262167, +281, 14, 3, 262176, -186, +282, 1, -185, +281, 262203, -186, -187, +282, +283, 1, 262203, -186, -188, +282, +284, 1, 262176, -197, +293, 1, 14, 262172, -225, +324, 7, -68, +81, 262176, -226, +325, 4, -225, +324, 262203, -226, -227, +325, +326, 4, +196637, +328, +7, +196638, +329, +328, +262176, +330, +2, +329, 262203, -102, -229, +330, +331, +2, +262187, +16, +332, 0, 262176, -234, +334, +2, +7, +262176, +337, 4, 7, -262187, -14, -236, -4062, -262167, -244, +262172, +339, 6, -3, +81, 262176, -245, -7, -244, -196637, -258, -7, -196638, -259, -258, +340, +4, +339, +262203, +340, +341, +4, +589849, +343, +6, +5, +0, +0, +0, +1, +0, +196635, +344, +343, 262176, -260, -2, -259, +345, +0, +344, 262203, -260, -261, +345, +346, +0, +262176, +352, +4, +6, +262187, +14, +354, +2, +262176, +355, +2, +6, +458796, +7, +376, +76, +76, +76, +76, +262187, +14, +393, +20, +262187, +6, +396, +1101004800, +262187, +16, +406, +1, +262187, +16, +413, 2, 262187, 16, -262, -0, +421, +3, +262187, +16, +458, +7, +262187, +6, +475, +1073741824, +262187, +16, +493, +4, 262176, -266, +494, 2, +16, +262176, +571, 7, +9, +196650, +9, +573, 262168, -291, +580, 7, 4, 262172, -292, +581, 6, -59, +73, 393246, -293, -291, +582, +580, 7, 16, -292, +581, 262176, -294, +583, 2, -293, +582, 262203, -294, -295, +583, +584, 2, 393260, -185, -296, -68, -90, -90, +281, +585, +81, +103, +103, 327734, 2, 4, @@ -32236,490 +31232,1392 @@ const std::vector compute_tangents = {119734787, 5, 262203, 15, -189, +285, 7, 262203, 15, -190, +286, 7, 262203, 17, -191, +287, 7, 262203, 15, -192, +288, 7, 262203, 15, -193, +289, 7, 262203, 15, -194, +290, 7, 262203, 15, -195, +291, 7, 262203, 15, -196, +292, 7, 262203, 15, -200, +296, 7, 262203, 15, -203, +299, 7, 262203, 15, -205, +301, 7, 262203, 17, -207, +303, 7, 262203, 15, -209, +305, 7, 262203, 15, -211, +307, 7, 262203, 15, -213, +309, 7, 262203, 15, -215, +311, 7, 262203, 15, -237, +321, 7, 262203, -245, -246, +8, +375, 7, 262203, -245, -271, +65, +377, +7, +262203, +65, +391, +7, +262203, +232, +398, +7, +262203, +17, +427, +7, +262203, +232, +436, +7, +262203, +232, +449, +7, +262203, +17, +472, +7, +262203, +17, +479, +7, +262203, +17, +486, +7, +262203, +17, +498, +7, +262203, +8, +520, +7, +262203, +8, +523, +7, +262203, +65, +526, +7, +262203, +65, +529, +7, +262203, +8, +554, +7, +262203, +8, +557, +7, +262203, +65, +560, +7, +262203, +65, +563, +7, +262203, +571, +572, +7, +327745, +293, +294, +283, +123, +262205, +14, +295, +294, +196670, +292, +295, +327745, +293, +297, +284, +123, +262205, +14, +298, +297, +196670, +296, +298, +262205, +14, +300, +285, +196670, +299, +300, +262205, +14, +302, +286, +196670, +301, +302, +262205, +16, +304, +287, +196670, +303, +304, +262205, +14, +306, +288, +196670, +305, +306, +262205, +14, +308, +289, +196670, +307, +308, +262205, +14, +310, +290, +196670, +309, +310, +262205, +14, +312, +291, +196670, +311, +312, +852025, +2, +313, +28, +292, +296, +299, +301, +303, +305, +307, +309, +311, +262205, +14, +314, +299, +196670, +285, +314, +262205, +14, +315, +301, +196670, +286, +315, +262205, +16, +316, +303, +196670, +287, +316, +262205, +14, +317, +305, +196670, +288, +317, +262205, +14, +318, +307, +196670, +289, +318, +262205, +14, +319, +309, +196670, +290, +319, +262205, +14, +320, +311, +196670, +291, +320, +327745, +86, +322, +84, +85, +262205, +14, +323, +322, +196670, +321, +323, +262205, +14, +327, +290, +262205, +16, +333, +287, +393281, +334, +335, +331, +332, +333, +262205, +7, +336, +335, +327745, +337, +338, +326, +327, +196670, +338, +336, +262205, +14, +342, +290, +262205, +344, +347, +346, +262205, +16, +348, +287, +262244, +343, +349, +347, +327775, +7, +350, +349, +348, +327761, +6, +351, +350, +0, +327745, +352, +353, +341, +342, +196670, +353, +351, +262368, +354, +103, +123, +393281, +355, +356, +84, +332, +123, +262205, +6, +357, +356, +327862, +9, +358, +357, +76, +262312, +9, +359, +358, +196855, +361, +0, +262394, +359, +360, +361, +131320, +360, +393281, +355, +362, +84, +332, +103, +262205, +6, +363, +362, +327862, +9, +364, +363, +76, +131321, +361, +131320, +361, +458997, +9, +365, +358, +5, +364, +360, +262312, +9, +366, +365, +196855, +368, +0, +262394, +366, +367, +368, +131320, +367, +393281, +355, +369, +84, +332, +354, +262205, +6, +370, +369, +327862, +9, +371, +370, +76, +131321, +368, +131320, +368, +458997, +9, +372, +365, +361, +371, +367, +196855, +374, +0, +262394, +372, +373, +374, +131320, +373, +196670, +375, +376, +393281, +355, +378, +84, +332, +73, +262205, +6, +379, +378, +196670, +377, +379, +262205, +14, +380, +288, +327854, +9, +381, +380, +354, +196855, +383, +0, +262394, +381, +382, +383, +131320, +382, +262205, +14, +384, +288, +262205, +14, +385, +289, +327810, +14, +386, +385, +103, +327856, +9, +387, +384, +386, +131321, +383, +131320, +383, +458997, +9, +388, +381, +373, +387, +382, +196855, +390, +0, +262394, +388, +389, +390, +131320, +389, +262205, +14, +392, +285, +327817, +14, +394, +392, +393, +262256, +6, +395, +394, +327816, +6, +397, +395, +396, +196670, +391, +397, +262205, +6, +399, +391, +327745, +334, +400, +84, +332, +262205, +7, +401, +400, +524367, +231, +402, +401, +401, +0, +1, +2, +327822, +231, +403, +402, +399, +262205, +6, +404, +391, +327811, +6, +405, +216, +404, +327745, +334, +407, +84, +406, +262205, +7, +408, +407, +524367, +231, +409, +408, +408, +0, +1, +2, +327822, +231, +410, +409, +405, +327809, +231, +411, +403, +410, +262205, +6, +412, +391, +327745, +334, +414, +84, +413, +262205, +7, +415, +414, +524367, +231, +416, +415, +415, +0, +1, +2, +327822, +231, +417, +416, +412, +327809, +231, +418, +411, +417, +262205, +6, +419, +391, +327811, +6, +420, +216, +419, +327745, +334, +422, +84, +421, +262205, +7, +423, +422, +524367, +231, +424, +423, +423, +0, +1, +2, +327822, +231, +425, +424, +420, +327809, +231, +426, +418, +425, +196670, +398, +426, +262205, +14, +428, +288, +262268, +16, +429, +428, +262205, +14, +430, +321, +262268, +16, +431, +430, +327812, +16, +432, +429, +431, +262205, +14, +433, +286, +262268, +16, +434, +433, +327808, +16, +435, +432, +434, +196670, +427, +435, +262205, +16, +437, +427, +327745, +337, +438, +326, +437, +262205, +7, +439, +438, +524367, +231, +440, +439, +439, +0, +1, +2, +262205, +16, +441, +427, +262268, +14, +442, +441, +262205, +14, +443, +321, +327808, +14, +444, +442, +443, +327745, +337, +445, +326, +444, +262205, +7, +446, +445, +524367, +231, +447, +446, +446, +0, +1, +2, +327811, +231, +448, +440, +447, +196670, +436, +448, +262205, +231, +450, +436, +262205, +231, +451, +398, +458764, +231, +452, +1, +68, +450, +451, +262205, +231, +453, +436, +458764, +231, +454, +1, +68, +452, +453, +262271, +231, +455, +454, +196670, +449, +455, +262205, +16, +456, +427, +262205, +231, +457, +449, +327745, +355, +459, +84, +458, +262205, +6, +460, +459, +327822, +231, +461, +457, +460, +327745, +355, +462, +84, +458, +262205, +6, +463, +462, +327822, +231, +464, +461, +463, +327745, +337, +465, +326, +456, +262205, +7, +466, +465, +524367, +231, +467, +466, +466, +0, +1, +2, +327809, +231, +468, +467, +464, +327745, +337, +469, +326, +456, +262205, 7, -262203, -245, -278, +470, +469, +589903, 7, -327745, -197, -198, -187, -109, -262205, -14, -199, -198, +471, +470, +468, +4, +5, +6, +3, 196670, -196, -199, -327745, -197, -201, -188, -109, +469, +471, +131321, +390, +131320, +390, +131321, +374, +131320, +374, +262368, +354, +103, +123, 262205, 14, -202, -201, +473, +289, +262256, +6, +474, +473, +327816, +6, +476, +474, +475, +393228, +6, +477, +1, +8, +476, +262254, +16, +478, +477, 196670, -200, -202, +472, +478, 262205, 14, -204, -189, +480, +289, +262256, +6, +481, +480, +327811, +6, +482, +481, +216, +327816, +6, +483, +482, +475, +393228, +6, +484, +1, +8, +483, +262254, +16, +485, +484, 196670, -203, -204, -262205, -14, -206, -190, +479, +485, 196670, -205, -206, +486, +332, +131321, +487, +131320, +487, +262390, +489, +490, +0, +131321, +491, +131320, +491, 262205, 16, -208, -191, -196670, -207, -208, +492, +486, +327745, +494, +495, +84, +493, 262205, -14, -210, -192, -196670, -209, -210, +16, +496, +495, +327857, +9, +497, +492, +496, +262394, +497, +488, +489, +131320, +488, 262205, 14, -212, -193, -196670, -211, -212, +499, +288, +262268, +16, +500, +499, +327812, +16, +501, +413, +500, 262205, 14, -214, -194, -196670, -213, -214, +502, +321, +262268, +16, +503, +502, +327812, +16, +504, +501, +503, 262205, 14, -216, -195, +505, +286, +262268, +16, +506, +505, +327808, +16, +507, +504, +506, 196670, -215, -216, -852025, -2, -217, -39, -196, -200, -203, -205, -207, -209, -211, -213, -215, +498, +507, 262205, 14, -218, -203, -196670, -189, -218, +508, +288, 262205, +16, +509, +472, +262268, 14, -219, -205, -196670, -190, -219, +510, +509, +327856, +9, +511, +508, +510, +196855, +513, +0, +262394, +511, +512, +513, +131320, +512, 262205, 16, -220, -207, -196670, -191, -220, +514, +498, 262205, +16, +515, +498, +262268, 14, -221, -209, -196670, -192, -221, +516, +515, 262205, 14, -222, -211, -196670, -193, -222, -262205, +517, +321, +327808, 14, -223, -213, +518, +516, +517, +262205, +16, +519, +498, +327745, +337, +521, +326, +514, +262205, +7, +522, +521, 196670, -194, -223, +520, +522, +327745, +337, +524, +326, +518, 262205, -14, -224, -215, +7, +525, +524, 196670, -195, -224, +523, +525, +327745, +352, +527, +341, +519, 262205, -14, -228, -194, +6, +528, +527, +196670, +526, +528, +196670, +529, +216, +524345, +2, +530, +71, +520, +523, +526, +529, 262205, -101, -230, -229, +7, +531, +520, +327745, +337, +532, +326, +514, +196670, +532, +531, 262205, -16, -231, -191, -327775, -107, -232, -230, -231, -262256, 7, -233, -232, +533, +523, 327745, -234, -235, -227, -228, +337, +534, +326, +518, 196670, -235, -233, -196833, -90, -236, +534, +533, +131321, +513, +131320, +513, 262368, -90, -90, -109, -327745, -73, -238, -71, -72, +354, +103, +123, 262205, 14, -239, -238, -196670, -237, -239, +535, +288, 262205, +16, +536, +479, +262268, 14, -240, -192, -327850, +537, +536, +327856, 9, -241, -240, -109, +538, +535, +537, 196855, -243, +540, 0, 262394, -241, -242, -270, +538, +539, +540, 131320, -242, +539, 262205, +16, +541, +498, +262268, 14, -247, -194, +542, +541, 262205, 14, -248, -237, +543, +321, 327808, 14, -249, -247, -248, -327745, -234, -250, -227, -249, -262205, -7, -251, -250, -524367, -244, -252, -251, -251, -0, -1, -2, -262205, -14, -253, -194, -327745, -234, -254, -227, -253, -262205, -7, -255, -254, -524367, -244, -256, -255, -255, -0, -1, -2, -327811, -244, -257, -252, -256, -196670, -246, -257, +544, +542, +543, 262205, 16, -263, -191, -262205, -244, -264, -246, -393228, -244, -265, -1, -69, -264, -393281, -266, -267, -261, -262, -263, +545, +498, +262268, +14, +546, +545, 262205, -7, -268, -267, -589903, -7, -269, -268, -265, -4, -5, -6, -3, -196670, -267, -269, -131321, -243, -131320, -270, +14, +547, +321, +327812, +14, +548, +547, +354, +327808, +14, +549, +546, +548, 262205, +16, +550, +498, +262268, 14, -272, -194, +551, +550, 262205, 14, -273, -237, -327810, +552, +321, +327808, 14, -274, -272, -273, +553, +551, +552, 327745, -234, -275, -227, -274, +337, +555, +326, +544, 262205, 7, -276, -275, -524367, -244, -277, -276, -276, -0, -1, -2, +556, +555, 196670, -271, -277, -262205, -14, -279, -194, +554, +556, 327745, -234, -280, -227, -279, +337, +558, +326, +549, 262205, 7, -281, -280, -524367, -244, -282, -281, -281, -0, -1, +559, +558, +196670, +557, +559, +327745, +352, +561, +341, +553, +262205, +6, +562, +561, +196670, +560, +562, +196670, +563, +216, +524345, 2, +564, +71, +554, +557, +560, +563, +262205, +7, +565, +554, +327745, +337, +566, +326, +544, 196670, -278, -282, +566, +565, 262205, -16, -283, -191, +7, +567, +557, +327745, +337, +568, +326, +549, +196670, +568, +567, +131321, +540, +131320, +540, +262368, +354, +103, +123, +131321, +490, +131320, +490, 262205, -244, -284, -278, +16, +569, +486, +327808, +16, +570, +569, +406, +196670, +486, +570, +131321, +487, +131320, +489, +196670, +572, +573, 262205, -244, -285, -271, -327811, -244, -286, -284, -285, -393228, -244, +16, +574, 287, -1, -69, -286, -393281, -266, -288, -261, -262, -283, 262205, -7, -289, -288, -589903, -7, +14, +575, 290, -289, -287, -4, -5, -6, -3, +327745, +337, +576, +326, +575, +262205, +7, +577, +576, +393281, +334, +578, +331, +332, +574, 196670, -288, -290, -131321, -243, -131320, -243, +578, +577, 65789, 65592, 327734, @@ -32733,21 +32631,21 @@ const std::vector compute_tangents = {119734787, 131320, 13, 327745, -60, -61, +65, +74, 11, -59, +73, 262205, 6, -62, -61, +75, +74, 327866, 9, -64, -62, -63, +77, +75, +76, 131326, -64, +77, 65592, 327734, 2, @@ -32785,189 +32683,193 @@ const std::vector compute_tangents = {119734787, 29, 262205, 14, -67, +80, 19, 196670, 26, -67, +80, 327745, -73, -74, -71, -72, +86, +87, +84, +85, 262205, 14, -75, -74, +88, +87, 327814, 14, -76, -68, -75, +89, +81, +88, 196670, 25, -76, +89, 262205, 14, -77, +90, 19, 327745, -73, -78, -71, -72, +86, +91, +84, +85, 262205, 14, -79, -78, +92, +91, 327817, 14, -80, -77, -79, +93, +90, +92, 196670, 22, -80, +93, 262205, 14, -81, +94, 20, 327745, -73, -82, -71, -72, +86, +95, +84, +85, 262205, 14, -83, -82, +96, +95, 327812, 14, -84, -81, -83, +97, +94, +96, 262205, 14, -85, +98, 22, 327808, 14, -86, -84, -85, +99, +97, +98, 196670, 21, -86, +99, 327745, -73, -88, -71, -87, +86, +101, +84, +100, 262205, 14, -89, -88, +102, +101, 327808, 14, -91, -89, -90, +104, +102, +103, 262205, 14, -92, +105, 21, 327812, 14, -93, -92, -91, +106, +105, +104, 196670, 21, -93, +106, 262205, 14, -94, +107, 19, 262205, 14, -95, +108, 22, 327810, 14, -96, -94, -95, +109, +107, +108, 327745, -73, -97, -71, -72, +86, +110, +84, +85, 262205, 14, -98, -97, +111, +110, 327814, 14, -99, -96, -98, +112, +109, +111, 196670, 24, -99, +112, 262205, -101, -104, -103, +114, +117, +116, 262205, 14, -105, +118, 21, 262268, 16, -106, -105, +119, +118, +262244, +113, +120, +117, 327775, -107, -108, -104, -106, +121, +122, +120, +119, 327761, 14, -110, -108, +124, +122, 0, 196670, 27, -110, +124, 262205, 14, -111, +125, 21, 262205, 14, -112, +126, 25, 327812, 14, -113, -111, -112, +127, +125, +126, 262205, 14, -114, +128, 24, 327808, 14, -115, -113, -114, +129, +127, +128, 262268, 16, -116, -115, +130, +129, 196670, 23, -116, +130, 65789, 65592, 327734, @@ -33006,163 +32908,167 @@ const std::vector compute_tangents = {119734787, 40, 262205, 14, -117, +131, 30, 196670, 37, -117, +131, 327745, -73, -118, -71, -72, +86, +132, +84, +85, 262205, 14, -119, -118, +133, +132, 327814, 14, -120, -68, -119, +134, +81, +133, 196670, 36, -120, +134, 262205, 14, -121, +135, 30, 327745, -73, -122, -71, -72, +86, +136, +84, +85, 262205, 14, -123, -122, +137, +136, 327817, 14, -124, -121, -123, +138, +135, +137, 196670, 33, -124, +138, 262205, 14, -125, +139, 31, 327745, -73, -126, -71, -72, +86, +140, +84, +85, 262205, 14, -127, -126, +141, +140, 327812, -14, -128, -125, -127, +14, +142, +139, +141, 262205, 14, -129, +143, 33, 327808, 14, -130, -128, -129, +144, +142, +143, 196670, 32, -130, +144, 262205, 14, -131, +145, 30, 262205, 14, -132, +146, 33, 327810, 14, -133, -131, -132, +147, +145, +146, 327745, -73, -134, -71, -72, +86, +148, +84, +85, 262205, 14, -135, -134, +149, +148, 327814, 14, -136, -133, -135, +150, +147, +149, 196670, 35, -136, +150, 262205, -101, -137, -103, +114, +151, +116, 262205, 14, -138, +152, 32, 262268, 16, -139, -138, +153, +152, +262244, +113, +154, +151, 327775, -107, -140, -137, -139, +121, +155, +154, +153, 327761, 14, -141, -140, +156, +155, 0, 196670, 38, -141, +156, 262205, 14, -142, +157, 32, 262205, 14, -143, +158, 36, 327812, 14, -144, -142, -143, +159, +157, +158, 262205, 14, -145, +160, 35, 327808, 14, -146, -144, -145, +161, +159, +160, 262268, 16, -147, -146, +162, +161, 196670, 34, -147, +162, 65789, 65592, 327734, @@ -33192,226 +33098,629 @@ const std::vector compute_tangents = {119734787, 49, 262205, 14, -148, +163, 43, 327812, 14, -149, -68, -148, +164, +81, +163, 262205, 14, -150, +165, 42, 327808, 14, -151, -149, -150, +166, +164, +165, 196670, 44, -151, +166, 327745, -73, -152, -71, -72, +86, +167, +84, +85, 262205, 14, -153, -152, +168, +167, 327814, 14, -154, +169, +81, +168, +196670, +45, +169, +262205, +114, +170, +116, +262205, +14, +171, +44, +262268, +16, +172, +171, +262244, +113, +173, +170, +327775, +121, +174, +173, +172, +327761, +14, +175, +174, +0, +196670, +47, +175, +262205, +14, +176, +44, +262205, +14, +177, +45, +327812, +14, +178, +176, +177, +196670, +46, +178, +65789, +65592, +327734, +2, +57, +0, +50, +196663, +17, +51, +196663, +17, +52, +196663, +17, +53, +196663, +15, +54, +196663, +17, +55, +196663, +15, +56, +131320, +58, +262205, +16, +180, +52, +327812, +16, +181, +179, +180, +262205, +16, +182, +51, +327808, +16, +183, +181, +182, +196670, +53, +183, +327745, +86, +184, +84, +100, +262205, +14, +185, +184, +327808, +14, +186, +185, +103, +262268, +16, +187, +186, +262205, +16, +188, +53, +327812, +16, +189, +188, +187, +196670, +53, +189, +327745, +86, +190, +84, +85, +262205, +14, +191, +190, +327814, +14, +192, +81, +191, +196670, +54, +192, +262205, +114, +193, +116, +262205, +16, +194, +53, +262244, +113, +195, +193, +327775, +121, +196, +195, +194, +327761, +14, +197, +196, +0, +196670, +56, +197, +262205, +16, +198, +53, +262205, +14, +199, +54, +262268, +16, +200, +199, +327812, +16, +201, +198, +200, +196670, +55, +201, +65789, +65592, +327734, +59, +63, +0, +60, +196663, +8, +61, +196663, +8, +62, +131320, +64, +262203, +8, +202, +7, +262203, +8, +207, +7, +262203, +8, +220, +7, +262205, +7, +203, +61, +196670, +202, +203, +327737, +9, +204, +12, +202, +196855, +206, +0, +262394, +204, +205, +219, +131320, +205, +262205, +7, +208, +62, +196670, +207, +208, +327737, +9, +209, +12, +207, +196855, +211, +0, +262394, +209, +210, +215, +131320, +210, +131326, +213, +131320, +215, +131326, +217, +131320, +211, +131321, +206, +131320, +219, +262205, +7, +221, +62, +196670, +220, +221, +327737, +9, +222, +12, +220, +196855, +224, +0, +262394, +222, +223, +227, +131320, +223, +131326, +225, +131320, +227, +131326, +228, +131320, +224, +131321, +206, +131320, +206, +196609, +59, +230, +131326, +230, +65592, +327734, +2, +71, +0, +66, +196663, +8, +67, +196663, +8, 68, -153, +196663, +65, +69, +196663, +65, +70, +131320, +72, +262203, +232, +233, +7, +262203, +65, +239, +7, +262203, +65, +244, +7, +262203, +252, +253, +7, +262203, +8, +254, +7, +262203, +8, +256, +7, +262205, +7, +234, +68, +524367, +231, +235, +234, +234, +0, +1, +2, +262205, +7, +236, +67, +524367, +231, +237, +236, +236, +0, +1, +2, +327811, +231, +238, +235, +237, +196670, +233, +238, +262205, +231, +240, +233, +393228, +6, +241, +1, +66, +240, +458764, +6, +243, +1, +40, +241, +242, 196670, -45, -154, +239, +243, 262205, -101, -155, -103, +6, +245, +69, 262205, -14, -156, -44, -262268, -16, -157, -156, -327775, -107, -158, -155, -157, -327761, -14, -159, -158, -0, +6, +246, +239, +327816, +6, +247, +245, +246, +327811, +6, +248, +216, +247, 196670, -47, -159, +244, +248, 262205, -14, -160, -44, +6, +249, +244, 262205, -14, -161, -45, -327812, -14, -162, -160, -161, +231, +250, +233, +327822, +231, +251, +250, +249, 196670, -46, -162, -65789, -65592, -327734, -2, -57, -0, -50, -196663, -17, -51, -196663, -17, -52, -196663, -17, -53, -196663, -15, -54, -196663, -17, -55, -196663, -15, -56, -131320, -58, +233, +251, 262205, -16, -164, -52, -327812, -16, -165, -163, -164, +7, +255, +67, +196670, +254, +255, 262205, -16, -166, -51, -327808, -16, -167, -165, -166, +7, +257, +68, 196670, -53, -167, +256, +257, +393273, +59, +258, +63, +254, +256, +196670, +253, +258, 327745, -73, -168, -71, -87, +65, +259, +253, +123, 262205, -14, -169, -168, -327808, -14, -170, -169, -90, -262268, -16, -171, -170, +6, +260, +259, 262205, -16, -172, -53, -327812, -16, -173, -172, -171, +231, +261, +233, +327822, +231, +262, +261, +260, +262205, +6, +263, +70, +327822, +231, +264, +262, +263, +262205, +7, +265, +67, +524367, +231, +266, +265, +265, +0, +1, +2, +327809, +231, +267, +266, +264, +262205, +7, +268, +67, +589903, +7, +269, +268, +267, +4, +5, +6, +3, 196670, -53, -173, +67, +269, 327745, -73, -174, -71, -72, +65, +270, +253, +103, 262205, -14, -175, -174, -327814, -14, -176, -68, -175, -196670, -54, -176, +6, +271, +270, 262205, -101, -177, -103, +231, +272, +233, +327822, +231, +273, +272, +271, 262205, -16, -178, -53, -327775, -107, -179, -177, -178, -327761, -14, -180, -179, -0, -196670, -56, -180, +6, +274, +70, +327822, +231, +275, +273, +274, 262205, -16, -181, -53, +7, +276, +68, +524367, +231, +277, +276, +276, +0, +1, +2, +327811, +231, +278, +277, +275, 262205, -14, -182, -54, -262268, -16, -183, -182, -327812, -16, -184, -181, -183, +7, +279, +68, +589903, +7, +280, +279, +278, +4, +5, +6, +3, 196670, -55, -184, +68, +280, 65789, 65592, }; const std::vector prepare_follow_hair = {119734787, 65536, 524289, -271, +276, 0, 131089, 1, @@ -33431,8 +33740,8 @@ const std::vector prepare_follow_hair = {119734787, 4, 1852399981, 0, -187, -188, +191, +192, 393232, 4, 17, @@ -34001,7 +34310,7 @@ const std::vector prepare_follow_hair = {119734787, 1701869908, 0, 524293, -187, +191, 1281322087, 1818321775, 1870032457, @@ -34009,41 +34318,41 @@ const std::vector prepare_follow_hair = {119734787, 1145663087, 0, 393221, -188, +192, 1465871463, 1198223983, 1886744434, 17481, 458757, -189, +193, 1651469415, 1951624289, 1684955506, 1701080649, 120, 458757, -190, +194, 1633906540, 1920226156, 1231318625, 2019910766, 0, 458757, -191, +195, 1651469415, 1700162657, 2019914866, 1701080649, 120, 458757, -192, +196, 1633906540, 1919243884, 1232627060, 2019910766, 0, 524293, -193, +197, 1450014062, 1769239141, 1232299363, @@ -34051,31 +34360,23 @@ const std::vector prepare_follow_hair = {119734787, 1634890835, 25710, 458757, -194, +198, 1701080681, 1919895160, 1918986323, 1699570789, 109, 327685, -195, +199, 1634890867, 2035573870, 25968, 262149, -196, -1634886000, -109, -262149, 200, 1634886000, 109, 262149, -203, -1634886000, -109, -262149, -205, +204, 1634886000, 109, 262149, @@ -34098,11 +34399,19 @@ const std::vector prepare_follow_hair = {119734787, 215, 1634886000, 109, +262149, +217, +1634886000, +109, +262149, +219, +1634886000, +109, 196613, -225, +229, 105, 524293, -237, +241, 1651469415, 1866886241, 2003790956, @@ -34110,11 +34419,11 @@ const std::vector prepare_follow_hair = {119734787, 1850308709, 7890276, 262149, -246, +250, 1919508840, 7565136, 524293, -250, +254, 1632132967, 1700164201, 2019914866, @@ -34122,7 +34431,7 @@ const std::vector prepare_follow_hair = {119734787, 1852795252, 115, 524293, -255, +260, 1953067639, 1818386789, 1936674917, @@ -34130,7 +34439,7 @@ const std::vector prepare_follow_hair = {119734787, 1701990510, 118, 655366, -255, +260, 0, 1632132967, 1700164201, @@ -34140,16 +34449,16 @@ const std::vector prepare_follow_hair = {119734787, 1701990515, 118, 196613, -257, +262, 0, 393221, -267, +272, 1684104520, 1851880020, 1919903347, 109, 589830, -267, +272, 0, 1867341671, 1416389988, @@ -34158,7 +34467,7 @@ const std::vector prepare_follow_hair = {119734787, 1215459142, 6578533, 589830, -267, +272, 1, 1867341671, 1382835556, @@ -34167,7 +34476,7 @@ const std::vector prepare_follow_hair = {119734787, 1684104520, 0, 589830, -267, +272, 2, 1852396386, 1214606439, @@ -34176,12 +34485,12 @@ const std::vector prepare_follow_hair = {119734787, 1836216166, 0, 327686, -267, +272, 3, 1684300144, 6778473, 196613, -269, +274, 0, 327752, 69, @@ -34348,87 +34657,87 @@ const std::vector prepare_follow_hair = {119734787, 33, 22, 262215, -187, +191, 11, 27, 262215, -188, +192, 11, 26, 262215, -250, +254, 34, 1, 262215, -250, +254, 33, 7, 262215, -254, +259, 6, 16, 327752, -255, +260, 0, 35, 0, 196679, -255, +260, 3, 262215, -257, +262, 34, 1, 262215, -257, +262, 33, 20, 262215, -266, +271, 6, 16, 262216, -267, +272, 0, 5, 327752, -267, +272, 0, 35, 0, 327752, -267, +272, 0, 7, 16, 327752, -267, +272, 1, 35, 64, 327752, -267, +272, 2, 35, 80, 327752, -267, +272, 3, 35, 96, 196679, -267, +272, 3, 262215, -269, +274, 34, 0, 262215, -269, +274, 33, 27, 262215, -270, +275, 11, 25, 131091, @@ -34591,47 +34900,47 @@ const std::vector prepare_follow_hair = {119734787, 103, 0, 262167, -107, +108, 14, 4, 262187, 14, -109, +110, 0, 262187, 16, -163, +166, 64, 262167, -185, +189, 14, 3, 262176, -186, +190, 1, -185, +189, 262203, -186, -187, +190, +191, 1, 262203, -186, -188, +190, +192, 1, 262176, -197, +201, 1, 14, 262187, 16, -226, +230, 0, 262187, 16, -242, +246, 1, 589849, -247, +251, 6, 5, 0, @@ -34640,59 +34949,59 @@ const std::vector prepare_follow_hair = {119734787, 1, 0, 196635, -248, -247, +252, +251, 262176, -249, +253, 0, -248, +252, 262203, -249, -250, +253, +254, 0, 196637, -254, +259, 7, 196638, -255, -254, +260, +259, 262176, -256, +261, 2, -255, +260, 262203, -256, -257, +261, +262, 2, 262176, -260, +265, 2, 7, 262168, -265, +270, 7, 4, 262172, -266, +271, 6, 59, 393246, -267, -265, +272, +270, 7, 16, -266, +271, 262176, -268, +273, 2, -267, +272, 262203, -268, -269, +273, +274, 2, 393260, -185, -270, +189, +275, 68, 90, 90, @@ -34705,345 +35014,349 @@ const std::vector prepare_follow_hair = {119734787, 5, 262203, 15, -189, +193, 7, 262203, 15, -190, +194, 7, 262203, 17, -191, +195, 7, 262203, 15, -192, +196, 7, 262203, 15, -193, +197, 7, 262203, 15, -194, +198, 7, 262203, 15, -195, +199, 7, 262203, 15, -196, +200, 7, 262203, 15, -200, +204, 7, 262203, 15, -203, +207, 7, 262203, 15, -205, +209, 7, 262203, 17, -207, +211, 7, 262203, 15, -209, +213, 7, 262203, 15, -211, +215, 7, 262203, 15, -213, +217, 7, 262203, 15, -215, +219, 7, 262203, 17, -225, +229, 7, 262203, 17, -237, +241, 7, 262203, 8, -246, +250, 7, 327745, -197, -198, -187, -109, -262205, -14, -199, -198, -196670, -196, -199, -327745, -197, 201, -188, -109, +202, +191, +110, 262205, 14, +203, 202, -201, 196670, 200, -202, -262205, -14, -204, -189, -196670, 203, -204, +327745, +201, +205, +192, +110, 262205, 14, 206, -190, -196670, 205, +196670, +204, 206, 262205, -16, +14, 208, -191, +193, 196670, 207, 208, 262205, 14, 210, -192, +194, 196670, 209, 210, 262205, -14, +16, 212, -193, +195, 196670, 211, 212, 262205, 14, 214, -194, +196, 196670, 213, 214, 262205, 14, 216, -195, +197, 196670, 215, 216, -852025, -2, -217, -28, -196, -200, -203, -205, -207, -209, -211, -213, -215, 262205, 14, 218, -203, +198, 196670, -189, +217, 218, 262205, 14, -219, -205, -196670, -190, -219, -262205, -16, 220, -207, +199, 196670, -191, +219, 220, -262205, -14, +852025, +2, 221, +28, +200, +204, +207, 209, -196670, -192, -221, +211, +213, +215, +217, +219, 262205, 14, 222, -211, +207, 196670, 193, 222, 262205, 14, 223, -213, +209, 196670, 194, 223, 262205, -14, +16, 224, -215, +211, 196670, 195, 224, +262205, +14, +225, +213, 196670, +196, 225, +262205, +14, 226, -131321, +215, +196670, +197, +226, +262205, +14, 227, -131320, +217, +196670, +198, 227, -262390, +262205, +14, +228, +219, +196670, +199, +228, +196670, 229, 230, -0, 131321, 231, 131320, 231, +262390, +233, +234, +0, +131321, +235, +131320, +235, 262205, 16, -232, -225, +236, +229, 262268, 14, -233, -232, +237, +236, 327745, 73, -234, +238, 71, 87, 262205, 14, -235, -234, +239, +238, 327856, 9, -236, -233, -235, +240, +237, +239, 262394, -236, -228, -229, +240, +232, +233, 131320, -228, +232, 262205, 16, -238, -191, +242, +195, 262205, 14, -239, -193, +243, +197, 262268, 16, -240, -239, +244, +243, 262205, 16, -241, -225, +245, +229, 327808, 16, -243, -241, -242, +247, +245, +246, 327812, 16, +248, 244, -240, -243, +247, 327808, 16, -245, -238, -244, +249, +242, +248, 196670, -237, -245, +241, +249, 262205, -248, -251, -250, +252, +255, +254, 262205, 16, -252, -237, +256, +241, +262244, +251, +257, +255, 327775, 7, -253, -251, -252, +258, +257, +256, 196670, -246, -253, +250, +258, 262205, 16, -258, -237, +263, +241, 262205, 7, -259, -246, +264, +250, 393281, -260, -261, -257, -226, -258, +265, +266, +262, +230, +263, 196670, -261, -259, +266, +264, 131321, -230, +234, 131320, -230, +234, 262205, 16, -262, -225, +267, +229, 327808, 16, -263, -262, -242, +268, +267, +246, 196670, -225, -263, +229, +268, 131321, -227, +231, 131320, -229, +233, 65789, 65592, 327734, @@ -35250,48 +35563,52 @@ const std::vector prepare_follow_hair = {119734787, 16, 106, 105, -327775, +262244, +100, 107, -108, 104, +327775, +108, +109, +107, 106, 327761, 14, -110, -108, +111, +109, 0, 196670, 27, -110, +111, 262205, 14, -111, +112, 21, 262205, 14, -112, +113, 25, 327812, 14, -113, -111, +114, 112, +113, 262205, 14, -114, +115, 24, 327808, 14, -115, -113, +116, 114, +115, 262268, 16, +117, 116, -115, 196670, 23, -116, +117, 65789, 65592, 327734, @@ -35330,163 +35647,167 @@ const std::vector prepare_follow_hair = {119734787, 40, 262205, 14, -117, +118, 30, 196670, 37, -117, +118, 327745, 73, -118, +119, 71, 72, 262205, 14, +120, 119, -118, 327814, 14, -120, +121, 68, -119, +120, 196670, 36, -120, +121, 262205, 14, -121, +122, 30, 327745, 73, -122, +123, 71, 72, 262205, 14, +124, 123, -122, 327817, 14, +125, +122, 124, -121, -123, 196670, 33, -124, +125, 262205, 14, -125, +126, 31, 327745, 73, -126, +127, 71, 72, 262205, 14, +128, 127, -126, 327812, 14, +129, +126, 128, -125, -127, 262205, 14, -129, +130, 33, 327808, 14, -130, -128, +131, 129, +130, 196670, 32, -130, +131, 262205, 14, -131, +132, 30, 262205, 14, -132, +133, 33, 327810, 14, -133, -131, +134, 132, +133, 327745, 73, -134, +135, 71, 72, 262205, 14, +136, 135, -134, 327814, 14, +137, +134, 136, -133, -135, 196670, 35, -136, +137, 262205, 101, -137, +138, 103, 262205, 14, -138, +139, 32, 262268, 16, +140, 139, +262244, +100, +141, 138, 327775, -107, +108, +142, +141, 140, -137, -139, 327761, 14, -141, -140, +143, +142, 0, 196670, 38, -141, +143, 262205, 14, -142, +144, 32, 262205, 14, -143, +145, 36, 327812, 14, +146, 144, -142, -143, +145, 262205, 14, -145, +147, 35, 327808, 14, +148, 146, -144, -145, +147, 262268, 16, -147, -146, +149, +148, 196670, 34, -147, +149, 65789, 65592, 327734, @@ -35516,83 +35837,87 @@ const std::vector prepare_follow_hair = {119734787, 49, 262205, 14, -148, +150, 43, 327812, 14, -149, +151, 68, -148, +150, 262205, 14, -150, +152, 42, 327808, 14, +153, 151, -149, -150, +152, 196670, 44, -151, +153, 327745, 73, -152, +154, 71, 72, 262205, 14, -153, -152, +155, +154, 327814, 14, -154, +156, 68, -153, +155, 196670, 45, -154, +156, 262205, 101, -155, +157, 103, 262205, 14, -156, +158, 44, 262268, 16, -157, -156, -327775, -107, +159, 158, -155, +262244, +100, +160, 157, +327775, +108, +161, +160, +159, 327761, 14, -159, -158, +162, +161, 0, 196670, 47, -159, +162, 262205, 14, -160, +163, 44, 262205, 14, -161, +164, 45, 327812, 14, -162, -160, -161, +165, +163, +164, 196670, 46, -162, +165, 65789, 65592, 327734, @@ -35622,120 +35947,124 @@ const std::vector prepare_follow_hair = {119734787, 58, 262205, 16, -164, +167, 52, 327812, 16, -165, -163, -164, +168, +166, +167, 262205, 16, -166, +169, 51, 327808, 16, -167, -165, -166, +170, +168, +169, 196670, 53, -167, +170, 327745, 73, -168, +171, 71, 87, 262205, 14, -169, -168, +172, +171, 327808, 14, -170, -169, +173, +172, 90, 262268, 16, -171, -170, +174, +173, 262205, 16, -172, +175, 53, 327812, 16, -173, -172, -171, +176, +175, +174, 196670, 53, -173, +176, 327745, 73, -174, +177, 71, 72, 262205, 14, -175, -174, +178, +177, 327814, 14, -176, +179, 68, -175, +178, 196670, 54, -176, +179, 262205, 101, -177, +180, 103, 262205, 16, -178, +181, 53, +262244, +100, +182, +180, 327775, -107, -179, -177, -178, +108, +183, +182, +181, 327761, 14, -180, -179, +184, +183, 0, 196670, 56, -180, +184, 262205, 16, -181, +185, 53, 262205, 14, -182, +186, 54, 262268, 16, -183, -182, +187, +186, 327812, 16, -184, -181, -183, +188, +185, +187, 196670, 55, -184, +188, 65789, 65592, }; const std::vector update_follow_hair = {119734787, 65536, 524289, -312, +317, 0, 131089, 1, @@ -35755,8 +36084,8 @@ const std::vector update_follow_hair = {119734787, 4, 1852399981, 0, -187, -188, +191, +192, 393232, 4, 17, @@ -36325,7 +36654,7 @@ const std::vector update_follow_hair = {119734787, 1701869908, 0, 524293, -187, +191, 1281322087, 1818321775, 1870032457, @@ -36333,41 +36662,41 @@ const std::vector update_follow_hair = {119734787, 1145663087, 0, 393221, -188, +192, 1465871463, 1198223983, 1886744434, 17481, 458757, -189, +193, 1651469415, 1951624289, 1684955506, 1701080649, 120, 458757, -190, +194, 1633906540, 1920226156, 1231318625, 2019910766, 0, 458757, -191, +195, 1651469415, 1700162657, 2019914866, 1701080649, 120, 458757, -192, +196, 1633906540, 1919243884, 1232627060, 2019910766, 0, 524293, -193, +197, 1450014062, 1769239141, 1232299363, @@ -36375,31 +36704,23 @@ const std::vector update_follow_hair = {119734787, 1634890835, 25710, 458757, -194, +198, 1701080681, 1919895160, 1918986323, 1699570789, 109, 327685, -195, +199, 1634890867, 2035573870, 25968, 262149, -196, -1634886000, -109, -262149, 200, 1634886000, 109, 262149, -203, -1634886000, -109, -262149, -205, +204, 1634886000, 109, 262149, @@ -36422,20 +36743,28 @@ const std::vector update_follow_hair = {119734787, 215, 1634886000, 109, +262149, +217, +1634886000, +109, +262149, +219, +1634886000, +109, 327685, -227, +231, 1918986355, 1867539557, 115, 458757, -230, +234, 1953067639, 1818386789, 1936674917, 1869182057, 29550, 589830, -230, +234, 0, 1632132967, 1700164201, @@ -36444,13 +36773,13 @@ const std::vector update_follow_hair = {119734787, 1852795252, 115, 196613, -232, +236, 0, 196613, -241, +245, 105, 524293, -252, +256, 1651469415, 1866886241, 2003790956, @@ -36458,7 +36787,7 @@ const std::vector update_follow_hair = {119734787, 1850308709, 7890276, 524293, -261, +265, 1651469415, 1866886241, 2003790956, @@ -36466,16 +36795,16 @@ const std::vector update_follow_hair = {119734787, 1850303598, 7890276, 262149, -267, +271, 1952670054, 29295, 327685, -282, +286, 1819045734, 1867544431, 115, 524293, -291, +295, 1866882919, 2003790956, 1919508808, @@ -36483,13 +36812,13 @@ const std::vector update_follow_hair = {119734787, 1936090703, 29797, 393221, -308, +313, 1684104520, 1851880020, 1919903347, 109, 589830, -308, +313, 0, 1867341671, 1416389988, @@ -36498,7 +36827,7 @@ const std::vector update_follow_hair = {119734787, 1215459142, 6578533, 589830, -308, +313, 1, 1867341671, 1382835556, @@ -36507,7 +36836,7 @@ const std::vector update_follow_hair = {119734787, 1684104520, 0, 589830, -308, +313, 2, 1852396386, 1214606439, @@ -36516,12 +36845,12 @@ const std::vector update_follow_hair = {119734787, 1836216166, 0, 327686, -308, +313, 3, 1684300144, 6778473, 196613, -310, +315, 0, 327752, 69, @@ -36688,87 +37017,87 @@ const std::vector update_follow_hair = {119734787, 33, 22, 262215, -187, +191, 11, 27, 262215, -188, +192, 11, 26, 262215, -229, +233, 6, 16, 327752, -230, +234, 0, 35, 0, 196679, -230, +234, 3, 262215, -232, +236, 34, 1, 262215, -232, +236, 33, 7, 262215, -291, +295, 34, 1, 262215, -291, +295, 33, 25, 262215, -307, +312, 6, 16, 262216, -308, +313, 0, 5, 327752, -308, +313, 0, 35, 0, 327752, -308, +313, 0, 7, 16, 327752, -308, +313, 1, 35, 64, 327752, -308, +313, 2, 35, 80, 327752, -308, +313, 3, 35, 96, 196679, -308, +313, 3, 262215, -310, +315, 34, 0, 262215, -310, +315, 33, 27, 262215, -311, +316, 11, 25, 131091, @@ -36931,105 +37260,105 @@ const std::vector update_follow_hair = {119734787, 103, 0, 262167, -107, +108, 14, 4, 262187, 14, -109, +110, 0, 262187, 16, -163, +166, 64, 262167, -185, +189, 14, 3, 262176, -186, +190, 1, -185, +189, 262203, -186, -187, +190, +191, 1, 262203, -186, -188, +190, +192, 1, 262176, -197, +201, 1, 14, 262172, -225, +229, 7, 68, 262176, -226, +230, 4, -225, +229, 262203, -226, -227, +230, +231, 4, 196637, -229, +233, 7, 196638, -230, -229, +234, +233, 262176, -231, +235, 2, -230, +234, 262203, -231, -232, +235, +236, 2, 262187, 16, -233, +237, 0, 262176, -235, +239, 2, 7, 262176, -238, +242, 4, 7, 262187, 14, -240, -4062, +244, +2, 262187, 16, -257, +261, 1, 262187, 16, -268, +272, 26, 262176, -269, +273, 2, 6, 262187, 6, -278, +282, 1065353216, 262167, -280, +284, 6, 3, 262176, -281, +285, 7, -280, +284, 589849, -288, +292, 6, 5, 0, @@ -37038,41 +37367,41 @@ const std::vector update_follow_hair = {119734787, 1, 0, 196635, -289, -288, +293, +292, 262176, -290, +294, 0, -289, +293, 262203, -290, -291, +294, +295, 0, 262168, -306, +311, 7, 4, 262172, -307, +312, 6, 59, 393246, -308, -306, +313, +311, 7, 16, -307, +312, 262176, -309, +314, 2, -308, +313, 262203, -309, -310, +314, +315, 2, 393260, -185, -311, +189, +316, 68, 90, 90, @@ -37085,510 +37414,511 @@ const std::vector update_follow_hair = {119734787, 5, 262203, 15, -189, +193, 7, 262203, 15, -190, +194, 7, 262203, 17, -191, +195, 7, 262203, 15, -192, +196, 7, 262203, 15, -193, +197, 7, 262203, 15, -194, +198, 7, 262203, 15, -195, +199, 7, 262203, 15, -196, +200, 7, 262203, 15, -200, +204, 7, 262203, 15, -203, +207, 7, 262203, 15, -205, +209, 7, 262203, 17, -207, +211, 7, 262203, 15, -209, +213, 7, 262203, 15, -211, +215, 7, 262203, 15, -213, +217, 7, 262203, 15, -215, +219, 7, 262203, 17, -241, +245, 7, 262203, 17, -252, +256, 7, 262203, 17, -261, +265, 7, 262203, 60, -267, +271, 7, 262203, -281, -282, +285, +286, 7, 327745, -197, -198, -187, -109, -262205, -14, -199, -198, -196670, -196, -199, -327745, -197, 201, -188, -109, +202, +191, +110, 262205, 14, +203, 202, -201, 196670, 200, -202, -262205, -14, -204, -189, -196670, 203, -204, +327745, +201, +205, +192, +110, 262205, 14, 206, -190, -196670, 205, +196670, +204, 206, 262205, -16, +14, 208, -191, +193, 196670, 207, 208, 262205, 14, 210, -192, +194, 196670, 209, 210, 262205, -14, +16, 212, -193, +195, 196670, 211, 212, 262205, 14, 214, -194, +196, 196670, 213, 214, 262205, 14, 216, -195, +197, 196670, 215, 216, -852025, -2, -217, -28, -196, -200, -203, -205, -207, -209, -211, -213, -215, 262205, 14, 218, -203, +198, 196670, -189, +217, 218, 262205, 14, -219, -205, -196670, -190, -219, -262205, -16, 220, -207, +199, 196670, -191, +219, 220, -262205, -14, +852025, +2, 221, +28, +200, +204, +207, 209, -196670, -192, -221, +211, +213, +215, +217, +219, 262205, 14, 222, -211, +207, 196670, 193, 222, 262205, 14, 223, -213, +209, 196670, 194, 223, 262205, -14, +16, 224, -215, +211, 196670, 195, 224, 262205, 14, +225, +213, +196670, +196, +225, +262205, +14, +226, +215, +196670, +197, +226, +262205, +14, +227, +217, +196670, +198, +227, +262205, +14, 228, -194, +219, +196670, +199, +228, +262205, +14, +232, +198, 262205, 16, -234, -191, +238, +195, 393281, -235, +239, +240, 236, -232, -233, -234, +237, +238, 262205, 7, -237, -236, +241, +240, 327745, -238, -239, -227, -228, +242, +243, +231, +232, 196670, -239, -237, -196833, -90, -240, +243, +241, 262368, +244, 90, -90, -109, +110, 196670, -241, -233, +245, +237, 131321, -242, +246, 131320, -242, +246, 262390, -244, -245, +248, +249, 0, 131321, -246, +250, 131320, -246, +250, 262205, 16, -247, -241, +251, +245, 262268, 14, -248, -247, +252, +251, 327745, 73, -249, +253, 71, 87, 262205, 14, -250, -249, +254, +253, 327856, 9, -251, -248, -250, +255, +252, +254, 262394, -251, -243, -244, +255, +247, +248, 131320, -243, +247, 262205, 16, -253, -191, +257, +195, 262205, 14, -254, -193, +258, +197, 262268, 16, -255, -254, +259, +258, 262205, 16, -256, -241, +260, +245, 327808, 16, -258, -256, -257, +262, +260, +261, 327812, 16, +263, 259, -255, -258, +262, 327808, 16, -260, -253, -259, +264, +257, +263, 196670, -252, -260, +256, +264, 262205, 14, -262, -189, +266, +193, 262268, 16, -263, -262, +267, +266, 262205, 16, -264, -241, +268, +245, 327808, 16, -265, -263, -264, +269, +267, +268, 327808, 16, -266, -265, -257, -196670, -261, -266, -327745, +270, 269, +261, +196670, +265, 270, +327745, +273, +274, 71, -268, +272, 262205, 6, -271, -270, +275, +274, 262205, 14, -272, -192, +276, +196, 262256, 6, -273, -272, +277, +276, 262205, 14, -274, -193, +278, +197, 262256, 6, -275, -274, +279, +278, 327816, 6, -276, -273, -275, +280, +277, +279, 327813, 6, -277, -271, -276, +281, +275, +280, 327809, 6, -279, -277, -278, +283, +281, +282, 196670, -267, -279, +271, +283, 262205, 14, -283, -194, +287, +198, 327745, -238, -284, -227, -283, +242, +288, +231, +287, 262205, 7, -285, -284, +289, +288, 524367, -280, -286, -285, -285, +284, +290, +289, +289, 0, 1, 2, 262205, 6, -287, -267, -262205, -289, -292, 291, +271, 262205, -16, 293, -261, +296, +295, +262205, +16, +297, +265, +262244, +292, +298, +296, 327775, 7, -294, -292, -293, +299, +298, +297, 524367, -280, -295, -294, -294, +284, +300, +299, +299, 0, 1, 2, 327822, -280, -296, -295, -287, +284, +301, +300, +291, 327809, -280, -297, -286, -296, +284, +302, +290, +301, 196670, -282, -297, +286, +302, 262205, 16, -298, -252, +303, +256, 262205, -280, -299, -282, +284, +304, +286, 393281, -235, -300, -232, -233, -298, +239, +305, +236, +237, +303, 262205, 7, -301, -300, +306, +305, 589903, 7, -302, -301, -299, +307, +306, +304, 4, 5, 6, 3, 196670, -300, -302, +305, +307, 131321, -245, +249, 131320, -245, +249, 262205, 16, -303, -241, +308, +245, 327808, 16, -304, -303, -257, +309, +308, +261, 196670, -241, -304, +245, +309, 131321, -242, +246, 131320, -244, +248, 65789, 65592, 327734, @@ -37795,48 +38125,52 @@ const std::vector update_follow_hair = {119734787, 16, 106, 105, -327775, +262244, +100, 107, -108, 104, +327775, +108, +109, +107, 106, 327761, 14, -110, -108, +111, +109, 0, 196670, 27, -110, +111, 262205, 14, -111, +112, 21, 262205, 14, -112, +113, 25, 327812, 14, -113, -111, +114, 112, +113, 262205, 14, -114, +115, 24, 327808, 14, -115, -113, +116, 114, +115, 262268, 16, +117, 116, -115, 196670, 23, -116, +117, 65789, 65592, 327734, @@ -37875,163 +38209,167 @@ const std::vector update_follow_hair = {119734787, 40, 262205, 14, -117, +118, 30, 196670, 37, -117, +118, 327745, 73, -118, +119, 71, 72, 262205, 14, +120, 119, -118, 327814, 14, -120, +121, 68, -119, +120, 196670, 36, -120, +121, 262205, 14, -121, +122, 30, 327745, 73, -122, +123, 71, 72, 262205, 14, +124, 123, -122, 327817, 14, +125, +122, 124, -121, -123, 196670, 33, -124, +125, 262205, 14, -125, +126, 31, 327745, 73, -126, +127, 71, 72, 262205, 14, +128, 127, -126, 327812, 14, +129, +126, 128, -125, -127, 262205, 14, -129, +130, 33, 327808, 14, -130, -128, +131, 129, +130, 196670, 32, -130, +131, 262205, 14, -131, +132, 30, 262205, 14, -132, +133, 33, 327810, 14, -133, -131, +134, 132, +133, 327745, 73, -134, +135, 71, 72, 262205, 14, +136, 135, -134, 327814, 14, +137, +134, 136, -133, -135, 196670, 35, -136, +137, 262205, 101, -137, +138, 103, 262205, 14, -138, +139, 32, 262268, 16, +140, 139, +262244, +100, +141, 138, 327775, -107, +108, +142, +141, 140, -137, -139, 327761, 14, -141, -140, +143, +142, 0, 196670, 38, -141, +143, 262205, 14, -142, +144, 32, 262205, 14, -143, +145, 36, 327812, 14, +146, 144, -142, -143, +145, 262205, 14, -145, +147, 35, 327808, 14, +148, 146, -144, -145, +147, 262268, 16, -147, -146, +149, +148, 196670, 34, -147, +149, 65789, 65592, 327734, @@ -38061,83 +38399,87 @@ const std::vector update_follow_hair = {119734787, 49, 262205, 14, -148, +150, 43, 327812, 14, -149, +151, 68, -148, +150, 262205, 14, -150, +152, 42, 327808, 14, +153, 151, -149, -150, +152, 196670, 44, -151, +153, 327745, 73, -152, +154, 71, 72, 262205, 14, -153, -152, +155, +154, 327814, 14, -154, +156, 68, -153, +155, 196670, 45, -154, +156, 262205, 101, -155, +157, 103, 262205, 14, -156, +158, 44, 262268, 16, -157, -156, -327775, -107, +159, 158, -155, +262244, +100, +160, 157, +327775, +108, +161, +160, +159, 327761, 14, -159, -158, +162, +161, 0, 196670, 47, -159, +162, 262205, 14, -160, +163, 44, 262205, 14, -161, +164, 45, 327812, 14, -162, -160, -161, +165, +163, +164, 196670, 46, -162, +165, 65789, 65592, 327734, @@ -38167,113 +38509,117 @@ const std::vector update_follow_hair = {119734787, 58, 262205, 16, -164, +167, 52, 327812, 16, -165, -163, -164, +168, +166, +167, 262205, 16, -166, +169, 51, 327808, 16, -167, -165, -166, +170, +168, +169, 196670, 53, -167, +170, 327745, 73, -168, +171, 71, 87, 262205, 14, -169, -168, +172, +171, 327808, 14, -170, -169, +173, +172, 90, 262268, 16, -171, -170, +174, +173, 262205, 16, -172, +175, 53, 327812, 16, -173, -172, -171, +176, +175, +174, 196670, 53, -173, +176, 327745, 73, -174, +177, 71, 72, 262205, 14, -175, -174, +178, +177, 327814, 14, -176, +179, 68, -175, +178, 196670, 54, -176, +179, 262205, 101, -177, +180, 103, 262205, 16, -178, +181, 53, +262244, +100, +182, +180, 327775, -107, -179, -177, -178, +108, +183, +182, +181, 327761, 14, -180, -179, +184, +183, 0, 196670, 56, -180, +184, 262205, 16, -181, +185, 53, 262205, 14, -182, +186, 54, 262268, 16, -183, -182, +187, +186, 327812, 16, -184, -181, -183, +188, +185, +187, 196670, 55, -184, +188, 65789, 65592, }; diff --git a/amd_tressfx_vulkan/src/TressFXRendererVulkan.cpp b/amd_tressfx_vulkan/src/TressFXRendererVulkan.cpp index ce36111..6b5076b 100644 --- a/amd_tressfx_vulkan/src/TressFXRendererVulkan.cpp +++ b/amd_tressfx_vulkan/src/TressFXRendererVulkan.cpp @@ -32,16 +32,8 @@ #include "TressFXPrecompiledShadersVulkan.h" #include "UtilVulkan.h" -#ifndef AMD_V_RETURN -#define AMD_V_RETURN(x) \ - { \ - vr = (x); \ - if (vr != VK_SUCCESS) \ - { \ - return vr; \ - } \ - } -#endif +// Number of depth layers to use. 2 or 3 supported. +#define SHORTCUT_NUM_DEPTHS 3 // unreferenced formal parameter #pragma warning(disable : 4100) @@ -124,12 +116,15 @@ struct PPLL_BUFFERS VkBuffer pAtomicCounterPLL_Buffer; VkDeviceMemory pAtomicCounterPLL_Memory; + // If possible PLLL head, PPLL and atomic counter use same memory block + VkDeviceMemory pSharedMemory; + int width; int height; int refCount; // reference count - delete buffers when 0 }; -PPLL_BUFFERS g_PPLBuffers = {nullptr, nullptr, nullptr, 0, 0, 0}; +PPLL_BUFFERS g_PPLBuffers = {VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE, 0, 0, 0}; const static UINT g_HairTotalLayers = 32; @@ -142,17 +137,17 @@ namespace // Create the render pass used for the non shortcut algorithm // //---------------------------------------------------------------------------------- -VkRenderPass CreateRenderPass(VkDevice dev) +VkRenderPass CreateRenderPass(VkDevice dev, VkFormat depthStencilFormat, VkFormat colorFormat) { const VkAttachmentDescription attachments[] = { // Depth Buffer - {0, VK_FORMAT_D24_UNORM_S8_UINT, VK_SAMPLE_COUNT_1_BIT, + {0, depthStencilFormat, VK_SAMPLE_COUNT_1_BIT, VK_ATTACHMENT_LOAD_OP_LOAD, VK_ATTACHMENT_STORE_OP_STORE, VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_DONT_CARE, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL}, // color texture - {0, VK_FORMAT_R8G8B8A8_SRGB, VK_SAMPLE_COUNT_1_BIT, VK_ATTACHMENT_LOAD_OP_LOAD, + {0, colorFormat, VK_SAMPLE_COUNT_1_BIT, VK_ATTACHMENT_LOAD_OP_LOAD, VK_ATTACHMENT_STORE_OP_STORE, VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_STORE_OP_DONT_CARE, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL}}; @@ -231,7 +226,7 @@ namespace AMD // //-------------------------------------------------------------------------------------- VkResult TressFXRenderer::CreateTextureAndViews( - VkDevice pvkDevice, uint32_t texture_memory_index, VkCommandBuffer commandBuffer, + VkDevice pvkDevice, VkPhysicalDeviceMemoryProperties memProperties, VkCommandBuffer commandBuffer, VkDeviceMemory scratchMemory, VkBuffer scratchBuffer, size_t &offsetInScratchBuffer) { VkResult vr; @@ -241,17 +236,10 @@ VkResult TressFXRenderer::CreateTextureAndViews( VkImageCreateInfo hairShadowMapInfo = getImageCreateInfo( VK_FORMAT_D32_SFLOAT, SM_HAIR_WIDTH, SM_HAIR_HEIGHT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateImage(pvkDevice, &hairShadowMapInfo, nullptr, &m_pSMHairTexture)); - VkMemoryRequirements mem_requirement; - vkGetImageMemoryRequirements(pvkDevice, m_pSMHairTexture, &mem_requirement); - VkMemoryAllocateInfo memoryAllocateInfo{VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, - nullptr, mem_requirement.size, - texture_memory_index}; - AMD_V_RETURN( - vkAllocateMemory(pvkDevice, &memoryAllocateInfo, nullptr, &m_pSMHairMemory)); - AMD_V_RETURN(vkBindImageMemory(pvkDevice, m_pSMHairTexture, m_pSMHairMemory, 0)); + m_pSMHairMemory = allocImageMemory(pvkDevice, m_pSMHairTexture, memProperties); VkImageViewCreateInfo dsvDesc{VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; dsvDesc.format = VK_FORMAT_D32_SFLOAT; @@ -260,11 +248,11 @@ VkResult TressFXRenderer::CreateTextureAndViews( dsvDesc.subresourceRange.layerCount = 1; dsvDesc.subresourceRange.levelCount = 1; dsvDesc.image = m_pSMHairTexture; - AMD_V_RETURN(vkCreateImageView(pvkDevice, &dsvDesc, nullptr, &m_pSMHairView)); + AMD_CHECKED_VULKAN_CALL(vkCreateImageView(pvkDevice, &dsvDesc, nullptr, &m_pSMHairView)); VkImageMemoryBarrier defineHairSMLayoutBarrier[] = {getImageMemoryBarrier( m_pSMHairTexture, 0, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, VK_IMAGE_ASPECT_DEPTH_BIT)}; + VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, 1, VK_IMAGE_ASPECT_DEPTH_BIT)}; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, nullptr, 0, @@ -277,17 +265,9 @@ VkResult TressFXRenderer::CreateTextureAndViews( VkImageCreateInfo noiseTextureInfo = getImageCreateInfo( VK_FORMAT_R32G32B32A32_SFLOAT, 512, 512, VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateImage(pvkDevice, &noiseTextureInfo, nullptr, &m_pNoiseTexture)); - - VkMemoryRequirements mem_requirement; - vkGetImageMemoryRequirements(pvkDevice, m_pNoiseTexture, &mem_requirement); - VkMemoryAllocateInfo memoryAllocateInfo = {VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, - nullptr, mem_requirement.size, - texture_memory_index}; - AMD_V_RETURN( - vkAllocateMemory(pvkDevice, &memoryAllocateInfo, nullptr, &m_pNoiseMemory)); - AMD_V_RETURN(vkBindImageMemory(pvkDevice, m_pNoiseTexture, m_pNoiseMemory, 0)); + m_pNoiseMemory = allocImageMemory(pvkDevice, m_pNoiseTexture, memProperties); XMFLOAT4 *noiseArray = new XMFLOAT4[512 * 512]; for (UINT i = 0; i < 512 * 512; i++) @@ -307,10 +287,10 @@ VkResult TressFXRenderer::CreateTextureAndViews( VkImageMemoryBarrier makeNoiseTextureTransferableBarrier[] = { getImageMemoryBarrier(m_pNoiseTexture, 0, VK_ACCESS_TRANSFER_WRITE_BIT, VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL)}; + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, VK_IMAGE_ASPECT_COLOR_BIT)}; - vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, nullptr, 0, + vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, AMD_ARRAY_SIZE(makeNoiseTextureTransferableBarrier), makeNoiseTextureTransferableBarrier); @@ -327,10 +307,10 @@ VkResult TressFXRenderer::CreateTextureAndViews( VkImageMemoryBarrier makeNoiseTextureSampleableBarrier[] = {getImageMemoryBarrier( m_pNoiseTexture, VK_ACCESS_TRANSFER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)}; + VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, 1, VK_IMAGE_ASPECT_COLOR_BIT)}; - vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, nullptr, 0, + vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, 0, 0, nullptr, 0, nullptr, AMD_ARRAY_SIZE(makeNoiseTextureSampleableBarrier), makeNoiseTextureSampleableBarrier); @@ -344,66 +324,12 @@ VkResult TressFXRenderer::CreateTextureAndViews( srDesc.subresourceRange.levelCount = 1; srDesc.image = m_pNoiseTexture; - AMD_V_RETURN(vkCreateImageView(pvkDevice, &srDesc, nullptr, &m_pNoiseView)); + AMD_CHECKED_VULKAN_CALL(vkCreateImageView(pvkDevice, &srDesc, nullptr, &m_pNoiseView)); } return VK_SUCCESS; } -//-------------------------------------------------------------------------------------- -// -// CreateVertexBuffers -// -// Creates the vertex buffers for hair rendering -// -//-------------------------------------------------------------------------------------- -VkResult TressFXRenderer::CreateVertexBuffers( - VkDevice pvkDevice, uint32_t texture_memory_index, VkCommandBuffer commandBuffer, - VkDeviceMemory scratchMemory, VkBuffer scratchBuffer, size_t &offsetInScratchBuffer) -{ - VkResult vr; - // Create the screen quad vertex buffer(use StandardVertex for simplicity) - const StandardVertex screenQuad[6] = { - {XMFLOAT3(-1.0f, -1.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 0.0f), - XMFLOAT2(0.0f, 1.0f)}, // 0 - {XMFLOAT3(-1.0f, 1.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 0.0f), - XMFLOAT2(0.0f, 0.0f)}, // 1 - {XMFLOAT3(1.0f, -1.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 0.0f), - XMFLOAT2(1.0f, 1.0f)}, // 2 - {XMFLOAT3(1.0f, -1.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 0.0f), - XMFLOAT2(1.0f, 1.0f)}, // 2 - {XMFLOAT3(-1.0f, 1.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 0.0f), - XMFLOAT2(0.0f, 0.0f)}, // 1 - {XMFLOAT3(1.0f, 1.0f, 0.0f), XMFLOAT3(0.0f, 0.0f, 0.0f), - XMFLOAT2(1.0f, 0.0f)} // 3 - }; - - VkBufferCreateInfo bd{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; - bd.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - bd.size = sizeof(StandardVertex) * 6; - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &bd, nullptr, &m_pScreenQuadVB)); - - VkMemoryRequirements memReq; - vkGetBufferMemoryRequirements(pvkDevice, m_pScreenQuadVB, &memReq); - VkMemoryAllocateInfo allocInfo{VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO}; - allocInfo.allocationSize = memReq.size; - allocInfo.memoryTypeIndex = texture_memory_index; - AMD_V_RETURN(vkAllocateMemory(pvkDevice, &allocInfo, nullptr, &m_pScreenQuadMemory)); - AMD_V_RETURN(vkBindBufferMemory(pvkDevice, m_pScreenQuadVB, m_pScreenQuadMemory, 0)); - - void *memoryPointer; - vkMapMemory(pvkDevice, scratchMemory, offsetInScratchBuffer, - 6 * sizeof(StandardVertex), 0, &memoryPointer); - memcpy(memoryPointer, screenQuad, 6 * sizeof(StandardVertex)); - - VkBufferCopy region{offsetInScratchBuffer, 0, 6 * sizeof(StandardVertex)}; - vkCmdCopyBuffer(commandBuffer, scratchBuffer, m_pScreenQuadVB, 1, ®ion); - offsetInScratchBuffer += 6 * sizeof(StandardVertex); - vkUnmapMemory(pvkDevice, scratchMemory); - - return VK_SUCCESS; -} - //-------------------------------------------------------------------------------------- // // CreateConstantBuffers @@ -413,14 +339,14 @@ VkResult TressFXRenderer::CreateVertexBuffers( //-------------------------------------------------------------------------------------- VkResult TressFXRenderer::CreateConstantBuffer(VkDevice pvkDevice, uint32_t maxUniformBuffer, - uint32_t cpu_memory_index) + VkPhysicalDeviceMemoryProperties memProperties) { VkResult vr; VkBufferCreateInfo cbDesc{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; cbDesc.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT; cbDesc.size = maxUniformBuffer * sizeof(CB_PER_FRAME); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &cbDesc, nullptr, &m_pcbPerFrame)); - m_pcbPerFrameMemory = allocBufferMemory(pvkDevice, m_pcbPerFrame, cpu_memory_index); + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &cbDesc, nullptr, &m_pcbPerFrame)); + m_pcbPerFrameMemory = allocBufferMemory(pvkDevice, m_pcbPerFrame, memProperties, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); return VK_SUCCESS; } @@ -443,7 +369,7 @@ VkResult TressFXRenderer::CreateFrameBuffer(VkDevice pvkDevice, info.width = width; info.height = height; info.layers = 1; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateFramebuffer(pvkDevice, &info, nullptr, &m_renderHairFramebuffer)); } @@ -455,7 +381,7 @@ VkResult TressFXRenderer::CreateFrameBuffer(VkDevice pvkDevice, info.width = SM_HAIR_WIDTH; info.height = SM_HAIR_HEIGHT; info.layers = 1; - AMD_V_RETURN(vkCreateFramebuffer(pvkDevice, &info, nullptr, &m_shadowFrameBuffer)); + AMD_CHECKED_VULKAN_CALL(vkCreateFramebuffer(pvkDevice, &info, nullptr, &m_shadowFrameBuffer)); return VK_SUCCESS; } @@ -474,13 +400,13 @@ VkResult TressFXRenderer::CreateSamplers(VkDevice pvkDevice) samDesc.compareOp = VK_COMPARE_OP_NEVER; samDesc.minLod = 0.f; samDesc.maxLod = 1000.f; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateSampler(pvkDevice, &samDesc, nullptr, &m_pSamplerStateLinearWrap)); samDesc.minFilter = VK_FILTER_NEAREST; samDesc.magFilter = VK_FILTER_NEAREST; samDesc.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateSampler(pvkDevice, &samDesc, nullptr, &m_pSamplerStatePointClamp)); samDesc.minFilter = VK_FILTER_LINEAR; @@ -491,7 +417,7 @@ VkResult TressFXRenderer::CreateSamplers(VkDevice pvkDevice) samDesc.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; samDesc.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; samDesc.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; - AMD_V_RETURN(vkCreateSampler(pvkDevice, &samDesc, nullptr, &m_pSamplerStateCmpLess)); + AMD_CHECKED_VULKAN_CALL(vkCreateSampler(pvkDevice, &samDesc, nullptr, &m_pSamplerStateCmpLess)); return VK_SUCCESS; } @@ -503,11 +429,11 @@ VkResult TressFXRenderer::CreateSamplers(VkDevice pvkDevice) // Creates the render state objects for hair rendering // //-------------------------------------------------------------------------------------- -VkResult TressFXRenderer::CreateRenderStateObjects(VkDevice pvkDevice) +VkResult TressFXRenderer::CreateRenderStateObjects(VkDevice pvkDevice, VkFormat depthStencilFormat, VkFormat colorFormat) { VkResult vr; - m_pRPHairRendering = CreateRenderPass(pvkDevice); + m_pRPHairRendering = CreateRenderPass(pvkDevice, depthStencilFormat, colorFormat); ShaderModule fragmentShadersModule(pvkDevice, pass1_fragment); ShaderModule vertexShadersModule(pvkDevice, render_hair_aa_strand_copies_vertex); @@ -615,7 +541,7 @@ VkResult TressFXRenderer::CreateRenderStateObjects(VkDevice pvkDevice) VkPipeline pipelineArray[6] = {}; - AMD_V_RETURN(vkCreateGraphicsPipelines(pvkDevice, VK_NULL_HANDLE, + AMD_CHECKED_VULKAN_CALL(vkCreateGraphicsPipelines(pvkDevice, VK_NULL_HANDLE, AMD_ARRAY_SIZE(pipelineInfoArray), pipelineInfoArray, nullptr, pipelineArray)); @@ -638,29 +564,27 @@ VkResult TressFXRenderer::CreateRenderStateObjects(VkDevice pvkDevice) //-------------------------------------------------------------------------------------- VkResult TressFXRenderer::OnCreateDevice( VkDevice pvkDevice, int winWidth, int winHeight, bool bShortCutOn, - uint32_t maxUniformBuffer, uint32_t cpu_memory_index, uint32_t texture_memory_index, + uint32_t maxUniformBuffer, VkPhysicalDeviceMemoryProperties memProperties, VkImageView depthTexture, VkImageView colorTexture, VkCommandBuffer commandBuffer, - VkDeviceMemory scratchMemory, VkBuffer scratchBuffer, size_t &offsetInScratchBuffer) + VkDeviceMemory scratchMemory, VkBuffer scratchBuffer, size_t &offsetInScratchBuffer, + VkFormat depthStencilFormat, VkFormat colorFormat) { m_pvkDevice = pvkDevice; VkResult vr; - AMD_V_RETURN(CreateTextureAndViews(pvkDevice, texture_memory_index, commandBuffer, + AMD_CHECKED_VULKAN_CALL(CreateTextureAndViews(pvkDevice, memProperties, commandBuffer, scratchMemory, scratchBuffer, offsetInScratchBuffer)); - AMD_V_RETURN(CreateConstantBuffer(pvkDevice, maxUniformBuffer, cpu_memory_index)); - AMD_V_RETURN(CreateVertexBuffers(pvkDevice, texture_memory_index, commandBuffer, - scratchMemory, scratchBuffer, - offsetInScratchBuffer)); - AMD_V_RETURN(CreateSamplers(pvkDevice)); - AMD_V_RETURN(CreateLayouts(pvkDevice)); + AMD_CHECKED_VULKAN_CALL(CreateConstantBuffer(pvkDevice, maxUniformBuffer, memProperties)); + AMD_CHECKED_VULKAN_CALL(CreateSamplers(pvkDevice)); + AMD_CHECKED_VULKAN_CALL(CreateLayouts(pvkDevice)); if (!bShortCutOn) { - AMD_V_RETURN( - CreatePPLL(pvkDevice, winWidth, winHeight, false, texture_memory_index)); + AMD_CHECKED_VULKAN_CALL( + CreatePPLL(pvkDevice, winWidth, winHeight, false, memProperties)); VkImageMemoryBarrier defineHeadPPLLBarrier[] = {getImageMemoryBarrier( m_pHeadPPLLTexture, 0, VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, - VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL)}; + VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, 1, VK_IMAGE_ASPECT_COLOR_BIT)}; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, AMD_ARRAY_SIZE(defineHeadPPLLBarrier), @@ -672,31 +596,32 @@ VkResult TressFXRenderer::OnCreateDevice( m_pSamplerStateLinearWrap, m_pSamplerStatePointClamp, depthTexture, colorTexture, m_pcbPerFrame, sizeof(CB_PER_FRAME), m_pNoiseView, m_pSMHairView, - texture_memory_index, winWidth, winHeight); + memProperties, winWidth, winHeight, depthStencilFormat, colorFormat); VkImageMemoryBarrier barriers[] = { getImageMemoryBarrier(m_ShortCut.m_pAccumInvAlphaTexture, 0, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT, VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL), + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, 1, VK_IMAGE_ASPECT_COLOR_BIT), getImageMemoryBarrier(m_ShortCut.m_pFragmentDepthsTexture, 0, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT, - VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL), + VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, + SHORTCUT_NUM_DEPTHS, VK_IMAGE_ASPECT_COLOR_BIT), getImageMemoryBarrier(m_ShortCut.m_pFragmentColorsTexture, 0, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT, VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)}; + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, 1, VK_IMAGE_ASPECT_COLOR_BIT)}; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, nullptr, 0, nullptr, AMD_ARRAY_SIZE(barriers), barriers); } - AMD_V_RETURN(CreateRenderStateObjects(pvkDevice)); - AMD_V_RETURN(AllocateAndPopulateSets(pvkDevice, bShortCutOn)); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL(CreateRenderStateObjects(pvkDevice, depthStencilFormat, colorFormat)); + AMD_CHECKED_VULKAN_CALL(AllocateAndPopulateSets(pvkDevice, bShortCutOn)); + AMD_CHECKED_VULKAN_CALL( CreateFrameBuffer(pvkDevice, depthTexture, colorTexture, winWidth, winHeight)); return VK_SUCCESS; @@ -726,7 +651,7 @@ VkResult TressFXRenderer::CreateLayouts(VkDevice pvkDevice) {IDSRV_HAIR_THICKNESSES, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT}, }; - AMD_V_RETURN(getDescriptorLayout(pvkDevice, pass1_hair_bindings, + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, pass1_hair_bindings, AMD_ARRAY_SIZE(pass1_hair_bindings), m_pass1_hair_set_layout)); } @@ -753,7 +678,7 @@ VkResult TressFXRenderer::CreateLayouts(VkDevice pvkDevice) {IDSRV_NOISEMAP, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, 1, VK_SHADER_STAGE_VERTEX_BIT}, }; - AMD_V_RETURN(getDescriptorLayout(pvkDevice, pass1_config_bindings, + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, pass1_config_bindings, AMD_ARRAY_SIZE(pass1_config_bindings), m_pass1_config_set_layout)); } @@ -763,7 +688,7 @@ VkResult TressFXRenderer::CreateLayouts(VkDevice pvkDevice) VkPipelineLayoutCreateInfo pipelineLayoutInfo{ VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, nullptr, 0, AMD_ARRAY_SIZE(pass1_descriptor_set_layouts), pass1_descriptor_set_layouts}; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreatePipelineLayout(pvkDevice, &pipelineLayoutInfo, nullptr, &m_pass1_layout)); // Pass 2 set layout @@ -785,7 +710,7 @@ VkResult TressFXRenderer::CreateLayouts(VkDevice pvkDevice) {IDSRV_SHADOW_SAMPLER, VK_DESCRIPTOR_TYPE_SAMPLER, 1, VK_SHADER_STAGE_FRAGMENT_BIT, &m_pSamplerStatePointClamp}, }; - AMD_V_RETURN(getDescriptorLayout(pvkDevice, pass2_bindings, + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, pass2_bindings, AMD_ARRAY_SIZE(pass2_bindings), m_pass2_set_layout)); } @@ -793,7 +718,7 @@ VkResult TressFXRenderer::CreateLayouts(VkDevice pvkDevice) VkPipelineLayoutCreateInfo pass2PipelineLayoutInfo{ VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, nullptr, 0, 1, &m_pass2_set_layout}; - AMD_V_RETURN(vkCreatePipelineLayout(pvkDevice, &pass2PipelineLayoutInfo, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreatePipelineLayout(pvkDevice, &pass2PipelineLayoutInfo, nullptr, &m_pass2_layout)); // Shadow pass model dependent set layout @@ -803,7 +728,7 @@ VkResult TressFXRenderer::CreateLayouts(VkDevice pvkDevice) {IDSRV_HAIR_VERTEX_POSITIONS, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT}, }; - AMD_V_RETURN(getDescriptorLayout(pvkDevice, shadow_pass_hair_bindings, + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, shadow_pass_hair_bindings, AMD_ARRAY_SIZE(shadow_pass_hair_bindings), m_shadow_pass_hair_set_layout)); } @@ -814,7 +739,7 @@ VkResult TressFXRenderer::CreateLayouts(VkDevice pvkDevice) // TressFX parameters {IDSRV_CONSTANTS_BUFFER, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, 1, VK_SHADER_STAGE_VERTEX_BIT}}; - AMD_V_RETURN(getDescriptorLayout(pvkDevice, shadow_pass_config_bindings, + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, shadow_pass_config_bindings, AMD_ARRAY_SIZE(shadow_pass_config_bindings), m_shadow_pass_config_set_layout)); } @@ -825,7 +750,7 @@ VkResult TressFXRenderer::CreateLayouts(VkDevice pvkDevice) VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, nullptr, 0, AMD_ARRAY_SIZE(shadow_pass_descriptor_set_layouts), shadow_pass_descriptor_set_layouts}; - AMD_V_RETURN(vkCreatePipelineLayout(pvkDevice, &shadowPassPipelineLayoutInfo, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreatePipelineLayout(pvkDevice, &shadowPassPipelineLayoutInfo, nullptr, &m_shadow_pass_layout)); return VK_SUCCESS; @@ -854,43 +779,27 @@ VkResult TressFXRenderer::AllocateAndPopulateSets(VkDevice pvkDevice, bool isSho descriptorPoolCreateInfo.maxSets = 3; descriptorPoolCreateInfo.poolSizeCount = AMD_ARRAY_SIZE(descriptorPoolSize); descriptorPoolCreateInfo.pPoolSizes = descriptorPoolSize; - AMD_V_RETURN(vkCreateDescriptorPool(pvkDevice, &descriptorPoolCreateInfo, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateDescriptorPool(pvkDevice, &descriptorPoolCreateInfo, nullptr, &m_descriptorStorage)); + VkDescriptorBufferInfo bufferDescriptor{m_pcbPerFrame, 0, sizeof(CB_PER_FRAME)}; + VkDescriptorSetAllocateInfo allocateInfo{ + VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO}; + allocateInfo.descriptorPool = m_descriptorStorage; + allocateInfo.descriptorSetCount = 1; + allocateInfo.pSetLayouts = &m_shadow_pass_config_set_layout; + AMD_CHECKED_VULKAN_CALL( + vkAllocateDescriptorSets(pvkDevice, &allocateInfo, &m_shadow_pass_set)); if (!isShortcut) { - VkDescriptorSetAllocateInfo allocateInfo{ - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO}; - allocateInfo.descriptorPool = m_descriptorStorage; allocateInfo.descriptorSetCount = 1; allocateInfo.pSetLayouts = &m_pass1_config_set_layout; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkAllocateDescriptorSets(pvkDevice, &allocateInfo, &m_pass1_config_set)); - } - - if (!isShortcut) - { - VkDescriptorSetAllocateInfo allocate2Info{ - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO}; - allocate2Info.descriptorPool = m_descriptorStorage; - allocate2Info.descriptorSetCount = 1; - allocate2Info.pSetLayouts = &m_pass2_set_layout; - AMD_V_RETURN(vkAllocateDescriptorSets(pvkDevice, &allocate2Info, &m_pass2_set)); - } - { - VkDescriptorSetAllocateInfo allocate3Info{ - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO}; - allocate3Info.descriptorPool = m_descriptorStorage; - allocate3Info.descriptorSetCount = 1; - allocate3Info.pSetLayouts = &m_shadow_pass_config_set_layout; - AMD_V_RETURN( - vkAllocateDescriptorSets(pvkDevice, &allocate3Info, &m_shadow_pass_set)); - } - - VkDescriptorBufferInfo bufferDescriptor{m_pcbPerFrame, 0, sizeof(CB_PER_FRAME)}; - if (!isShortcut) - { + allocateInfo.descriptorSetCount = 1; + allocateInfo.pSetLayouts = &m_pass2_set_layout; + AMD_CHECKED_VULKAN_CALL(vkAllocateDescriptorSets(pvkDevice, &allocateInfo, &m_pass2_set)); VkDescriptorBufferInfo atomicCounterDescriptor{m_pAtomicCounterPPLLBuffer, 0, sizeof(unsigned int)}; @@ -960,7 +869,7 @@ VkResult TressFXRenderer::AllocateAndPopulateSets(VkDevice pvkDevice, bool isSho // //-------------------------------------------------------------------------------------- VkResult TressFXRenderer::CreatePPLL(VkDevice pvkDevice, int winWidth, int winHeight, - bool resize, uint32_t texture_memory_index) + bool resize, VkPhysicalDeviceMemoryProperties memProperties) { VkResult vr; @@ -968,52 +877,78 @@ VkResult TressFXRenderer::CreatePPLL(VkDevice pvkDevice, int winWidth, int winHe if ((winWidth != g_PPLBuffers.width) || (winHeight != g_PPLBuffers.height) || (g_PPLBuffers.refCount == 0)) { - // Release any previously allocated buffers - // AMD_SAFE_RELEASE(g_PPLBuffers.pHeadPPLL_Buffer); - // AMD_SAFE_RELEASE(g_PPLBuffers.pHeadPPLL_SRV); - // AMD_SAFE_RELEASE(g_PPLBuffers.pHeadPPLL_UAV); - // AMD_SAFE_RELEASE(g_PPLBuffers.pPPLL_Buffer); - // AMD_SAFE_RELEASE(g_PPLBuffers.pPPLL_UAV); - // AMD_SAFE_RELEASE(g_PPLBuffers.pPPLL_SRV); - // linked list head texture VkImageCreateInfo headPPLLInfo = getImageCreateInfo(VK_FORMAT_R32_UINT, winWidth, winHeight, - VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT); - AMD_V_RETURN(vkCreateImage(pvkDevice, &headPPLLInfo, nullptr, + VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT); + AMD_CHECKED_VULKAN_CALL(vkCreateImage(pvkDevice, &headPPLLInfo, nullptr, &g_PPLBuffers.pHeadPPLL_Buffer)); - g_PPLBuffers.pHeadPPLL_Memory = allocImageMemory( - pvkDevice, g_PPLBuffers.pHeadPPLL_Buffer, texture_memory_index); - - // View for linked list head - VkImageViewCreateInfo srDesc{VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; - srDesc.format = VK_FORMAT_R32_UINT; - srDesc.viewType = VK_IMAGE_VIEW_TYPE_2D; - srDesc.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - srDesc.subresourceRange.layerCount = 1; - srDesc.subresourceRange.levelCount = 1; - srDesc.image = g_PPLBuffers.pHeadPPLL_Buffer; - AMD_V_RETURN( - vkCreateImageView(pvkDevice, &srDesc, nullptr, &g_PPLBuffers.pHeadPPLL_View)); // Per-pixel Linked List (PPLL) buffer VkBufferCreateInfo BufferDesc{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; BufferDesc.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; BufferDesc.size = (DWORD)(g_HairTotalLayers * winWidth * winHeight * sizeof(PER_PIXEL_LINKED_LIST_STRUCT)); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateBuffer(pvkDevice, &BufferDesc, nullptr, &g_PPLBuffers.pPPLL_Buffer)); - g_PPLBuffers.pPPLL_Memory = - allocBufferMemory(pvkDevice, g_PPLBuffers.pPPLL_Buffer, texture_memory_index); // Atomic counter buffer BufferDesc.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; BufferDesc.size = sizeof(unsigned int); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &BufferDesc, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &BufferDesc, nullptr, &g_PPLBuffers.pAtomicCounterPLL_Buffer)); - g_PPLBuffers.pAtomicCounterPLL_Memory = allocBufferMemory( - pvkDevice, g_PPLBuffers.pAtomicCounterPLL_Buffer, texture_memory_index); + + VkMemoryRequirements headPPLLMemReq; + vkGetImageMemoryRequirements(pvkDevice, g_PPLBuffers.pHeadPPLL_Buffer, &headPPLLMemReq); + VkMemoryRequirements PPLBufferMemReq; + vkGetBufferMemoryRequirements(pvkDevice, g_PPLBuffers.pPPLL_Buffer, &PPLBufferMemReq); + VkMemoryRequirements atomicBufferMemReq; + vkGetBufferMemoryRequirements(pvkDevice, g_PPLBuffers.pAtomicCounterPLL_Buffer, &atomicBufferMemReq); + + uint32_t typeBits = headPPLLMemReq.memoryTypeBits & PPLBufferMemReq.memoryTypeBits & atomicBufferMemReq.memoryTypeBits; + uint32_t memoryType = getMemoryTypeIndex(typeBits, memProperties, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + if (memoryType == -1) + { + // Split in 3 + g_PPLBuffers.pHeadPPLL_Memory = allocImageMemory( + pvkDevice, g_PPLBuffers.pHeadPPLL_Buffer, memProperties); + + g_PPLBuffers.pPPLL_Memory = + allocBufferMemory(pvkDevice, g_PPLBuffers.pPPLL_Buffer, memProperties, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + + g_PPLBuffers.pAtomicCounterPLL_Memory = allocBufferMemory( + pvkDevice, g_PPLBuffers.pAtomicCounterPLL_Buffer, memProperties, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); + } + else + { + VkDeviceSize PPLBufferOffset = align(headPPLLMemReq.size, PPLBufferMemReq.alignment); + VkDeviceSize atomicBufferOffset = align(PPLBufferOffset + PPLBufferMemReq.size, atomicBufferMemReq.alignment); + VkDeviceSize totalSize = atomicBufferOffset + atomicBufferMemReq.size; + + VkMemoryAllocateInfo allocate{ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO }; + allocate.allocationSize = totalSize; + allocate.memoryTypeIndex = memoryType; + AMD_CHECKED_VULKAN_CALL(vkAllocateMemory(pvkDevice, &allocate, NULL, &g_PPLBuffers.pSharedMemory)); + + AMD_CHECKED_VULKAN_CALL(vkBindImageMemory(pvkDevice, g_PPLBuffers.pHeadPPLL_Buffer, g_PPLBuffers.pSharedMemory, 0)); + AMD_CHECKED_VULKAN_CALL(vkBindBufferMemory(pvkDevice, g_PPLBuffers.pPPLL_Buffer, g_PPLBuffers.pSharedMemory, PPLBufferOffset)); + AMD_CHECKED_VULKAN_CALL(vkBindBufferMemory(pvkDevice, g_PPLBuffers.pAtomicCounterPLL_Buffer, g_PPLBuffers.pSharedMemory, atomicBufferOffset)); + } + + + // View for linked list head + VkImageViewCreateInfo srDesc{VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; + srDesc.format = VK_FORMAT_R32_UINT; + srDesc.viewType = VK_IMAGE_VIEW_TYPE_2D; + srDesc.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + srDesc.subresourceRange.layerCount = 1; + srDesc.subresourceRange.levelCount = 1; + srDesc.image = g_PPLBuffers.pHeadPPLL_Buffer; + AMD_CHECKED_VULKAN_CALL( + vkCreateImageView(pvkDevice, &srDesc, nullptr, &g_PPLBuffers.pHeadPPLL_View)); + + // update the width and height g_PPLBuffers.width = winWidth; @@ -1071,6 +1006,7 @@ void TressFXRenderer::DeletePPLL(VkDevice pvkDevice) AMD_SAFE_RELEASE(g_PPLBuffers.pAtomicCounterPLL_Buffer, vkDestroyBuffer, pvkDevice); AMD_SAFE_RELEASE(g_PPLBuffers.pAtomicCounterPLL_Memory, vkFreeMemory, pvkDevice); + AMD_SAFE_RELEASE(g_PPLBuffers.pSharedMemory, vkFreeMemory, pvkDevice); g_PPLBuffers.width = 0; g_PPLBuffers.height = 0; @@ -1087,16 +1023,16 @@ void TressFXRenderer::DeletePPLL(VkDevice pvkDevice) //-------------------------------------------------------------------------------------- VkResult TressFXRenderer::OnResizedSwapChain(VkDevice pvkDevice, int width, int height, bool bShortCutOn, - uint32_t texture_memory_index) + VkPhysicalDeviceMemoryProperties memProperties) { VkResult vr; if (bShortCutOn) { - // AMD_V_RETURN(m_ShortCut.OnResizedSwapChain(pd3dDevice, width, height)); + // AMD_CHECKED_VULKAN_CALL(m_ShortCut.OnResizedSwapChain(pd3dDevice, width, height)); } else { - AMD_V_RETURN(CreatePPLL(pvkDevice, width, height, true, texture_memory_index)); + AMD_CHECKED_VULKAN_CALL(CreatePPLL(pvkDevice, width, height, true, memProperties)); } return VK_SUCCESS; } @@ -1230,7 +1166,7 @@ void TressFXRenderer::BeginHairFrame( // // RenderScreenQuad // -// Renders a full screen quad +// Renders a triangle big enough to cover whole screen // ////-------------------------------------------------------------------------------------- void TressFXRenderer::RenderScreenQuad(VkCommandBuffer cmdbuffer, VkPipeline pPipeline) @@ -1238,11 +1174,8 @@ void TressFXRenderer::RenderScreenQuad(VkCommandBuffer cmdbuffer, VkPipeline pPi // set shader vkCmdBindPipeline(cmdbuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pPipeline); - VkDeviceSize offsets = 0; - vkCmdBindVertexBuffers(cmdbuffer, 0, 1, &m_pScreenQuadVB, &offsets); - - // Draw full screen quad - vkCmdDraw(cmdbuffer, 6, 1, 0, 0); + // Draw full screen triangle + vkCmdDraw(cmdbuffer, 3, 1, 0, 0); } //-------------------------------------------------------------------------------------- @@ -1252,8 +1185,10 @@ void TressFXRenderer::RenderScreenQuad(VkCommandBuffer cmdbuffer, VkPipeline pPi // Renders the hair from the point of view of the light into a shadow map // //-------------------------------------------------------------------------------------- -void TressFXRenderer::GenerateShadowMap(VkDevice pvkDevice, VkCommandBuffer commandBuffer, - float density, uint32_t uniformBufferIndex) +void TressFXRenderer::GenerateShadowMap(VkDevice pvkDevice, + VkCommandBuffer commandBuffer, + float density, uint32_t uniformBufferIndex, + const DebugMarkerPointer& markerCallbacks) { VkViewport viewport{0.f, 0.f, SM_HAIR_WIDTH, SM_HAIR_HEIGHT, 0.f, 1.f}; vkCmdSetViewport(commandBuffer, 0, 1, &viewport); @@ -1268,6 +1203,7 @@ void TressFXRenderer::GenerateShadowMap(VkDevice pvkDevice, VkCommandBuffer comm depthClear.depthStencil.depth = 1.f; info.pClearValues = &depthClear; info.renderArea.extent = {SM_HAIR_WIDTH, SM_HAIR_HEIGHT}; + markerCallbacks.markBeginRegion(commandBuffer, "Shadowmap"); vkCmdBeginRenderPass(commandBuffer, &info, VK_SUBPASS_CONTENTS_INLINE); vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, m_pPLGenerateHairSM); @@ -1281,6 +1217,7 @@ void TressFXRenderer::GenerateShadowMap(VkDevice pvkDevice, VkCommandBuffer comm vkCmdDrawIndexed(commandBuffer, UINT(density * m_pTressFXMesh->m_TotalIndexCount), 1, 0, 0, 0); vkCmdEndRenderPass(commandBuffer); + markerCallbacks.markEndRegion(commandBuffer); } //-------------------------------------------------------------------------------------- @@ -1295,13 +1232,16 @@ void TressFXRenderer::GenerateShadowMap(VkDevice pvkDevice, VkCommandBuffer comm // and blends the nearest k fragments (K-buffer) in back to front order. // ////-------------------------------------------------------------------------------------- -void TressFXRenderer::RenderHair(VkDevice pvkDevice, VkCommandBuffer commandBuffer, - uint32_t width, uint32_t height, - uint32_t uniformBufferIndex) +void TressFXRenderer::RenderHair(VkDevice pvkDevice, + VkCommandBuffer commandBuffer, + uint32_t width, + uint32_t height, + uint32_t uniformBufferIndex, const DebugMarkerPointer& markerCallbacks) { // Caller must rebind original render target and depth stencil view after call // render hair + markerCallbacks.markBeginRegion(commandBuffer, "RenderHair"); // Clear HeadPPLL buffer as it's not an attachment VkClearColorValue dwClearDataMinusOne{}; @@ -1385,11 +1325,14 @@ void TressFXRenderer::RenderHair(VkDevice pvkDevice, VkCommandBuffer commandBuff AMD_ARRAY_SIZE(descriptorOffsets), descriptorOffsets); RenderScreenQuad(commandBuffer, m_pPLResolveKBuffer); vkCmdEndRenderPass(commandBuffer); + markerCallbacks.markEndRegion(commandBuffer); } void TressFXRenderer::RenderHairShortcut(VkDevice pvkDevice, - VkCommandBuffer commandBuffer, uint32_t width, - uint32_t height, uint32_t uniformBufferIndex) + + VkCommandBuffer commandBuffer, + uint32_t width, + uint32_t height, uint32_t uniformBufferIndex, const DebugMarkerPointer& markerCallbacks) { m_ShortCut.SetupDepthPass(pvkDevice, commandBuffer, width, height); @@ -1513,9 +1456,6 @@ void TressFXRenderer::OnDestroy() { m_ShortCut.OnDestroy(true); - AMD_SAFE_RELEASE(m_pScreenQuadVB, vkDestroyBuffer, m_pvkDevice); - AMD_SAFE_RELEASE(m_pScreenQuadMemory, vkFreeMemory, m_pvkDevice); - { AMD_SAFE_RELEASE(m_pPLRenderHairAAStrandCopies, vkDestroyPipeline, m_pvkDevice); AMD_SAFE_RELEASE(m_pPLRenderHairAA, vkDestroyPipeline, m_pvkDevice); diff --git a/amd_tressfx_vulkan/src/TressFXRendererVulkan.h b/amd_tressfx_vulkan/src/TressFXRendererVulkan.h index c373db8..1bff44f 100644 --- a/amd_tressfx_vulkan/src/TressFXRendererVulkan.h +++ b/amd_tressfx_vulkan/src/TressFXRendererVulkan.h @@ -97,10 +97,6 @@ class TressFXRenderer VkDeviceMemory m_pSMHairMemory; VkImageView m_pSMHairView; - // vertex buffer for full screen quad - VkBuffer m_pScreenQuadVB; - VkDeviceMemory m_pScreenQuadMemory; - TressFXShortCut m_ShortCut; VkImageView m_depthBuffer; @@ -122,20 +118,16 @@ class TressFXRenderer VkResult CreateFrameBuffer(VkDevice pvkDevice, VkImageView depthTextureView, VkImageView colorTextureView, uint32_t width, uint32_t height); - VkResult CreateTextureAndViews(VkDevice pvkDevice, uint32_t MemoryIndexGPU, + VkResult CreateTextureAndViews(VkDevice pvkDevice, VkPhysicalDeviceMemoryProperties memProperties, VkCommandBuffer commandBuffer, VkDeviceMemory scratchMemory, VkBuffer scratchBuffer, size_t &offsetInScratchBuffer); VkResult CreateConstantBuffer(VkDevice pvkDevice, uint32_t maxUniformBuffer, - uint32_t MemoryIndexCPU); - VkResult CreateVertexBuffers(VkDevice pvkDevice, uint32_t MemoryIndexGPU, - VkCommandBuffer commandBuffer, - VkDeviceMemory scratchMemory, VkBuffer scratchBuffer, - size_t &offsetInScratchBuffer); + VkPhysicalDeviceMemoryProperties memProperties); VkResult CreateSamplers(VkDevice pvkDevice); - VkResult CreateRenderStateObjects(VkDevice pvkDevice); + VkResult CreateRenderStateObjects(VkDevice pvkDevice, VkFormat depthStencilFormat, VkFormat colorFormat); VkResult CreatePPLL(VkDevice pvkDevice, int winWidth, int winHeight, bool resize, - uint32_t MemoryIndexGPU); + VkPhysicalDeviceMemoryProperties memProperties); VkResult CreateLayouts(VkDevice pvkDevice); VkResult AllocateAndPopulateSets(VkDevice pvkDevice, bool isShortcut); void DeletePPLL(VkDevice pvkDevice); @@ -148,12 +140,13 @@ class TressFXRenderer VkImageView GetShadowMapSRV() { return m_pSMHairView; }; VkResult OnCreateDevice(VkDevice pvkDevice, int winWidth, int winHeight, bool bShortCutOn, uint32_t maxUniformBuffer, - uint32_t MemoryIndexCPU, uint32_t MemoryIndexGPU, + VkPhysicalDeviceMemoryProperties memProperties, VkImageView depthTexture, VkImageView colorTexture, VkCommandBuffer commandBuffer, VkDeviceMemory scratchMemory, - VkBuffer scratchBuffer, size_t &offsetInScratchBuffer); + VkBuffer scratchBuffer, size_t &offsetInScratchBuffer, + VkFormat depthStencilFormat, VkFormat colorFormat); VkResult OnResizedSwapChain(VkDevice pvkDevice, int winWidth, int WinHeight, - bool bShortCutOn, uint32_t MemoryIndexGPU); + bool bShortCutOn, VkPhysicalDeviceMemoryProperties memProperties); void BeginHairFrame(VkDevice pvkDevice, DirectX::XMVECTOR eyePoint, DirectX::XMVECTOR lightPosition, DirectX::XMMATRIX *pModelTrasnsformForHead, @@ -161,12 +154,18 @@ class TressFXRenderer DirectX::XMMATRIX *pViewProjLightOut, float screenWidth, float screenHeight, bool singleHeadTransform, uint32_t uniformBufferIndex); - void GenerateShadowMap(VkDevice pvkDevice, VkCommandBuffer commandBuffer, - float density, uint32_t uniformBufferIndex); - void RenderHair(VkDevice pvkDevice, VkCommandBuffer commandBuffer, uint32_t width, - uint32_t height, uint32_t uniformBufferIndex); - void RenderHairShortcut(VkDevice pvkDevice, VkCommandBuffer commandBuffer, - uint32_t width, uint32_t height, uint32_t uniformBufferIndex); + void GenerateShadowMap(VkDevice pvkDevice, + VkCommandBuffer commandBuffer, + float density, uint32_t uniformBufferIndex, + const DebugMarkerPointer& markerCallbacks); + void RenderHair(VkDevice pvkDevice, VkCommandBuffer commandBuffer, + uint32_t width, + uint32_t height, uint32_t uniformBufferIndex, + const DebugMarkerPointer& markerCallbacks); + void RenderHairShortcut(VkDevice pvkDevice, + VkCommandBuffer commandBuffer, + uint32_t width, uint32_t height, uint32_t uniformBufferIndex, + const DebugMarkerPointer& markerCallbacks); void EndHairFrame(VkDevice pvkDevice); void OnDestroy(); }; diff --git a/amd_tressfx_vulkan/src/TressFXShortCutVulkan.cpp b/amd_tressfx_vulkan/src/TressFXShortCutVulkan.cpp index 852e76f..2a91d61 100644 --- a/amd_tressfx_vulkan/src/TressFXShortCutVulkan.cpp +++ b/amd_tressfx_vulkan/src/TressFXShortCutVulkan.cpp @@ -32,17 +32,6 @@ #include "UtilVulkan.h" #include -#ifndef AMD_V_RETURN -#define AMD_V_RETURN(x) \ - { \ - vr = (x); \ - if (vr != VK_SUCCESS) \ - { \ - return vr; \ - } \ - } -#endif - // unreferenced formal parameter #pragma warning(disable : 4100) @@ -73,7 +62,7 @@ VkResult GPUOnlyStructuredBuffer::Create(VkDevice pvkDevice, uint32_t structSize VkBufferCreateInfo BufferDesc{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; BufferDesc.size = structCount * structSize; BufferDesc.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &BufferDesc, NULL, &m_pBuffer)); + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &BufferDesc, NULL, &m_pBuffer)); m_pvkDevice = pvkDevice; return VK_SUCCESS; @@ -87,7 +76,7 @@ void GPUOnlyStructuredBuffer::Destroy() VkResult TressFXShortCut::CreateScreenSizedItems(VkDevice pvkDevice, int winWidth, int winHeight, - uint32_t texture_memory_index) + VkPhysicalDeviceMemoryProperties memProperties) { m_pvkDevice = pvkDevice; VkResult vr; @@ -96,10 +85,10 @@ VkResult TressFXShortCut::CreateScreenSizedItems(VkDevice pvkDevice, int winWidt VK_FORMAT_R16_SFLOAT, winWidth, winHeight, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT); - AMD_V_RETURN(vkCreateImage(pvkDevice, &accumInvAlphaInfo, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateImage(pvkDevice, &accumInvAlphaInfo, nullptr, &m_pAccumInvAlphaTexture)); m_pAccumInvAlphaMemory = - allocImageMemory(pvkDevice, m_pAccumInvAlphaTexture, texture_memory_index); + allocImageMemory(pvkDevice, m_pAccumInvAlphaTexture, memProperties); VkImageViewCreateInfo srDesc{VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; srDesc.format = VK_FORMAT_R16_SFLOAT; @@ -108,7 +97,7 @@ VkResult TressFXShortCut::CreateScreenSizedItems(VkDevice pvkDevice, int winWidt srDesc.subresourceRange.layerCount = 1; srDesc.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; srDesc.image = m_pAccumInvAlphaTexture; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateImageView(pvkDevice, &srDesc, nullptr, &m_pAccumInvAlphaView)); } @@ -118,11 +107,11 @@ VkResult TressFXShortCut::CreateScreenSizedItems(VkDevice pvkDevice, int winWidt VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, SHORTCUT_NUM_DEPTHS); - AMD_V_RETURN(vkCreateImage(pvkDevice, &fragmentDepthInfo, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateImage(pvkDevice, &fragmentDepthInfo, nullptr, &m_pFragmentDepthsTexture)); m_pFragmentDepthsMemory = - allocImageMemory(pvkDevice, m_pFragmentDepthsTexture, texture_memory_index); + allocImageMemory(pvkDevice, m_pFragmentDepthsTexture, memProperties); VkImageViewCreateInfo srDesc{VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; srDesc.format = VK_FORMAT_R32_UINT; @@ -131,7 +120,7 @@ VkResult TressFXShortCut::CreateScreenSizedItems(VkDevice pvkDevice, int winWidt srDesc.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; srDesc.subresourceRange.layerCount = SHORTCUT_NUM_DEPTHS; srDesc.image = m_pFragmentDepthsTexture; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateImageView(pvkDevice, &srDesc, nullptr, &m_pFragmentDepthsView)); } @@ -141,11 +130,11 @@ VkResult TressFXShortCut::CreateScreenSizedItems(VkDevice pvkDevice, int winWidt VK_FORMAT_R16G16B16A16_SFLOAT, winWidth, winHeight, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT); - AMD_V_RETURN(vkCreateImage(pvkDevice, &fragmentColorInfo, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreateImage(pvkDevice, &fragmentColorInfo, nullptr, &m_pFragmentColorsTexture)); m_pFragmentColorsMemory = - allocImageMemory(pvkDevice, m_pFragmentColorsTexture, texture_memory_index); + allocImageMemory(pvkDevice, m_pFragmentColorsTexture, memProperties); VkImageViewCreateInfo srDesc{VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; srDesc.format = VK_FORMAT_R16G16B16A16_SFLOAT; @@ -154,7 +143,7 @@ VkResult TressFXShortCut::CreateScreenSizedItems(VkDevice pvkDevice, int winWidt srDesc.subresourceRange.layerCount = 1; srDesc.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; srDesc.image = m_pFragmentColorsTexture; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateImageView(pvkDevice, &srDesc, nullptr, &m_pFragmentColorsView)); } #else @@ -195,13 +184,13 @@ VkAttachmentDescription getAttachmentDescription( inoutLayout}; } -VkRenderPass createRenderPass(VkDevice pvkDevice) +VkRenderPass createRenderPass(VkDevice pvkDevice, VkFormat depthStencilFormat, VkFormat colorFormat) { VkRenderPassCreateInfo info{VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO}; const VkAttachmentDescription attachments[] = { // DS - getAttachmentDescription(VK_FORMAT_D24_UNORM_S8_UINT, VK_ATTACHMENT_LOAD_OP_LOAD, + getAttachmentDescription(depthStencilFormat, VK_ATTACHMENT_LOAD_OP_LOAD, VK_ATTACHMENT_STORE_OP_STORE, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, VK_ATTACHMENT_LOAD_OP_CLEAR, @@ -219,7 +208,7 @@ VkRenderPass createRenderPass(VkDevice pvkDevice) // TODO #endif // Result - getAttachmentDescription(VK_FORMAT_R8G8B8A8_SNORM, VK_ATTACHMENT_LOAD_OP_LOAD, + getAttachmentDescription(colorFormat, VK_ATTACHMENT_LOAD_OP_LOAD, VK_ATTACHMENT_STORE_OP_STORE, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL), @@ -305,9 +294,9 @@ VkRenderPass createRenderPass(VkDevice pvkDevice) // Creates the pipelines for hair rendering // //-------------------------------------------------------------------------------------- -VkResult TressFXShortCut::CreateRenderStateObjects(VkDevice pvkDevice) +VkResult TressFXShortCut::CreateRenderStateObjects(VkDevice pvkDevice, VkFormat depthStencilFormat, VkFormat colorFormat) { - m_pRPRenderHair = createRenderPass(pvkDevice); + m_pRPRenderHair = createRenderPass(pvkDevice, depthStencilFormat, colorFormat); ShaderModule m_pPSDepthsAlpha(pvkDevice, depth_hair_data); ShaderModule m_pPSFillColors(pvkDevice, fillcolors_hair_data); @@ -508,7 +497,7 @@ VkResult TressFXShortCut::CreateRenderStateObjects(VkDevice pvkDevice) VkPipeline pipelines[AMD_ARRAY_SIZE(pipelinesDesc)]; VkResult vr; - AMD_V_RETURN(vkCreateGraphicsPipelines(pvkDevice, VK_NULL_HANDLE, + AMD_CHECKED_VULKAN_CALL(vkCreateGraphicsPipelines(pvkDevice, VK_NULL_HANDLE, AMD_ARRAY_SIZE(pipelinesDesc), pipelinesDesc, nullptr, pipelines)); @@ -559,7 +548,7 @@ VkResult TressFXShortCut::CreateLayouts(VkDevice pvkDevice, }; info.bindingCount = AMD_ARRAY_SIZE(bindings); info.pBindings = bindings; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateDescriptorSetLayout(pvkDevice, &info, nullptr, &m_pSLDepthAlpha)); } @@ -598,7 +587,7 @@ VkResult TressFXShortCut::CreateLayouts(VkDevice pvkDevice, }; info.bindingCount = AMD_ARRAY_SIZE(bindings); info.pBindings = bindings; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateDescriptorSetLayout(pvkDevice, &info, nullptr, &m_pSLColors)); } @@ -608,7 +597,7 @@ VkResult TressFXShortCut::CreateLayouts(VkDevice pvkDevice, info.setLayoutCount = AMD_ARRAY_SIZE(set_layout); info.pSetLayouts = set_layout; - AMD_V_RETURN(vkCreatePipelineLayout(pvkDevice, &info, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreatePipelineLayout(pvkDevice, &info, nullptr, &m_depthPassPipelineLayout)); } @@ -618,7 +607,7 @@ VkResult TressFXShortCut::CreateLayouts(VkDevice pvkDevice, info.setLayoutCount = AMD_ARRAY_SIZE(set_layout); info.pSetLayouts = set_layout; - AMD_V_RETURN(vkCreatePipelineLayout(pvkDevice, &info, nullptr, + AMD_CHECKED_VULKAN_CALL(vkCreatePipelineLayout(pvkDevice, &info, nullptr, &m_colorPassPipelineLayout)); } @@ -652,7 +641,7 @@ VkResult TressFXShortCut::CreateFramebuffer(VkDevice pvkDevice, #else // TODO #endif - AMD_V_RETURN(vkCreateFramebuffer(pvkDevice, &info, nullptr, &m_pFBRenderHair)); + AMD_CHECKED_VULKAN_CALL(vkCreateFramebuffer(pvkDevice, &info, nullptr, &m_pFBRenderHair)); } return VK_SUCCESS; } @@ -682,7 +671,7 @@ VkResult TressFXShortCut::AllocateAndPopulateSets(VkDevice pvkDevice, info.maxSets = 2; info.poolSizeCount = AMD_ARRAY_SIZE(sizes); info.pPoolSizes = sizes; - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( vkCreateDescriptorPool(pvkDevice, &info, nullptr, &m_pDPShortcutPool)); } @@ -693,7 +682,7 @@ VkResult TressFXShortCut::AllocateAndPopulateSets(VkDevice pvkDevice, info.descriptorSetCount = AMD_ARRAY_SIZE(setLayout); info.pSetLayouts = setLayout; VkDescriptorSet sets[AMD_ARRAY_SIZE(setLayout)]; - AMD_V_RETURN(vkAllocateDescriptorSets(pvkDevice, &info, sets)); + AMD_CHECKED_VULKAN_CALL(vkAllocateDescriptorSets(pvkDevice, &info, sets)); m_depthPassSet = sets[0]; m_colorPassSet = sets[1]; } @@ -745,19 +734,19 @@ VkResult TressFXShortCut::OnCreateDevice( VkDevice pd3dDevice, int winWidth, int winHeight, VkDescriptorSetLayout mesh_layout, VkSampler noiseSamplerRef, VkSampler shadowSamplerRef, VkImageView depthStencilView, VkImageView colorView, VkBuffer configBuffer, uint64_t configBufferSize, - VkImageView noiseMap, VkImageView hairShadowMap, uint32_t deviceLocalMemoryIndex, - uint32_t width, uint32_t height) + VkImageView noiseMap, VkImageView hairShadowMap, VkPhysicalDeviceMemoryProperties memProperties, + uint32_t width, uint32_t height, VkFormat depthStencilFormat, VkFormat colorFormat) { VkResult vr; - AMD_V_RETURN( - CreateScreenSizedItems(pd3dDevice, winWidth, winHeight, deviceLocalMemoryIndex)); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL( + CreateScreenSizedItems(pd3dDevice, winWidth, winHeight, memProperties)); + AMD_CHECKED_VULKAN_CALL( CreateLayouts(pd3dDevice, mesh_layout, noiseSamplerRef, shadowSamplerRef)); - AMD_V_RETURN(CreateRenderStateObjects(pd3dDevice)); - AMD_V_RETURN( + AMD_CHECKED_VULKAN_CALL(CreateRenderStateObjects(pd3dDevice, depthStencilFormat, colorFormat)); + AMD_CHECKED_VULKAN_CALL( CreateFramebuffer(pd3dDevice, depthStencilView, colorView, width, height)); - AMD_V_RETURN(AllocateAndPopulateSets(pd3dDevice, configBuffer, configBufferSize, + AMD_CHECKED_VULKAN_CALL(AllocateAndPopulateSets(pd3dDevice, configBuffer, configBufferSize, noiseMap, hairShadowMap)) return VK_SUCCESS; @@ -765,13 +754,13 @@ VkResult TressFXShortCut::OnCreateDevice( VkResult TressFXShortCut::OnResizedSwapChain(VkDevice pd3dDevice, int winWidth, int winHeight, - uint32_t deviceLocalMemoryIndex) + VkPhysicalDeviceMemoryProperties memProperties) { DestroyScreenSizedItems(); VkResult vr; - AMD_V_RETURN( - CreateScreenSizedItems(pd3dDevice, winWidth, winHeight, deviceLocalMemoryIndex)); + AMD_CHECKED_VULKAN_CALL( + CreateScreenSizedItems(pd3dDevice, winWidth, winHeight, memProperties)); return VK_SUCCESS; } diff --git a/amd_tressfx_vulkan/src/TressFXShortCutVulkan.h b/amd_tressfx_vulkan/src/TressFXShortCutVulkan.h index 89c5a6d..354a989 100644 --- a/amd_tressfx_vulkan/src/TressFXShortCutVulkan.h +++ b/amd_tressfx_vulkan/src/TressFXShortCutVulkan.h @@ -34,7 +34,7 @@ namespace AMD { struct GPUOnlyStructuredBuffer { - GPUOnlyStructuredBuffer() : m_pBuffer(nullptr), m_pvkDevice(nullptr) {} + GPUOnlyStructuredBuffer() : m_pBuffer(VK_NULL_HANDLE), m_pvkDevice(nullptr) {} VkResult Create(VkDevice pd3dDevice, uint32_t structCount, uint32_t structSize); void Destroy(); @@ -92,9 +92,9 @@ class TressFXShortCut GPUOnlyStructuredBuffer m_FragmentColors; VkResult CreateScreenSizedItems(VkDevice pvkDevice, int winWidth, int winHeight, - uint32_t MemoryIndexGPU); + VkPhysicalDeviceMemoryProperties memProperties); void DestroyScreenSizedItems(); - VkResult CreateRenderStateObjects(VkDevice pvkDevice); + VkResult CreateRenderStateObjects(VkDevice pvkDevice, VkFormat depthStencilFormat, VkFormat colorFormat); VkResult CreateLayouts(VkDevice pvkDevice, VkDescriptorSetLayout SLMesh, VkSampler noiseSamplerRef, VkSampler shadowSamplerRef); VkResult CreateFramebuffer(VkDevice pvkDevice, VkImageView depthStencilView, @@ -105,11 +105,11 @@ class TressFXShortCut public: TressFXShortCut(void) - : m_pFragmentColorsTexture(nullptr), m_pFragmentColorsMemory(nullptr), - m_pFragmentColorsView(nullptr), m_pFragmentDepthsTexture(nullptr), - m_pFragmentDepthsMemory(nullptr), m_pFragmentDepthsView(nullptr), - m_pAccumInvAlphaTexture(nullptr), m_pAccumInvAlphaMemory(nullptr), - m_pAccumInvAlphaView(nullptr) + : m_pFragmentColorsTexture(VK_NULL_HANDLE), m_pFragmentColorsMemory(VK_NULL_HANDLE), + m_pFragmentColorsView(VK_NULL_HANDLE), m_pFragmentDepthsTexture(VK_NULL_HANDLE), + m_pFragmentDepthsMemory(VK_NULL_HANDLE), m_pFragmentDepthsView(VK_NULL_HANDLE), + m_pAccumInvAlphaTexture(VK_NULL_HANDLE), m_pAccumInvAlphaMemory(VK_NULL_HANDLE), + m_pAccumInvAlphaView(VK_NULL_HANDLE) { } ~TressFXShortCut(void){}; @@ -119,10 +119,10 @@ class TressFXShortCut VkSampler shadowSamplerRef, VkImageView depthStencilView, VkImageView colorView, VkBuffer configBuffer, uint64_t configBufferSize, VkImageView noiseMap, - VkImageView hairShadowMap, uint32_t deviceLocalMemoryIndex, - uint32_t width, uint32_t height); + VkImageView hairShadowMap, VkPhysicalDeviceMemoryProperties memProperties, + uint32_t width, uint32_t height, VkFormat depthStencilFormat, VkFormat colorFormat); VkResult OnResizedSwapChain(VkDevice pvkDevice, int winWidth, int WinHeight, - uint32_t deviceLocalMemoryIndex); + VkPhysicalDeviceMemoryProperties memProperties); // Individual render pass setups. // Each basically sets up render state, UAVs, SRVs, and returns pixel diff --git a/amd_tressfx_vulkan/src/TressFXSimulationVulkan.cpp b/amd_tressfx_vulkan/src/TressFXSimulationVulkan.cpp index e422ae4..507ec12 100644 --- a/amd_tressfx_vulkan/src/TressFXSimulationVulkan.cpp +++ b/amd_tressfx_vulkan/src/TressFXSimulationVulkan.cpp @@ -99,7 +99,6 @@ struct ConstBufferCS_HeadTransform namespace AMD { - //-------------------------------------------------------------------------------------- // // Constructor @@ -139,9 +138,9 @@ TressFXSimulation::~TressFXSimulation(void) {} namespace { VkComputePipelineCreateInfo getComputePipelineInfo(VkPipelineLayout layout, - VkShaderModule computeShader) + VkShaderModule computeShader) { - VkComputePipelineCreateInfo result{VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO}; + VkComputePipelineCreateInfo result{ VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO }; result.layout = layout; result.stage.module = computeShader; result.stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; @@ -154,16 +153,16 @@ VkComputePipelineCreateInfo getComputePipelineInfo(VkPipelineLayout layout, namespace { VkResult getPipelineLayout(VkDevice pvkDevice, VkDescriptorSetLayout configSetLayout, - VkDescriptorSetLayout secondSetLayout, - VkPipelineLayout &result) + VkDescriptorSetLayout secondSetLayout, + VkPipelineLayout &result) { VkPipelineLayoutCreateInfo pipelineInfo{ - VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; - VkDescriptorSetLayout setLayouts[] = {configSetLayout, secondSetLayout}; + VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO }; + VkDescriptorSetLayout setLayouts[] = { configSetLayout, secondSetLayout }; pipelineInfo.setLayoutCount = AMD_ARRAY_SIZE(setLayouts); pipelineInfo.pSetLayouts = setLayouts; VkResult vr; - AMD_V_RETURN(vkCreatePipelineLayout(pvkDevice, &pipelineInfo, nullptr, &result)); + AMD_CHECKED_VULKAN_CALL(vkCreatePipelineLayout(pvkDevice, &pipelineInfo, nullptr, &result)); return VK_SUCCESS; } } @@ -174,126 +173,126 @@ VkResult TressFXSimulation::CreateDescriptorSet(VkDevice pvkDevice) const VkDescriptorSetLayoutBinding global_constraints_bindings[] = { {IDSRV_HAIR_VERTEX_POSITIONS, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_PREVIOUS_VERTEX_POSITIONS, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_VERTEX_INITIAL_POSITIONS, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_STRAND_TYPE, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, }; const VkDescriptorSetLayoutBinding local_constraints_bindings[] = { {IDSRV_HAIR_VERTEX_POSITIONS, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_STRAND_TYPE, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_GLOBAL_ROTATION, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_LOCAL_REF_VEC, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, }; const VkDescriptorSetLayoutBinding length_wind_collision_bindings[] = { {IDSRV_HAIR_VERTEX_POSITIONS, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_STRAND_TYPE, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_LENGTH, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, }; const VkDescriptorSetLayoutBinding prepare_follow_hair_bindings[] = { {IDSRV_HAIR_VERTEX_POSITIONS, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_PREVIOUS_VERTEX_POSITIONS, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_STRAND_TYPE, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, }; const VkDescriptorSetLayoutBinding update_follow_hair_bindings[] = { {IDSRV_HAIR_VERTEX_POSITIONS, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_STRAND_TYPE, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_ROOT_OFFSET, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, }; const VkDescriptorSetLayoutBinding compute_tangent_bindings[] = { {IDSRV_HAIR_VERTEX_POSITIONS, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_STRAND_TYPE, VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HAIR_TANGENTS, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, }; - AMD_V_RETURN(getDescriptorLayout(pvkDevice, global_constraints_bindings, - AMD_ARRAY_SIZE(global_constraints_bindings), - m_GlobalConstraintsSetLayout)); - AMD_V_RETURN(getDescriptorLayout(pvkDevice, local_constraints_bindings, - AMD_ARRAY_SIZE(local_constraints_bindings), - m_LocalConstraintsSetLayout)); - AMD_V_RETURN(getDescriptorLayout(pvkDevice, length_wind_collision_bindings, - AMD_ARRAY_SIZE(length_wind_collision_bindings), - m_LenghtWindTangentSetLayout)); - AMD_V_RETURN(getDescriptorLayout(pvkDevice, prepare_follow_hair_bindings, - AMD_ARRAY_SIZE(prepare_follow_hair_bindings), - m_PrepareFollowHairSetLayout)); - AMD_V_RETURN(getDescriptorLayout(pvkDevice, update_follow_hair_bindings, - AMD_ARRAY_SIZE(update_follow_hair_bindings), - m_UpdateFollowHaitSetLayout)); - AMD_V_RETURN(getDescriptorLayout(pvkDevice, compute_tangent_bindings, - AMD_ARRAY_SIZE(compute_tangent_bindings), - m_ComputeTangentSetLayout)); + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, global_constraints_bindings, + AMD_ARRAY_SIZE(global_constraints_bindings), + m_GlobalConstraintsSetLayout)); + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, local_constraints_bindings, + AMD_ARRAY_SIZE(local_constraints_bindings), + m_LocalConstraintsSetLayout)); + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, length_wind_collision_bindings, + AMD_ARRAY_SIZE(length_wind_collision_bindings), + m_LenghtWindTangentSetLayout)); + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, prepare_follow_hair_bindings, + AMD_ARRAY_SIZE(prepare_follow_hair_bindings), + m_PrepareFollowHairSetLayout)); + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, update_follow_hair_bindings, + AMD_ARRAY_SIZE(update_follow_hair_bindings), + m_UpdateFollowHaitSetLayout)); + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, compute_tangent_bindings, + AMD_ARRAY_SIZE(compute_tangent_bindings), + m_ComputeTangentSetLayout)); const VkDescriptorSetLayoutBinding configBindings[] = { {IDSRV_CONSTANTS_BUFFER, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, 1, - VK_SHADER_STAGE_COMPUTE_BIT}, + VK_SHADER_STAGE_COMPUTE_BIT}, {IDSRV_HEAD_TRANSFORM, VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, - VK_SHADER_STAGE_COMPUTE_BIT}}; - AMD_V_RETURN(getDescriptorLayout(pvkDevice, configBindings, - AMD_ARRAY_SIZE(configBindings), m_configSetLayout)); - - AMD_V_RETURN(getPipelineLayout(pvkDevice, m_configSetLayout, - m_GlobalConstraintsSetLayout, - m_CSIntegrationAndGlobalShapeConstraintsLayout)); - AMD_V_RETURN(getPipelineLayout(pvkDevice, m_configSetLayout, - m_LocalConstraintsSetLayout, - m_CSLocalShapeConstraintsLayout)); - AMD_V_RETURN(getPipelineLayout(pvkDevice, m_configSetLayout, - m_LocalConstraintsSetLayout, - m_CSLocalShapeConstraintsSingleDispatchLayout)); - AMD_V_RETURN(getPipelineLayout(pvkDevice, m_configSetLayout, - m_LenghtWindTangentSetLayout, - m_CSLengthConstriantsWindAndCollisionLayout)); - AMD_V_RETURN(getPipelineLayout(pvkDevice, m_configSetLayout, - m_PrepareFollowHairSetLayout, - m_CSPrepareFollowHairBeforeTurningIntoGuideLayout)); - AMD_V_RETURN(getPipelineLayout(pvkDevice, m_configSetLayout, - m_UpdateFollowHaitSetLayout, - m_CSUpdateFollowHairVerticesLayout)); - AMD_V_RETURN(getPipelineLayout(pvkDevice, m_configSetLayout, - m_ComputeTangentSetLayout, m_CSComputeTangentsLayout)); - - VkDescriptorPoolSize poolSizes[] = {{VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, 1}, - {VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1}}; + VK_SHADER_STAGE_COMPUTE_BIT} }; + AMD_CHECKED_VULKAN_CALL(getDescriptorLayout(pvkDevice, configBindings, + AMD_ARRAY_SIZE(configBindings), m_configSetLayout)); + + AMD_CHECKED_VULKAN_CALL(getPipelineLayout(pvkDevice, m_configSetLayout, + m_GlobalConstraintsSetLayout, + m_CSIntegrationAndGlobalShapeConstraintsLayout)); + AMD_CHECKED_VULKAN_CALL(getPipelineLayout(pvkDevice, m_configSetLayout, + m_LocalConstraintsSetLayout, + m_CSLocalShapeConstraintsLayout)); + AMD_CHECKED_VULKAN_CALL(getPipelineLayout(pvkDevice, m_configSetLayout, + m_LocalConstraintsSetLayout, + m_CSLocalShapeConstraintsSingleDispatchLayout)); + AMD_CHECKED_VULKAN_CALL(getPipelineLayout(pvkDevice, m_configSetLayout, + m_LenghtWindTangentSetLayout, + m_CSLengthConstriantsWindAndCollisionLayout)); + AMD_CHECKED_VULKAN_CALL(getPipelineLayout(pvkDevice, m_configSetLayout, + m_PrepareFollowHairSetLayout, + m_CSPrepareFollowHairBeforeTurningIntoGuideLayout)); + AMD_CHECKED_VULKAN_CALL(getPipelineLayout(pvkDevice, m_configSetLayout, + m_UpdateFollowHaitSetLayout, + m_CSUpdateFollowHairVerticesLayout)); + AMD_CHECKED_VULKAN_CALL(getPipelineLayout(pvkDevice, m_configSetLayout, + m_ComputeTangentSetLayout, m_CSComputeTangentsLayout)); + + VkDescriptorPoolSize poolSizes[] = { {VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, 1}, + {VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1} }; VkDescriptorPoolCreateInfo descriptorPoolInfo{ - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO}; + VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO }; descriptorPoolInfo.maxSets = 1; descriptorPoolInfo.poolSizeCount = AMD_ARRAY_SIZE(poolSizes); descriptorPoolInfo.pPoolSizes = poolSizes; - AMD_V_RETURN(vkCreateDescriptorPool(pvkDevice, &descriptorPoolInfo, nullptr, - &m_descriptorPool)); + AMD_CHECKED_VULKAN_CALL(vkCreateDescriptorPool(pvkDevice, &descriptorPoolInfo, nullptr, + &m_descriptorPool)); - VkDescriptorSetAllocateInfo allocInfo{VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO}; + VkDescriptorSetAllocateInfo allocInfo{ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO }; allocInfo.descriptorSetCount = 1; allocInfo.pSetLayouts = &m_configSetLayout; allocInfo.descriptorPool = m_descriptorPool; - AMD_V_RETURN(vkAllocateDescriptorSets(pvkDevice, &allocInfo, &m_configSet)); + AMD_CHECKED_VULKAN_CALL(vkAllocateDescriptorSets(pvkDevice, &allocInfo, &m_configSet)); return VK_SUCCESS; } @@ -307,29 +306,28 @@ VkResult TressFXSimulation::CreateDescriptorSet(VkDevice pvkDevice) // //-------------------------------------------------------------------------------------- VkResult TressFXSimulation::OnCreateDevice(VkDevice pvkDevice, - TressFX_CollisionCapsule *pCollision, - uint32_t maxUniformCount, - uint32_t cpu_memory_index, - uint32_t gpu_memory_index) + TressFX_CollisionCapsule *pCollision, + uint32_t maxUniformCount, + VkPhysicalDeviceMemoryProperties memProperties, const DebugMarkerPointer& markerCallbacks) { VkResult vr; - AMD_V_RETURN(CreateDescriptorSet(pvkDevice)); + AMD_CHECKED_VULKAN_CALL(CreateDescriptorSet(pvkDevice)); // reset m_elapsedTimeSinceLastSim to zero m_elapsedTimeSinceLastSim = 0; ShaderModule IntegrationAndGlobalShapeConstraints_Module(pvkDevice, - global_constraints); - // TODO + global_constraints); + ShaderModule ApplyHairTransformGlobally_Module(pvkDevice, global_constraints); ShaderModule ComputeTangents_Module(pvkDevice, compute_tangents); ShaderModule LocalShapeConstraints_Module(pvkDevice, local_constraints); ShaderModule LocalShapeConstraintsWithIteration_Module(pvkDevice, local_constraints); ShaderModule LengthConstraintsWindAndCollision_Module(pvkDevice, - length_wind_collision); + length_wind_collision); ShaderModule UpdateFollowHairVertices_Module(pvkDevice, update_follow_hair); ShaderModule PrepareFollowHairBeforeTurningIntoGuide_Data(pvkDevice, - prepare_follow_hair); - // TODO + prepare_follow_hair); + ShaderModule GenerateTransforms_Module(pvkDevice, global_constraints); VkComputePipelineCreateInfo computePipelineInfo[] = { @@ -337,44 +335,53 @@ VkResult TressFXSimulation::OnCreateDevice(VkDevice pvkDevice, m_CSIntegrationAndGlobalShapeConstraintsLayout, IntegrationAndGlobalShapeConstraints_Module.m_shaderModule), getComputePipelineInfo(m_CSIntegrationAndGlobalShapeConstraintsLayout, - ApplyHairTransformGlobally_Module.m_shaderModule), + ApplyHairTransformGlobally_Module.m_shaderModule), getComputePipelineInfo(m_CSComputeTangentsLayout, - ComputeTangents_Module.m_shaderModule), + ComputeTangents_Module.m_shaderModule), getComputePipelineInfo(m_CSLocalShapeConstraintsSingleDispatchLayout, - LocalShapeConstraints_Module.m_shaderModule), + LocalShapeConstraints_Module.m_shaderModule), getComputePipelineInfo(m_CSLocalShapeConstraintsLayout, - LocalShapeConstraintsWithIteration_Module.m_shaderModule), + LocalShapeConstraintsWithIteration_Module.m_shaderModule), getComputePipelineInfo(m_CSLengthConstriantsWindAndCollisionLayout, - LengthConstraintsWindAndCollision_Module.m_shaderModule), + LengthConstraintsWindAndCollision_Module.m_shaderModule), getComputePipelineInfo(m_CSUpdateFollowHairVerticesLayout, - UpdateFollowHairVertices_Module.m_shaderModule), + UpdateFollowHairVertices_Module.m_shaderModule), getComputePipelineInfo( m_CSPrepareFollowHairBeforeTurningIntoGuideLayout, PrepareFollowHairBeforeTurningIntoGuide_Data.m_shaderModule), getComputePipelineInfo(m_CSIntegrationAndGlobalShapeConstraintsLayout, - GenerateTransforms_Module.m_shaderModule), + GenerateTransforms_Module.m_shaderModule), }; VkPipeline pipelines[9]{}; - AMD_V_RETURN(vkCreateComputePipelines(pvkDevice, VK_NULL_HANDLE, - AMD_ARRAY_SIZE(computePipelineInfo), - computePipelineInfo, nullptr, pipelines)); + AMD_CHECKED_VULKAN_CALL(vkCreateComputePipelines(pvkDevice, VK_NULL_HANDLE, + AMD_ARRAY_SIZE(computePipelineInfo), + computePipelineInfo, nullptr, pipelines)); m_CSIntegrationAndGlobalShapeConstraints = pipelines[0]; + markerCallbacks.nameObject(m_CSIntegrationAndGlobalShapeConstraints, "CSIntegrationAndGlobalShapeConstraints"); m_CSApplyHairTransformGlobally = pipelines[1]; + markerCallbacks.nameObject(m_CSApplyHairTransformGlobally, "CSApplyHairTransformGlobally"); m_CSComputeTangents = pipelines[2]; + markerCallbacks.nameObject(m_CSComputeTangents, "CSComputeTangents"); m_CSLocalShapeConstraints = pipelines[3]; + markerCallbacks.nameObject(m_CSLocalShapeConstraints, "CSLocalShapeConstraints"); m_CSLocalShapeConstraintsSingleDispatch = pipelines[4]; + markerCallbacks.nameObject(m_CSLocalShapeConstraintsSingleDispatch, "CSLocalShapeConstraintsSingleDispatch"); m_CSLengthConstriantsWindAndCollision = pipelines[5]; + markerCallbacks.nameObject(m_CSLengthConstriantsWindAndCollision, "CSLengthConstriantsWindAndCollision"); m_CSUpdateFollowHairVertices = pipelines[6]; + markerCallbacks.nameObject(m_CSUpdateFollowHairVertices, "CSUpdateFollowHairVertices"); m_CSPrepareFollowHairBeforeTurningIntoGuide = pipelines[7]; + markerCallbacks.nameObject(m_CSPrepareFollowHairBeforeTurningIntoGuide, "CSPrepareFollowHairBeforeTurningIntoGuide"); m_CSGenerateTransforms = pipelines[8]; + markerCallbacks.nameObject(m_CSGenerateTransforms, "CSGenerateTransforms"); //------------------------- // Create constant buffers //------------------------- - AMD_V_RETURN(CreateComputeShaderConstantBuffers( - pvkDevice, pCollision, maxUniformCount, cpu_memory_index, gpu_memory_index)); + AMD_CHECKED_VULKAN_CALL(CreateComputeShaderConstantBuffers( + pvkDevice, pCollision, maxUniformCount, memProperties)); return VK_SUCCESS; } @@ -572,7 +579,7 @@ const float MATH_PI2 = 3.14159265359f; // //-------------------------------------------------------------------------------------- void ComputeWindPyramid(float4 &wind, float4 &wind1, float4 &wind2, float4 &wind3, - const float windMag, const tressfx_vec3 &windDir) + const float windMag, const tressfx_vec3 &windDir) { static int frame = 0; @@ -646,14 +653,13 @@ float getScaledStiffness(float s0, float s_min_scale, float h, float h0) // ////-------------------------------------------------------------------------------------- VkResult TressFXSimulation::Simulate(VkDevice pvkDevice, VkCommandBuffer commandBuffer, - float fElapsedTime, float density, - tressfx_vec3 &windDir, float windMag, - XMMATRIX *pModelTransformForHead, - ID3D11UnorderedAccessView *pSkinningTransforms, - float targetFrameRate, bool singleHeadTransform, - bool warp, uint32_t uniformBufferIndex) + float fElapsedTime, float density, + tressfx_vec3 &windDir, float windMag, + XMMATRIX *pModelTransformForHead, + float targetFrameRate, bool singleHeadTransform, + bool warp, uint32_t uniformBufferIndex, + const DebugMarkerPointer& markerCallbacks) { - (void)pSkinningTransforms; m_elapsedTimeSinceLastSim += fElapsedTime; bool bFullSimulate = true; @@ -677,148 +683,40 @@ VkResult TressFXSimulation::Simulate(VkDevice pvkDevice, VkCommandBuffer command ConstBufferCS_Per_Frame *pCSPerFrame; vkMapMemory(pvkDevice, m_pCBCSPerFrameMemory, - uniformBufferIndex * sizeof(ConstBufferCS_Per_Frame), - sizeof(ConstBufferCS_Per_Frame), 0, - reinterpret_cast(&pCSPerFrame)); - - { - pCSPerFrame->bWarp = warp; - - if (bFullSimulate) - { - pCSPerFrame->NumLengthConstraintIterations = - m_simParams.numLengthConstraintIterations; - } - else - { - pCSPerFrame->NumLengthConstraintIterations = 1; - } - - pCSPerFrame->bCollision = (m_simParams.bCollision == true) ? 1 : 0; - - pCSPerFrame->GravityMagnitude = m_simParams.gravityMagnitude; + uniformBufferIndex * sizeof(ConstBufferCS_Per_Frame), + sizeof(ConstBufferCS_Per_Frame), 0, + reinterpret_cast(&pCSPerFrame)); - pCSPerFrame->timeStep = targetFrameRate; - - pCSPerFrame->NumOfStrandsPerThreadGroup = numOfStrandsPerThreadGroup; - pCSPerFrame->NumFollowHairsPerGuideHair = - (m_bGuideFollowHairPrev - ? m_pTressFXMesh->m_HairAsset.m_NumFollowHairsPerGuideHair - : 0); - pCSPerFrame->TipSeparationFactor = - m_pTressFXMesh->m_HairAsset.m_TipSeparationFactor; - - ComputeWindPyramid(pCSPerFrame->Wind, pCSPerFrame->Wind1, pCSPerFrame->Wind2, - pCSPerFrame->Wind3, windMag, windDir); - - int numSections = m_simParams.numHairSections; - - // hair section 0 - if (numSections > 0) - { - pCSPerFrame->Damping0 = m_simParams.perSectionShapeParams[0].damping; - pCSPerFrame->StiffnessForLocalShapeMatching0 = - m_simParams.perSectionShapeParams[0].stiffnessForLocalShapeMatching; - pCSPerFrame->StiffnessForGlobalShapeMatching0 = - m_simParams.perSectionShapeParams[0].stiffnessForGlobalShapeMatching; - pCSPerFrame->GlobalShapeMatchingEffectiveRange0 = - m_simParams.perSectionShapeParams[0].globalShapeMatchingEffectiveRange; - } - - // hair section 1 - if (numSections > 1) - { - pCSPerFrame->Damping1 = m_simParams.perSectionShapeParams[1].damping; - pCSPerFrame->StiffnessForLocalShapeMatching1 = - m_simParams.perSectionShapeParams[1].stiffnessForLocalShapeMatching; - pCSPerFrame->StiffnessForGlobalShapeMatching1 = - m_simParams.perSectionShapeParams[1].stiffnessForGlobalShapeMatching; - pCSPerFrame->GlobalShapeMatchingEffectiveRange1 = - m_simParams.perSectionShapeParams[1].globalShapeMatchingEffectiveRange; - } - - // hair section 2 - if (numSections > 2) - { - pCSPerFrame->Damping2 = m_simParams.perSectionShapeParams[2].damping; - pCSPerFrame->StiffnessForLocalShapeMatching2 = - m_simParams.perSectionShapeParams[2].stiffnessForLocalShapeMatching; - pCSPerFrame->StiffnessForGlobalShapeMatching2 = - m_simParams.perSectionShapeParams[2].stiffnessForGlobalShapeMatching; - pCSPerFrame->GlobalShapeMatchingEffectiveRange2 = - m_simParams.perSectionShapeParams[2].globalShapeMatchingEffectiveRange; - } - - // hair section 3 - if (numSections > 3) - { - pCSPerFrame->Damping3 = m_simParams.perSectionShapeParams[3].damping; - pCSPerFrame->StiffnessForLocalShapeMatching3 = - m_simParams.perSectionShapeParams[3].stiffnessForLocalShapeMatching; - pCSPerFrame->StiffnessForGlobalShapeMatching3 = - m_simParams.perSectionShapeParams[3].stiffnessForGlobalShapeMatching; - pCSPerFrame->GlobalShapeMatchingEffectiveRange3 = - m_simParams.perSectionShapeParams[3].globalShapeMatchingEffectiveRange; - } - - if (!bFullSimulate) - { - float h = fElapsedTime; - float h0 = targetFrameRate; - float s_min_scale = - 0.3f; // minimum stiffness = s_min_scale * current stiffness - - pCSPerFrame->StiffnessForLocalShapeMatching0 = getScaledStiffness( - m_simParams.perSectionShapeParams[0].stiffnessForLocalShapeMatching, - s_min_scale, h, h0); - pCSPerFrame->StiffnessForLocalShapeMatching1 = getScaledStiffness( - m_simParams.perSectionShapeParams[1].stiffnessForLocalShapeMatching, - s_min_scale, h, h0); - pCSPerFrame->StiffnessForLocalShapeMatching2 = getScaledStiffness( - m_simParams.perSectionShapeParams[2].stiffnessForLocalShapeMatching, - s_min_scale, h, h0); - pCSPerFrame->StiffnessForLocalShapeMatching3 = getScaledStiffness( - m_simParams.perSectionShapeParams[3].stiffnessForLocalShapeMatching, - s_min_scale, h, h0); - } - - if (bFullSimulate) - { - pCSPerFrame->NumLocalShapeMatchingIterations = - m_simParams.numLocalShapeMatchingIterations; - } - else - { - pCSPerFrame->NumLocalShapeMatchingIterations = 1; - } - - pCSPerFrame->NumVerticesPerStrand = g_TressFXNumVerticesPerStrand; - } + fillConstantBuffer(pCSPerFrame, warp, bFullSimulate, targetFrameRate, numOfStrandsPerThreadGroup, windMag, windDir, fElapsedTime); vkUnmapMemory(pvkDevice, m_pCBCSPerFrameMemory); // ConstBufferCS_HeadTransform ConstBufferCS_HeadTransform *pCSHeadTransform; - AMD_V_RETURN(vkMapMemory(pvkDevice, m_pCBHeadTransformsMemory, 0, - sizeof(ConstBufferCS_HeadTransform), 0, - reinterpret_cast(&pCSHeadTransform))); - { - pCSHeadTransform->bSingleHeadTransform = singleHeadTransform; - pCSHeadTransform->ModelRotateForHead = - XMQuaternionRotationMatrix(*pModelTransformForHead); - pCSHeadTransform->ModelTransformForHead = *pModelTransformForHead; - } + AMD_CHECKED_VULKAN_CALL(vkMapMemory(pvkDevice, m_pCBHeadTransformsMemory, 0, + sizeof(ConstBufferCS_HeadTransform), 0, + reinterpret_cast(&pCSHeadTransform))); + fillHeadConstantBuffer(pCSHeadTransform, singleHeadTransform, pModelTransformForHead); vkUnmapMemory(pvkDevice, m_pCBHeadTransformsMemory); + markerCallbacks.markBeginRegion(commandBuffer, "Simulation"); + fillSimulationCommands(commandBuffer, density, uniformBufferIndex); + markerCallbacks.markEndRegion(commandBuffer); + + return vr; +} + +void TressFXSimulation::fillSimulationCommands(const VkCommandBuffer &commandBuffer, float &density, const uint32_t &uniformBufferIndex) +{ VkBufferMemoryBarrier bufferBarrier[] = { getBufferBarrier(m_pCBCSPerFrame, VK_ACCESS_HOST_WRITE_BIT, - VK_ACCESS_UNIFORM_READ_BIT), + VK_ACCESS_UNIFORM_READ_BIT), getBufferBarrier(m_pCBHeadTransforms, VK_ACCESS_HOST_WRITE_BIT, - VK_ACCESS_UNIFORM_READ_BIT), + VK_ACCESS_UNIFORM_READ_BIT), }; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_HOST_BIT, - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, - AMD_ARRAY_SIZE(bufferBarrier), bufferBarrier, 0, nullptr); + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, + AMD_ARRAY_SIZE(bufferBarrier), bufferBarrier, 0, nullptr); //======= Run the compute shader ======= @@ -835,63 +733,63 @@ VkResult TressFXSimulation::Simulate(VkDevice pvkDevice, VkCommandBuffer command int numOfGroupsForCS_VertexLevel = (int)(((float)(m_bGuideFollowHairPrev - ? m_pTressFXMesh->m_HairAsset.m_NumGuideHairVertices - : m_pTressFXMesh->m_HairAsset.m_NumTotalHairVertices) / - (float)THREAD_GROUP_SIZE) * - density); + ? m_pTressFXMesh->m_HairAsset.m_NumGuideHairVertices + : m_pTressFXMesh->m_HairAsset.m_NumTotalHairVertices) / + (float)THREAD_GROUP_SIZE) * + density); - uint32_t descriptorOffset[] = {uniformBufferIndex * sizeof(ConstBufferCS_Per_Frame)}; + uint32_t descriptorOffset[] = { uniformBufferIndex * sizeof(ConstBufferCS_Per_Frame) }; // Prepare follow hair vertices before they are turning into guide ones. // One thread computes one vertex if (m_bGuideFollowHairPrev && !m_simParams.bGuideFollowSimulation) { VkDescriptorSet prepareFollowHairSets[] = { - m_configSet, m_pTressFXMesh->m_PrepareFollowHairSet}; + m_configSet, m_pTressFXMesh->m_PrepareFollowHairSet }; vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSPrepareFollowHairBeforeTurningIntoGuideLayout, 0, - AMD_ARRAY_SIZE(prepareFollowHairSets), - prepareFollowHairSets, AMD_ARRAY_SIZE(descriptorOffset), - descriptorOffset); + m_CSPrepareFollowHairBeforeTurningIntoGuideLayout, 0, + AMD_ARRAY_SIZE(prepareFollowHairSets), + prepareFollowHairSets, AMD_ARRAY_SIZE(descriptorOffset), + descriptorOffset); vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSPrepareFollowHairBeforeTurningIntoGuide); + m_CSPrepareFollowHairBeforeTurningIntoGuide); vkCmdDispatch(commandBuffer, numOfGroupsForCS_VertexLevel, 1, 1); - VkBufferMemoryBarrier flushPrevPositionBarrier[] = {getBufferBarrier( + VkBufferMemoryBarrier flushPrevPositionBarrier[] = { getBufferBarrier( m_pTressFXMesh->m_HairVertexPositionsPrevBuffer, VK_ACCESS_MEMORY_WRITE_BIT, - VK_ACCESS_MEMORY_WRITE_BIT | VK_ACCESS_MEMORY_READ_BIT)}; + VK_ACCESS_MEMORY_WRITE_BIT | VK_ACCESS_MEMORY_READ_BIT) }; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, - AMD_ARRAY_SIZE(flushPrevPositionBarrier), - flushPrevPositionBarrier, 0, nullptr); + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, + AMD_ARRAY_SIZE(flushPrevPositionBarrier), + flushPrevPositionBarrier, 0, nullptr); } // Integrate and global shape constraints // One thread computes one vertex - VkDescriptorSet globalConstraintSets[] = {m_configSet, - m_pTressFXMesh->m_GlobalConstraintsSet}; + VkDescriptorSet globalConstraintSets[] = { m_configSet, + m_pTressFXMesh->m_GlobalConstraintsSet }; vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSIntegrationAndGlobalShapeConstraintsLayout, 0, - AMD_ARRAY_SIZE(globalConstraintSets), globalConstraintSets, - AMD_ARRAY_SIZE(descriptorOffset), descriptorOffset); + m_CSIntegrationAndGlobalShapeConstraintsLayout, 0, + AMD_ARRAY_SIZE(globalConstraintSets), globalConstraintSets, + AMD_ARRAY_SIZE(descriptorOffset), descriptorOffset); vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSIntegrationAndGlobalShapeConstraints); + m_CSIntegrationAndGlobalShapeConstraints); vkCmdDispatch(commandBuffer, numOfGroupsForCS_VertexLevel, 1, 1); VkBufferMemoryBarrier globalConstraintsBarriers[] = { getBufferBarrier(m_pTressFXMesh->m_HairVertexPositionsBuffer, - VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, - VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT), + VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, + VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT), getBufferBarrier(m_pTressFXMesh->m_HairVertexPositionsPrevBuffer, - VK_ACCESS_MEMORY_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, - VK_ACCESS_SHADER_READ_BIT)}; + VK_ACCESS_MEMORY_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, + VK_ACCESS_SHADER_READ_BIT) }; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, - AMD_ARRAY_SIZE(globalConstraintsBarriers), - globalConstraintsBarriers, 0, nullptr); + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, + AMD_ARRAY_SIZE(globalConstraintsBarriers), + globalConstraintsBarriers, 0, nullptr); // Local shape constraints. If the hair is very curly, increase the iteration so that // hair style can be preserved well. @@ -901,149 +799,267 @@ VkResult TressFXSimulation::Simulate(VkDevice pvkDevice, VkCommandBuffer command if (g_TressFXNumVerticesPerStrand >= 16) { for (int iteration = 0; iteration < m_simParams.numLocalShapeMatchingIterations; - iteration++) + iteration++) { int numOfGroupsForCS_StrandLevel = (int)(((float)(m_bGuideFollowHairPrev - ? m_pTressFXMesh->m_HairAsset.m_NumGuideHairStrands - : m_pTressFXMesh->m_HairAsset.m_NumTotalHairStrands) / - (float)THREAD_GROUP_SIZE) * - density); + ? m_pTressFXMesh->m_HairAsset.m_NumGuideHairStrands + : m_pTressFXMesh->m_HairAsset.m_NumTotalHairStrands) / + (float)THREAD_GROUP_SIZE) * + density); VkDescriptorSet localConstraintSets[] = { - m_configSet, m_pTressFXMesh->m_LocalConstraintsSet}; + m_configSet, m_pTressFXMesh->m_LocalConstraintsSet }; vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSLocalShapeConstraintsSingleDispatchLayout, 0, - AMD_ARRAY_SIZE(localConstraintSets), - localConstraintSets, AMD_ARRAY_SIZE(descriptorOffset), - descriptorOffset); + m_CSLocalShapeConstraintsSingleDispatchLayout, 0, + AMD_ARRAY_SIZE(localConstraintSets), + localConstraintSets, AMD_ARRAY_SIZE(descriptorOffset), + descriptorOffset); vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSLocalShapeConstraints); + m_CSLocalShapeConstraints); vkCmdDispatch(commandBuffer, numOfGroupsForCS_StrandLevel, 1, 1); VkBufferMemoryBarrier localBarrier[] = { getBufferBarrier(m_pTressFXMesh->m_HairVertexPositionsBuffer, - VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, - VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT)}; + VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, + VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT) }; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, - AMD_ARRAY_SIZE(localBarrier), localBarrier, 0, nullptr); + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, + AMD_ARRAY_SIZE(localBarrier), localBarrier, 0, nullptr); } } else { int numOfGroupsForCS_StrandLevel = (int)(((float)(m_bGuideFollowHairPrev - ? m_pTressFXMesh->m_HairAsset.m_NumGuideHairStrands - : m_pTressFXMesh->m_HairAsset.m_NumTotalHairStrands) / - (float)THREAD_GROUP_SIZE) * - density); - VkDescriptorSet localConstraintSets[] = {m_configSet, - m_pTressFXMesh->m_LocalConstraintsSet}; + ? m_pTressFXMesh->m_HairAsset.m_NumGuideHairStrands + : m_pTressFXMesh->m_HairAsset.m_NumTotalHairStrands) / + (float)THREAD_GROUP_SIZE) * + density); + VkDescriptorSet localConstraintSets[] = { m_configSet, + m_pTressFXMesh->m_LocalConstraintsSet }; vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSLocalShapeConstraintsSingleDispatchLayout, 0, - AMD_ARRAY_SIZE(localConstraintSets), localConstraintSets, - AMD_ARRAY_SIZE(descriptorOffset), descriptorOffset); + m_CSLocalShapeConstraintsSingleDispatchLayout, 0, + AMD_ARRAY_SIZE(localConstraintSets), localConstraintSets, + AMD_ARRAY_SIZE(descriptorOffset), descriptorOffset); vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSLocalShapeConstraintsSingleDispatch); + m_CSLocalShapeConstraintsSingleDispatch); vkCmdDispatch(commandBuffer, numOfGroupsForCS_StrandLevel, 1, 1); VkBufferMemoryBarrier localBarrier[] = { getBufferBarrier(m_pTressFXMesh->m_HairVertexPositionsBuffer, - VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, - VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT)}; + VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, + VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT) }; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, - AMD_ARRAY_SIZE(localBarrier), localBarrier, 0, nullptr); + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, + AMD_ARRAY_SIZE(localBarrier), localBarrier, 0, nullptr); } // Edge length constraints, wind and collisions // One thread computes one vertex VkDescriptorSet lengthWindCollisionSets[] = { - m_configSet, m_pTressFXMesh->m_LenghtWindCollisionSet}; + m_configSet, m_pTressFXMesh->m_LenghtWindCollisionSet }; vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSLengthConstriantsWindAndCollisionLayout, 0, - AMD_ARRAY_SIZE(lengthWindCollisionSets), - lengthWindCollisionSets, AMD_ARRAY_SIZE(descriptorOffset), - descriptorOffset); + m_CSLengthConstriantsWindAndCollisionLayout, 0, + AMD_ARRAY_SIZE(lengthWindCollisionSets), + lengthWindCollisionSets, AMD_ARRAY_SIZE(descriptorOffset), + descriptorOffset); vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSLengthConstriantsWindAndCollision); + m_CSLengthConstriantsWindAndCollision); vkCmdDispatch(commandBuffer, numOfGroupsForCS_VertexLevel, 1, 1); VkBufferMemoryBarrier lengthWindCollisionBarriers[] = { getBufferBarrier(m_pTressFXMesh->m_HairVertexPositionsBuffer, - VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, - VK_ACCESS_MEMORY_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT)}; + VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, + VK_ACCESS_MEMORY_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT) }; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, - AMD_ARRAY_SIZE(lengthWindCollisionBarriers), - lengthWindCollisionBarriers, 0, nullptr); + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, + AMD_ARRAY_SIZE(lengthWindCollisionBarriers), + lengthWindCollisionBarriers, 0, nullptr); // Update follow hair vertices // One thread computes one vertex if (m_bGuideFollowHairPrev) { - VkDescriptorSet updateFollowHairSets[] = {m_configSet, - m_pTressFXMesh->m_UpdateFollowHairSet}; + VkDescriptorSet updateFollowHairSets[] = { m_configSet, + m_pTressFXMesh->m_UpdateFollowHairSet }; vkCmdBindDescriptorSets( commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, m_CSUpdateFollowHairVerticesLayout, 0, AMD_ARRAY_SIZE(updateFollowHairSets), updateFollowHairSets, AMD_ARRAY_SIZE(descriptorOffset), descriptorOffset); vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSUpdateFollowHairVertices); + m_CSUpdateFollowHairVertices); vkCmdDispatch(commandBuffer, numOfGroupsForCS_VertexLevel, 1, 1); VkBufferMemoryBarrier updateFollowHairBarriers[] = { getBufferBarrier(m_pTressFXMesh->m_HairVertexPositionsBuffer, - VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, - VK_ACCESS_SHADER_READ_BIT), + VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT, + VK_ACCESS_SHADER_READ_BIT), + getBufferBarrier( + m_pTressFXMesh->m_HairVertexTangentsBuffer, VK_ACCESS_MEMORY_READ_BIT, + VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT) }; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, - AMD_ARRAY_SIZE(updateFollowHairBarriers), - updateFollowHairBarriers, 0, nullptr); + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, + AMD_ARRAY_SIZE(updateFollowHairBarriers), + updateFollowHairBarriers, 0, nullptr); } + else + { + VkBufferMemoryBarrier makeTangentBarrier[] = { getBufferBarrier( + m_pTressFXMesh->m_HairVertexTangentsBuffer, VK_ACCESS_MEMORY_READ_BIT, + VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT) }; - VkBufferMemoryBarrier makeTangentBarrier[] = {getBufferBarrier( - m_pTressFXMesh->m_HairVertexTangentsBuffer, VK_ACCESS_MEMORY_READ_BIT, - VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT)}; - - vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, - AMD_ARRAY_SIZE(makeTangentBarrier), makeTangentBarrier, 0, - nullptr); + vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, + AMD_ARRAY_SIZE(makeTangentBarrier), makeTangentBarrier, 0, + nullptr); + } // Compute tangents for every vertex (guide + follow) { int numOfGroupsForCS_TotalVertexLevel = (int)(((float)(m_pTressFXMesh->m_HairAsset.m_NumTotalHairVertices) / - (float)THREAD_GROUP_SIZE) * - density); + (float)THREAD_GROUP_SIZE) * + density); vkCmdBindPipeline(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSComputeTangents); - VkDescriptorSet computeTangentSet[] = {m_configSet, - m_pTressFXMesh->m_ComputeTangentSet}; + m_CSComputeTangents); + VkDescriptorSet computeTangentSet[] = { m_configSet, + m_pTressFXMesh->m_ComputeTangentSet }; vkCmdBindDescriptorSets(commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, - m_CSComputeTangentsLayout, 0, - AMD_ARRAY_SIZE(computeTangentSet), computeTangentSet, - AMD_ARRAY_SIZE(descriptorOffset), descriptorOffset); + m_CSComputeTangentsLayout, 0, + AMD_ARRAY_SIZE(computeTangentSet), computeTangentSet, + AMD_ARRAY_SIZE(descriptorOffset), descriptorOffset); vkCmdDispatch(commandBuffer, numOfGroupsForCS_TotalVertexLevel, 1, 1); VkBufferMemoryBarrier computeTangentBarrier[] = { getBufferBarrier(m_pTressFXMesh->m_HairVertexTangentsBuffer, - VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, - VK_ACCESS_SHADER_READ_BIT)}; + VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT, + VK_ACCESS_SHADER_READ_BIT) }; vkCmdPipelineBarrier(commandBuffer, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, - AMD_ARRAY_SIZE(computeTangentBarrier), computeTangentBarrier, - 0, nullptr); + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, nullptr, + AMD_ARRAY_SIZE(computeTangentBarrier), computeTangentBarrier, + 0, nullptr); } +} - return vr; +void TressFXSimulation::fillHeadConstantBuffer(ConstBufferCS_HeadTransform * pCSHeadTransform, bool singleHeadTransform, DirectX::XMMATRIX * pModelTransformForHead) +{ + pCSHeadTransform->bSingleHeadTransform = singleHeadTransform; + pCSHeadTransform->ModelRotateForHead = + XMQuaternionRotationMatrix(*pModelTransformForHead); + pCSHeadTransform->ModelTransformForHead = *pModelTransformForHead; +} + +void TressFXSimulation::fillConstantBuffer(ConstBufferCS_Per_Frame * pCSPerFrame, bool warp, bool bFullSimulate, float targetFrameRate, int numOfStrandsPerThreadGroup, float windMag, AMD::tressfx_vec3 & windDir, float fElapsedTime) +{ + pCSPerFrame->bWarp = warp; + + if (bFullSimulate) + { + pCSPerFrame->NumLengthConstraintIterations = + m_simParams.numLengthConstraintIterations; + } + else + { + pCSPerFrame->NumLengthConstraintIterations = 1; + } + + pCSPerFrame->bCollision = (m_simParams.bCollision == true) ? 1 : 0; + + pCSPerFrame->GravityMagnitude = m_simParams.gravityMagnitude; + + pCSPerFrame->timeStep = targetFrameRate; + + pCSPerFrame->NumOfStrandsPerThreadGroup = numOfStrandsPerThreadGroup; + pCSPerFrame->NumFollowHairsPerGuideHair = + (m_bGuideFollowHairPrev + ? m_pTressFXMesh->m_HairAsset.m_NumFollowHairsPerGuideHair + : 0); + pCSPerFrame->TipSeparationFactor = + m_pTressFXMesh->m_HairAsset.m_TipSeparationFactor; + + ComputeWindPyramid(pCSPerFrame->Wind, pCSPerFrame->Wind1, pCSPerFrame->Wind2, + pCSPerFrame->Wind3, windMag, windDir); + + int numSections = m_simParams.numHairSections; + + switch (numSections) + { + // hair section 3 + case 3: + pCSPerFrame->Damping3 = m_simParams.perSectionShapeParams[3].damping; + pCSPerFrame->StiffnessForLocalShapeMatching3 = + m_simParams.perSectionShapeParams[3].stiffnessForLocalShapeMatching; + pCSPerFrame->StiffnessForGlobalShapeMatching3 = + m_simParams.perSectionShapeParams[3].stiffnessForGlobalShapeMatching; + pCSPerFrame->GlobalShapeMatchingEffectiveRange3 = + m_simParams.perSectionShapeParams[3].globalShapeMatchingEffectiveRange; + // hair section 2 + case 2: + pCSPerFrame->Damping2 = m_simParams.perSectionShapeParams[2].damping; + pCSPerFrame->StiffnessForLocalShapeMatching2 = + m_simParams.perSectionShapeParams[2].stiffnessForLocalShapeMatching; + pCSPerFrame->StiffnessForGlobalShapeMatching2 = + m_simParams.perSectionShapeParams[2].stiffnessForGlobalShapeMatching; + pCSPerFrame->GlobalShapeMatchingEffectiveRange2 = + m_simParams.perSectionShapeParams[2].globalShapeMatchingEffectiveRange; + // hair section 1 + case 1: + pCSPerFrame->Damping1 = m_simParams.perSectionShapeParams[1].damping; + pCSPerFrame->StiffnessForLocalShapeMatching1 = + m_simParams.perSectionShapeParams[1].stiffnessForLocalShapeMatching; + pCSPerFrame->StiffnessForGlobalShapeMatching1 = + m_simParams.perSectionShapeParams[1].stiffnessForGlobalShapeMatching; + pCSPerFrame->GlobalShapeMatchingEffectiveRange1 = + m_simParams.perSectionShapeParams[1].globalShapeMatchingEffectiveRange; + // hair section 0 + case 0: + pCSPerFrame->Damping0 = m_simParams.perSectionShapeParams[0].damping; + pCSPerFrame->StiffnessForLocalShapeMatching0 = + m_simParams.perSectionShapeParams[0].stiffnessForLocalShapeMatching; + pCSPerFrame->StiffnessForGlobalShapeMatching0 = + m_simParams.perSectionShapeParams[0].stiffnessForGlobalShapeMatching; + pCSPerFrame->GlobalShapeMatchingEffectiveRange0 = + m_simParams.perSectionShapeParams[0].globalShapeMatchingEffectiveRange; + } + + if (!bFullSimulate) + { + float h = fElapsedTime; + float h0 = targetFrameRate; + float s_min_scale = + 0.3f; // minimum stiffness = s_min_scale * current stiffness + + pCSPerFrame->StiffnessForLocalShapeMatching0 = getScaledStiffness( + m_simParams.perSectionShapeParams[0].stiffnessForLocalShapeMatching, + s_min_scale, h, h0); + pCSPerFrame->StiffnessForLocalShapeMatching1 = getScaledStiffness( + m_simParams.perSectionShapeParams[1].stiffnessForLocalShapeMatching, + s_min_scale, h, h0); + pCSPerFrame->StiffnessForLocalShapeMatching2 = getScaledStiffness( + m_simParams.perSectionShapeParams[2].stiffnessForLocalShapeMatching, + s_min_scale, h, h0); + pCSPerFrame->StiffnessForLocalShapeMatching3 = getScaledStiffness( + m_simParams.perSectionShapeParams[3].stiffnessForLocalShapeMatching, + s_min_scale, h, h0); + } + + if (bFullSimulate) + { + pCSPerFrame->NumLocalShapeMatchingIterations = + m_simParams.numLocalShapeMatchingIterations; + } + else + { + pCSPerFrame->NumLocalShapeMatchingIterations = 1; + } + + pCSPerFrame->NumVerticesPerStrand = g_TressFXNumVerticesPerStrand; } //-------------------------------------------------------------------------------------- @@ -1055,56 +1071,55 @@ VkResult TressFXSimulation::Simulate(VkDevice pvkDevice, VkCommandBuffer command //-------------------------------------------------------------------------------------- VkResult TressFXSimulation::CreateComputeShaderConstantBuffers( VkDevice pvkDevice, TressFX_CollisionCapsule *pCollision, - uint32_t maxUniformBufferCount, uint32_t cpu_memory_index, - uint32_t texture_memory_index) + uint32_t maxUniformBufferCount, VkPhysicalDeviceMemoryProperties memProperties) { (void)pCollision; VkResult vr = VK_SUCCESS; // const buffer for per frame data - VkBufferCreateInfo Desc{VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO}; + VkBufferCreateInfo Desc{ VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; // FIXME: Uniform buffer + compute shader crash nvidia driver Desc.usage = VK_BUFFER_USAGE_STORAGE_BUFFER_BIT; Desc.size = maxUniformBufferCount * sizeof(ConstBufferCS_Per_Frame); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &Desc, nullptr, &m_pCBCSPerFrame)); + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &Desc, nullptr, &m_pCBCSPerFrame)); m_pCBCSPerFrameMemory = - allocBufferMemory(pvkDevice, m_pCBCSPerFrame, cpu_memory_index); + allocBufferMemory(pvkDevice, m_pCBCSPerFrame, memProperties, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); // const buffer for capsule collision Desc.size = sizeof(TressFX_CollisionCapsule); // data.pSysMem = (void *)pCollision; - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &Desc, nullptr, &m_pCBCSCollisionCapsule)); + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &Desc, nullptr, &m_pCBCSCollisionCapsule)); m_pCBCSCollisionCapsuleMemory = - allocBufferMemory(pvkDevice, m_pCBCSCollisionCapsule, texture_memory_index); + allocBufferMemory(pvkDevice, m_pCBCSCollisionCapsule, memProperties, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); /* void* scratch_buffer_mapped_memory; vkMapMemory(pvkDevice, ..., 0, sizeof(TressFX_CollisionCapsule), 0, - &scratch_buffer_mapped_memory); + &scratch_buffer_mapped_memory); memcpy(scratch_buffer_mapped_memory, pCollision, - sizeof(TressFX_CollisionCapsule)); + sizeof(TressFX_CollisionCapsule)); vkUnmapMemory(pvkDevice, ...); vkCmdCopyBuffer(..., ..., m_pCBCSCollisionCapsule, 1, );*/ - // const buffer for hair root transformation + // const buffer for hair root transformation Desc.size = sizeof(TransformConstantBuffer); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &Desc, nullptr, &m_pCBGenerateTransforms)); + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &Desc, nullptr, &m_pCBGenerateTransforms)); m_pCBGenerateTransformsMemory = - allocBufferMemory(pvkDevice, m_pCBGenerateTransforms, cpu_memory_index); + allocBufferMemory(pvkDevice, m_pCBGenerateTransforms, memProperties, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); // const buffer for head transformation Desc.size = sizeof(ConstBufferCS_HeadTransform); - AMD_V_RETURN(vkCreateBuffer(pvkDevice, &Desc, nullptr, &m_pCBHeadTransforms)); + AMD_CHECKED_VULKAN_CALL(vkCreateBuffer(pvkDevice, &Desc, nullptr, &m_pCBHeadTransforms)); m_pCBHeadTransformsMemory = - allocBufferMemory(pvkDevice, m_pCBHeadTransforms, cpu_memory_index); + allocBufferMemory(pvkDevice, m_pCBHeadTransforms, memProperties, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); - VkDescriptorBufferInfo perFrameCBCS{m_pCBCSPerFrame, 0, - sizeof(ConstBufferCS_Per_Frame)}; - VkDescriptorBufferInfo headTransform{m_pCBHeadTransforms, 0, - sizeof(ConstBufferCS_HeadTransform)}; + VkDescriptorBufferInfo perFrameCBCS{ m_pCBCSPerFrame, 0, + sizeof(ConstBufferCS_Per_Frame) }; + VkDescriptorBufferInfo headTransform{ m_pCBHeadTransforms, 0, + sizeof(ConstBufferCS_HeadTransform) }; VkWriteDescriptorSet writeSet[] = { getWriteDescriptor(m_configSet, IDSRV_CONSTANTS_BUFFER, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, &perFrameCBCS), + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, &perFrameCBCS), getWriteDescriptor(m_configSet, IDSRV_HEAD_TRANSFORM, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, &headTransform), + VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, &headTransform), }; vkUpdateDescriptorSets(pvkDevice, AMD_ARRAY_SIZE(writeSet), writeSet, 0, nullptr); return VK_SUCCESS; @@ -1121,49 +1136,49 @@ void TressFXSimulation::OnDestroy(VkDevice pvkDevice) { { AMD_SAFE_RELEASE(m_CSIntegrationAndGlobalShapeConstraints, vkDestroyPipeline, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_CSApplyHairTransformGlobally, vkDestroyPipeline, pvkDevice); AMD_SAFE_RELEASE(m_CSComputeTangents, vkDestroyPipeline, pvkDevice); AMD_SAFE_RELEASE(m_CSLocalShapeConstraints, vkDestroyPipeline, pvkDevice); AMD_SAFE_RELEASE(m_CSLocalShapeConstraintsSingleDispatch, vkDestroyPipeline, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_CSLengthConstriantsWindAndCollision, vkDestroyPipeline, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_CSUpdateFollowHairVertices, vkDestroyPipeline, pvkDevice); AMD_SAFE_RELEASE(m_CSPrepareFollowHairBeforeTurningIntoGuide, vkDestroyPipeline, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_CSGenerateTransforms, vkDestroyPipeline, pvkDevice); AMD_SAFE_RELEASE(m_CSIntegrationAndGlobalShapeConstraintsLayout, - vkDestroyPipelineLayout, pvkDevice); + vkDestroyPipelineLayout, pvkDevice); // AMD_SAFE_RELEASE(m_CSApplyHairTransformGloballyLayout, vkDestroyPipelineLayout, // pvkDevice); AMD_SAFE_RELEASE(m_CSComputeTangentsLayout, vkDestroyPipelineLayout, pvkDevice); AMD_SAFE_RELEASE(m_CSLocalShapeConstraintsLayout, vkDestroyPipelineLayout, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_CSLocalShapeConstraintsSingleDispatchLayout, - vkDestroyPipelineLayout, pvkDevice); + vkDestroyPipelineLayout, pvkDevice); AMD_SAFE_RELEASE(m_CSLengthConstriantsWindAndCollisionLayout, - vkDestroyPipelineLayout, pvkDevice); + vkDestroyPipelineLayout, pvkDevice); AMD_SAFE_RELEASE(m_CSUpdateFollowHairVerticesLayout, vkDestroyPipelineLayout, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_CSPrepareFollowHairBeforeTurningIntoGuideLayout, - vkDestroyPipelineLayout, pvkDevice); + vkDestroyPipelineLayout, pvkDevice); // AMD_SAFE_RELEASE(m_CSGenerateTransformsLayout, vkDestroyPipelineLayout, // pvkDevice); AMD_SAFE_RELEASE(m_GlobalConstraintsSetLayout, vkDestroyDescriptorSetLayout, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_LocalConstraintsSetLayout, vkDestroyDescriptorSetLayout, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_LenghtWindTangentSetLayout, vkDestroyDescriptorSetLayout, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_PrepareFollowHairSetLayout, vkDestroyDescriptorSetLayout, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_UpdateFollowHaitSetLayout, vkDestroyDescriptorSetLayout, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_ComputeTangentSetLayout, vkDestroyDescriptorSetLayout, - pvkDevice); + pvkDevice); AMD_SAFE_RELEASE(m_configSetLayout, vkDestroyDescriptorSetLayout, pvkDevice); } AMD_SAFE_RELEASE(m_descriptorPool, vkDestroyDescriptorPool, pvkDevice); @@ -1176,5 +1191,4 @@ void TressFXSimulation::OnDestroy(VkDevice pvkDevice) AMD_SAFE_RELEASE(m_pCBHeadTransforms, vkDestroyBuffer, pvkDevice); AMD_SAFE_RELEASE(m_pCBHeadTransformsMemory, vkFreeMemory, pvkDevice); } - } // namespace AMD diff --git a/amd_tressfx_vulkan/src/TressFXSimulationVulkan.h b/amd_tressfx_vulkan/src/TressFXSimulationVulkan.h index da6aec3..39f1dc8 100644 --- a/amd_tressfx_vulkan/src/TressFXSimulationVulkan.h +++ b/amd_tressfx_vulkan/src/TressFXSimulationVulkan.h @@ -38,31 +38,25 @@ typedef DirectX::XMFLOAT4 float4; typedef DirectX::XMFLOAT3 float3; +struct ConstBufferCS_Per_Frame; +struct ConstBufferCS_HeadTransform; + namespace AMD { - class TressFXSimulation { - public: +public: TressFXSimulation(void); ~TressFXSimulation(void); - VkResult OnCreateDevice(VkDevice pvkDevice, TressFX_CollisionCapsule *pCollision, - uint32_t maxUniformCount, uint32_t cpu_memory_index, - uint32_t gpu_memory_index); + VkResult OnCreateDevice(VkDevice pvkDevice, + TressFX_CollisionCapsule *pCollision, + uint32_t maxUniformCount, VkPhysicalDeviceMemoryProperties memProperties, const DebugMarkerPointer& markerCallbacks); VkResult Simulate(VkDevice pvkContext, VkCommandBuffer commandBuffer, - float fElapsedTime, float density, tressfx_vec3 &windDir, - float windMag, DirectX::XMMATRIX *pModelTransformForHead, - ID3D11UnorderedAccessView *pSkinningTransforms, - float targetFrameRate, bool singleHeadTransform, bool warp, - uint32_t uniformBufferIndex); - VkResult GenerateTransforms(VkDevice pvkContext, TressFX_SceneMesh sceneMesh, - ID3D11UnorderedAccessView **ppSkinningTransformationsUAV, - DirectX::XMMATRIX *pModelTransformForHead); - VkResult ApplyTransformGlobally(VkDevice pvkContext, - ID3D11UnorderedAccessView *pSkinningTransforms, - float density, bool singleHeadTransform, - DirectX::XMMATRIX *pModelTransformForHead); + float fElapsedTime, float density, tressfx_vec3 &windDir, + float windMag, DirectX::XMMATRIX *pModelTransformForHead, + float targetFrameRate, bool singleHeadTransform, bool warp, + uint32_t uniformBufferIndex, const DebugMarkerPointer& markerCallbacks); void OnDestroy(VkDevice pvkDevice); TressFXMesh *m_pTressFXMesh; float m_elapsedTimeSinceLastSim; @@ -75,7 +69,7 @@ class TressFXSimulation VkDescriptorSetLayout m_UpdateFollowHaitSetLayout; VkDescriptorSetLayout m_ComputeTangentSetLayout; - private: +private: bool m_bGuideFollowHairPrev; // hair simulation params @@ -117,17 +111,18 @@ class TressFXSimulation VkDeviceMemory m_pCBHeadTransformsMemory; VkResult CreateComputeShaderConstantBuffers(VkDevice pvkDevice, - TressFX_CollisionCapsule *pCollision, - uint32_t maxUniformBufferCount, - uint32_t memoryIndexCPU, - uint32_t memoryIndexGPU); + TressFX_CollisionCapsule *pCollision, + uint32_t maxUniformBufferCount, + VkPhysicalDeviceMemoryProperties memProps); VkResult CreateDescriptorSet(VkDevice pvkDevice); - public: + void fillConstantBuffer(ConstBufferCS_Per_Frame * pCSPerFrame, bool warp, bool bFullSimulate, float targetFrameRate, int numOfStrandsPerThreadGroup, float windMag, AMD::tressfx_vec3 & windDir, float fElapsedTime); + void fillHeadConstantBuffer(ConstBufferCS_HeadTransform * pCSHeadTransform, bool singleHeadTransform, DirectX::XMMATRIX * pModelTransformForHead); + void fillSimulationCommands(const VkCommandBuffer &commandBuffer, float &density, const uint32_t &uniformBufferIndex); +public: void SetSimulationParams(const TressFX_SimulationParams &simParams) { m_simParams = simParams; } }; - } // namespace AMD diff --git a/amd_tressfx_vulkan/src/TressFXVulkan.cpp b/amd_tressfx_vulkan/src/TressFXVulkan.cpp index 5faf793..a1048cb 100644 --- a/amd_tressfx_vulkan/src/TressFXVulkan.cpp +++ b/amd_tressfx_vulkan/src/TressFXVulkan.cpp @@ -79,9 +79,13 @@ TressFX_Initialize(TressFX_Desc &desc, VkImageView depthTexture, VkImageView col VkBuffer scratchBuffer, size_t &offsetInScratchBuffer) { desc.pOpaque = &gTressFXOpaqueDesc; - desc.pOpaque->Initialize(desc, depthTexture, colorTexture, commandBuffer, - scratchMemory, scratchBuffer, offsetInScratchBuffer, - desc.memoryIndexHostVisible, desc.memoryIndexDeviceLocal); + desc.pOpaque->Initialize(desc, depthTexture, + colorTexture, + commandBuffer, + scratchMemory, + scratchBuffer, + offsetInScratchBuffer, + desc.memoryProperties); desc.pTressFXMesh = NULL; desc.groupID = 0; @@ -135,8 +139,10 @@ TRESSFX_RETURN_CODE AMD_TRESSFX_DLL_API TressFX_LoadProcessedAsset( pTressFXMesh = new TressFXMesh(); memcpy(desc.tressFXHair.pHair, pHairBlob->pHair, pHairBlob->size); desc.tressFXHair.size = pHairBlob->size; - pTressFXMesh->OnCreate(desc.pvkDevice, &desc.tressFXHair, sceneMesh, pTressFXTexture, - desc.memoryIndexDeviceLocal, uploadCmdBuffer, scratchBuffer, + pTressFXMesh->OnCreate(desc.pvkDevice, &desc.tressFXHair, sceneMesh, + pTressFXTexture, + desc.memoryProperties, uploadCmdBuffer, + scratchBuffer, scratchMemory, desc.pOpaque->tressFXSimulation.m_GlobalConstraintsSetLayout, desc.pOpaque->tressFXSimulation.m_LocalConstraintsSetLayout, @@ -145,7 +151,8 @@ TRESSFX_RETURN_CODE AMD_TRESSFX_DLL_API TressFX_LoadProcessedAsset( desc.pOpaque->tressFXSimulation.m_UpdateFollowHaitSetLayout, desc.pOpaque->tressFXSimulation.m_ComputeTangentSetLayout, desc.pOpaque->tressFXRenderer.m_pass1_hair_set_layout, - desc.pOpaque->tressFXRenderer.m_shadow_pass_hair_set_layout); + desc.pOpaque->tressFXRenderer.m_shadow_pass_hair_set_layout, + desc.pOpaque->markerCallbacks); desc.numTotalHairStrands = pTressFXMesh->m_HairAsset.m_NumTotalHairStrands; desc.numTotalHairVertices = pTressFXMesh->m_HairAsset.m_NumTotalHairVertices; desc.pTressFXMesh = (void *)pTressFXMesh; @@ -169,7 +176,7 @@ TRESSFX_RETURN_CODE AMD_TRESSFX_DLL_API TressFX_CreateProcessedAsset( VkDeviceMemory scratchMemory) { bool success = desc.pOpaque->CreateProcessedAsset( - desc, ppHairBlob, sceneMesh, hairTexture, desc.memoryIndexDeviceLocal, + desc, ppHairBlob, sceneMesh, hairTexture, desc.memoryProperties, uploadCmdBuffer, scratchBuffer, scratchMemory); desc.groupID = 0; return (success ? TRESSFX_RETURN_CODE_SUCCESS : TRESSFX_RETURN_CODE_FAIL); @@ -257,9 +264,9 @@ TRESSFX_RETURN_CODE AMD_TRESSFX_DLL_API TressFX_End(TressFX_Desc &desc) // //-------------------------------------------------------------------------------------- TRESSFX_RETURN_CODE AMD_TRESSFX_DLL_API TressFX_Resize(TressFX_Desc &desc, - uint32_t texture_memory_index) + VkPhysicalDeviceMemoryProperties memProperties) { - bool success = desc.pOpaque->Resize(desc, texture_memory_index); + bool success = desc.pOpaque->Resize(desc, memProperties); return (success ? TRESSFX_RETURN_CODE_SUCCESS : TRESSFX_RETURN_CODE_FAIL); } diff --git a/amd_tressfx_vulkan/src/UtilVulkan.cpp b/amd_tressfx_vulkan/src/UtilVulkan.cpp index d39b907..3e43d8c 100644 --- a/amd_tressfx_vulkan/src/UtilVulkan.cpp +++ b/amd_tressfx_vulkan/src/UtilVulkan.cpp @@ -17,15 +17,39 @@ ShaderModule::~ShaderModule() vkDestroyShaderModule(m_pvkDevice, m_shaderModule, nullptr); } + +uint32_t getMemoryTypeIndex(uint32_t typeBits, const VkPhysicalDeviceMemoryProperties &memprops, VkMemoryPropertyFlags properties) +{ + // Iterate over all memory types available for the device used in this example + for (uint32_t i = 0; i < memprops.memoryTypeCount; i++) + { + if ((typeBits & 1) == 1) + { + if ((memprops.memoryTypes[i].propertyFlags & properties) == properties) + { + return i; + } + } + typeBits >>= 1; + } + return static_cast(-1); +} + +VkDeviceSize align(VkDeviceSize offset, VkDeviceSize alignment) +{ + return ((offset + alignment - 1) / alignment) * alignment; +} + + VkDeviceMemory allocBufferMemory(VkDevice dev, VkBuffer buffer, - uint32_t texture_memory_index) + const VkPhysicalDeviceMemoryProperties &memprops, VkMemoryPropertyFlags properties) { VkMemoryRequirements memReqs; vkGetBufferMemoryRequirements(dev, buffer, &memReqs); VkMemoryAllocateInfo allocateInfo{VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO}; allocateInfo.allocationSize = memReqs.size; - allocateInfo.memoryTypeIndex = texture_memory_index; + allocateInfo.memoryTypeIndex = getMemoryTypeIndex(memReqs.memoryTypeBits, memprops, properties); VkDeviceMemory result; vkAllocateMemory(dev, &allocateInfo, nullptr, &result); vkBindBufferMemory(dev, buffer, result, 0); @@ -33,14 +57,14 @@ VkDeviceMemory allocBufferMemory(VkDevice dev, VkBuffer buffer, } VkDeviceMemory allocImageMemory(VkDevice dev, VkImage image, - uint32_t texture_memory_index) + const VkPhysicalDeviceMemoryProperties &memprops) { VkMemoryRequirements memReqs; vkGetImageMemoryRequirements(dev, image, &memReqs); VkMemoryAllocateInfo allocateInfo{VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO}; allocateInfo.allocationSize = memReqs.size; - allocateInfo.memoryTypeIndex = texture_memory_index; + allocateInfo.memoryTypeIndex = getMemoryTypeIndex(memReqs.memoryTypeBits, memprops, VkMemoryPropertyFlagBits::VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); VkDeviceMemory result; vkAllocateMemory(dev, &allocateInfo, nullptr, &result); vkBindImageMemory(dev, image, result, 0); @@ -91,10 +115,10 @@ void fillInitialData(VkCommandBuffer commandBuffer, VkBuffer scratchBuffer, size_t &offsetInScratchBuffer, VkDeviceSize size) { memcpy(reinterpret_cast(pScratchBuffer) + offsetInScratchBuffer, - pDataToUpload, size); + pDataToUpload, static_cast(size)); VkBufferCopy copyInfo{offsetInScratchBuffer, 0, static_cast(size)}; vkCmdCopyBuffer(commandBuffer, scratchBuffer, destBuffer, 1, ©Info); - offsetInScratchBuffer += size; + offsetInScratchBuffer += static_cast(size); } VkResult getDescriptorLayout(VkDevice pvkDevice, const VkDescriptorSetLayoutBinding *ptr, @@ -106,13 +130,13 @@ VkResult getDescriptorLayout(VkDevice pvkDevice, const VkDescriptorSetLayoutBind info.pBindings = ptr; VkResult vr; - AMD_V_RETURN(vkCreateDescriptorSetLayout(pvkDevice, &info, nullptr, &result)); + AMD_CHECKED_VULKAN_CALL(vkCreateDescriptorSetLayout(pvkDevice, &info, nullptr, &result)); return VK_SUCCESS; } VkBufferMemoryBarrier getBufferBarrier(VkBuffer buffer, VkAccessFlags srcAccess, VkAccessFlags dstAccess, size_t offset, - size_t size) + uint64_t size) { VkBufferMemoryBarrier result{VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER}; result.buffer = buffer; @@ -214,7 +238,7 @@ VkGraphicsPipelineCreateInfo CommonPipelineState::getBasePipelineCreateInfo( namespace { VkPipelineDepthStencilStateCreateInfo -getSpecializedDSS(bool depth_test_enable, bool depth_write_enable, +getSpecializedDepthStencilState(bool depth_test_enable, bool depth_write_enable, bool stencil_test_enable, VkCompareOp stencil_op, VkStencilOp pass_op, uint32_t write_mask) { @@ -266,29 +290,20 @@ const VkPipelineColorBlendAttachmentState m_pSum_BS_render_target_0{ VK_BLEND_FACTOR_ONE, VK_BLEND_OP_ADD, VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT}; - -// Full screen quad layout structure -const VkVertexInputBindingDescription layout_quad_bindings[1] = { - {0, 32, VK_VERTEX_INPUT_RATE_VERTEX}}; -const VkVertexInputAttributeDescription layout_quad[3] = { - {0, 0, VK_FORMAT_R32G32B32_SFLOAT, 0}, // POSITION - {1, 0, VK_FORMAT_R32G32B32_SFLOAT, 12}, // TANGENT - {2, 0, VK_FORMAT_R32G32_SFLOAT, 24}, // TEXCOORD -}; } const VkPipelineDepthStencilStateCreateInfo CommonPipelineState::DepthTestEnabledDesc = - getSpecializedDSS(true, true, false, VK_COMPARE_OP_NEVER, VK_STENCIL_OP_KEEP, 0xff); + getSpecializedDepthStencilState(true, true, false, VK_COMPARE_OP_NEVER, VK_STENCIL_OP_KEEP, 0xff); const VkPipelineDepthStencilStateCreateInfo CommonPipelineState::DepthTestEnabledNoDepthWritesStencilWriteIncrementDesc = - getSpecializedDSS(true, false, true, VK_COMPARE_OP_ALWAYS, + getSpecializedDepthStencilState(true, false, true, VK_COMPARE_OP_ALWAYS, VK_STENCIL_OP_INCREMENT_AND_WRAP, 0xff); const VkPipelineDepthStencilStateCreateInfo - CommonPipelineState::DepthTestDisabledStencilTestLessDSS = getSpecializedDSS( + CommonPipelineState::DepthTestDisabledStencilTestLessDSS = getSpecializedDepthStencilState( false, false, true, VK_COMPARE_OP_LESS, VK_STENCIL_OP_KEEP, 0x00); const VkPipelineDepthStencilStateCreateInfo CommonPipelineState::m_pDepthWriteEnabledStencilTestLess_DSS = - getSpecializedDSS(true, true, true, VK_COMPARE_OP_LESS, VK_STENCIL_OP_KEEP, 0x0); + getSpecializedDepthStencilState(true, true, true, VK_COMPARE_OP_LESS, VK_STENCIL_OP_KEEP, 0x0); // disable color write if there is no need for fragments counting const VkPipelineColorBlendStateCreateInfo CommonPipelineState::ColorWritesOff{ @@ -334,14 +349,14 @@ const VkPipelineVertexInputStateCreateInfo CommonPipelineState::m_pLayoutQuad{ VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, nullptr, 0, - 1, - layout_quad_bindings, - 3, - layout_quad}; + 0, + nullptr, + 0, + nullptr}; VkImageMemoryBarrier getImageMemoryBarrier(VkImage image, VkAccessFlags srcMask, VkAccessFlags dstMask, VkImageLayout oldLayout, - VkImageLayout newLayout, + VkImageLayout newLayout, uint32_t layoutCount, VkImageAspectFlags aspect) { VkImageMemoryBarrier memoryBarrier{VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER}; @@ -351,8 +366,8 @@ VkImageMemoryBarrier getImageMemoryBarrier(VkImage image, VkAccessFlags srcMask, memoryBarrier.newLayout = newLayout; memoryBarrier.image = image; memoryBarrier.subresourceRange.aspectMask = aspect; - memoryBarrier.subresourceRange.levelCount = - memoryBarrier.subresourceRange.layerCount = 1; + memoryBarrier.subresourceRange.levelCount = 1; + memoryBarrier.subresourceRange.layerCount = layoutCount; return memoryBarrier; } diff --git a/amd_tressfx_vulkan/src/UtilVulkan.h b/amd_tressfx_vulkan/src/UtilVulkan.h index 046f58b..b81faeb 100644 --- a/amd_tressfx_vulkan/src/UtilVulkan.h +++ b/amd_tressfx_vulkan/src/UtilVulkan.h @@ -3,7 +3,7 @@ #include #include -#define AMD_V_RETURN(x) \ +#define AMD_CHECKED_VULKAN_CALL(x) \ { \ vr = (x); \ if (vr != VK_SUCCESS) \ @@ -12,103 +12,185 @@ } \ } -namespace AMD -{ -struct ShaderModule -{ - VkShaderModule m_shaderModule; - - ShaderModule(VkDevice dev, const std::vector &code); - ~ShaderModule(); - - private: - VkDevice m_pvkDevice; -}; - -VkDeviceMemory allocBufferMemory(VkDevice dev, VkBuffer buffer, - uint32_t texture_memory_index); -VkDeviceMemory allocImageMemory(VkDevice dev, VkImage image, - uint32_t texture_memory_index); - -VkWriteDescriptorSet getWriteDescriptor(VkDescriptorSet dstSet, uint32_t dstBinding, - VkDescriptorType descriptorType, - const VkBufferView *texelBufferView); +#undef AMD_SAFE_RELEASE +#define AMD_SAFE_RELEASE(object, releaseFunction, device) if (object != VK_NULL_HANDLE) releaseFunction(device, object, nullptr); -VkWriteDescriptorSet getWriteDescriptor(VkDescriptorSet dstSet, uint32_t dstBinding, - VkDescriptorType descriptorType, - const VkDescriptorBufferInfo *Bufferdescriptor); - -VkWriteDescriptorSet getWriteDescriptor(VkDescriptorSet dstSet, uint32_t dstBinding, - VkDescriptorType descriptorType, - const VkDescriptorImageInfo *descriptor); - -void fillInitialData(VkCommandBuffer commandBuffer, VkBuffer scratchBuffer, - void *pScratchBuffer, void *pDataToUpload, VkBuffer destBuffer, - size_t &offsetInScratchBuffer, VkDeviceSize size); - -VkResult getDescriptorLayout(VkDevice pvkDevice, const VkDescriptorSetLayoutBinding *ptr, - size_t count, VkDescriptorSetLayout &result); -VkBufferMemoryBarrier getBufferBarrier(VkBuffer buffer, VkAccessFlags srcAccess, - VkAccessFlags dstAccess, size_t offset = 0, - size_t size = VK_WHOLE_SIZE); - -VkPipelineShaderStageCreateInfo getShaderStageCreateInfo(VkShaderModule module, - VkShaderStageFlagBits stage, - const char *shaderName); - -VkImageCreateInfo getImageCreateInfo(VkFormat format, uint32_t width, uint32_t height, - VkImageUsageFlags usage, uint32_t layers = 1); - -struct CommonPipelineState +namespace AMD { - // No tesselation - static const VkPipelineTessellationStateCreateInfo tessellationState; - // One viewport and scissor - static const VkDynamicState dynamicStates[2]; - static const VkPipelineDynamicStateCreateInfo dynamicState; - // One sample - static const VkPipelineMultisampleStateCreateInfo multisampleState; - // One viewport - static const VkPipelineViewportStateCreateInfo viewportState; - static const VkPipelineRasterizationStateCreateInfo rasterizationCreateInfo; - - static const VkPipelineVertexInputStateCreateInfo m_pLayoutHair; - // Full screen quad layout structure - static const VkPipelineVertexInputStateCreateInfo m_pLayoutQuad; - - // Triangles list - static const VkPipelineInputAssemblyStateCreateInfo inputAssemblyTriangle; - // Lines list - static const VkPipelineInputAssemblyStateCreateInfo inputAssemblyLine; - - static VkGraphicsPipelineCreateInfo getBasePipelineCreateInfo( - const VkPipelineVertexInputStateCreateInfo *vertex_input_state, - const VkPipelineDepthStencilStateCreateInfo *depth_stencil_state, - const VkPipelineColorBlendStateCreateInfo *color_blend_state, - const VkPipelineInputAssemblyStateCreateInfo *input_assembly, - const VkPipelineShaderStageCreateInfo *stages, VkPipelineLayout layout, - VkRenderPass render_pass, uint32_t subpass); - - static const VkPipelineDepthStencilStateCreateInfo DepthTestEnabledDesc; - // Enable depth test to use early z, disable depth write to make sure required layers - // won't be clipped out in early z - static const VkPipelineDepthStencilStateCreateInfo - DepthTestEnabledNoDepthWritesStencilWriteIncrementDesc; - static const VkPipelineDepthStencilStateCreateInfo - DepthTestDisabledStencilTestLessDSS; - static const VkPipelineDepthStencilStateCreateInfo - m_pDepthWriteEnabledStencilTestLess_DSS; - - // disable color write if there is no need for fragments counting - static const VkPipelineColorBlendStateCreateInfo ColorWritesOff; - static const VkPipelineColorBlendStateCreateInfo BlendStateBlendToBg; - static const VkPipelineColorBlendStateCreateInfo m_pDepthWritesToColor_BS; - static const VkPipelineColorBlendStateCreateInfo m_pResolveColor_BS; - static const VkPipelineColorBlendStateCreateInfo m_pSum_BS; -}; - -VkImageMemoryBarrier -getImageMemoryBarrier(VkImage image, VkAccessFlags srcMask, VkAccessFlags dstMask, - VkImageLayout oldLayout, VkImageLayout newLayout, - VkImageAspectFlags aspect = VK_IMAGE_ASPECT_COLOR_BIT); + struct DebugMarkerPointer + { + DebugMarkerPointer() {} + + void init(VkDevice device) + { + dev = device; + pfnDebugMarkerSetObjectTag = (PFN_vkDebugMarkerSetObjectTagEXT)vkGetDeviceProcAddr(device, "vkDebugMarkerSetObjectTagEXT"); + pfnDebugMarkerSetObjectName = (PFN_vkDebugMarkerSetObjectNameEXT)vkGetDeviceProcAddr(device, "vkDebugMarkerSetObjectNameEXT"); + pfnCmdDebugMarkerBegin = (PFN_vkCmdDebugMarkerBeginEXT)vkGetDeviceProcAddr(device, "vkCmdDebugMarkerBeginEXT"); + pfnCmdDebugMarkerEnd = (PFN_vkCmdDebugMarkerEndEXT)vkGetDeviceProcAddr(device, "vkCmdDebugMarkerEndEXT"); + pfnCmdDebugMarkerInsert = (PFN_vkCmdDebugMarkerInsertEXT)vkGetDeviceProcAddr(device, "vkCmdDebugMarkerInsertEXT"); + } + + void nameObject(VkBuffer object, const char* name) const + { + nameObject_impl(VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, reinterpret_cast(object), name); + } + + void nameObject(VkBufferView object, const char* name) const + { + nameObject_impl(VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT, reinterpret_cast(object), name); + } + + void nameObject(VkDeviceMemory object, const char* name) const + { + nameObject_impl(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT, reinterpret_cast(object), name); + } + + void nameObject(VkPipeline object, const char* name) const + { + + nameObject_impl(VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, reinterpret_cast(object), name); + } + + void markBeginRegion(VkCommandBuffer cmdBuffer, const char* name) const + { + if (!pfnCmdDebugMarkerBegin) + return; + VkDebugMarkerMarkerInfoEXT info{ VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT }; + info.pMarkerName = name; + info.color[0] = 1.f; + pfnCmdDebugMarkerBegin(cmdBuffer, &info); + } + + void markEndRegion(VkCommandBuffer cmdBuffer) const + { + if (!pfnCmdDebugMarkerEnd) + return; + pfnCmdDebugMarkerEnd(cmdBuffer); + } + + private: + PFN_vkDebugMarkerSetObjectTagEXT pfnDebugMarkerSetObjectTag; + PFN_vkDebugMarkerSetObjectNameEXT pfnDebugMarkerSetObjectName; + PFN_vkCmdDebugMarkerBeginEXT pfnCmdDebugMarkerBegin; + PFN_vkCmdDebugMarkerEndEXT pfnCmdDebugMarkerEnd; + PFN_vkCmdDebugMarkerInsertEXT pfnCmdDebugMarkerInsert; + + VkDevice dev; + + void nameObject_impl(VkDebugReportObjectTypeEXT type, uint64_t object, const char* name) const + { + if (!pfnDebugMarkerSetObjectName) + return; + VkDebugMarkerObjectNameInfoEXT info{ VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT }; + info.objectType = type; + info.object = object; + info.pObjectName = name; + pfnDebugMarkerSetObjectName(dev, &info); + } + }; + + + struct ShaderModule + { + VkShaderModule m_shaderModule; + + ShaderModule(VkDevice dev, const std::vector &code); + ~ShaderModule(); + private: + VkDevice m_pvkDevice; + + ShaderModule(const ShaderModule&) {}; + ShaderModule& operator=(const ShaderModule&) {}; + }; + + uint32_t getMemoryTypeIndex(uint32_t typeBits, const VkPhysicalDeviceMemoryProperties &memprops, VkMemoryPropertyFlags properties); + VkDeviceSize align(VkDeviceSize offset, VkDeviceSize alignment); + VkDeviceMemory allocBufferMemory(VkDevice dev, VkBuffer buffer, + const VkPhysicalDeviceMemoryProperties &memprops, VkMemoryPropertyFlags properties); + VkDeviceMemory allocImageMemory(VkDevice dev, VkImage image, + const VkPhysicalDeviceMemoryProperties &memprops); + + VkWriteDescriptorSet getWriteDescriptor(VkDescriptorSet dstSet, uint32_t dstBinding, + VkDescriptorType descriptorType, + const VkBufferView *texelBufferView); + + VkWriteDescriptorSet getWriteDescriptor(VkDescriptorSet dstSet, uint32_t dstBinding, + VkDescriptorType descriptorType, + const VkDescriptorBufferInfo *Bufferdescriptor); + + VkWriteDescriptorSet getWriteDescriptor(VkDescriptorSet dstSet, uint32_t dstBinding, + VkDescriptorType descriptorType, + const VkDescriptorImageInfo *descriptor); + + void fillInitialData(VkCommandBuffer commandBuffer, VkBuffer scratchBuffer, + void *pScratchBuffer, void *pDataToUpload, VkBuffer destBuffer, + size_t &offsetInScratchBuffer, VkDeviceSize size); + + VkResult getDescriptorLayout(VkDevice pvkDevice, const VkDescriptorSetLayoutBinding *ptr, + size_t count, VkDescriptorSetLayout &result); + VkBufferMemoryBarrier getBufferBarrier(VkBuffer buffer, VkAccessFlags srcAccess, + VkAccessFlags dstAccess, size_t offset = 0u, + uint64_t size = VK_WHOLE_SIZE); + + VkPipelineShaderStageCreateInfo getShaderStageCreateInfo(VkShaderModule module, + VkShaderStageFlagBits stage, + const char *shaderName); + + VkImageCreateInfo getImageCreateInfo(VkFormat format, uint32_t width, uint32_t height, + VkImageUsageFlags usage, uint32_t layers = 1); + + struct CommonPipelineState + { + // No tesselation + static const VkPipelineTessellationStateCreateInfo tessellationState; + // One viewport and scissor + static const VkDynamicState dynamicStates[2]; + static const VkPipelineDynamicStateCreateInfo dynamicState; + // One sample + static const VkPipelineMultisampleStateCreateInfo multisampleState; + // One viewport + static const VkPipelineViewportStateCreateInfo viewportState; + static const VkPipelineRasterizationStateCreateInfo rasterizationCreateInfo; + + static const VkPipelineVertexInputStateCreateInfo m_pLayoutHair; + // Full screen quad layout structure + static const VkPipelineVertexInputStateCreateInfo m_pLayoutQuad; + + // Triangles list + static const VkPipelineInputAssemblyStateCreateInfo inputAssemblyTriangle; + // Lines list + static const VkPipelineInputAssemblyStateCreateInfo inputAssemblyLine; + + static VkGraphicsPipelineCreateInfo getBasePipelineCreateInfo( + const VkPipelineVertexInputStateCreateInfo *vertex_input_state, + const VkPipelineDepthStencilStateCreateInfo *depth_stencil_state, + const VkPipelineColorBlendStateCreateInfo *color_blend_state, + const VkPipelineInputAssemblyStateCreateInfo *input_assembly, + const VkPipelineShaderStageCreateInfo *stages, VkPipelineLayout layout, + VkRenderPass render_pass, uint32_t subpass); + + static const VkPipelineDepthStencilStateCreateInfo DepthTestEnabledDesc; + // Enable depth test to use early z, disable depth write to make sure required layers + // won't be clipped out in early z + static const VkPipelineDepthStencilStateCreateInfo + DepthTestEnabledNoDepthWritesStencilWriteIncrementDesc; + static const VkPipelineDepthStencilStateCreateInfo + DepthTestDisabledStencilTestLessDSS; + static const VkPipelineDepthStencilStateCreateInfo + m_pDepthWriteEnabledStencilTestLess_DSS; + + // disable color write if there is no need for fragments counting + static const VkPipelineColorBlendStateCreateInfo ColorWritesOff; + static const VkPipelineColorBlendStateCreateInfo BlendStateBlendToBg; + static const VkPipelineColorBlendStateCreateInfo m_pDepthWritesToColor_BS; + static const VkPipelineColorBlendStateCreateInfo m_pResolveColor_BS; + static const VkPipelineColorBlendStateCreateInfo m_pSum_BS; + }; + + VkImageMemoryBarrier + getImageMemoryBarrier(VkImage image, VkAccessFlags srcMask, VkAccessFlags dstMask, + VkImageLayout oldLayout, VkImageLayout newLayout, + uint32_t layerCount, + VkImageAspectFlags aspect); } \ No newline at end of file