[D3D12] 32bpb and 128bpb untiling, fix 3D tiled offset
This commit is contained in:
22
src/xenia/gpu/d3d12/shaders/texture_load_32bpb.cs.hlsl
Normal file
22
src/xenia/gpu/d3d12/shaders/texture_load_32bpb.cs.hlsl
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "texture_copy.hlsli"
|
||||
|
||||
[numthreads(8, 32, 1)]
|
||||
void main(uint3 xe_thread_id : SV_DispatchThreadID) {
|
||||
// 1 thread = 4 uint blocks.
|
||||
uint3 block_index = xe_thread_id;
|
||||
block_index.x <<= 2u;
|
||||
[branch] if (any(block_index >= xe_texture_copy_size)) {
|
||||
return;
|
||||
}
|
||||
uint4 block_offsets_guest =
|
||||
XeTextureCopyGuestBlockOffsets(block_index, 4u, 2u);
|
||||
uint4 blocks = uint4(xe_texture_copy_source.Load(block_offsets_guest.x),
|
||||
xe_texture_copy_source.Load(block_offsets_guest.y),
|
||||
xe_texture_copy_source.Load(block_offsets_guest.z),
|
||||
xe_texture_copy_source.Load(block_offsets_guest.w));
|
||||
blocks = XeByteSwap(blocks, xe_texture_copy_endianness);
|
||||
uint block_offset_host = XeTextureHostLinearOffset(
|
||||
block_index, xe_texture_copy_size.y, xe_texture_copy_host_pitch, 4u) +
|
||||
xe_texture_copy_host_base;
|
||||
xe_texture_copy_dest.Store4(block_offset_host, blocks);
|
||||
}
|
||||
Reference in New Issue
Block a user