/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ #include #include #include #include #include #include #include #include #include #include namespace AZ { namespace Render { namespace Hair { HairDispatchItem::~HairDispatchItem() { } // Reference in the code above that tackles handling of the different dispatches possible // This one is targeting the per vertex dispatches for now. 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.m_arguments = dispatchArgs; RHI::PipelineStateDescriptorForDispatch pipelineDesc; m_shader->GetVariant(RPI::ShaderAsset::RootShaderVariantStableId).ConfigurePipelineState(pipelineDesc); m_dispatchItem.m_pipelineState = m_shader->AcquirePipelineState(pipelineDesc); m_dispatchItem.m_shaderResourceGroupCount = 2; // the per pass will be added by each pass. m_dispatchItem.m_shaderResourceGroups = { hairGenerationSrg->GetRHIShaderResourceGroup(), // Static generation data hairSimSrg->GetRHIShaderResourceGroup() // Dynamic data changed between passes }; } } // namespace Hair } // namespace Render } // namespace AZ