When cloning framebuffers for reinterpret, adjust width according to bpp
This commit is contained in:
parent
cb8497731d
commit
7be3063c96
1 changed files with 11 additions and 0 deletions
|
@ -2809,6 +2809,17 @@ VirtualFramebuffer *FramebufferManagerCommon::ResolveFramebufferColorToFormat(Vi
|
|||
// Create a clone!
|
||||
vfb = new VirtualFramebuffer();
|
||||
*vfb = *src; // Copies everything, but watch out! Can't copy fbo.
|
||||
|
||||
// Adjust width by bpp.
|
||||
float widthFactor = (float)BufferFormatBytesPerPixel(vfb->fb_format) / (float)BufferFormatBytesPerPixel(newFormat);
|
||||
|
||||
vfb->width *= widthFactor;
|
||||
vfb->bufferWidth *= widthFactor;
|
||||
vfb->renderWidth *= widthFactor;
|
||||
vfb->drawnWidth *= widthFactor;
|
||||
vfb->newWidth *= widthFactor;
|
||||
vfb->safeWidth *= widthFactor;
|
||||
|
||||
vfb->fb_format = newFormat;
|
||||
char tag[128];
|
||||
FormatFramebufferName(vfb, tag, sizeof(tag));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue