This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/gpu/vulkan/vk_uniform_buffer.cc
Jeroen Bakker afd0ab5cce Vulkan: Initial VKUniformBuffer.
Only supports uploading data to a uniform buffer.
Requirement for push constants #104880.

Pull Request #105129
2023-02-23 14:51:34 +01:00

44 lines
771 B
C++

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2022 Blender Foundation. All rights reserved. */
/** \file
* \ingroup gpu
*/
#include "vk_uniform_buffer.hh"
#include "vk_context.hh"
namespace blender::gpu {
void VKUniformBuffer::update(const void *data)
{
VKContext &context = *VKContext::get();
if (!buffer_.is_allocated()) {
allocate(context);
}
buffer_.update(context, data);
}
void VKUniformBuffer::allocate(VKContext &context)
{
buffer_.create(context, size_in_bytes_, GPU_USAGE_STATIC, VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT);
}
void VKUniformBuffer::clear_to_zero()
{
}
void VKUniformBuffer::bind(int /*slot*/)
{
}
void VKUniformBuffer::bind_as_ssbo(int /*slot*/)
{
}
void VKUniformBuffer::unbind()
{
}
} // namespace blender::gpu