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

Method SetSampler

trinityal/src/Tr2ResourceSetAL.cpp:413–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413bool Tr2ResourceSetDescriptionAL::SetSampler( Tr2RenderContextEnum::ShaderType stage, uint32_t registerIndex, const Tr2SamplerStateAL& sampler )
414{
415 if( m_registerMap.samplerCount == 0 )
416 {
417 return false;
418 }
419 auto index = m_registerMap.samplers[stage][registerIndex];
420 if( index >= m_registerMap.samplerCount )
421 {
422 return false;
423 }
424 auto& resource = m_samplers[index];
425 if( resource.type == Sampler::SAMPLER && resource.sampler == sampler )
426 {
427 return false;
428 }
429 resource.sampler = sampler;
430 resource.type = Sampler::SAMPLER;
431 return true;
432}
433
434bool Tr2ResourceSetDescriptionAL::operator==( const Tr2ResourceSetDescriptionAL& other ) const
435{

Callers 6

ReadMethod · 0.45
DispatchMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
CreateMethod · 0.45

Calls

no outgoing calls

Tested by 3

TEST_FFunction · 0.36
TEST_FFunction · 0.36
CreateMethod · 0.36