rtshadow updates

This commit is contained in:
Turánszki János
2025-05-20 06:36:28 +02:00
parent a69b96ee6b
commit 5d3aa93efe
3 changed files with 15 additions and 16 deletions
+10 -13
View File
@@ -26,19 +26,6 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint3 GTid :
if (depth == 0)
return;
#ifdef RTSHADOW
uint flatTileIdx = 0;
if (GTid.y < 4)
{
flatTileIdx = flatten2D(Gid.xy * uint2(1, 2) + uint2(0, 0), (postprocess.resolution + uint2(7, 3)) / uint2(8, 4));
}
else
{
flatTileIdx = flatten2D(Gid.xy * uint2(1, 2) + uint2(0, 1), (postprocess.resolution + uint2(7, 3)) / uint2(8, 4));
}
output_tiles[flatTileIdx] = 0;
#endif // RTSHADOW
float3 P = reconstruct_position(uv, depth);
float3 N = decode_oct(texture_normal[DTid.xy * DOWNSAMPLE]);
@@ -323,6 +310,16 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint3 GTid :
#ifdef RTSHADOW
output_normals[DTid.xy] = saturate(N * 0.5 + 0.5);
uint flatTileIdx = 0;
if (GTid.y < 4)
{
flatTileIdx = flatten2D(Gid.xy * uint2(1, 2) + uint2(0, 0), (postprocess.resolution + uint2(7, 3)) / uint2(8, 4));
}
else
{
flatTileIdx = flatten2D(Gid.xy * uint2(1, 2) + uint2(0, 1), (postprocess.resolution + uint2(7, 3)) / uint2(8, 4));
}
// pack 4 lights into tile bitmask:
int lane_index = (DTid.y % 4) * 8 + (DTid.x % 8);
+4 -2
View File
@@ -15035,11 +15035,9 @@ void Postprocess_RTShadow(
GPUBarrier::Image(&res.moments[3][1], res.moments[3][1].desc.layout, ResourceState::UNORDERED_ACCESS),
};
device->Barrier(barriers, arraysize(barriers), cmd);
device->ClearUAV(&res.raytraced, 0, cmd);
device->ClearUAV(&res.temporal[0], 0, cmd);
device->ClearUAV(&res.temporal[1], 0, cmd);
device->ClearUAV(&res.denoised, 0, cmd);
device->ClearUAV(&res.normals, 0, cmd);
device->ClearUAV(&res.scratch[0][0], 0, cmd);
device->ClearUAV(&res.scratch[0][1], 0, cmd);
device->ClearUAV(&res.scratch[1][0], 0, cmd);
@@ -15097,6 +15095,10 @@ void Postprocess_RTShadow(
}
device->ClearUAV(&output, 0, cmd);
device->ClearUAV(&res.raytraced, 0, cmd);
device->ClearUAV(&res.normals, 0, cmd);
device->ClearUAV(&res.tiles, 0, cmd);
device->Barrier(GPUBarrier::Memory(), cmd);
device->Dispatch(
(postprocess.resolution.x + POSTPROCESS_BLOCKSIZE - 1) / POSTPROCESS_BLOCKSIZE,
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wi::version
// minor features, major updates, breaking compatibility changes
const int minor = 71;
// minor bug fixes, alterations, refactors, updates
const int revision = 769;
const int revision = 770;
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);