KiCad PCB EDA Suite
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2016-2017 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Maciej Suminski <[email protected]>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef __OPENGL_UTILS_H
23#define __OPENGL_UTILS_H
24
25#include <gal/gal.h>
26
27#include <cstddef>
28#include <string>
29
41int checkGlError( const std::string& aInfo, const char* aFile, int aLine, bool aThrow = true );
42
48void enableGlDebug( bool aEnable );
49
50
51namespace KIGFX
52{
53
63
73
86GAL_API VRAM_RESIZE_STRATEGY chooseResizeStrategy( size_t aFreeVRAM, size_t aOldBytes,
87 size_t aNewBytes, double aMarginFrac );
88
89} // namespace KIGFX
90
91#endif /* __OPENGL_ERROR_H */
#define GAL_API
Definition gal.h:27
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29
VRAM_RESIZE_STRATEGY
Strategy for growing a GPU vertex buffer, trading copy speed against peak video memory.
Definition utils.h:58
@ REFUSE
Neither path fits; the caller should fall back to software rendering.
Definition utils.h:61
@ GPU_COPY
Fast GPU-side copy; the old and new buffers are briefly co-resident.
Definition utils.h:59
@ RAM_STAGE
Stage through host memory so only the larger of the two buffers is resident.
Definition utils.h:60
VRAM_RESIZE_STRATEGY chooseResizeStrategy(size_t aFreeVRAM, size_t aOldBytes, size_t aNewBytes, double aMarginFrac)
Decide how to grow a GPU vertex buffer given the free video memory budget.
Definition utils.cpp:234
size_t queryFreeVideoMemoryBytes()
Query the amount of free video memory the driver reports.
Definition utils.cpp:204
VRAM_RESIZE_STRATEGY
Strategy for growing a GPU vertex buffer, trading copy speed against peak video memory.
Definition utils.h:58
void enableGlDebug(bool aEnable)
Enable or disable OpenGL driver messages output.
Definition utils.cpp:187
int checkGlError(const std::string &aInfo, const char *aFile, int aLine, bool aThrow=true)
Check if a recent OpenGL operation has failed.
Definition utils.cpp:44