[GPU] Mostly generic, not square-only resolution scaling

This commit is contained in:
Triang3l
2021-12-11 21:55:33 +03:00
parent e2da8597e1
commit 38b4741c8f
254 changed files with 86052 additions and 344263 deletions

View File

@@ -7,23 +7,23 @@ RWBuffer<uint4> xe_texture_load_dest : register(u0);
[numthreads(8, 32, 1)]
void main(uint3 xe_thread_id : SV_DispatchThreadID) {
// 1 thread = 4 DXT3A-as-1111 blocks to 16x4 B4G4R4A4 texels.
uint3 block_index = xe_thread_id << uint3(2, 0, 0);
uint3 block_index = xe_thread_id << uint3(2u, 0u, 0u);
[branch] if (any(block_index >= xe_texture_load_size_blocks)) {
return;
}
int3 texel_index_host = int3(block_index) << int3(2, 2, 0);
int3 texel_index_host = int3(block_index) << uint3(2u, 2u, 0u);
int block_offset_host =
(XeTextureHostLinearOffset(texel_index_host, xe_texture_load_host_pitch,
xe_texture_load_height_texels, 2u) +
xe_texture_load_host_offset) >> 4;
int elements_pitch_host = xe_texture_load_host_pitch >> 4;
int block_offset_guest =
XeTextureLoadGuestBlockOffset(int3(block_index), 8u, 3u) >> 4;
xe_texture_load_host_offset) >> 4u;
int elements_pitch_host = xe_texture_load_host_pitch >> 4u;
uint block_offset_guest =
XeTextureLoadGuestBlockOffset(block_index, 8u, 3u) >> 4u;
uint endian = XeTextureLoadEndian32();
uint4 blocks_01 = XeEndianSwap32(xe_texture_load_source[block_offset_guest],
endian);
// Odd 2 blocks = even 2 blocks + 32 bytes when tiled.
block_offset_guest += XeTextureLoadIsTiled() ? 2 : 1;
block_offset_guest += XeTextureLoadIsTiled() ? 2u : 1u;
uint4 blocks_23 = XeEndianSwap32(xe_texture_load_source[block_offset_guest],
endian);
xe_texture_load_dest[block_offset_host] =