mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-24 12:26:26 -05:00
GPU: Added a function to retrieve the bytes per pixel of the render target formats.
This commit is contained in:
parent
378c881427
commit
a6da2b93c1
2 changed files with 15 additions and 0 deletions
|
@ -22,4 +22,16 @@ const Tegra::Engines::Maxwell3D& GPU::Get3DEngine() const {
|
||||||
return *maxwell_3d;
|
return *maxwell_3d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 RenderTargetBytesPerPixel(RenderTargetFormat format) {
|
||||||
|
ASSERT(format != RenderTargetFormat::NONE);
|
||||||
|
|
||||||
|
switch (format) {
|
||||||
|
case RenderTargetFormat::RGBA8_UNORM:
|
||||||
|
case RenderTargetFormat::RGB10_A2_UNORM:
|
||||||
|
return 4;
|
||||||
|
default:
|
||||||
|
UNIMPLEMENTED_MSG("Unimplemented render target format %u", static_cast<u32>(format));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Tegra
|
} // namespace Tegra
|
||||||
|
|
|
@ -21,6 +21,9 @@ enum class RenderTargetFormat : u32 {
|
||||||
RGBA8_SRGB = 0xD6,
|
RGBA8_SRGB = 0xD6,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Returns the number of bytes per pixel of each rendertarget format.
|
||||||
|
u32 RenderTargetBytesPerPixel(RenderTargetFormat format);
|
||||||
|
|
||||||
class DebugContext;
|
class DebugContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue