uint32_t vc4_gem_hindex(struct vc4_context *vc4, struct vc4_bo *bo) { uint32_t hindex; uint32_t *current_handles = vc4->bo_handles.base; for (hindex = 0; hindex < (vc4->bo_handles.next - vc4->bo_handles.base) / 4; hindex++) { if (current_handles[hindex] == bo->handle) return hindex; } cl_u32(&vc4->bo_handles, bo->handle); cl_ptr(&vc4->bo_pointers, vc4_bo_reference(bo)); return hindex; }
uint32_t vc4_gem_hindex(struct vc4_context *vc4, struct vc4_bo *bo) { uint32_t hindex; uint32_t *current_handles = vc4->bo_handles.base; for (hindex = 0; hindex < cl_offset(&vc4->bo_handles) / 4; hindex++) { if (current_handles[hindex] == bo->handle) return hindex; } struct vc4_cl_out *out; out = cl_start(&vc4->bo_handles); cl_u32(&out, bo->handle); cl_end(&vc4->bo_handles, out); out = cl_start(&vc4->bo_pointers); cl_ptr(&out, vc4_bo_reference(bo)); cl_end(&vc4->bo_pointers, out); return hindex; }