1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include <Code/src/TressFX/TressFXCommon.h>
- #include <Rendering/HairDispatchItem.h>
- #include <Rendering/HairRenderObject.h>
- #include <Passes/HairSkinningComputePass.h>
- #include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
- #include <Atom/RPI.Public/Shader/Shader.h>
- #include <Atom/RPI.Public/Buffer/Buffer.h>
- #include <Atom/RHI/Factory.h>
- #include <Atom/RHI/DeviceBufferView.h>
- #include <limits>
- namespace AZ
- {
- namespace Render
- {
- namespace Hair
- {
- HairDispatchItem::~HairDispatchItem()
- {
- }
-
-
- void HairDispatchItem::InitSkinningDispatch(
- RPI::Shader* shader,
- RPI::ShaderResourceGroup* hairGenerationSrg,
- RPI::ShaderResourceGroup* hairSimSrg,
- uint32_t elementsAmount )
- {
- m_shader = shader;
- RHI::DispatchDirect dispatchArgs(
- elementsAmount, 1, 1,
- TRESSFX_SIM_THREAD_GROUP_SIZE, 1, 1
- );
- m_dispatchItem.SetArguments(dispatchArgs);
- RHI::PipelineStateDescriptorForDispatch pipelineDesc;
- m_shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId).ConfigurePipelineState(pipelineDesc);
- m_dispatchItem.SetPipelineState(m_shader->AcquirePipelineState(pipelineDesc));
- AZStd::array<const RHI::ShaderResourceGroup*, 2> srgs{
- hairGenerationSrg->GetRHIShaderResourceGroup(),
- hairSimSrg->GetRHIShaderResourceGroup()
- };
- m_dispatchItem.SetShaderResourceGroups(srgs);
- }
- }
- }
- }
|