Blender V5.3
gl_query.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2020 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_vector.hh"
12
13#include "gpu_query.hh"
14
15#include <epoxy/gl.h>
16
17namespace blender::gpu {
18
19class GLQueryPool : public QueryPool {
20 private:
24 GPUQueryType type_;
26 GLenum gl_type_;
31 uint32_t query_issued_;
33 bool initialized_ = false;
34
35 public:
37
38 void init(GPUQueryType type) override;
39
40 void begin_query() override;
41 void end_query() override;
42
43 void get_occlusion_result(MutableSpan<uint32_t> r_values) override;
44};
45
46static inline GLenum to_gl(GPUQueryType type)
47{
48 if (type == GPU_QUERY_OCCLUSION) {
49 /* TODO(fclem): try with GL_ANY_SAMPLES_PASSED​. */
50 return GL_SAMPLES_PASSED;
51 }
52 BLI_assert(0);
53 return GL_SAMPLES_PASSED;
54}
55
56} // namespace blender::gpu
void get_occlusion_result(MutableSpan< uint32_t > r_values) override
Definition gl_query.cc:54
void end_query() override
Definition gl_query.cc:48
void begin_query() override
Definition gl_query.cc:36
void init(GPUQueryType type) override
Definition gl_query.cc:20
@ GPU_QUERY_OCCLUSION
Definition gpu_query.hh:18
GLenum to_gl(eGPUDataFormat format)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
unsigned int uint32_t
Definition BKE_text.h:81