Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/opengl/gl_context.hh
| Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | public: | ||||
| Vector<GLuint> buffers; | Vector<GLuint> buffers; | ||||
| public: | public: | ||||
| void orphans_clear(void); | void orphans_clear(void); | ||||
| }; | }; | ||||
| class GLContext : public GPUContext { | class GLContext : public GPUContext { | ||||
| public: | public: | ||||
| /** Capabilities. */ | |||||
| static GLint max_texture_3d_size; | |||||
| static GLint max_cubemap_size; | |||||
| static GLint max_ubo_size; | |||||
| static GLint max_ubo_binds; | |||||
| /** Extensions. */ | |||||
| static bool base_instance_support; | |||||
| static bool texture_cube_map_array_support; | |||||
| /** Workarounds. */ | |||||
| static bool texture_copy_workaround; | |||||
| static bool unused_fb_slot_workaround; | |||||
| static float derivative_signs[2]; | |||||
| /** Used for debugging purpose. Bitflags of all bound slots. */ | /** Used for debugging purpose. Bitflags of all bound slots. */ | ||||
| uint16_t bound_ubo_slots; | uint16_t bound_ubo_slots; | ||||
| /* TODO(fclem) these needs to become private. */ | /* TODO(fclem) these needs to become private. */ | ||||
| public: | public: | ||||
| /** VBO for missing vertex attrib binding. Avoid undefined behavior on some implementation. */ | /** VBO for missing vertex attrib binding. Avoid undefined behavior on some implementation. */ | ||||
| GLuint default_attr_vbo_; | GLuint default_attr_vbo_; | ||||
| /** | /** | ||||
| Show All 13 Lines | |||||
| public: | public: | ||||
| GLContext(void *ghost_window, GLSharedOrphanLists &shared_orphan_list); | GLContext(void *ghost_window, GLSharedOrphanLists &shared_orphan_list); | ||||
| ~GLContext(); | ~GLContext(); | ||||
| static void check_error(const char *info); | static void check_error(const char *info); | ||||
| void activate(void) override; | void activate(void) override; | ||||
| void deactivate(void) override; | void deactivate(void) override; | ||||
| void memory_statistics_get(int *total_mem, int *free_mem) override; | |||||
| static inline GLStateManager *state_manager_active_get() | static inline GLStateManager *state_manager_active_get() | ||||
| { | { | ||||
| GLContext *ctx = static_cast<GLContext *>(GPU_context_active_get()); | GLContext *ctx = static_cast<GLContext *>(GPU_context_active_get()); | ||||
| return static_cast<GLStateManager *>(ctx->state_manager); | return static_cast<GLStateManager *>(ctx->state_manager); | ||||
| }; | }; | ||||
| /* These need to be called with the context the id was created with. */ | |||||
| void vao_free(GLuint vao_id); | |||||
| void fbo_free(GLuint fbo_id); | |||||
| /* These can be called by any threads even without OpenGL ctx. Deletion will be delayed. */ | |||||
| static void buf_free(GLuint buf_id); | |||||
| static void tex_free(GLuint tex_id); | |||||
| /* TODO(fclem) these needs to become private. */ | /* TODO(fclem) these needs to become private. */ | ||||
| public: | public: | ||||
| void orphans_add(Vector<GLuint> &orphan_list, std::mutex &list_mutex, GLuint id); | static void orphans_add(Vector<GLuint> &orphan_list, std::mutex &list_mutex, GLuint id); | ||||
| void orphans_clear(void); | void orphans_clear(void); | ||||
| void vao_free(GLuint vao_id); | |||||
| void fbo_free(GLuint fbo_id); | |||||
| void vao_cache_register(GLVaoCache *cache); | void vao_cache_register(GLVaoCache *cache); | ||||
| void vao_cache_unregister(GLVaoCache *cache); | void vao_cache_unregister(GLVaoCache *cache); | ||||
| }; | }; | ||||
| } // namespace gpu | } // namespace gpu | ||||
| } // namespace blender | } // namespace blender | ||||