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

Method SetMaterialConstants

trinity/Tr2IndirectDrawBuffer.cpp:68–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void Tr2IndirectDrawBufferWriter::SetMaterialConstants( Tr2RenderContextEnum::ShaderType stage, const Tr2ConstantBufferAL& buffer )
69{
70 if( !HasMaterialConstants( stage ) )
71 {
72 return;
73 }
74#if TRINITY_PLATFORM == TRINITY_DIRECTX12
75 auto addr = m_renderContext.UploadConstants( buffer );
76 *reinterpret_cast<uint64_t*>( m_buffer + m_layout.m_materialOffsets[stage] ) = addr;
77#elif TRINITY_PLATFORM == TRINITY_METAL
78 auto addr = m_renderContext.UploadConstants( buffer );
79 m_buffer->material[stage] = addr;
80#endif
81}
82
83void Tr2IndirectDrawBufferWriter::SetPerObjectData( Tr2RenderContextEnum::ShaderType stage, const Tr2ConstantBufferAL& buffer )
84{

Callers 1

ApplyConstantBuffersMethod · 0.80

Calls 1

UploadConstantsMethod · 0.45

Tested by

no test coverage detected