This PR adds support for `GPU_unpack_row_length_set` to the vulkan backend. Texture unpacking is used when uploading a part of a texture from host memory to device memory. Pull Request: https://projects.blender.org/blender/blender/pulls/107360
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright 2023 Blender Foundation */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*/
|
|
|
|
#include "vk_state_manager.hh"
|
|
#include "vk_texture.hh"
|
|
|
|
namespace blender::gpu {
|
|
void VKStateManager::apply_state() {}
|
|
|
|
void VKStateManager::force_state() {}
|
|
|
|
void VKStateManager::issue_barrier(eGPUBarrier /*barrier_bits*/)
|
|
{
|
|
VKContext &context = *VKContext::get();
|
|
VKCommandBuffer &command_buffer = context.command_buffer_get();
|
|
/* TODO: Pipeline barriers should be added. We might be able to extract it from
|
|
* the actual pipeline, later on, but for now we submit the work as barrier. */
|
|
command_buffer.submit();
|
|
}
|
|
|
|
void VKStateManager::texture_bind(Texture * /*tex*/, GPUSamplerState /*sampler*/, int /*unit*/) {}
|
|
|
|
void VKStateManager::texture_unbind(Texture * /*tex*/) {}
|
|
|
|
void VKStateManager::texture_unbind_all() {}
|
|
|
|
void VKStateManager::image_bind(Texture *tex, int binding)
|
|
{
|
|
VKTexture *texture = unwrap(tex);
|
|
texture->image_bind(binding);
|
|
}
|
|
|
|
void VKStateManager::image_unbind(Texture * /*tex*/) {}
|
|
|
|
void VKStateManager::image_unbind_all() {}
|
|
|
|
void VKStateManager::texture_unpack_row_length_set(uint len)
|
|
{
|
|
texture_unpack_row_length_ = len;
|
|
}
|
|
|
|
uint VKStateManager::texture_unpack_row_length_get() const
|
|
{
|
|
return texture_unpack_row_length_;
|
|
}
|
|
|
|
} // namespace blender::gpu
|