MCPcopy Create free account
hub / github.com/carbonengine/trinity / ApplyMaterialDataForRtState

Method ApplyMaterialDataForRtState

trinity/Shader/Tr2Material.cpp:568–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566}
567
568void Tr2Material::ApplyMaterialDataForRtState( uint32_t techniqueIndex, const Tr2RtPipelineStateAL& rtPipelineState, Tr2RenderContext& renderContext ) const
569{
570 if( !m_shader )
571 {
572 return;
573 }
574 auto& pp = *m_parametersForPasses[techniqueIndex].libraries[0];
575
576 ApplyConstants( Tr2RenderContextEnum::COMPUTE_SHADER, pp.m_globalInput, !pp.m_reroutedParameters.empty(), renderContext );
577
578 bool descChanged = pp.m_globalResourceSetDirty;
579 descChanged |= UpdateResourceSetDesc( Tr2RenderContextEnum::COMPUTE_SHADER, pp.m_globalInput, pp.m_globalResourceSetDesc );
580
581 if( descChanged || !pp.m_globalResourceSet.IsValid() )
582 {
583 USE_MAIN_THREAD_RENDER_CONTEXT();
584 pp.m_globalResourceSet.Create( pp.m_globalResourceSetDesc, rtPipelineState, renderContext );
585 pp.m_globalResourceSetDirty = false;
586 }
587
588 renderContext.SetResourceSet( pp.m_globalResourceSet );
589}
590
591void Tr2Material::ApplyMaterialDataForRtMaterial( uint32_t techniqueIndex, Tr2RtLocalMaterialDescriptionAL& localMaterial, Tr2RenderContext& renderContext ) const
592{

Callers 3

RenderFogMethod · 0.80
RenderShadowsMethod · 0.80

Calls 4

emptyMethod · 0.80
IsValidMethod · 0.45
CreateMethod · 0.45
SetResourceSetMethod · 0.45

Tested by

no test coverage detected