Gems/AtomTressFX/Code/Rendering/HairDispatchItem.cpp
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
                };
            }
// Reference in the code above that tackles handling of the different dispatches possible
// This one is targeting the per vertex dispatches for now.
Reference in the code above that tackles handling of the different dispatches possible
This one is targeting the per vertex dispatches for now.
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;      
                m_dispatchItem.m_shaderResourceGroups = {
                    hairGenerationSrg->GetRHIShaderResourceGroup(), 
                    hairSimSrg->GetRHIShaderResourceGroup()         
                };
            }
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 ; m_dispatchItem . m_shaderResourceGroups = { hairGenerationSrg -> GetRHIShaderResourceGroup ( ) , hairSimSrg -> GetRHIShaderResourceGroup ( ) } ; }
Reference in the code above that tackles handling of the different dispatches possible
This one is targeting the per vertex dispatches for now.
Reference in the code above that tackles handling of the different dispatches possible This one is targeting the per vertex dispatches for now .
// the per pass will be added by each pass. // Static generation data // Dynamic data changed between passes