mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 19:58:53 +00:00
VideoBackends: Add AbstractStagingTexture class
Can be used for asynchronous readback or upload of textures.
This commit is contained in:
parent
a584ccc7d8
commit
f43d85921d
33 changed files with 1220 additions and 12 deletions
|
@ -3,6 +3,7 @@
|
|||
// Refer to the license.txt file included.
|
||||
|
||||
#include "VideoCommon/TextureConfig.h"
|
||||
#include "VideoCommon/AbstractTexture.h"
|
||||
|
||||
#include <tuple>
|
||||
|
||||
|
@ -12,7 +13,28 @@ bool TextureConfig::operator==(const TextureConfig& o) const
|
|||
std::tie(o.width, o.height, o.levels, o.layers, o.format, o.rendertarget);
|
||||
}
|
||||
|
||||
bool TextureConfig::operator!=(const TextureConfig& o) const
|
||||
{
|
||||
return !operator==(o);
|
||||
}
|
||||
|
||||
MathUtil::Rectangle<int> TextureConfig::GetRect() const
|
||||
{
|
||||
return {0, 0, static_cast<int>(width), static_cast<int>(height)};
|
||||
}
|
||||
|
||||
MathUtil::Rectangle<int> TextureConfig::GetMipRect(u32 level) const
|
||||
{
|
||||
return {0, 0, static_cast<int>(std::max(width >> level, 1u)),
|
||||
static_cast<int>(std::max(height >> level, 1u))};
|
||||
}
|
||||
|
||||
size_t TextureConfig::GetStride() const
|
||||
{
|
||||
return AbstractTexture::CalculateStrideForFormat(format, width);
|
||||
}
|
||||
|
||||
size_t TextureConfig::GetMipStride(u32 level) const
|
||||
{
|
||||
return AbstractTexture::CalculateStrideForFormat(format, std::max(width >> level, 1u));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue