[D3D12] Experimental 2x resolution scale

This commit is contained in:
Triang3l
2018-12-06 10:19:07 +03:00
parent 132af3e266
commit 9427667a27
173 changed files with 16680 additions and 4985 deletions

View File

@@ -5,25 +5,23 @@ RWByteAddressBuffer xe_texture_tile_dest : register(u0);
[numthreads(8, 32, 1)]
void main(uint3 xe_thread_id : SV_DispatchThreadID) {
// 1 thread = 4 texels.
uint2 texture_size = (xe_texture_tile_size >> uint2(0u, 16u)) & 0xFFFFu;
uint2 texture_size = XeTextureTileSizeScaled();
uint2 texel_index = xe_thread_id.xy;
texel_index.x <<= 2u;
texel_index.x *= 4u;
[branch] if (any(texel_index >= texture_size)) {
return;
}
uint4 texel_addresses = xe_texture_tile_guest_base + XeTextureTiledOffset2D(
((xe_texture_tile_offset >> uint2(0u, 16u)) & 0xFFFFu) + texel_index,
xe_texture_tile_endian_format_guest_pitch >> 9u, 2u);
uint4 texel_addresses = XeTextureTileGuestAddress(texel_index, 2u);
bool3 texels_inside = uint3(1u, 2u, 3u) + texel_index.x < texture_size.x;
uint endian = XeTextureTileEndian();
uint texels_host_offset = xe_texture_tile_host_base + texel_index.y *
xe_texture_tile_host_pitch + texel_index.x * 8u;
uint4 texels_host = xe_texture_tile_source.Load4(texels_host_offset);
uint2 texels = XeByteSwap(
((texels_host.xz >> 5u) & 2047u) | ((texels_host.xz >> 21u) << 11u) |
((texels_host.yw >> 6u) << 22u),
xe_texture_tile_endian_format_guest_pitch);
((texels_host.yw >> 6u) << 22u), endian);
xe_texture_tile_dest.Store(texel_addresses.x, texels.x);
[branch] if (texels_inside.x) {
xe_texture_tile_dest.Store(texel_addresses.y, texels.y);
@@ -31,8 +29,7 @@ void main(uint3 xe_thread_id : SV_DispatchThreadID) {
texels_host = xe_texture_tile_source.Load4(texels_host_offset + 16u);
texels = XeByteSwap(
((texels_host.xz >> 5u) & 2047u) | ((texels_host.xz >> 21u) << 11u) |
((texels_host.yw >> 6u) << 22u),
xe_texture_tile_endian_format_guest_pitch);
((texels_host.yw >> 6u) << 22u), endian);
xe_texture_tile_dest.Store(texel_addresses.z, texels.x);
[branch] if (texels_inside.z) {
xe_texture_tile_dest.Store(texel_addresses.w, texels.y);