37 struct VertexDescriptorShaderInterfacePair {
49 class MTLVertexDescriptorCache {
60 VertexDescriptorShaderInterfacePair *find(
const ShaderInterface *interface);
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 bool shader_in_use_ =
false;
72 MTLVertexDescriptorCache vao_cache = {
this};
77 uint32_t topology_buffer_input_v_count_ = 0;
78 uint32_t topology_buffer_output_v_count_ = 0;
84 void draw(
int v_first,
int v_count,
int i_first,
int i_count)
override;
96 id<MTLRenderCommandEncoder>
bind(
uint v_count);
97 void unbind(id<MTLRenderCommandEncoder> rec);
110 return static_cast<MTLVertBuf *
>(inst[index]);
114 return active_shader_;
119 void draw_advanced(
int v_first,
int v_count,
int i_first,
int i_count);
120 void draw_advanced_indirect(GPUStorageBuf *indirect_buf,
intptr_t offset);
127 id<MTLBuffer> get_emulated_toplogy_buffer(
GPUPrimType &in_out_prim_type,
uint32_t &v_count);
129 void prepare_vertex_descriptor_and_bindings(
MTLVertBuf **
buffers,
int &num_buffers);
131 MEM_CXX_CLASS_ALLOC_FUNCS(
"MTLBatch");