MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ resize_texture()

void MayaFlux::Buffers::TextureBuffer::resize_texture ( uint32_t  new_width,
uint32_t  new_height 
)

Reallocate the GPU texture at new dimensions.

Resets the GPU texture handle so TextureProcessor allocates a fresh VKImage at the updated dimensions on the next processing cycle. Marks texture and geometry dirty. Invalidates the streaming staging buffer so it is reallocated at the correct size.

Parameters
new_widthNew texture width in pixels.
new_heightNew texture height in pixels.

Definition at line 149 of file TextureBuffer.cpp.

150{
151 if (new_width == m_width && new_height == m_height) {
152 return;
153 }
154
155 m_width = new_width;
156 m_height = new_height;
157 m_gpu_texture.reset();
158 m_texture_dirty = true;
159 m_geometry_dirty = true;
160
161 if (auto proc = get_texture_processor()) {
162 proc->invalidate_staging();
163 }
164}
std::shared_ptr< TextureProcessor > get_texture_processor() const
std::shared_ptr< Core::VKImage > m_gpu_texture

References get_texture_processor(), m_geometry_dirty, m_gpu_texture, m_height, m_texture_dirty, and m_width.

+ Here is the call graph for this function: