|
Blender V4.5
|
#include <vk_context.hh>
Inherits blender::gpu::Context, and blender::NonCopyable.
Static Public Member Functions | |
| static VKContext * | get () |
| Static Public Member Functions inherited from blender::gpu::Context | |
| static Context * | get () |
Public Attributes | |
| VKDiscardPool | discard_pool |
| Public Attributes inherited from blender::gpu::Context | |
| Shader * | shader = nullptr |
| FrameBuffer * | active_fb = nullptr |
| GPUMatrixState * | matrix_state = nullptr |
| StateManager * | state_manager = nullptr |
| Immediate * | imm = nullptr |
| FrameBuffer * | back_left = nullptr |
| FrameBuffer * | front_left = nullptr |
| FrameBuffer * | back_right = nullptr |
| FrameBuffer * | front_right = nullptr |
| DebugStack | debug_stack |
| bool | debug_is_capturing = false |
| int | context_id = 0 |
| Vector< GPUStorageBuf * > | printf_buf |
| VertBuf * | dummy_vbo = nullptr |
| Batch * | procedural_points_batch = nullptr |
| Batch * | procedural_lines_batch = nullptr |
| Batch * | procedural_triangles_batch = nullptr |
| Batch * | procedural_triangle_strips_batch = nullptr |
| TexturePool * | texture_pool = nullptr |
| int | shader_builtin_srgb_transform = 0 |
| bool | shader_builtin_srgb_is_dirty = false |
Friends | |
| class | VKDevice |
Graphics pipeline | |
| void | specialization_constants_set (const shader::SpecializationConstants *constants_state) |
| static void | swap_buffers_pre_callback (const GHOST_VulkanSwapChainData *data) |
| static void | swap_buffers_post_callback () |
OpenXR | |
| static void | openxr_acquire_framebuffer_image_callback (GHOST_VulkanOpenXRData *data) |
| static void | openxr_release_framebuffer_image_callback (GHOST_VulkanOpenXRData *data) |
Pipeline | |
| render_graph::VKResourceAccessInfo & | reset_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) |
Additional Inherited Members | |
| Static Public Attributes inherited from blender::gpu::Context | |
| static int | context_counter = 0 |
| Protected Member Functions inherited from blender::gpu::Context | |
| void | free_resources () |
| Protected Attributes inherited from blender::gpu::Context | |
| pthread_t | thread_ |
| bool | is_active_ |
| void * | ghost_window_ |
Definition at line 40 of file vk_context.hh.
| blender::gpu::VKContext::VKContext | ( | void * | ghost_window, |
| void * | ghost_context ) |
Definition at line 25 of file vk_context.cc.
References blender::gpu::Context::active_fb, blender::gpu::Context::back_left, blender::gpu::Context::front_left, blender::gpu::Context::ghost_window_, blender::gpu::Context::imm, and blender::gpu::Context::state_manager.
Referenced by get(), openxr_acquire_framebuffer_image_callback(), openxr_release_framebuffer_image_callback(), swap_buffers_post_callback(), and swap_buffers_pre_callback().
|
virtual |
Definition at line 38 of file vk_context.cc.
References blender::gpu::Context::back_left, blender::gpu::VKDevice::context_unregister(), blender::gpu::VKBackend::device, blender::gpu::Context::free_resources(), blender::gpu::Context::front_left, blender::gpu::VKBackend::get(), GPU_FB_COLOR_ATTACHMENT0, GPU_texture_free(), blender::gpu::Context::imm, and VKDevice.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 101 of file vk_context.cc.
References BLI_assert, blender::gpu::VKDevice::current_thread_data(), blender::gpu::Context::debug_stack, blender::gpu::VKBackend::device, blender::gpu::VKBackend::get(), blender::gpu::debug::get_debug_group_color(), immActivate(), blender::gpu::Context::is_active_, blender::gpu::VKDevice::render_graph_new(), sync_backbuffer(), and VKDevice.
| void blender::gpu::VKContext::activate_framebuffer | ( | VKFrameBuffer & | framebuffer | ) |
| VKFrameBuffer * blender::gpu::VKContext::active_framebuffer_get | ( | ) | const |
Definition at line 249 of file vk_context.cc.
References blender::gpu::Context::active_fb, and blender::gpu::unwrap().
Referenced by deactivate_framebuffer(), flush_render_graph(), has_active_framebuffer(), rendering_end(), and update_pipeline_data().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 139 of file vk_context.cc.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 130 of file vk_context.cc.
References flush_render_graph(), immDeactivate(), and blender::gpu::Context::is_active_.
| void blender::gpu::VKContext::deactivate_framebuffer | ( | ) |
Definition at line 259 of file vk_context.cc.
References blender::gpu::Context::active_fb, active_framebuffer_get(), BLI_assert, blender::gpu::VKFrameBuffer::is_rendering(), and blender::gpu::VKFrameBuffer::rendering_end().
Referenced by activate_framebuffer(), and sync_backbuffer().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 92 of file vk_debug.cc.
References blender::gpu::VKBackend::debug_capture_begin(), flush_render_graph(), blender::gpu::VKBackend::get(), blender::gpu::RENEW_RENDER_GRAPH, blender::gpu::SUBMIT, and blender::gpu::WAIT_FOR_COMPLETION.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 113 of file vk_debug.cc.
References blender::gpu::VKBackend::debug_capture_end(), flush_render_graph(), blender::gpu::VKBackend::get(), blender::gpu::RENEW_RENDER_GRAPH, blender::gpu::SUBMIT, and blender::gpu::WAIT_FOR_COMPLETION.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 132 of file vk_debug.cc.
References blender::gpu::VKBackend::debug_capture_begin(), G, blender::gpu::VKBackend::get(), and UNUSED_VARS.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 127 of file vk_debug.cc.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 146 of file vk_debug.cc.
References blender::gpu::VKBackend::debug_capture_end(), G, blender::gpu::VKBackend::get(), and UNUSED_VARS.
|
overridevirtual |
Reimplemented from blender::gpu::Context.
Definition at line 24 of file vk_debug.cc.
References blender::gpu::render_graph::VKRenderGraph::debug_group_begin(), G, blender::gpu::debug::get_debug_group_color(), and render_graph().
|
overridevirtual |
Reimplemented from blender::gpu::Context.
Definition at line 40 of file vk_debug.cc.
References CLOG_ERROR, blender::gpu::render_graph::VKRenderGraph::debug_group_end(), G, i, blender::gpu::LOG, and render_graph().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 225 of file vk_context.cc.
References state_manager_get(), and blender::gpu::VKStateManager::storage_buffer_unbind_all().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 220 of file vk_context.cc.
References state_manager_get(), and blender::gpu::VKStateManager::uniform_buffer_unbind_all().
| VKDescriptorPools & blender::gpu::VKContext::descriptor_pools_get | ( | ) |
Definition at line 205 of file vk_context.cc.
Referenced by flush_render_graph().
| VKDescriptorSetTracker & blender::gpu::VKContext::descriptor_set_get | ( | ) |
Definition at line 210 of file vk_context.cc.
Referenced by flush_render_graph().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 141 of file vk_context.cc.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 193 of file vk_context.cc.
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 146 of file vk_context.cc.
References flush_render_graph(), and blender::gpu::RENEW_RENDER_GRAPH.
| TimelineValue blender::gpu::VKContext::flush_render_graph | ( | RenderGraphFlushFlags | flags, |
| VkPipelineStageFlags | wait_dst_stage_mask = VK_PIPELINE_STAGE_NONE, | ||
| VkSemaphore | wait_semaphore = VK_NULL_HANDLE, | ||
| VkSemaphore | signal_semaphore = VK_NULL_HANDLE, | ||
| VkFence | signal_fence = VK_NULL_HANDLE ) |
Definition at line 151 of file vk_context.cc.
References active_framebuffer_get(), blender::gpu::Context::debug_stack, blender::gpu::VKExtensions::descriptor_buffer, descriptor_pools_get(), descriptor_set_get(), blender::gpu::VKBackend::device, blender::gpu::VKDescriptorPools::discard(), discard_pool, blender::gpu::VKDevice::extensions_get(), blender::gpu::VKBackend::get(), blender::gpu::debug::get_debug_group_color(), has_active_framebuffer(), blender::gpu::VKFrameBuffer::is_rendering(), blender::gpu::VKDevice::render_graph_new(), blender::gpu::VKDevice::render_graph_submit(), blender::gpu::VKFrameBuffer::rendering_end(), blender::gpu::RENEW_RENDER_GRAPH, blender::gpu::SUBMIT, blender::gpu::VKDescriptorSetTracker::upload_descriptor_sets(), VKDevice, and blender::gpu::WAIT_FOR_COMPLETION.
Referenced by deactivate(), debug_capture_begin(), debug_capture_end(), and flush().
|
inlinestatic |
Definition at line 142 of file vk_context.hh.
References blender::gpu::Context::get(), and VKContext().
Referenced by blender::gpu::VKStorageBuffer::async_flush_to_host(), blender::gpu::VKQueryPool::begin_query(), blender::gpu::VKFrameBuffer::bind(), blender::gpu::VKShader::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::VKBackend::compute_dispatch(), blender::gpu::VKBackend::compute_dispatch_indirect(), blender::gpu::VKStorageBuffer::copy_sub(), blender::gpu::VKTexture::copy_to(), blender::gpu::VKDiscardPool::discard_pool_get(), 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(), openxr_acquire_framebuffer_image_callback(), openxr_release_framebuffer_image_callback(), blender::gpu::VKIndexBuffer::read(), blender::gpu::VKStorageBuffer::read(), blender::gpu::VKVertexBuffer::read(), blender::gpu::VKTexture::read_sub(), blender::gpu::VKBackend::render_end(), 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::VKVertexBuffer::update_sub(), blender::gpu::VKPushConstants::update_uniform_buffer(), blender::gpu::VKVertexBuffer::upload_data(), blender::gpu::VKShader::VKShader(), and blender::gpu::VKFrameBuffer::~VKFrameBuffer().
| bool blender::gpu::VKContext::has_active_framebuffer | ( | ) | const |
Definition at line 254 of file vk_context.cc.
References active_framebuffer_get().
Referenced by activate_framebuffer(), flush_render_graph(), and sync_backbuffer().
|
overridevirtual |
Implements blender::gpu::Context.
Definition at line 195 of file vk_context.cc.
References blender::gpu::VKBackend::device, blender::gpu::VKBackend::get(), blender::gpu::VKDevice::memory_statistics_get(), and VKDevice.
|
static |
Definition at line 436 of file vk_context.cc.
References BLI_assert, get(), and VKContext().
Referenced by blender::gpu::VKBackend::context_alloc().
|
static |
Definition at line 443 of file vk_context.cc.
References BLI_assert, get(), and VKContext().
Referenced by blender::gpu::VKBackend::context_alloc().
|
inline |
Definition at line 80 of file vk_context.hh.
|
inline |
Definition at line 76 of file vk_context.hh.
Referenced by debug_group_begin(), and debug_group_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 269 of file vk_context.cc.
References active_framebuffer_get(), and blender::gpu::VKFrameBuffer::rendering_end().
| render_graph::VKResourceAccessInfo & blender::gpu::VKContext::reset_and_get_access_info | ( | ) |
Definition at line 336 of file vk_context.cc.
References blender::gpu::render_graph::VKResourceAccessInfo::reset().
| void blender::gpu::VKContext::specialization_constants_set | ( | const shader::SpecializationConstants * | constants_state | ) |
Definition at line 423 of file vk_context.cc.
Referenced by blender::gpu::VKShader::bind().
| VKStateManager & blender::gpu::VKContext::state_manager_get | ( | ) | const |
Definition at line 215 of file vk_context.cc.
References blender::gpu::Context::state_manager.
Referenced by blender::gpu::VKIndexBuffer::bind_as_ssbo(), debug_unbind_all_ssbo(), debug_unbind_all_ubo(), and update_pipeline_data().
|
static |
Definition at line 355 of file vk_context.cc.
References BLI_assert, get(), and VKContext().
Referenced by blender::gpu::VKBackend::context_alloc().
|
static |
Definition at line 348 of file vk_context.cc.
References BLI_assert, get(), and VKContext().
Referenced by blender::gpu::VKBackend::context_alloc().
| void blender::gpu::VKContext::sync_backbuffer | ( | bool | cycle_resource_pool | ) |
Definition at line 55 of file vk_context.cc.
References blender::gpu::Context::back_left, deactivate_framebuffer(), blender::gpu::Context::front_left, blender::gpu::Context::ghost_window_, GPU_ATTACHMENT_TEXTURE, GPU_FB_COLOR_ATTACHMENT0, GPU_texture_create_2d(), GPU_texture_free(), GPU_TEXTURE_USAGE_ATTACHMENT, has_active_framebuffer(), blender::gpu::VKThreadData::resource_pool_next(), and blender::gpu::to_gpu_format().
Referenced by activate().
| void blender::gpu::VKContext::update_pipeline_data | ( | GPUPrimType | primitive, |
| VKVertexAttributeObject & | vao, | ||
| render_graph::VKPipelineData & | r_pipeline_data ) |
Definition at line 283 of file vk_context.cc.
References active_framebuffer_get(), blender::gpu::VKShader::ensure_and_get_graphics_pipeline(), GPU_PRIM_POINTS, GPU_shader_uniform_1f(), blender::gpu::StateManager::mutable_state, blender::gpu::GPUStateMutable::point_size, blender::gpu::Context::shader, state_manager_get(), blender::gpu::unwrap(), update_pipeline_data(), and blender::gpu::wrap().
| 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 302 of file vk_context.cc.
References blender::gpu::VKShader::ensure_and_get_compute_pipeline(), blender::gpu::Context::shader, blender::gpu::unwrap(), and update_pipeline_data().
Referenced by update_pipeline_data(), and update_pipeline_data().
|
friend |
Definition at line 41 of file vk_context.hh.
References VKDevice.
Referenced by activate(), flush_render_graph(), memory_statistics_get(), VKDevice, and ~VKContext().
| VKDiscardPool blender::gpu::VKContext::discard_pool |
Definition at line 74 of file vk_context.hh.
Referenced by flush_render_graph().