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

#include <vk_state_manager.hh>

Inherits blender::gpu::StateManager.

Public Member Functions

void apply_state () override
void force_state () override
void issue_barrier (eGPUBarrier barrier_bits) override
void texture_bind (Texture *tex, GPUSamplerState sampler, int unit) override
void texture_unbind (Texture *tex) override
void texture_unbind_all () override
void image_bind (Texture *tex, int unit) override
void image_unbind (Texture *tex) override
void image_unbind_all () override
void uniform_buffer_bind (VKUniformBuffer *uniform_buffer, int slot)
void uniform_buffer_unbind (VKUniformBuffer *uniform_buffer)
void uniform_buffer_unbind_all ()
void texel_buffer_bind (VKVertexBuffer &vertex_buffer, int slot)
void texel_buffer_unbind (VKVertexBuffer &vertex_buffer)
void storage_buffer_bind (BindSpaceStorageBuffers::Type resource_type, void *resource, int binding)
void storage_buffer_unbind (void *resource)
void storage_buffer_unbind_all ()
void unbind_from_all_namespaces (void *resource)
void texture_unpack_row_length_set (uint len) override
uint texture_unpack_row_length_get () const
Public Member Functions inherited from blender::gpu::StateManager
virtual ~StateManager ()
 StateManager ()

Public Attributes

bool is_dirty = false
Public Attributes inherited from blender::gpu::StateManager
GPUState state
GPUStateMutable mutable_state
bool use_bgl = false

Friends

class VKDescriptorSetTracker

Detailed Description

Definition at line 202 of file vk_state_manager.hh.

Member Function Documentation

◆ apply_state()

void blender::gpu::VKStateManager::apply_state ( )
overridevirtual

Implements blender::gpu::StateManager.

Definition at line 21 of file vk_state_manager.cc.

◆ force_state()

void blender::gpu::VKStateManager::force_state ( )
overridevirtual

Implements blender::gpu::StateManager.

Definition at line 27 of file vk_state_manager.cc.

◆ image_bind()

void blender::gpu::VKStateManager::image_bind ( Texture * tex,
int unit )
overridevirtual

Implements blender::gpu::StateManager.

Definition at line 74 of file vk_state_manager.cc.

References is_dirty, texture, and blender::gpu::unwrap().

◆ image_unbind()

void blender::gpu::VKStateManager::image_unbind ( Texture * tex)
overridevirtual

Implements blender::gpu::StateManager.

Definition at line 81 of file vk_state_manager.cc.

References is_dirty, texture, and blender::gpu::unwrap().

◆ image_unbind_all()

void blender::gpu::VKStateManager::image_unbind_all ( )
overridevirtual

Implements blender::gpu::StateManager.

Definition at line 88 of file vk_state_manager.cc.

References is_dirty.

◆ issue_barrier()

void blender::gpu::VKStateManager::issue_barrier ( eGPUBarrier barrier_bits)
overridevirtual

Workaround for EEVEE ThicknessFromShadow shader.

EEVEE light evaluation uses layered sub-pass tracking. Currently, the tracking supports transitioning a layer to a different layout once per rendering scope. When using the thickness from shadow, the layers need to be transitioned twice: once to image load/store for the thickness from shadow shader and then to a sampler for the light evaluation shader. We work around this limitation by suspending the rendering.

The reason we need to suspend the rendering is that Vulkan, by default, doesn't support layout transitions between the begin and end of rendering. By suspending the render, the graph will create a new node group that allows the necessary image layout transition.

This limitation could also be addressed in the render graph scheduler, but that would be quite a hassle to track and might not be worth the effort.

Implements blender::gpu::StateManager.

Definition at line 32 of file vk_state_manager.cc.

References blender::gpu::VKContext::get(), and GPU_BARRIER_SHADER_IMAGE_ACCESS.

◆ storage_buffer_bind()

void blender::gpu::VKStateManager::storage_buffer_bind ( BindSpaceStorageBuffers::Type resource_type,
void * resource,
int binding )

◆ storage_buffer_unbind()

void blender::gpu::VKStateManager::storage_buffer_unbind ( void * resource)

Definition at line 144 of file vk_state_manager.cc.

References is_dirty.

Referenced by blender::gpu::VKUniformBuffer::unbind().

◆ storage_buffer_unbind_all()

void blender::gpu::VKStateManager::storage_buffer_unbind_all ( )

Definition at line 150 of file vk_state_manager.cc.

References is_dirty.

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

◆ texel_buffer_bind()

void blender::gpu::VKStateManager::texel_buffer_bind ( VKVertexBuffer & vertex_buffer,
int slot )

◆ texel_buffer_unbind()

void blender::gpu::VKStateManager::texel_buffer_unbind ( VKVertexBuffer & vertex_buffer)

Definition at line 130 of file vk_state_manager.cc.

References is_dirty.

◆ texture_bind()

void blender::gpu::VKStateManager::texture_bind ( Texture * tex,
GPUSamplerState sampler,
int unit )
overridevirtual

◆ texture_unbind()

void blender::gpu::VKStateManager::texture_unbind ( Texture * tex)
overridevirtual

Implements blender::gpu::StateManager.

Definition at line 62 of file vk_state_manager.cc.

References is_dirty, and texture.

◆ texture_unbind_all()

void blender::gpu::VKStateManager::texture_unbind_all ( )
overridevirtual

Implements blender::gpu::StateManager.

Definition at line 68 of file vk_state_manager.cc.

References is_dirty.

◆ texture_unpack_row_length_get()

uint blender::gpu::VKStateManager::texture_unpack_row_length_get ( ) const

Row length for unpacking host data when uploading texture data.

When set to zero (0) host data can be assumed to be stored sequential.

Definition at line 161 of file vk_state_manager.cc.

◆ texture_unpack_row_length_set()

void blender::gpu::VKStateManager::texture_unpack_row_length_set ( uint len)
overridevirtual

Implements blender::gpu::StateManager.

Definition at line 156 of file vk_state_manager.cc.

References len.

◆ unbind_from_all_namespaces()

void blender::gpu::VKStateManager::unbind_from_all_namespaces ( void * resource)

Definition at line 112 of file vk_state_manager.cc.

References is_dirty.

◆ uniform_buffer_bind()

void blender::gpu::VKStateManager::uniform_buffer_bind ( VKUniformBuffer * uniform_buffer,
int slot )

Definition at line 94 of file vk_state_manager.cc.

References is_dirty.

◆ uniform_buffer_unbind()

void blender::gpu::VKStateManager::uniform_buffer_unbind ( VKUniformBuffer * uniform_buffer)

Definition at line 100 of file vk_state_manager.cc.

References is_dirty.

Referenced by blender::gpu::VKUniformBuffer::unbind().

◆ uniform_buffer_unbind_all()

void blender::gpu::VKStateManager::uniform_buffer_unbind_all ( )

Definition at line 106 of file vk_state_manager.cc.

References is_dirty.

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

◆ VKDescriptorSetTracker

friend class VKDescriptorSetTracker
friend

Definition at line 203 of file vk_state_manager.hh.

References VKDescriptorSetTracker.

Referenced by VKDescriptorSetTracker.

Member Data Documentation

◆ is_dirty


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