Files
test2/source/blender/gpu/vulkan/vk_immediate.hh
Jeroen Bakker ddef26505b Vulkan: Remove legacy resource tracker
Before the render graph was introduced we relied on a submission
resource tracker that allowed to resuse resources in the next frame.
With the introduction of the render graph we slowly migrated the
resource tracking to the render graph and eventually also moved the
whole discard pools to the submission runner.

There was still one part that 'used' the legacy resource tracker, but
actually didn't as it never reused resources. This PR removes the
resource tracker and migrate the push constants to use the render graph
to update a single buffer per shader.

Pull Request: https://projects.blender.org/blender/blender/pulls/146627
2025-09-23 12:46:23 +02:00

53 lines
1.1 KiB
C++

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*
* Mimics old style OpenGL immediate mode drawing.
*/
#pragma once
#include "MEM_guardedalloc.h"
#include "gpu_immediate_private.hh"
#include "gpu_vertex_format_private.hh"
#include "vk_buffer.hh"
#include "vk_data_conversion.hh"
#include "vk_mem_alloc.h"
#include "vk_vertex_attribute_object.hh"
namespace blender::gpu {
class VKDevice;
/* Size of internal buffer. */
constexpr size_t DEFAULT_INTERNAL_BUFFER_SIZE = 4 * 1024 * 1024;
class VKImmediate : public Immediate {
private:
VKVertexAttributeObject vertex_attributes_;
VkDeviceSize buffer_offset_ = 0;
VkDeviceSize current_subbuffer_len_ = 0;
std::optional<VKBuffer> active_buffer_;
public:
uchar *begin() override;
void end() override;
friend class VKVertexAttributeObject;
private:
VKBufferWithOffset active_buffer() const;
VkDeviceSize buffer_bytes_free();
VKBuffer &ensure_space(VkDeviceSize bytes_needed, VkDeviceSize offset_alignment);
};
} // namespace blender::gpu