This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/gawain/buffer_id.h
Mike Erwin 328a47fa2c Gawain: manage GL buffer IDs in a thread-safe way
Needed because deps graph can destroy objects from any thread. We ran into the same problem & solved it in GPU_buffers.

Implemented in C++11 since it provides the needed machinery. The interface is in C like the rest of Gawain.
2016-11-29 00:03:54 -05:00

35 lines
780 B
C++

// Gawain buffer IDs
//
// This code is part of the Gawain library, with modifications
// specific to integration with Blender.
//
// Copyright 2016 Mike Erwin
//
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
// the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
#pragma once
// Manage GL buffer IDs in a thread-safe way
// Use these instead of glGenBuffers & its friends
// - alloc must be called from main thread
// - free can be called from any thread
#ifdef __cplusplus
extern "C" {
#endif
#include "common.h"
GLuint buffer_id_alloc(void);
void buffer_id_free(GLuint buffer_id);
GLuint vao_id_alloc(void);
void vao_id_free(GLuint vao_id);
#ifdef __cplusplus
}
#endif