MCPcopy Create free account
hub / github.com/defold/defold / SetTextureBindingByUnit

Function SetTextureBindingByUnit

engine/render/src/render/render.cpp:861–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859 }
860
861 void SetTextureBindingByUnit(HRenderContext render_context, uint32_t unit, dmGraphics::HTexture texture)
862 {
863 if (unit >= render_context->m_TextureBindTable.Size())
864 {
865 render_context->m_TextureBindTable.SetCapacity(unit + 1);
866
867 // Make sure new data area is zeroed out
868 uint32_t fill_index_start = render_context->m_TextureBindTable.Size();
869 uint32_t fill_size = render_context->m_TextureBindTable.Remaining() * sizeof(TextureBinding);
870
871 render_context->m_TextureBindTable.SetSize(render_context->m_TextureBindTable.Capacity());
872 memset(&render_context->m_TextureBindTable[fill_index_start], 0, fill_size);
873 }
874
875 render_context->m_TextureBindTable[unit].m_Texture = texture;
876 render_context->m_TextureBindTable[unit].m_Samplerhash = 0;
877 }
878
879 static void TrimTextureBindingTable(HRenderContext render_context)
880 {

Callers 2

TEST_FFunction · 0.85
ParseCommandsFunction · 0.85

Calls 5

SizeMethod · 0.45
SetCapacityMethod · 0.45
RemainingMethod · 0.45
SetSizeMethod · 0.45
CapacityMethod · 0.45

Tested by 1

TEST_FFunction · 0.68