Blender
V2.93
source
blender
gpu
opengl
gl_query.hh
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*
16
* Copyright 2020, Blender Foundation.
17
* All rights reserved.
18
*/
19
24
#pragma once
25
26
#include "
BLI_vector.hh
"
27
28
#include "
gpu_query.hh
"
29
30
#include "
glew-mx.h
"
31
32
namespace
blender::gpu
{
33
34
class
GLQueryPool
:
public
QueryPool
{
35
private
:
37
Vector<GLuint>
query_ids_;
39
GPUQueryType
type_;
41
GLenum gl_type_;
44
uint32_t
query_issued_;
46
bool
initialized_ =
false
;
47
48
public
:
49
~GLQueryPool
();
50
51
void
init
(
GPUQueryType
type
)
override
;
52
53
void
begin_query
(
void
)
override
;
54
void
end_query
(
void
)
override
;
55
56
void
get_occlusion_result
(
MutableSpan<uint32_t>
r_values)
override
;
57
};
58
59
static
inline
GLenum
to_gl
(
GPUQueryType
type
)
60
{
61
if
(
type
==
GPU_QUERY_OCCLUSION
) {
62
/* TODO(fclem): try with GL_ANY_SAMPLES_PASSED​. */
63
return
GL_SAMPLES_PASSED;
64
}
65
BLI_assert
(0);
66
return
GL_SAMPLES_PASSED;
67
}
68
69
}
// namespace blender::gpu
BLI_assert
#define BLI_assert(a)
Definition:
BLI_assert.h:58
BLI_vector.hh
type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Definition:
GPU_legacy_stubs.h:167
blender::MutableSpan
Definition:
BLI_span.hh:470
blender::Vector< GLuint >
blender::gpu::GLQueryPool
Definition:
gl_query.hh:34
blender::gpu::GLQueryPool::get_occlusion_result
void get_occlusion_result(MutableSpan< uint32_t > r_values) override
Definition:
gl_query.cc:68
blender::gpu::GLQueryPool::end_query
void end_query(void) override
Definition:
gl_query.cc:62
blender::gpu::GLQueryPool::~GLQueryPool
~GLQueryPool()
Definition:
gl_query.cc:30
blender::gpu::GLQueryPool::init
void init(GPUQueryType type) override
Definition:
gl_query.cc:35
blender::gpu::GLQueryPool::begin_query
void begin_query(void) override
Definition:
gl_query.cc:51
blender::gpu::QueryPool
Definition:
gpu_query.hh:34
glew-mx.h
gpu_query.hh
blender::gpu
Definition:
gpu_backend.hh:29
blender::gpu::GPUQueryType
GPUQueryType
Definition:
gpu_query.hh:30
blender::gpu::GPU_QUERY_OCCLUSION
@ GPU_QUERY_OCCLUSION
Definition:
gpu_query.hh:31
blender::gpu::to_gl
static GLenum to_gl(const GPUAttachmentType type)
Definition:
gl_framebuffer.hh:121
uint32_t
unsigned int uint32_t
Definition:
stdint.h:83
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1