[GPU] TextureInfo::GetMaxMipLevels
This commit is contained in:
parent
62bee78edd
commit
f7c7cc54ed
|
@ -204,6 +204,11 @@ void TextureInfo::CalculateTextureSizesCube(uint32_t width, uint32_t height,
|
||||||
input_length = size_cube.input_face_length * 6;
|
input_length = size_cube.input_face_length * 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t TextureInfo::GetMaxMipLevels(uint32_t width, uint32_t height,
|
||||||
|
uint32_t depth) {
|
||||||
|
return 1 + xe::log2_floor(std::max({width, height, depth}));
|
||||||
|
}
|
||||||
|
|
||||||
bool TextureInfo::GetPackedTileOffset(const TextureInfo& texture_info,
|
bool TextureInfo::GetPackedTileOffset(const TextureInfo& texture_info,
|
||||||
uint32_t* out_offset_x,
|
uint32_t* out_offset_x,
|
||||||
uint32_t* out_offset_y) {
|
uint32_t* out_offset_y) {
|
||||||
|
|
|
@ -304,6 +304,8 @@ struct TextureInfo {
|
||||||
uint32_t width, uint32_t height,
|
uint32_t width, uint32_t height,
|
||||||
TextureInfo* out_info);
|
TextureInfo* out_info);
|
||||||
|
|
||||||
|
static uint32_t GetMaxMipLevels(uint32_t width, uint32_t height,
|
||||||
|
uint32_t depth);
|
||||||
static bool GetPackedTileOffset(const TextureInfo& texture_info,
|
static bool GetPackedTileOffset(const TextureInfo& texture_info,
|
||||||
uint32_t* out_offset_x,
|
uint32_t* out_offset_x,
|
||||||
uint32_t* out_offset_y);
|
uint32_t* out_offset_y);
|
||||||
|
|
Loading…
Reference in New Issue