Blender
V3.3
source
blender
gpu
opengl
gl_query.hh
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later
2
* Copyright 2020 Blender Foundation. All rights reserved. */
3
8
#pragma once
9
10
#include "
BLI_vector.hh
"
11
12
#include "
gpu_query.hh
"
13
14
#include "
glew-mx.h
"
15
16
namespace
blender::gpu
{
17
18
class
GLQueryPool
:
public
QueryPool
{
19
private
:
21
Vector<GLuint, QUERY_MIN_LEN>
query_ids_;
23
GPUQueryType
type_;
25
GLenum gl_type_;
28
uint32_t
query_issued_;
30
bool
initialized_ =
false
;
31
32
public
:
33
~GLQueryPool
();
34
35
void
init
(
GPUQueryType
type
)
override
;
36
37
void
begin_query
()
override
;
38
void
end_query
()
override
;
39
40
void
get_occlusion_result
(
MutableSpan<uint32_t>
r_values)
override
;
41
};
42
43
static
inline
GLenum
to_gl
(
GPUQueryType
type
)
44
{
45
if
(
type
==
GPU_QUERY_OCCLUSION
) {
46
/* TODO(fclem): try with GL_ANY_SAMPLES_PASSED​. */
47
return
GL_SAMPLES_PASSED;
48
}
49
BLI_assert
(0);
50
return
GL_SAMPLES_PASSED;
51
}
52
53
}
// namespace blender::gpu
BLI_assert
#define BLI_assert(a)
Definition:
BLI_assert.h:46
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:151
blender::MutableSpan
Definition:
BLI_span.hh:457
blender::Vector< GLuint, QUERY_MIN_LEN >
blender::gpu::GLQueryPool
Definition:
gl_query.hh:18
blender::gpu::GLQueryPool::get_occlusion_result
void get_occlusion_result(MutableSpan< uint32_t > r_values) override
Definition:
gl_query.cc:53
blender::gpu::GLQueryPool::end_query
void end_query() override
Definition:
gl_query.cc:47
blender::gpu::GLQueryPool::begin_query
void begin_query() override
Definition:
gl_query.cc:35
blender::gpu::GLQueryPool::~GLQueryPool
~GLQueryPool()
Definition:
gl_query.cc:14
blender::gpu::GLQueryPool::init
void init(GPUQueryType type) override
Definition:
gl_query.cc:19
blender::gpu::QueryPool
Definition:
gpu_query.hh:20
glew-mx.h
gpu_query.hh
blender::gpu
Definition:
gpu_backend.hh:15
blender::gpu::GPUQueryType
GPUQueryType
Definition:
gpu_query.hh:16
blender::gpu::GPU_QUERY_OCCLUSION
@ GPU_QUERY_OCCLUSION
Definition:
gpu_query.hh:17
blender::gpu::to_gl
static GLenum to_gl(const GPUAttachmentType type)
Definition:
gl_framebuffer.hh:116
uint32_t
unsigned int uint32_t
Definition:
stdint.h:80
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1