Blender V4.5
blender::gpu::VKThreadData Class Reference

#include <vk_device.hh>

Inherits blender::NonCopyable, and blender::NonMovable.

Public Member Functions

VKResourcePoolresource_pool_get ()
void resource_pool_next ()
VKThreadData
 VKThreadData (VKDevice &device, pthread_t thread_id)
Public Member Functions inherited from blender::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
NonCopyableoperator= (const NonCopyable &other)=delete
 NonCopyable ()=default
 NonCopyable (NonCopyable &&other)=default
NonCopyableoperator= (NonCopyable &&other)=default

Public Attributes

pthread_t thread_id
uint32_t resource_pool_index = UINT32_MAX
std::array< VKResourcePool, resource_pools_count > resource_pools
int32_t rendering_depth = 0

Detailed Description

Shared resources between contexts that run in the same thread.

Definition at line 109 of file vk_device.hh.

Constructor & Destructor Documentation

◆ VKThreadData()

blender::gpu::VKThreadData::VKThreadData ( VKDevice & device,
pthread_t thread_id )

Definition at line 507 of file vk_device.cc.

References resource_pools, and thread_id.

Member Function Documentation

◆ resource_pool_get()

VKResourcePool & blender::gpu::VKThreadData::resource_pool_get ( )
inline

Get the active resource pool.

Definition at line 144 of file vk_device.hh.

References resource_pool_index, and resource_pools.

◆ resource_pool_next()

void blender::gpu::VKThreadData::resource_pool_next ( )
inline

Activate the next resource pool.

Definition at line 153 of file vk_device.hh.

References resource_pool_index, and UINT32_MAX.

Referenced by blender::gpu::VKContext::sync_backbuffer().

Member Data Documentation

◆ rendering_depth

int32_t blender::gpu::VKThreadData::rendering_depth = 0

The current rendering depth.

GPU_rendering_begin can be called multiple times forming a hierarchy. The same resource pool should be used for the whole hierarchy. rendering_depth is increased for every GPU_rendering_begin and decreased when GPU_rendering_end is called. Resources pools are cycled when the rendering_depth set to 0.

Definition at line 137 of file vk_device.hh.

Referenced by blender::gpu::VKBackend::render_begin(), and blender::gpu::VKBackend::render_end().

◆ resource_pool_index

uint32_t blender::gpu::VKThreadData::resource_pool_index = UINT32_MAX

Index of the active resource pool. Is in sync with the active swap chain image or cycled when rendering.

NOTE: Initialized to UINT32_MAX to detect first change.

Definition at line 126 of file vk_device.hh.

Referenced by resource_pool_get(), and resource_pool_next().

◆ resource_pools

std::array<VKResourcePool, resource_pools_count> blender::gpu::VKThreadData::resource_pools

Definition at line 127 of file vk_device.hh.

Referenced by resource_pool_get(), and VKThreadData().

◆ thread_id

pthread_t blender::gpu::VKThreadData::thread_id

Thread ID this instance belongs to.

Definition at line 119 of file vk_device.hh.

Referenced by VKThreadData().


The documentation for this class was generated from the following files: