[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,22 +7,22 @@ RWBuffer<uint4> xe_texture_load_dest : register(u0);
void main(uint3 xe_thread_id : SV_DispatchThreadID) {
// 1 thread = 16 blocks passed through an externally provided
// uint4 transformation function (XE_TEXTURE_LOAD_16BPB_TRANSFORM).
uint3 block_index = xe_thread_id << uint3(4, 0, 0);
uint3 block_index = xe_thread_id << uint3(4u, 0u, 0u);
[branch] if (any(block_index >= xe_texture_load_size_blocks)) {
return;
}
int block_offset_host =
(XeTextureHostLinearOffset(int3(block_index), xe_texture_load_host_pitch,
xe_texture_load_size_blocks.y, 2u) +
xe_texture_load_host_offset) >> 4;
int block_offset_guest =
XeTextureLoadGuestBlockOffset(int3(block_index), 2u, 1u) >> 4;
xe_texture_load_host_offset) >> 4u;
uint block_offset_guest =
XeTextureLoadGuestBlockOffset(block_index, 2u, 1u) >> 4u;
uint endian = XeTextureLoadEndian32();
xe_texture_load_dest[block_offset_host] = XE_TEXTURE_LOAD_16BPB_TRANSFORM(
XeEndianSwap16(xe_texture_load_source[block_offset_guest], endian));
++block_offset_host;
// Odd 8 blocks = even 8 blocks + 64 bytes when tiled.
block_offset_guest += XeTextureLoadIsTiled() ? 4 : 1;
block_offset_guest +=
XeTextureLoadRightConsecutiveBlocksOffset(block_index.x, 1u) >> 4u;
xe_texture_load_dest[block_offset_host] = XE_TEXTURE_LOAD_16BPB_TRANSFORM(
XeEndianSwap16(xe_texture_load_source[block_offset_guest], endian));
}