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

Function EnableVertexStream

engine/graphics/src/null/graphics_null.cpp:625–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623 }
624
625 static void EnableVertexStream(HContext _context, uint32_t binding_index, uint16_t stream, uint16_t size, Type type, uint16_t stride, const void* vertex_buffer)
626 {
627 assert(_context);
628 assert(vertex_buffer);
629
630 NullContext* context = (NullContext*) _context;
631
632 VertexStreamBufferList& stream_list = context->m_VertexStreams[binding_index];
633
634 if (stream >= stream_list.Size())
635 {
636 stream_list.SetCapacity(stream + 1);
637
638 VertexStreamBuffer default_stream = {};
639 uint32_t old_size = stream_list.Size();
640 stream_list.SetSize(stream + 1);
641
642 for (uint32_t i = old_size; i < stream_list.Size(); ++i)
643 {
644 stream_list[i] = default_stream;
645 }
646 }
647
648 VertexStreamBuffer& s = stream_list[stream];
649 assert(s.m_Source == 0x0);
650 assert(s.m_Buffer == 0x0);
651 s.m_Source = vertex_buffer;
652 s.m_Size = size * TYPE_SIZE[type - dmGraphics::TYPE_BYTE];
653 s.m_Stride = stride;
654 }
655
656 static void DisableVertexStream(HContext context, uint32_t binding_index, uint16_t stream)
657 {

Callers 1

EnableVertexDeclarationFunction · 0.85

Calls 4

assertFunction · 0.50
SizeMethod · 0.45
SetCapacityMethod · 0.45
SetSizeMethod · 0.45

Tested by

no test coverage detected