36 struct VertexDescriptorShaderInterfacePair {
45 uint32_t cache_life_index = 0;
48 class MTLVertexDescriptorCache {
55 uint32_t cache_life_index_ = 0;
60 bool insert(VertexDescriptorShaderInterfacePair &
data);
63 void vertex_descriptor_cache_init(
MTLContext *ctx);
64 void vertex_descriptor_cache_clear();
65 void vertex_descriptor_cache_ensure();
70 MTLVertexDescriptorCache vao_cache = {
this};
75 uint32_t topology_buffer_input_v_count_ = 0;
76 uint32_t topology_buffer_output_v_count_ = 0;
82 void draw(
int v_first,
int v_count,
int i_first,
int i_count)
override;
94 id<MTLRenderCommandEncoder>
bind();
95 void unbind(id<MTLRenderCommandEncoder> rec);
108 return active_shader_;
112 void draw_advanced(
int v_first,
int v_count,
int i_first,
int i_count);
113 void draw_advanced_indirect(
StorageBuf *indirect_buf, intptr_t offset);
117 uint16_t &attr_mask);
119 id<MTLBuffer> get_emulated_toplogy_buffer(
GPUPrimType &in_out_prim_type, uint32_t &v_count);
121 void prepare_vertex_descriptor_and_bindings(
MTLVertBuf **
buffers,
int &num_buffers);
123 MEM_CXX_CLASS_ALLOC_FUNCS(
"MTLBatch");