Blender V4.3
blender::gpu::VKContext Class Reference

#include <vk_context.hh>

Inherits blender::gpu::Context, and blender::NonCopyable.

Public Member Functions

 VKContext (void *ghost_window, void *ghost_context, render_graph::VKResourceStateTracker &resources)
 
virtual ~VKContext ()
 
void activate () override
 
void deactivate () override
 
void begin_frame () override
 
void end_frame () override
 
void flush () override
 
void flush_render_graph ()
 
void finish () override
 
void memory_statistics_get (int *r_total_mem_kb, int *r_free_mem_kb) override
 
void debug_group_begin (const char *, int) override
 
void debug_group_end () override
 
bool debug_capture_begin (const char *title) override
 
void debug_capture_end () override
 
void * debug_capture_scope_create (const char *name) override
 
bool debug_capture_scope_begin (void *scope) override
 
void debug_capture_scope_end (void *scope) override
 
void sync_backbuffer ()
 
State manager
void debug_unbind_all_ubo () override
 
void debug_unbind_all_ssbo () override
 
VKDescriptorPoolsdescriptor_pools_get ()
 
VKDescriptorSetTrackerdescriptor_set_get ()
 
VKStateManagerstate_manager_get () const
 
Frame-buffer
bool has_active_framebuffer () const
 
void activate_framebuffer (VKFrameBuffer &framebuffer)
 
void deactivate_framebuffer ()
 
VKFrameBufferactive_framebuffer_get () const
 
void rendering_end ()
 
- Public Member Functions inherited from blender::gpu::Context
 Context ()
 
virtual ~Context ()
 
bool is_active_on_thread ()
 

Static Public Member Functions

static VKContextget ()
 
- Static Public Member Functions inherited from blender::gpu::Context
static Contextget ()
 

Public Attributes

render_graph::VKRenderGraph render_graph
 
- Public Attributes inherited from blender::gpu::Context
Shadershader = nullptr
 
FrameBufferactive_fb = nullptr
 
GPUMatrixStatematrix_state = nullptr
 
StateManagerstate_manager = nullptr
 
Immediateimm = nullptr
 
ShaderCompilercompiler = nullptr
 
FrameBufferback_left = nullptr
 
FrameBufferfront_left = nullptr
 
FrameBufferback_right = nullptr
 
FrameBufferfront_right = nullptr
 
DebugStack debug_stack
 
bool debug_is_capturing = false
 
int context_id = 0
 
GPUStorageBuf * printf_buf = nullptr
 

Pipeline

render_graph::VKResourceAccessInforeset_and_get_access_info ()
 
void update_pipeline_data (render_graph::VKPipelineData &r_pipeline_data)
 
void update_pipeline_data (GPUPrimType primitive, VKVertexAttributeObject &vao, render_graph::VKPipelineData &r_pipeline_data)
 

Graphics pipeline

static void swap_buffers_pre_callback (const GHOST_VulkanSwapChainData *data)
 
static void swap_buffers_post_callback ()
 

Additional Inherited Members

- Static Public Attributes inherited from blender::gpu::Context
static int context_counter = 0
 
- Protected Attributes inherited from blender::gpu::Context
pthread_t thread_
 
bool is_active_
 
void * ghost_window_
 

Detailed Description

Definition at line 29 of file vk_context.hh.

Constructor & Destructor Documentation

◆ VKContext()

◆ ~VKContext()

Member Function Documentation

◆ activate()

◆ activate_framebuffer()

◆ active_framebuffer_get()

VKFrameBuffer * blender::gpu::VKContext::active_framebuffer_get ( ) const

◆ begin_frame()

void blender::gpu::VKContext::begin_frame ( )
overridevirtual

Implements blender::gpu::Context.

Definition at line 134 of file vk_context.cc.

◆ deactivate()

void blender::gpu::VKContext::deactivate ( )
overridevirtual

◆ deactivate_framebuffer()

◆ debug_capture_begin()

bool blender::gpu::VKContext::debug_capture_begin ( const char * title)
overridevirtual

◆ debug_capture_end()

void blender::gpu::VKContext::debug_capture_end ( )
overridevirtual

◆ debug_capture_scope_begin()

bool blender::gpu::VKContext::debug_capture_scope_begin ( void * scope)
overridevirtual

◆ debug_capture_scope_create()

void * blender::gpu::VKContext::debug_capture_scope_create ( const char * name)
overridevirtual

Implements blender::gpu::Context.

Definition at line 65 of file vk_debug.cc.

◆ debug_capture_scope_end()

void blender::gpu::VKContext::debug_capture_scope_end ( void * scope)
overridevirtual

◆ debug_group_begin()

void blender::gpu::VKContext::debug_group_begin ( const char * name,
int  )
overridevirtual

◆ debug_group_end()

void blender::gpu::VKContext::debug_group_end ( )
overridevirtual

Reimplemented from blender::gpu::Context.

Definition at line 27 of file vk_debug.cc.

References blender::gpu::render_graph::VKRenderGraph::debug_group_end(), and render_graph.

◆ debug_unbind_all_ssbo()

void blender::gpu::VKContext::debug_unbind_all_ssbo ( )
overridevirtual

◆ debug_unbind_all_ubo()

void blender::gpu::VKContext::debug_unbind_all_ubo ( )
overridevirtual

◆ descriptor_pools_get()

VKDescriptorPools & blender::gpu::VKContext::descriptor_pools_get ( )

Definition at line 164 of file vk_context.cc.

◆ descriptor_set_get()

VKDescriptorSetTracker & blender::gpu::VKContext::descriptor_set_get ( )

Definition at line 169 of file vk_context.cc.

Referenced by flush_render_graph().

◆ end_frame()

void blender::gpu::VKContext::end_frame ( )
overridevirtual

Implements blender::gpu::Context.

Definition at line 136 of file vk_context.cc.

◆ finish()

void blender::gpu::VKContext::finish ( )
overridevirtual

Implements blender::gpu::Context.

Definition at line 152 of file vk_context.cc.

◆ flush()

void blender::gpu::VKContext::flush ( )
overridevirtual

Implements blender::gpu::Context.

Definition at line 138 of file vk_context.cc.

◆ flush_render_graph()

◆ get()

static VKContext * blender::gpu::VKContext::get ( )
inlinestatic

Definition at line 97 of file vk_context.hh.

References blender::gpu::Context::get().

Referenced by blender::gpu::VKDrawList::append(), blender::gpu::VKQueryPool::begin_query(), blender::gpu::VKFrameBuffer::bind(), blender::gpu::VKStorageBuffer::bind(), blender::gpu::VKUniformBuffer::bind(), blender::gpu::VKIndexBuffer::bind_as_ssbo(), blender::gpu::VKUniformBuffer::bind_as_ssbo(), blender::gpu::VKVertexBuffer::bind_as_ssbo(), blender::gpu::VKVertexBuffer::bind_as_texture(), blender::gpu::VKFrameBuffer::blit_to(), blender::gpu::VKFrameBuffer::clear(), blender::gpu::VKStorageBuffer::clear(), blender::gpu::VKTexture::clear(), blender::gpu::VKTexture::clear_depth_stencil(), blender::gpu::VKUniformBuffer::clear_to_zero(), blender::gpu::VKStorageBuffer::copy_sub(), blender::gpu::VKTexture::copy_to(), blender::gpu::VKBatch::draw(), blender::gpu::VKImmediate::end(), blender::gpu::VKQueryPool::end_query(), blender::gpu::VKIndexBuffer::ensure_updated(), blender::gpu::VKUniformBuffer::ensure_updated(), blender::gpu::VKTexture::generate_mipmap(), blender::gpu::VKQueryPool::get_occlusion_result(), blender::gpu::VKStateManager::issue_barrier(), blender::gpu::VKBatch::multi_draw_indirect(), blender::gpu::VKIndexBuffer::read(), blender::gpu::VKStorageBuffer::read(), blender::gpu::VKVertexBuffer::read(), blender::gpu::VKTexture::read_sub(), blender::gpu::VKFence::signal(), blender::gpu::VKFrameBuffer::subpass_transition_impl(), swap_buffers_post_callback(), swap_buffers_pre_callback(), blender::gpu::VKStorageBuffer::unbind(), blender::gpu::VKUniformBuffer::unbind(), blender::gpu::VKStorageBuffer::update(), blender::gpu::VKUniformBuffer::update(), blender::gpu::VKTexture::update_sub(), blender::gpu::VKPushConstants::update_uniform_buffer(), blender::gpu::VKVertexBuffer::upload_data(), blender::gpu::VKShader::VKShader(), blender::gpu::VKFence::wait(), and blender::gpu::VKFrameBuffer::~VKFrameBuffer().

◆ has_active_framebuffer()

bool blender::gpu::VKContext::has_active_framebuffer ( ) const

Definition at line 213 of file vk_context.cc.

References active_framebuffer_get().

Referenced by activate_framebuffer(), flush_render_graph(), and sync_backbuffer().

◆ memory_statistics_get()

void blender::gpu::VKContext::memory_statistics_get ( int * r_total_mem_kb,
int * r_free_mem_kb )
overridevirtual

◆ rendering_end()

void blender::gpu::VKContext::rendering_end ( )

Ensure that the active framebuffer isn't rendering.

Between vkCmdBeginRendering and vkCmdEndRendering the framebuffer is rendering. Dispatch and transfer commands cannot be called between these commands. They can call this method to ensure that the framebuffer is outside these calls.

Definition at line 228 of file vk_context.cc.

References active_framebuffer_get(), and blender::gpu::VKFrameBuffer::rendering_end().

◆ reset_and_get_access_info()

render_graph::VKResourceAccessInfo & blender::gpu::VKContext::reset_and_get_access_info ( )

◆ state_manager_get()

VKStateManager & blender::gpu::VKContext::state_manager_get ( ) const

◆ swap_buffers_post_callback()

void blender::gpu::VKContext::swap_buffers_post_callback ( )
static

Definition at line 305 of file vk_context.cc.

References BLI_assert, and get().

◆ swap_buffers_pre_callback()

void blender::gpu::VKContext::swap_buffers_pre_callback ( const GHOST_VulkanSwapChainData * data)
static

Definition at line 298 of file vk_context.cc.

References BLI_assert, and get().

◆ sync_backbuffer()

◆ update_pipeline_data() [1/2]

void blender::gpu::VKContext::update_pipeline_data ( GPUPrimType primitive,
VKVertexAttributeObject & vao,
render_graph::VKPipelineData & r_pipeline_data )

◆ update_pipeline_data() [2/2]

void blender::gpu::VKContext::update_pipeline_data ( render_graph::VKPipelineData & r_pipeline_data)

Update the give shader data with the current state of the context.

Definition at line 254 of file vk_context.cc.

References blender::gpu::VKShader::ensure_and_get_compute_pipeline(), blender::gpu::unwrap(), and update_pipeline_data().

Referenced by update_pipeline_data(), and update_pipeline_data().

Member Data Documentation

◆ render_graph

render_graph::VKRenderGraph blender::gpu::VKContext::render_graph

Definition at line 42 of file vk_context.hh.

Referenced by debug_group_begin(), debug_group_end(), and flush_render_graph().


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