mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 13:11:33 +00:00
- don't map the frame buffer memory every frame when doing software rendering
This commit is contained in:
parent
8abbd63427
commit
bff22bbd81
2 changed files with 11 additions and 2 deletions
|
@ -69,6 +69,12 @@ void VkHardwareTexture::Reset()
|
|||
{
|
||||
ResetDescriptors();
|
||||
|
||||
if (mappedSWFB)
|
||||
{
|
||||
mImage.Image->Unmap();
|
||||
mappedSWFB = nullptr;
|
||||
}
|
||||
|
||||
auto &deleteList = fb->FrameDeleteList;
|
||||
if (mImage.Image) deleteList.Images.push_back(std::move(mImage.Image));
|
||||
if (mImage.View) deleteList.ImageViews.push_back(std::move(mImage.View));
|
||||
|
@ -348,12 +354,13 @@ void VkHardwareTexture::AllocateBuffer(int w, int h, int texelsize)
|
|||
|
||||
uint8_t *VkHardwareTexture::MapBuffer()
|
||||
{
|
||||
return (uint8_t*)mImage.Image->Map(0, mImage.Image->width * mImage.Image->height * mTexelsize);
|
||||
if (!mappedSWFB)
|
||||
mappedSWFB = (uint8_t*)mImage.Image->Map(0, mImage.Image->width * mImage.Image->height * mTexelsize);
|
||||
return mappedSWFB;
|
||||
}
|
||||
|
||||
unsigned int VkHardwareTexture::CreateTexture(unsigned char * buffer, int w, int h, int texunit, bool mipmap, int translation, const char *name)
|
||||
{
|
||||
mImage.Image->Unmap();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -77,4 +77,6 @@ private:
|
|||
int mTexelsize = 4;
|
||||
|
||||
VkTextureImage mDepthStencil;
|
||||
|
||||
uint8_t* mappedSWFB = nullptr;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue