[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

@@ -6,20 +6,17 @@ Texture2DMS<float> xe_host_depth_store_source : register(t0);
[numthreads(8, 8, 1)]
void main(uint3 xe_thread_id : SV_DispatchThreadID) {
// 1 thread = 8 samples (4x0.5 pixels, resolve granularity is 8 pixels).
uint resolution_scale = XeHostDepthStoreResolutionScale();
// Group height is aligned to resolve granularity, Y overflow check not
// needed.
[branch] if ((xe_thread_id.x >> 1u) >
XeHostDepthStoreWidthDiv8Minus1() * resolution_scale) {
// Group height can't cross resolve granularity, Y overflow check not needed.
[branch] if ((xe_thread_id.x >> 1u) >= XeHostDepthStoreScaledWidthDiv8()) {
return;
}
uint2 pixel_index = XeHostDepthStoreOrigin() * resolution_scale +
uint2 pixel_index = XeHostDepthStoreScaledOrigin() +
uint2(xe_thread_id.x << 2u, xe_thread_id.y >> 1u);
// For simplicity, passing samples directly, not pixels, to XeEdramOffsetInts.
uint edram_address_int4s =
XeEdramOffsetInts((pixel_index << 1u) | (xe_thread_id.xy & 1u), 0u,
XeHostDepthStorePitchTiles(), kXenosMsaaSamples_1X,
false, 0u, 0u, resolution_scale)
false, 0u, 0u, XeHostDepthStoreResolutionScale())
>> 2u;
// Render target horizontal sample in bit 0, vertical sample in bit 1.
int source_sample_left = int((xe_thread_id.y & 1u) << 1u);