[D3D12] 8/16bpp resolves, fixed16 RT exp bias, RT format documentation

This commit is contained in:
Triang3l
2018-09-26 16:06:43 +03:00
parent 6e36101b42
commit 70103804c3
72 changed files with 3261 additions and 1538 deletions

View File

@@ -17,6 +17,24 @@ void main(uint3 xe_thread_id : SV_DispatchThreadID) {
xe_texture_copy_source.Load(dword_offsets_guest.w));
blocks = (blocks >> ((block_offsets_guest & 2u) << 3u)) & 0xFFFFu;
blocks = XeByteSwap16(blocks, xe_texture_copy_endianness);
// Swap components - Xenos 16-bit packed textures are RGBA, but in Direct3D 12
// they are BGRA.
if (xe_texture_copy_guest_format == 3u) {
// k_1_5_5_5.
blocks = (blocks & ((31u << 5u) | (1u << 15u))) | ((blocks & 31u) << 10u) |
((blocks >> 10u) & 31u);
} else if (xe_texture_copy_guest_format == 4u) {
// k_5_6_5.
blocks = (blocks & (63u << 5u)) | ((blocks & 31u) << 11u) |
((blocks >> 11u) & 31u);
} else if (xe_texture_copy_guest_format == 15u) {
// k_4_4_4_4.
blocks =
(blocks & 0xF0F0u) | ((blocks & 15u) << 8u) | ((blocks >> 8u) & 15u);
}
// TODO(Triang3l): k_6_5_5.
uint block_offset_host = XeTextureHostLinearOffset(
block_index, xe_texture_copy_size_blocks.y, xe_texture_copy_host_pitch,
2u) + xe_texture_copy_host_base;