Files
test2/source/blender/gpu/vulkan/vk_query.hh
Jeroen Bakker 7a7ae5defe Vulkan: Occlusion Queries
Implements occlusion queries using VkQueryPools.

Pull Request: https://projects.blender.org/blender/blender/pulls/123883
2024-08-20 11:27:33 +02:00

39 lines
724 B
C++

/* SPDX-FileCopyrightText: 2022 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "BLI_vector.hh"
#include "gpu_query.hh"
#include "vk_common.hh"
namespace blender::gpu {
class VKQueryPool : public QueryPool {
const uint32_t query_chunk_len_ = 256;
Vector<VkQueryPool> vk_query_pools_;
VkQueryType vk_query_type_;
uint32_t queries_issued_ = 0;
protected:
~VKQueryPool();
public:
void init(GPUQueryType type) override;
void begin_query() override;
void end_query() override;
void get_occlusion_result(MutableSpan<uint32_t> r_values) override;
private:
uint32_t query_index_in_pool() const;
};
} // namespace blender::gpu