VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
metalVertexBufferLayout.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Created by Arnis Lektauers on 14.11.2025.
5//
6#pragma once
7
8#include <memory>
9#include <unordered_map>
10#include <vector>
11
13
14namespace visutwin::canvas
15{
24 {
25 public:
29 std::vector<void*> get(const std::shared_ptr<VertexFormat>& vertexFormat0,
30 const std::shared_ptr<VertexFormat>& vertexFormat1 = nullptr);
31
32 private:
36 std::string getKey(const std::shared_ptr<VertexFormat>& vertexFormat0,
37 const std::shared_ptr<VertexFormat>& vertexFormat1) const;
38
48 std::vector<void*> create(const std::shared_ptr<VertexFormat>& vertexFormat0,
49 const std::shared_ptr<VertexFormat>& vertexFormat1 = nullptr);
50
51 // Cache of vertex buffer layouts keyed by a format combination
52 std::unordered_map<std::string, std::vector<void*>> _cache;
53 };
54}
std::vector< void * > get(const std::shared_ptr< VertexFormat > &vertexFormat0, const std::shared_ptr< VertexFormat > &vertexFormat1=nullptr)