mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-18 09:24:58 +00:00
amdgpu: tiling mode introduced
This commit is contained in:
parent
d7d324ac76
commit
d491bbf366
4 changed files with 44 additions and 7 deletions
|
@ -85,6 +85,12 @@ constexpr std::string_view NameOf(ImageType type) {
|
|||
}
|
||||
}
|
||||
|
||||
enum class TilingMode : u32 {
|
||||
Display_Linear = 0x8u,
|
||||
Display_MacroTiled = 0xAu,
|
||||
Texture_MicroTiled = 0xDu,
|
||||
};
|
||||
|
||||
struct Image {
|
||||
union {
|
||||
BitField<0, 38, u64> base_address;
|
||||
|
@ -122,7 +128,7 @@ struct Image {
|
|||
}
|
||||
|
||||
u32 Pitch() const {
|
||||
return pitch;
|
||||
return pitch + 1;
|
||||
}
|
||||
|
||||
u32 NumLayers() const {
|
||||
|
@ -140,6 +146,19 @@ struct Image {
|
|||
NumberFormat GetNumberFmt() const noexcept {
|
||||
return static_cast<NumberFormat>(num_format.Value());
|
||||
}
|
||||
|
||||
[[nodiscard]] TilingMode GetTilingMode() const {
|
||||
return static_cast<TilingMode>(tiling_index.Value());
|
||||
}
|
||||
|
||||
[[nodiscard]] bool IsTiled() const {
|
||||
return GetTilingMode() != TilingMode::Display_Linear;
|
||||
}
|
||||
|
||||
[[nodiscard]] size_t GetSizeAligned() const {
|
||||
// TODO: Derive this properly from tiling params
|
||||
return (width + 1) * (height + 1) * NumComponents(GetDataFmt());
|
||||
}
|
||||
};
|
||||
|
||||
// 8.2.7. Image Sampler [RDNA 2 Instruction Set Architecture]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue