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 155 of file TextureBuffer.cpp.

156{
157 if (new_width == m_width && new_height == m_height) {
158 return;
159 }
160
161 m_width = new_width;
162 m_height = new_height;
163 m_gpu_texture.reset();
164 m_texture_dirty = true;
165 m_geometry_dirty = true;
166
167 if (auto proc = get_texture_processor()) {
168 proc->invalidate_staging();
169 }
170}
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: