dof, motionblur: unroll the loops

This commit is contained in:
turanszkij
2019-12-31 12:50:16 +01:00
parent 9016e9fdee
commit 952fc90d9a
4 changed files with 7 additions and 1 deletions
+4
View File
@@ -60,8 +60,10 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
#ifdef DEPTHOFFIELD_CHEAP
color = center_color;
[unroll]
for (uint j = 0; j < ringCount; ++j)
{
[unroll]
for (uint i = ringSampleCount[j]; i < ringSampleCount[j + 1]; ++i)
{
const float offsetCoc = disc[i].z;
@@ -75,8 +77,10 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
#else
float4 background = center_backgroundWeight * float4(center_color.rgb, 1);
float4 foreground = center_foregroundWeight * float4(center_color.rgb, 1);
[unroll]
for (uint j = 0; j < ringCount; ++j)
{
[unroll]
for (uint i = ringSampleCount[j]; i < ringSampleCount[j + 1]; ++i)
{
const float offsetCoc = disc[i].z;
+1
View File
@@ -54,6 +54,7 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
float seed = 54321;
const float2 ringScale = 2 * coc * xPPResolution_rcp;
[unroll]
for (uint i = ringSampleCount[0]; i < ringSampleCount[1]; ++i)
{
const float offsetCoc = disc[i].z;
+1
View File
@@ -82,6 +82,7 @@ void main(uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID)
float4 sum = 0;
float numSampling = 0;
float2 uv2 = uv - range * sampling_direction;
[unroll]
for (float i = -range; i <= range; i += 2.0f)
{
const float depth1 = texture_lineardepth.SampleLevel(sampler_point_clamp, uv2, 0);
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 36;
// minor bug fixes, alterations, refactors, updates
const int revision = 35;
const int revision = 36;
long GetVersion()