37 struct VertexDescriptorShaderInterfacePair {
46 uint32_t cache_life_index = 0;
49 class MTLVertexDescriptorCache {
56 uint32_t cache_life_index_ = 0;
61 bool insert(VertexDescriptorShaderInterfacePair &
data);
64 void vertex_descriptor_cache_init(
MTLContext *ctx);
65 void vertex_descriptor_cache_clear();
66 void vertex_descriptor_cache_ensure();
71 MTLVertexDescriptorCache vao_cache = {
this};
76 uint32_t topology_buffer_input_v_count_ = 0;
77 uint32_t topology_buffer_output_v_count_ = 0;
83 void draw(
int v_first,
int v_count,
int i_first,
int i_count)
override;
84 void draw_indirect(GPUStorageBuf *indirect_buf, intptr_t offset)
override;
95 id<MTLRenderCommandEncoder>
bind();
96 void unbind(id<MTLRenderCommandEncoder> rec);
109 return static_cast<MTLVertBuf *
>(inst[index]);
113 return active_shader_;
117 void draw_advanced(
int v_first,
int v_count,
int i_first,
int i_count);
118 void draw_advanced_indirect(GPUStorageBuf *indirect_buf, intptr_t offset);
125 id<MTLBuffer> get_emulated_toplogy_buffer(
GPUPrimType &in_out_prim_type, uint32_t &v_count);
127 void prepare_vertex_descriptor_and_bindings(
MTLVertBuf **
buffers,
int &num_buffers);
129 MEM_CXX_CLASS_ALLOC_FUNCS(
"MTLBatch");