Remove CCommandProcessorFragment_GLBase::Resize delegate

Use `ResizeImage` function directly instead.
This commit is contained in:
Robert Müller 2024-05-01 14:56:24 +02:00
parent 2cd877f0ce
commit dd62cda8ba
5 changed files with 11 additions and 19 deletions

View file

@ -1,11 +1,5 @@
#include "backend_base.h"
#include <base/system.h>
#include <engine/gfx/image_manipulation.h>
uint8_t *CCommandProcessorFragment_GLBase::Resize(const uint8_t *pData, int Width, int Height, int NewWidth, int NewHeight, int BPP)
{
return ResizeImage(pData, Width, Height, NewWidth, NewHeight, BPP);
}
bool CCommandProcessorFragment_GLBase::Texture2DTo3D(uint8_t *pImageBuffer, int ImageWidth, int ImageHeight, size_t PixelSize, int SplitCountWidth, int SplitCountHeight, uint8_t *pTarget3DImageData, int &Target3DImageWidth, int &Target3DImageHeight)
{

View file

@ -84,8 +84,6 @@ protected:
SGfxErrorContainer m_Error;
SGfxWarningContainer m_Warning;
static uint8_t *Resize(const uint8_t *pData, int Width, int Height, int NewWidth, int NewHeight, int BPP);
static bool Texture2DTo3D(uint8_t *pImageBuffer, int ImageWidth, int ImageHeight, size_t PixelSize, int SplitCountWidth, int SplitCountHeight, uint8_t *pTarget3DImageData, int &Target3DImageWidth, int &Target3DImageHeight);
virtual bool GetPresentedImageData(uint32_t &Width, uint32_t &Height, CImageInfo::EImageFormat &Format, std::vector<uint8_t> &vDstData) = 0;

View file

@ -632,7 +632,7 @@ void CCommandProcessorFragment_OpenGL::TextureUpdate(int Slot, int X, int Y, int
int ResizedW = (int)(Width * ResizeW);
int ResizedH = (int)(Height * ResizeH);
uint8_t *pTmpData = Resize(pTexData, Width, Height, ResizedW, ResizedH, GLFormatToPixelSize(GLFormat));
uint8_t *pTmpData = ResizeImage(pTexData, Width, Height, ResizedW, ResizedH, GLFormatToPixelSize(GLFormat));
free(pTexData);
pTexData = pTmpData;
@ -654,7 +654,7 @@ void CCommandProcessorFragment_OpenGL::TextureUpdate(int Slot, int X, int Y, int
Y /= 2;
}
uint8_t *pTmpData = Resize(pTexData, OldWidth, OldHeight, Width, Height, GLFormatToPixelSize(GLFormat));
uint8_t *pTmpData = ResizeImage(pTexData, OldWidth, OldHeight, Width, Height, GLFormatToPixelSize(GLFormat));
free(pTexData);
pTexData = pTmpData;
}
@ -729,7 +729,7 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He
int PowerOfTwoHeight = HighestBit(Height);
if(Width != PowerOfTwoWidth || Height != PowerOfTwoHeight)
{
uint8_t *pTmpData = Resize(pTexData, Width, Height, PowerOfTwoWidth, PowerOfTwoHeight, GLFormatToPixelSize(GLFormat));
uint8_t *pTmpData = ResizeImage(pTexData, Width, Height, PowerOfTwoWidth, PowerOfTwoHeight, GLFormatToPixelSize(GLFormat));
free(pTexData);
pTexData = pTmpData;
@ -761,7 +761,7 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He
if(NeedsResize)
{
uint8_t *pTmpData = Resize(pTexData, OldWidth, OldHeight, Width, Height, GLFormatToPixelSize(GLFormat));
uint8_t *pTmpData = ResizeImage(pTexData, OldWidth, OldHeight, Width, Height, GLFormatToPixelSize(GLFormat));
free(pTexData);
pTexData = pTmpData;
}
@ -879,7 +879,7 @@ void CCommandProcessorFragment_OpenGL::TextureCreate(int Slot, int Width, int He
dbg_msg("gfx", "3D/2D array texture was resized");
int NewWidth = maximum<int>(HighestBit(ConvertWidth), 16);
int NewHeight = maximum<int>(HighestBit(ConvertHeight), 16);
uint8_t *pNewTexData = Resize(pTexData, ConvertWidth, ConvertHeight, NewWidth, NewHeight, GLFormatToPixelSize(GLFormat));
uint8_t *pNewTexData = ResizeImage(pTexData, ConvertWidth, ConvertHeight, NewWidth, NewHeight, GLFormatToPixelSize(GLFormat));
ConvertWidth = NewWidth;
ConvertHeight = NewHeight;

View file

@ -503,7 +503,7 @@ void CCommandProcessorFragment_OpenGL3_3::TextureUpdate(int Slot, int X, int Y,
Y /= 2;
}
uint8_t *pTmpData = Resize(pTexData, Width, Height, Width, Height, GLFormatToPixelSize(GLFormat));
uint8_t *pTmpData = ResizeImage(pTexData, Width, Height, Width, Height, GLFormatToPixelSize(GLFormat));
free(pTexData);
pTexData = pTmpData;
}
@ -543,7 +543,7 @@ void CCommandProcessorFragment_OpenGL3_3::TextureCreate(int Slot, int Width, int
++RescaleCount;
} while(Width > m_MaxTexSize || Height > m_MaxTexSize);
uint8_t *pTmpData = Resize(pTexData, Width, Height, Width, Height, GLFormatToPixelSize(GLFormat));
uint8_t *pTmpData = ResizeImage(pTexData, Width, Height, Width, Height, GLFormatToPixelSize(GLFormat));
free(pTexData);
pTexData = pTmpData;
}
@ -629,7 +629,7 @@ void CCommandProcessorFragment_OpenGL3_3::TextureCreate(int Slot, int Width, int
dbg_msg("gfx", "3D/2D array texture was resized");
int NewWidth = maximum<int>(HighestBit(ConvertWidth), 16);
int NewHeight = maximum<int>(HighestBit(ConvertHeight), 16);
uint8_t *pNewTexData = Resize(pTexData, ConvertWidth, ConvertHeight, NewWidth, NewHeight, GLFormatToPixelSize(GLFormat));
uint8_t *pNewTexData = ResizeImage(pTexData, ConvertWidth, ConvertHeight, NewWidth, NewHeight, GLFormatToPixelSize(GLFormat));
ConvertWidth = NewWidth;
ConvertHeight = NewHeight;

View file

@ -2548,7 +2548,7 @@ protected:
YOff /= 2;
}
uint8_t *pTmpData = Resize(pData, Width, Height, Width, Height, VulkanFormatToPixelSize(Format));
uint8_t *pTmpData = ResizeImage(pData, Width, Height, Width, Height, VulkanFormatToPixelSize(Format));
free(pData);
pData = pTmpData;
}
@ -2602,7 +2602,7 @@ protected:
++RescaleCount;
} while((size_t)Width > m_MaxTextureSize || (size_t)Height > m_MaxTextureSize);
uint8_t *pTmpData = Resize(pData, Width, Height, Width, Height, PixelSize);
uint8_t *pTmpData = ResizeImage(pData, Width, Height, Width, Height, PixelSize);
free(pData);
pData = pTmpData;
}
@ -2657,7 +2657,7 @@ protected:
dbg_msg("vulkan", "3D/2D array texture was resized");
int NewWidth = maximum<int>(HighestBit(ConvertWidth), 16);
int NewHeight = maximum<int>(HighestBit(ConvertHeight), 16);
uint8_t *pNewTexData = Resize(pData, ConvertWidth, ConvertHeight, NewWidth, NewHeight, PixelSize);
uint8_t *pNewTexData = ResizeImage(pData, ConvertWidth, ConvertHeight, NewWidth, NewHeight, PixelSize);
ConvertWidth = NewWidth;
ConvertHeight = NewHeight;