mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 11:26:56 +02:00
format source files
This commit is contained in:
@@ -28,8 +28,8 @@ constexpr FormatInfo kFormatInfo[] = {
|
||||
{GpuEnumValue(BufferFormat::k16_16UInt), VK_FORMAT_R16G16_UINT, 4, 0, 4, true, true},
|
||||
{GpuEnumValue(BufferFormat::k16_16SInt), VK_FORMAT_R16G16_SINT, 4, 0, 4, false, false},
|
||||
{GpuEnumValue(BufferFormat::k16_16Float), VK_FORMAT_R16G16_SFLOAT, 4, 0, 4, true, false},
|
||||
{GpuEnumValue(BufferFormat::k11_11_10Float), VK_FORMAT_B10G11R11_UFLOAT_PACK32, 4, 0, 4,
|
||||
true, false},
|
||||
{GpuEnumValue(BufferFormat::k11_11_10Float), VK_FORMAT_B10G11R11_UFLOAT_PACK32, 4, 0, 4, true,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::k10_10_10_2UNorm), VK_FORMAT_A2B10G10R10_UNORM_PACK32, 4, 0, 4,
|
||||
true, false},
|
||||
{GpuEnumValue(BufferFormat::k8_8_8_8UNorm), VK_FORMAT_R8G8B8A8_UNORM, 4, 0, 4, true, false},
|
||||
@@ -50,28 +50,25 @@ constexpr FormatInfo kFormatInfo[] = {
|
||||
{GpuEnumValue(BufferFormat::k16_16_16_16Float), VK_FORMAT_R16G16B16A16_SFLOAT, 8, 0, 8, true,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::k32_32_32UInt), VK_FORMAT_R32G32B32_UINT, 12, 0, 12, true, true},
|
||||
{GpuEnumValue(BufferFormat::k32_32_32SInt), VK_FORMAT_R32G32B32_SINT, 12, 0, 12, false,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::k32_32_32SInt), VK_FORMAT_R32G32B32_SINT, 12, 0, 12, false, false},
|
||||
{GpuEnumValue(BufferFormat::k32_32_32Float), VK_FORMAT_R32G32B32_SFLOAT, 12, 0, 12, true,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::k32_32_32_32UInt), VK_FORMAT_R32G32B32A32_UINT, 16, 0, 16, true,
|
||||
true},
|
||||
{GpuEnumValue(BufferFormat::k32_32_32_32SInt), VK_FORMAT_R32G32B32A32_SINT, 16, 0, 16, false,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::k32_32_32_32Float), VK_FORMAT_R32G32B32A32_SFLOAT, 16, 0, 16,
|
||||
true, false},
|
||||
{GpuEnumValue(BufferFormat::k32_32_32_32Float), VK_FORMAT_R32G32B32A32_SFLOAT, 16, 0, 16, true,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::k8_8_8_8Srgb), VK_FORMAT_R8G8B8A8_SRGB, 4, 0, 4, true, false},
|
||||
{GpuEnumValue(BufferFormat::k9_9_9_5Float), VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, 4, 0, 0, true,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::k5_6_5UNorm), VK_FORMAT_B5G6R5_UNORM_PACK16, 2, 0, 2, true,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::k5_6_5UNorm), VK_FORMAT_B5G6R5_UNORM_PACK16, 2, 0, 2, true, false},
|
||||
{GpuEnumValue(BufferFormat::k5_5_5_1UNorm), VK_FORMAT_R5G5B5A1_UNORM_PACK16, 2, 0, 2, true,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::k4_4_4_4UNorm), VK_FORMAT_R4G4B4A4_UNORM_PACK16, 2, 0, 2, true,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::kFmask8_S4_F4), VK_FORMAT_R32_SFLOAT, 1, 0, 1, true, false},
|
||||
{GpuEnumValue(BufferFormat::kBc1UNorm), VK_FORMAT_BC1_RGBA_UNORM_BLOCK, 0, 8, 0, true,
|
||||
false},
|
||||
{GpuEnumValue(BufferFormat::kBc1UNorm), VK_FORMAT_BC1_RGBA_UNORM_BLOCK, 0, 8, 0, true, false},
|
||||
{GpuEnumValue(BufferFormat::kBc1Srgb), VK_FORMAT_BC1_RGBA_SRGB_BLOCK, 0, 8, 0, true, false},
|
||||
{GpuEnumValue(BufferFormat::kBc2UNorm), VK_FORMAT_BC2_UNORM_BLOCK, 0, 16, 0, true, false},
|
||||
{GpuEnumValue(BufferFormat::kBc2Srgb), VK_FORMAT_BC2_SRGB_BLOCK, 0, 16, 0, true, false},
|
||||
@@ -88,7 +85,7 @@ constexpr FormatInfo kFormatInfo[] = {
|
||||
};
|
||||
|
||||
constexpr auto MakeFormatInfoLookup() {
|
||||
constexpr uint32_t kMaxFormat = GpuEnumValue(BufferFormat::kBc7Srgb);
|
||||
constexpr uint32_t kMaxFormat = GpuEnumValue(BufferFormat::kBc7Srgb);
|
||||
std::array<const FormatInfo*, kMaxFormat + 1> lookup {};
|
||||
for (const auto& info: kFormatInfo) {
|
||||
lookup[info.format] = &info;
|
||||
|
||||
@@ -1526,9 +1526,7 @@ void CommandProcessor::WriteAtEndOfPipe(uint32_t cache_policy, uint32_t event_wr
|
||||
switch (interrupt_selector) {
|
||||
case 0x00:
|
||||
case 0x03: with_interrupt = false; break;
|
||||
case 0x01:
|
||||
Sync::TriggerEopEventAtEndOfPipe(CurrentBuffer(), interrupt_context_id);
|
||||
return;
|
||||
case 0x01: Sync::TriggerEopEventAtEndOfPipe(CurrentBuffer(), interrupt_context_id); return;
|
||||
case 0x02: with_interrupt = true; break;
|
||||
default: EXIT("unknown interrupt_selector\n");
|
||||
}
|
||||
@@ -1540,11 +1538,11 @@ void CommandProcessor::WriteAtEndOfPipe(uint32_t cache_policy, uint32_t event_wr
|
||||
|
||||
if (with_interrupt) {
|
||||
if (with_writeback) {
|
||||
Sync::WriteAtEndOfPipeWithInterruptWriteBack32(
|
||||
m_submit_id, CurrentBuffer(), dst, data, interrupt_context_id);
|
||||
Sync::WriteAtEndOfPipeWithInterruptWriteBack32(m_submit_id, CurrentBuffer(), dst,
|
||||
data, interrupt_context_id);
|
||||
} else {
|
||||
Sync::WriteAtEndOfPipeWithInterrupt32(m_submit_id, CurrentBuffer(), dst,
|
||||
data, interrupt_context_id);
|
||||
Sync::WriteAtEndOfPipeWithInterrupt32(m_submit_id, CurrentBuffer(), dst, data,
|
||||
interrupt_context_id);
|
||||
}
|
||||
} else if (with_writeback) {
|
||||
Sync::WriteAtEndOfPipeWithWriteBack32(m_submit_id, CurrentBuffer(), dst, data);
|
||||
@@ -1560,8 +1558,8 @@ void CommandProcessor::WriteAtEndOfPipe(uint32_t cache_policy, uint32_t event_wr
|
||||
auto* dst = static_cast<uint32_t*>(dst_gpu_addr);
|
||||
SynchronizeGpu();
|
||||
Sync::ReadGds(dst, value & 0xffffu, value >> 16u);
|
||||
Sync::WriteAtEndOfPipeGds32(m_submit_id, CurrentBuffer(), dst,
|
||||
value & 0xffffu, value >> 16u);
|
||||
Sync::WriteAtEndOfPipeGds32(m_submit_id, CurrentBuffer(), dst, value & 0xffffu,
|
||||
value >> 16u);
|
||||
return;
|
||||
}
|
||||
} else if (eop_event_type == 0x04 && cache_action == 0x00 && event_index == 0x05) {
|
||||
@@ -1588,12 +1586,12 @@ void CommandProcessor::WriteAtEndOfPipe(uint32_t cache_policy, uint32_t event_wr
|
||||
Sync::WriteAtEndOfPipeWithInterruptWriteBack64(
|
||||
m_submit_id, CurrentBuffer(), dst, value, interrupt_context_id);
|
||||
} else {
|
||||
Sync::WriteAtEndOfPipeWithInterrupt64(
|
||||
m_submit_id, CurrentBuffer(), dst, value, interrupt_context_id);
|
||||
Sync::WriteAtEndOfPipeWithInterrupt64(m_submit_id, CurrentBuffer(), dst,
|
||||
value, interrupt_context_id);
|
||||
}
|
||||
} else if (with_writeback) {
|
||||
Sync::WriteAtEndOfPipeWithWriteBack64(m_submit_id, CurrentBuffer(),
|
||||
dst, value);
|
||||
Sync::WriteAtEndOfPipeWithWriteBack64(m_submit_id, CurrentBuffer(), dst,
|
||||
value);
|
||||
} else {
|
||||
Sync::WriteAtEndOfPipe64(m_submit_id, CurrentBuffer(), dst, value);
|
||||
}
|
||||
@@ -1669,9 +1667,9 @@ void CommandProcessor::WriteAtEndOfPipe(uint32_t cache_policy, uint32_t event_wr
|
||||
if (((eop_event_type == 0x04 && event_index == 0x05) ||
|
||||
(eop_event_type == 0x28 && event_index == 0x00)) &&
|
||||
!with_interrupt) {
|
||||
Sync::WriteAtEndOfPipeClockCounter(
|
||||
m_submit_id, CurrentBuffer(), static_cast<uint64_t*>(dst_gpu_addr),
|
||||
clock);
|
||||
Sync::WriteAtEndOfPipeClockCounter(m_submit_id, CurrentBuffer(),
|
||||
static_cast<uint64_t*>(dst_gpu_addr),
|
||||
clock);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@@ -1815,9 +1813,9 @@ void CommandProcessor::Flip() {
|
||||
|
||||
auto* command = CurrentBuffer();
|
||||
auto request = Sync::PrepareDisplayBufferFlip(command, m_flip.handle, m_flip.index,
|
||||
m_flip.flip_mode, m_flip.flip_arg);
|
||||
m_flip.flip_mode, m_flip.flip_arg);
|
||||
Sync::WriteAtEndOfPipeOnlyFlip(m_submit_id, command, m_flip.handle, m_flip.index,
|
||||
m_flip.flip_mode, m_flip.flip_arg, request);
|
||||
m_flip.flip_mode, m_flip.flip_arg, request);
|
||||
m_scheduler.Flush();
|
||||
}
|
||||
|
||||
@@ -1836,10 +1834,10 @@ void CommandProcessor::Flip(void* dst_gpu_addr, uint32_t value) {
|
||||
std::memcpy(dst_gpu_addr, &value, sizeof(value));
|
||||
auto* command = CurrentBuffer();
|
||||
auto request = Sync::PrepareDisplayBufferFlip(command, m_flip.handle, m_flip.index,
|
||||
m_flip.flip_mode, m_flip.flip_arg);
|
||||
Sync::WriteAtEndOfPipeWithFlip32(
|
||||
m_submit_id, command, static_cast<uint32_t*>(dst_gpu_addr), value, m_flip.handle,
|
||||
m_flip.index, m_flip.flip_mode, m_flip.flip_arg, request);
|
||||
m_flip.flip_mode, m_flip.flip_arg);
|
||||
Sync::WriteAtEndOfPipeWithFlip32(m_submit_id, command, static_cast<uint32_t*>(dst_gpu_addr),
|
||||
value, m_flip.handle, m_flip.index, m_flip.flip_mode,
|
||||
m_flip.flip_arg, request);
|
||||
m_scheduler.Flush();
|
||||
}
|
||||
|
||||
@@ -1864,7 +1862,7 @@ void CommandProcessor::FlipWithInterrupt(uint32_t eop_event_type, uint32_t cache
|
||||
std::memcpy(dst_gpu_addr, &value, sizeof(value));
|
||||
auto* command = CurrentBuffer();
|
||||
auto request = Sync::PrepareDisplayBufferFlip(command, m_flip.handle, m_flip.index,
|
||||
m_flip.flip_mode, m_flip.flip_arg);
|
||||
m_flip.flip_mode, m_flip.flip_arg);
|
||||
Sync::WriteAtEndOfPipeWithInterruptWriteBackFlip32(
|
||||
m_submit_id, command, static_cast<uint32_t*>(dst_gpu_addr), value, m_flip.handle,
|
||||
m_flip.index, m_flip.flip_mode, m_flip.flip_arg, request);
|
||||
|
||||
@@ -299,8 +299,7 @@ static bool Gen5Standard64KBLayout(uint32_t format, uint32_t* bytes_per_element,
|
||||
}
|
||||
}
|
||||
|
||||
static bool Gen5Thin64KBBlockSizeFromElementBytes(uint32_t bytes_per_element,
|
||||
uint32_t* block_width,
|
||||
static bool Gen5Thin64KBBlockSizeFromElementBytes(uint32_t bytes_per_element, uint32_t* block_width,
|
||||
uint32_t* block_height) {
|
||||
// AGC thin 64 KiB block table, shared by depth and render-target tiles.
|
||||
switch (bytes_per_element) {
|
||||
@@ -1181,8 +1180,8 @@ static void ConvertRenderTargetTyped(uint32_t width, uint32_t height, uint32_t p
|
||||
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
EXIT_NOT_IMPLEMENTED(!Gen5Thin64KBBlockSizeFromElementBytes(
|
||||
static_cast<uint32_t>(sizeof(T)), &block_width, &block_height));
|
||||
EXIT_NOT_IMPLEMENTED(!Gen5Thin64KBBlockSizeFromElementBytes(static_cast<uint32_t>(sizeof(T)),
|
||||
&block_width, &block_height));
|
||||
|
||||
const uint64_t blocks_per_row = (static_cast<uint64_t>(pitch) + block_width - 1u) / block_width;
|
||||
const uint32_t block_columns = (width == 0 ? 0 : 1u + (width - 1u) / block_width);
|
||||
@@ -1487,9 +1486,9 @@ void TileConvertLinearToTiledStandard64KB32(void* dst, const void* src, uint32_t
|
||||
dst, src, width, height, pitch, size);
|
||||
}
|
||||
|
||||
auto* dst32 = static_cast<uint32_t*>(dst);
|
||||
const auto* src32 = static_cast<const uint32_t*>(src);
|
||||
const auto& tables = GetStandard64KB32Tables();
|
||||
auto* dst32 = static_cast<uint32_t*>(dst);
|
||||
const auto* src32 = static_cast<const uint32_t*>(src);
|
||||
const auto& tables = GetStandard64KB32Tables();
|
||||
const auto blocks_per_row = (static_cast<uint64_t>(pitch) + 127u) >> 7u;
|
||||
const auto block_rows = (static_cast<uint64_t>(height) + 127u) >> 7u;
|
||||
if (blocks_per_row > UINT64_MAX / block_rows / 65536u ||
|
||||
@@ -1800,10 +1799,10 @@ static void TileConvertLinearToTiledStandard64KB64Elements(
|
||||
"size=0x%016" PRIx64 " dst_size=0x%016" PRIx64 " dst=%u,%u\n",
|
||||
width_elements, height_elements, pitch_elements, size, dst_size, dst_x, dst_y);
|
||||
}
|
||||
auto* dst64 = static_cast<uint64_t*>(dst);
|
||||
const auto* src64 = static_cast<const uint64_t*>(src);
|
||||
const auto& tables = GetStandard64KB64Tables();
|
||||
const auto size_words = size >> 3u;
|
||||
auto* dst64 = static_cast<uint64_t*>(dst);
|
||||
const auto* src64 = static_cast<const uint64_t*>(src);
|
||||
const auto& tables = GetStandard64KB64Tables();
|
||||
const auto size_words = size >> 3u;
|
||||
const auto dst_size_words = dst_size >> 3u;
|
||||
for (uint32_t y = 0; y < height_elements; y++) {
|
||||
const uint64_t src_row = static_cast<uint64_t>(y) * pitch_elements;
|
||||
@@ -2222,14 +2221,12 @@ static void TileConvertDepth(void* dst, const void* src, uint32_t format, uint32
|
||||
const uint32_t block_width = supported_bpe && bytes_per_element <= 2 ? 256u : 128u;
|
||||
const uint32_t block_height = supported_bpe ? 65536u / (block_width * bytes_per_element) : 0;
|
||||
if (dst == nullptr || src == nullptr || width == 0 || height == 0 || pitch < width ||
|
||||
!supported_bpe || pitch % block_width != 0 ||
|
||||
size == 0 || size % 65536u != 0) {
|
||||
!supported_bpe || pitch % block_width != 0 || size == 0 || size % 65536u != 0) {
|
||||
EXIT("unsupported depth conversion, dst=%p src=%p format=%u "
|
||||
"extent=%ux%u pitch=%u size=0x%016" PRIx64 "\n",
|
||||
dst, src, format, width, height, pitch, size);
|
||||
}
|
||||
const uint64_t block_rows =
|
||||
(static_cast<uint64_t>(height) + block_height - 1u) / block_height;
|
||||
const uint64_t block_rows = (static_cast<uint64_t>(height) + block_height - 1u) / block_height;
|
||||
const uint64_t blocks_per_row = pitch / block_width;
|
||||
if (blocks_per_row > UINT64_MAX / block_rows ||
|
||||
blocks_per_row * block_rows > UINT64_MAX / 65536u ||
|
||||
@@ -2504,13 +2501,13 @@ void TileConvertLinearToTiledRenderTarget(void* dst, const void* src, uint32_t w
|
||||
KYTY_PROFILER_FUNCTION();
|
||||
const bool tail_block = dst_size != 0 && (dst_x != 0 || dst_y != 0 || size < dst_size);
|
||||
if (tail_block) {
|
||||
//Not sure about this at all
|
||||
// Not sure about this at all
|
||||
if (bytes_per_element != 8) {
|
||||
EXIT("unsupported linear-to-tiled render-target tail element size: %u\n",
|
||||
bytes_per_element);
|
||||
}
|
||||
TileConvertLinearToTiledStandard64KB64Elements(dst, src, width, height, pitch, size,
|
||||
dst_size, dst_x, dst_y);
|
||||
dst_size, dst_x, dst_y);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2596,8 +2593,8 @@ bool TileGetDepthSize(uint32_t width, uint32_t height, uint32_t pitch, uint32_t
|
||||
uint32_t TileGetRenderTargetPitch(uint32_t width, uint32_t bytes_per_element) {
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
if (width == 0 || !Gen5Thin64KBBlockSizeFromElementBytes(bytes_per_element, &block_width,
|
||||
&block_height)) {
|
||||
if (width == 0 ||
|
||||
!Gen5Thin64KBBlockSizeFromElementBytes(bytes_per_element, &block_width, &block_height)) {
|
||||
return 0;
|
||||
}
|
||||
const uint64_t pitch = (static_cast<uint64_t>(width) + block_width - 1u) &
|
||||
@@ -2611,8 +2608,7 @@ bool TileGetRenderTargetSize(uint32_t width, uint32_t height, uint32_t pitch,
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
if (height == 0 || pitch == 0 ||
|
||||
!Gen5Thin64KBBlockSizeFromElementBytes(bytes_per_element, &block_width,
|
||||
&block_height) ||
|
||||
!Gen5Thin64KBBlockSizeFromElementBytes(bytes_per_element, &block_width, &block_height) ||
|
||||
pitch != TileGetRenderTargetPitch(width, bytes_per_element)) {
|
||||
return false;
|
||||
}
|
||||
@@ -2655,8 +2651,8 @@ bool TileGetRenderTargetMipLayout(uint32_t width, uint32_t height, uint32_t pitc
|
||||
default: return false;
|
||||
}
|
||||
TileGetTextureSize(format, width, height, pitch, levels,
|
||||
Prospero::GpuEnumValue(Prospero::TileMode::kRenderTarget), total_size, level_sizes,
|
||||
padded_size);
|
||||
Prospero::GpuEnumValue(Prospero::TileMode::kRenderTarget), total_size,
|
||||
level_sizes, padded_size);
|
||||
return total_size->size != 0 && total_size->align == 65536;
|
||||
}
|
||||
|
||||
@@ -2738,8 +2734,8 @@ void TileGetTextureSize(uint32_t format, uint32_t width, uint32_t height, uint32
|
||||
bytes_per_element != 0 && tile == 27 && levels == 1) {
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
EXIT_NOT_IMPLEMENTED(!Gen5Thin64KBBlockSizeFromElementBytes(
|
||||
bytes_per_element, &block_width, &block_height));
|
||||
EXIT_NOT_IMPLEMENTED(
|
||||
!Gen5Thin64KBBlockSizeFromElementBytes(bytes_per_element, &block_width, &block_height));
|
||||
|
||||
const uint32_t padded_width = AlignUp(pitch, block_width);
|
||||
const uint32_t padded_height = AlignUp(height, block_height);
|
||||
@@ -2767,8 +2763,8 @@ void TileGetTextureSize(uint32_t format, uint32_t width, uint32_t height, uint32
|
||||
bytes_per_element != 0 && tile == 27 && levels > 1) {
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
EXIT_NOT_IMPLEMENTED(!Gen5Thin64KBBlockSizeFromElementBytes(
|
||||
bytes_per_element, &block_width, &block_height));
|
||||
EXIT_NOT_IMPLEMENTED(
|
||||
!Gen5Thin64KBBlockSizeFromElementBytes(bytes_per_element, &block_width, &block_height));
|
||||
|
||||
const uint32_t bytes_log2 = IntLog2(bytes_per_element);
|
||||
const uint32_t tail_width_limit = block_width >> 1u;
|
||||
@@ -2990,11 +2986,11 @@ void TileGetTextureSize(uint32_t format, uint32_t width, uint32_t height, uint32
|
||||
if (tile == 24 && levels == 1) {
|
||||
const uint32_t bytes_per_element = Prospero::NumBytesPerElement(format);
|
||||
if (bytes_per_element != 0) {
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
const bool supported = bytes_per_element <= 4 &&
|
||||
Gen5Thin64KBBlockSizeFromElementBytes(
|
||||
bytes_per_element, &block_width, &block_height);
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
const bool supported =
|
||||
bytes_per_element <= 4 && Gen5Thin64KBBlockSizeFromElementBytes(
|
||||
bytes_per_element, &block_width, &block_height);
|
||||
|
||||
if (supported) {
|
||||
const uint32_t padded_width = (pitch + block_width - 1u) & ~(block_width - 1u);
|
||||
@@ -3024,11 +3020,11 @@ void TileGetTextureSize(uint32_t format, uint32_t width, uint32_t height, uint32
|
||||
if (tile == 24 && levels > 1) {
|
||||
const uint32_t bytes_per_element = Prospero::NumBytesPerElement(format);
|
||||
if (bytes_per_element != 0) {
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
const bool supported = bytes_per_element <= 4 &&
|
||||
Gen5Thin64KBBlockSizeFromElementBytes(
|
||||
bytes_per_element, &block_width, &block_height);
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
const bool supported =
|
||||
bytes_per_element <= 4 && Gen5Thin64KBBlockSizeFromElementBytes(
|
||||
bytes_per_element, &block_width, &block_height);
|
||||
|
||||
if (supported) {
|
||||
static bool logged = false;
|
||||
@@ -3271,7 +3267,8 @@ uint32_t TileGetTexturePitch(uint32_t format, uint32_t width, uint32_t levels, u
|
||||
uint32_t pitch = width;
|
||||
|
||||
if (tile == 27) {
|
||||
if (const uint32_t bytes_per_element = Prospero::NumBytesPerElement(format); bytes_per_element != 0) {
|
||||
if (const uint32_t bytes_per_element = Prospero::NumBytesPerElement(format);
|
||||
bytes_per_element != 0) {
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
EXIT_NOT_IMPLEMENTED(!Gen5Thin64KBBlockSizeFromElementBytes(
|
||||
@@ -3281,7 +3278,8 @@ uint32_t TileGetTexturePitch(uint32_t format, uint32_t width, uint32_t levels, u
|
||||
}
|
||||
|
||||
if (tile == 0) {
|
||||
if (const auto bytes_per_element = Prospero::NumBytesPerElement(format); bytes_per_element != 0) {
|
||||
if (const auto bytes_per_element = Prospero::NumBytesPerElement(format);
|
||||
bytes_per_element != 0) {
|
||||
pitch = AlignUp(pitch * bytes_per_element, 256u) / bytes_per_element;
|
||||
}
|
||||
}
|
||||
@@ -3297,10 +3295,10 @@ uint32_t TileGetTexturePitch(uint32_t format, uint32_t width, uint32_t levels, u
|
||||
}
|
||||
if (tile == 24) {
|
||||
const uint32_t bytes_per_element = Prospero::NumBytesPerElement(format);
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
if (bytes_per_element <= 4 && Gen5Thin64KBBlockSizeFromElementBytes(
|
||||
bytes_per_element, &block_width, &block_height)) {
|
||||
uint32_t block_width = 0;
|
||||
uint32_t block_height = 0;
|
||||
if (bytes_per_element <= 4 &&
|
||||
Gen5Thin64KBBlockSizeFromElementBytes(bytes_per_element, &block_width, &block_height)) {
|
||||
pitch = AlignUp(pitch, block_width);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user