Gems/AtomTressFX/Code/Rendering/HairCommon.cpp
Data::Instance<RPI::ShaderResourceGroup> UtilityClass::CreateShaderResourceGroup(
                Data::Instance<RPI::Shader> shader,
                const char* shaderResourceGroupId,
                [[maybe_unused]] const char* moduleName)
            {
                Data::Instance<RPI::ShaderResourceGroup> srg = RPI::ShaderResourceGroup::Create(shader->GetAsset(), AZ::Name{ shaderResourceGroupId });
                if (!srg)
                {
                    AZ_Error(moduleName, false, "Failed to create shader resource group");
                    return nullptr;
                }
                return srg;
            }
//! Utility function to generate the Srg given the shader and the desired Srg name to be associated to.
//! If several shaders are sharing the same Srg (for example perView, perScene), it is enough to
//! create the Srg by associating it with a single shader and since the GPU signature and the data
//! are referring to the same shared description (preferable set in an [SrgDeclaration].aszli file)
//! The association with all shaders will work properly.
Utility function to generate the Srg given the shader and the desired Srg name to be associated to.
If several shaders are sharing the same Srg (for example perView, perScene), it is enough to
create the Srg by associating it with a single shader and since the GPU signature and the data
are referring to the same shared description (preferable set in an [SrgDeclaration].aszli file)
The association with all shaders will work properly.
Utility function to generate the Srg given the shader and the desired Srg name to be associated to . If several shaders are sharing the same Srg ( for example perView perScene ) it is enough to create the Srg by associating it with a single shader and since the GPU signature and the data are referring to the same shared description ( preferable set in an [ SrgDeclaration ] . aszli file ) The association with all shaders will work properly .
Data::Instance<RPI::ShaderResourceGroup> UtilityClass::CreateShaderResourceGroup(
                Data::Instance<RPI::Shader> shader,
                const char* shaderResourceGroupId,
                [[maybe_unused]] const char* moduleName)
            {
                Data::Instance<RPI::ShaderResourceGroup> srg = RPI::ShaderResourceGroup::Create(shader->GetAsset(), AZ::Name{ shaderResourceGroupId });
                if (!srg)
                {
                    AZ_Error(moduleName, false, "Failed to create shader resource group");
                    return nullptr;
                }
                return srg;
            }
Data :: Instance < RPI :: ShaderResourceGroup > UtilityClass :: CreateShaderResourceGroup ( Data :: Instance < RPI :: Shader > shader , const char * shaderResourceGroupId , [[ maybe_unused ]] const char * moduleName ) { Data :: Instance < RPI :: ShaderResourceGroup > srg = RPI :: ShaderResourceGroup :: Create ( shader -> GetAsset ( ) , AZ :: Name { shaderResourceGroupId } ) ; if ( ! srg ) { AZ_Error ( moduleName , false , " " ) ; return nullptr ; } return srg ; }
Utility function to generate the Srg given the shader and the desired Srg name to be associated to.
Utility function to generate the Srg given the shader and the desired Srg name to be associated to .