frame/texture: use dividers when allocating buffers

Allows render pipeline to know the "real" and "simulated" resolution of a
divided buffer.
This commit is contained in:
itsmattkc
2020-05-04 01:08:46 +10:00
parent e4e797c901
commit 2b1640ac04
15 changed files with 74 additions and 70 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ void ViewerDisplayWidget::SetImage(const QString &fn)
load_buffer_.set_video_params(VideoRenderingParams(input->spec().width, input->spec().height, image_format));
load_buffer_.allocate();
texture_.Create(context(), input->spec().width, input->spec().height, image_format);
texture_.Create(context(), VideoRenderingParams(input->spec().width, input->spec().height, image_format));
}
input->read_image(input->spec().format, load_buffer_.data(), OIIO::AutoStride, load_buffer_.linesize_bytes());
@@ -132,7 +132,7 @@ void ViewerDisplayWidget::SetImageFromLoadBuffer(Frame *in_buffer)
|| texture_.width() != in_buffer->width()
|| texture_.height() != in_buffer->height()
|| texture_.format() != in_buffer->format()) {
texture_.Create(context(), in_buffer->width(), in_buffer->height(), in_buffer->format(), in_buffer->data(), load_buffer_.linesize_pixels());
texture_.Create(context(), in_buffer->video_params(), in_buffer->data(), load_buffer_.linesize_pixels());
} else {
texture_.Upload(in_buffer);
}