| 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 | { |
no test coverage detected