Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/BulkLoadDemo/BulkLoadDemo.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<PlatformToolset>v142</PlatformToolset>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<TargetRuntime>Native</TargetRuntime>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<EmbedManifest>false</EmbedManifest>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<DefaultLanguage>en-US</DefaultLanguage>
<Keyword>Win32Proj</Keyword>
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<TargetRuntime>Native</TargetRuntime>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<EmbedManifest>false</EmbedManifest>
<GenerateManifest>false</GenerateManifest>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ float4 GetBicubicFilterWeights(float offset, float A)
//return ComputeWeights(offset, A);

// Precompute weights for 16 discrete offsets
static const float4 FilterWeights[16] =
const float4 FilterWeights[16] =
{
ComputeWeights( 0.5 / 16.0, -0.5),
ComputeWeights( 1.5 / 16.0, -0.5),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ float3 GetColor(uint s, uint t)
}

[RootSignature(Present_RootSig)]
float4 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
float3 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
{
float2 t = uv * TextureSize + 0.5;
float2 f = frac(t);
Expand All @@ -61,5 +61,5 @@ float4 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
W.z * GetColor(s2, st.y) +
W.w * GetColor(s3, st.y);

return float4(Color, 1);
return Color;
}
6 changes: 3 additions & 3 deletions Samples/BulkLoadDemo/Core/Shaders/BicubicUpsamplePS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ float3 GetColor(uint s, uint t)
}

[RootSignature(Present_RootSig)]
float4 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
float3 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
{
float2 t = uv * TextureSize + 0.5;
float2 f = frac(t);
Expand All @@ -88,8 +88,8 @@ float4 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
float3 Color = Cubic(GetWeights(f.y), c0, c1, c2, c3);

#ifdef GAMMA_SPACE
return float4(Color, 1);
return Color;
#else
return float4(ApplyDisplayProfile(Color, DISPLAY_PLANE_FORMAT), 1);
return ApplyDisplayProfile(Color, DISPLAY_PLANE_FORMAT);
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ float3 GetColor(uint s, uint t)
}

[RootSignature(Present_RootSig)]
float4 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
float3 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
{
float2 t = uv * TextureSize + 0.5;
float2 f = frac(t);
Expand All @@ -58,8 +58,8 @@ float4 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
W.w * GetColor(st.x, t3);

#ifdef GAMMA_SPACE
return float4(Color,1);
return Color;
#else
return float4(ApplyDisplayProfile(Color, DISPLAY_PLANE_FORMAT), 1);
return ApplyDisplayProfile(Color, DISPLAY_PLANE_FORMAT);
#endif
}
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/BilinearUpsamplePS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Texture2D<float3> ColorTex : register(t0);
SamplerState BilinearFilter : register(s0);

[RootSignature(Present_RootSig)]
float4 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
float3 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
{
float3 LinearRGB = RemoveDisplayProfile(ColorTex.SampleLevel(BilinearFilter, uv, 0), LDR_COLOR_FORMAT);
return float4(ApplyDisplayProfile(LinearRGB, DISPLAY_PLANE_FORMAT), 1);
return ApplyDisplayProfile(LinearRGB, DISPLAY_PLANE_FORMAT);
}
11 changes: 7 additions & 4 deletions Samples/BulkLoadDemo/Core/Shaders/BlurCS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ float3 BlurPixels( float3 a, float3 b, float3 c, float3 d, float3 e, float3 f, f
return Weights[0]*e + Weights[1]*(d+f) + Weights[2]*(c+g) + Weights[3]*(b+h) + Weights[4]*(a+i);
}

// 16x16 pixels with an 8x8 center that we will be blurring writing out. Each uint is two color channels packed together
// 16x16 pixels with an 8x8 center that we will be blurring writing out. Each uint is two color channels packed together
groupshared uint CacheR[128];
groupshared uint CacheG[128];
groupshared uint CacheB[128];
Expand Down Expand Up @@ -67,7 +67,7 @@ void Load1Pixel( uint index, out float3 pixel )
pixel = asfloat( uint3(CacheR[index], CacheG[index], CacheB[index]) );
}

// Blur two pixels horizontally. This reduces LDS reads and pixel unpacking.
// Blur two pixels horizontally. This reduces LDS reads and pixel unpacking.
void BlurHorizontally( uint outIndex, uint leftMostIndex )
{
float3 s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;
Expand All @@ -77,6 +77,9 @@ void BlurHorizontally( uint outIndex, uint leftMostIndex )
Load2Pixels( leftMostIndex + 3, s6, s7 );
Load2Pixels( leftMostIndex + 4, s8, s9 );

// Be sure to finish loading values before we rewrite them.
GroupMemoryBarrierWithGroupSync();

Store1Pixel(outIndex , BlurPixels(s0, s1, s2, s3, s4, s5, s6, s7, s8));
Store1Pixel(outIndex+1, BlurPixels(s1, s2, s3, s4, s5, s6, s7, s8, s9));
}
Expand Down Expand Up @@ -104,8 +107,8 @@ void main( uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID, uint3 DTid : S
//
// Load 4 pixels per thread into LDS
//
int2 GroupUL = (Gid.xy << 3) - 4; // Upper-left pixel coordinate of group read location
int2 ThreadUL = (GTid.xy << 1) + GroupUL; // Upper-left pixel coordinate of quad that this thread will read
int2 GroupUL = (Gid.xy << 3) - 4; // Upper-left pixel coordinate of group read location
int2 ThreadUL = (GTid.xy << 1) + GroupUL; // Upper-left pixel coordinate of quad that this thread will read

//
// Store 4 unblurred pixels in LDS
Expand Down
12 changes: 6 additions & 6 deletions Samples/BulkLoadDemo/Core/Shaders/ColorSpaceUtility.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,37 @@
float3 ApplySRGBCurve( float3 x )
{
// Approximately pow(x, 1.0 / 2.2)
return x < 0.0031308 ? 12.92 * x : 1.055 * pow(x, 1.0 / 2.4) - 0.055;
return select(x < 0.0031308, 12.92 * x, 1.055 * pow(x, 1.0 / 2.4) - 0.055);
}

float3 RemoveSRGBCurve( float3 x )
{
// Approximately pow(x, 2.2)
return x < 0.04045 ? x / 12.92 : pow( (x + 0.055) / 1.055, 2.4 );
return select(x < 0.04045, x / 12.92, pow( (x + 0.055) / 1.055, 2.4 ));
}

// These functions avoid pow() to efficiently approximate sRGB with an error < 0.4%.
float3 ApplySRGBCurve_Fast( float3 x )
{
return x < 0.0031308 ? 12.92 * x : 1.13005 * sqrt(x - 0.00228) - 0.13448 * x + 0.005719;
return select(x < 0.0031308, 12.92 * x, 1.13005 * sqrt(x - 0.00228) - 0.13448 * x + 0.005719);
}

float3 RemoveSRGBCurve_Fast( float3 x )
{
return x < 0.04045 ? x / 12.92 : -7.43605 * x - 31.24297 * sqrt(-0.53792 * x + 1.279924) + 35.34864;
return select(x < 0.04045, x / 12.92, -7.43605 * x - 31.24297 * sqrt(-0.53792 * x + 1.279924) + 35.34864);
}

// The OETF recommended for content shown on HDTVs. This "gamma ramp" may increase contrast as
// appropriate for viewing in a dark environment. Always use this curve with Limited RGB as it is
// used in conjunction with HDTVs.
float3 ApplyREC709Curve( float3 x )
{
return x < 0.0181 ? 4.5 * x : 1.0993 * pow(x, 0.45) - 0.0993;
return select(x < 0.0181, 4.5 * x, 1.0993 * pow(x, 0.45) - 0.0993);
}

float3 RemoveREC709Curve( float3 x )
{
return x < 0.08145 ? x / 4.5 : pow((x + 0.0993) / 1.0993, 1.0 / 0.45);
return select(x < 0.08145, x / 4.5, pow((x + 0.0993) / 1.0993, 1.0 / 0.45));
}

// This is the new HDR transfer function, also called "PQ" for perceptual quantizer. Note that REC2084
Expand Down
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/CompositeHDRPS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cbuffer CB0 : register(b0)
}

[RootSignature(Present_RootSig)]
float4 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
float3 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
{
int2 ST = (int2)position.xy;

Expand All @@ -36,5 +36,5 @@ float4 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
OverlayColor.rgb = REC709toREC2020(OverlayColor.rgb / (OverlayColor.a == 0.0 ? 1.0 : OverlayColor.a));
OverlayColor.rgb = ApplyREC2084Curve(OverlayColor.rgb * PaperWhiteRatio);

return float4(lerp(MainColor, OverlayColor.rgb, OverlayColor.a), 1);
return lerp(MainColor, OverlayColor.rgb, OverlayColor.a);
}
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/CompositeSDRPS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Texture2D<float3> MainBuffer : register(t0);
Texture2D<float4> OverlayBuffer : register(t1);

[RootSignature(Present_RootSig)]
float4 main( float4 position : SV_Position ) : SV_Target0
float3 main( float4 position : SV_Position ) : SV_Target0
{
float3 MainColor = ApplyDisplayProfile(MainBuffer[(int2)position.xy], DISPLAY_PLANE_FORMAT);
float4 OverlayColor = OverlayBuffer[(int2)position.xy];
return float4(OverlayColor.rgb + MainColor.rgb * (1.0 - OverlayColor.a), 1);
return OverlayColor.rgb + MainColor.rgb * (1.0 - OverlayColor.a);
}
23 changes: 13 additions & 10 deletions Samples/BulkLoadDemo/Core/Shaders/DoFPass1CS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,24 @@ void main( uint3 Gid : SV_GroupID, uint GI : SV_GroupIndex, uint3 GTid : SV_Grou
float TileMaxDepth = Max4(Depths);
float TileMaxCoC = MaxCoC(Depths);

// Write and sync
gs_ClosestDepthSearch[GI] = TileMinDepth;
gs_FarthestDepthSearch[GI] = TileMaxDepth;
gs_MaximumCoC[GI] = TileMaxCoC;
GroupMemoryBarrierWithGroupSync();

for (uint i = 32; i > 0; i >>= 1)
{
// Write and sync
gs_ClosestDepthSearch[GI] = TileMinDepth;
gs_FarthestDepthSearch[GI] = TileMaxDepth;
gs_MaximumCoC[GI] = TileMaxCoC;
GroupMemoryBarrierWithGroupSync();

// Read and sync
TileMinDepth = min(TileMinDepth, gs_ClosestDepthSearch[(GI + i) % 64]);
TileMaxDepth = max(TileMaxDepth, gs_FarthestDepthSearch[(GI + i) % 64]);
TileMaxCoC = max(TileMaxCoC, gs_MaximumCoC[(GI + i) % 64]);
if (GI < i)
{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... it would be helpful to have a description in the PR for the reasoning of change in this method. Should this be setting [GI] instead of [i]?

gs_ClosestDepthSearch[i] = min(gs_ClosestDepthSearch[i], gs_ClosestDepthSearch[GI + i]);
gs_FarthestDepthSearch[i] = max(gs_FarthestDepthSearch[i], gs_FarthestDepthSearch[GI + i]);
gs_MaximumCoC[i] = max(gs_MaximumCoC[i], gs_MaximumCoC[GI + i]);
}
GroupMemoryBarrierWithGroupSync();
}

if (GI == 0)
TileClass[Gid.xy] = float3(TileMaxCoC, TileMinDepth, TileMaxDepth);
TileClass[Gid.xy] = float3(gs_MaximumCoC[0], gs_FarthestDepthSearch[0], gs_FarthestDepthSearch[0]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be gs_ClosestDepthSearch?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(specifically, the first gs_FarthestDepthSearch on this line)

}
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/GenerateMipsCS.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ float4 LoadColor( uint Index )
float3 ApplySRGBCurve(float3 x)
{
// This is exactly the sRGB curve
//return x < 0.0031308 ? 12.92 * x : 1.055 * pow(abs(x), 1.0 / 2.4) - 0.055;
//return select(x < 0.0031308, 12.92 * x, 1.055 * pow(abs(x), 1.0 / 2.4) - 0.055);

// This is cheaper but nearly equivalent
return x < 0.0031308 ? 12.92 * x : 1.13005 * sqrt(abs(x - 0.00228)) - 0.13448 * x + 0.005719;
return select(x < 0.0031308, 12.92 * x, 1.13005 * sqrt(abs(x - 0.00228)) - 0.13448 * x + 0.005719);
}

float4 PackColor(float4 Linear)
Expand Down
2 changes: 1 addition & 1 deletion Samples/BulkLoadDemo/Core/Shaders/LanczosFunctions.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ float4 GetUpscaleFilterWeights(float offset)
//return ComputeWeights(offset);

// Precompute weights for 16 discrete offsets
static const float4 FilterWeights[16] =
const float4 FilterWeights[16] =
{
ComputeWeights( 0.5 / 16.0),
ComputeWeights( 1.5 / 16.0),
Expand Down
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/LanczosHorizontalPS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ float4x3 LoadSamples(int2 ST, uint2 Stride)
}

[RootSignature(Present_RootSig)]
float4 main(float4 Pos : SV_Position, float2 UV : TexCoord0) : SV_Target0
float3 main(float4 Pos : SV_Position, float2 UV : TexCoord0) : SV_Target0
{
// We subtract 0.5 because that represents the center of the pixel. We need to know where
// we lie between two pixel centers, and we will use frac() for that. We subtract another
Expand All @@ -53,5 +53,5 @@ float4 main(float4 Pos : SV_Position, float2 UV : TexCoord0) : SV_Target0
Result = ApplyDisplayProfile(Result, DISPLAY_PLANE_FORMAT);
#endif

return float4(Result, 1);
return Result;
}
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/MagnifyPixelsPS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ cbuffer Constants : register(b0)
}

[RootSignature(Present_RootSig)]
float4 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
float3 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
{
float2 ScaledUV = ScaleFactor * (uv - 0.5) + 0.5;
return float4(ColorTex.SampleLevel(PointSampler, ScaledUV, 0), 1);
return ColorTex.SampleLevel(PointSampler, ScaledUV, 0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void main( uint3 Gid : SV_GroupID, uint GI : SV_GroupIndex, uint3 GTid : SV_Grou
ParticleCountInBin = min(MAX_PARTICLES_PER_BIN, ParticleCountInBin);

// Compute the next power of two for the bitonic sort
uint NextPow2 = countbits(ParticleCountInBin) <= 1u ? ParticleCountInBin : (2u << firstbithigh(ParticleCountInBin));
uint NextPow2 = countbits(ParticleCountInBin) <= 1 ? ParticleCountInBin : (2u << firstbithigh(ParticleCountInBin));

// Fill in the sort key array. Each sort key has passenger data (in the least signficant
// bits, so that as the sort keys are moved around, they retain a pointer to the particle
Expand Down
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/PresentHDRPS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Texture2D<float3> MainBuffer : register(t0);

[RootSignature(Present_RootSig)]
float4 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
float3 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
{
return float4(ApplyREC2084Curve(MainBuffer[(int2)position.xy] / 10000.0), 1);
return ApplyREC2084Curve(MainBuffer[(int2)position.xy] / 10000.0);
}
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/PresentSDRPS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
Texture2D<float3> ColorTex : register(t0);

[RootSignature(Present_RootSig)]
float4 main( float4 position : SV_Position ) : SV_Target0
float3 main( float4 position : SV_Position ) : SV_Target0
{
float3 LinearRGB = ColorTex[(int2)position.xy];
return float4(ApplyDisplayProfile(LinearRGB, DISPLAY_PLANE_FORMAT), 1);
return ApplyDisplayProfile(LinearRGB, DISPLAY_PLANE_FORMAT);
}
6 changes: 3 additions & 3 deletions Samples/BulkLoadDemo/Core/Shaders/ScaleAndCompositeHDRPS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ float3 ScaleBuffer(float2 uv)
}

[RootSignature(Present_RootSig)]
float4 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
float3 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
{
float3 MainColor = ApplyREC2084Curve(ScaleBuffer(uv) / 10000.0);
float3 MainColor = ApplyREC2084Curve( saturate(ScaleBuffer(uv) / 10000.0) );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not very familiar with this method - what caused the need to add saturate?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also small nit: spacing

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zu-shi The PR description states that it updates the shaders to match the DirectX-Graphics-Samples repository, which appears to be their primary location and is thus more up-to-date. The saturate call was added in commit 8fc63a4 (Better HDR color range clamp).


float4 OverlayColor = OverlayBuffer[(int2)position.xy];
OverlayColor.rgb = RemoveSRGBCurve(OverlayColor.rgb);
OverlayColor.rgb = REC709toREC2020(OverlayColor.rgb / (OverlayColor.a == 0.0 ? 1.0 : OverlayColor.a));
OverlayColor.rgb = ApplyREC2084Curve(OverlayColor.rgb * PaperWhiteRatio);

return float4(lerp(MainColor, OverlayColor.rgb, OverlayColor.a), 1);
return lerp(MainColor, OverlayColor.rgb, OverlayColor.a);
}
4 changes: 2 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/ScaleAndCompositeSDRPS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ float3 ScaleBuffer(float2 uv)
}

[RootSignature(Present_RootSig)]
float4 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
float3 main( float4 position : SV_Position, float2 uv : TexCoord0 ) : SV_Target0
{
float3 MainColor = ApplyDisplayProfile(ScaleBuffer(uv), DISPLAY_PLANE_FORMAT);
float4 OverlayColor = OverlayBuffer[(int2)position.xy];
return float4(OverlayColor.rgb + MainColor.rgb * (1.0 - OverlayColor.a), 1);
return OverlayColor.rgb + MainColor.rgb * (1.0 - OverlayColor.a);
}
6 changes: 3 additions & 3 deletions Samples/BulkLoadDemo/Core/Shaders/SharpeningUpsamplePS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ float3 GetColor(float2 UV)
}

[RootSignature(Present_RootSig)]
float4 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
float3 main(float4 position : SV_Position, float2 uv : TexCoord0) : SV_Target0
{
float3 Color = WB * GetColor(uv) - WA * (
GetColor(uv + UVOffset0) + GetColor(uv - UVOffset0) +
GetColor(uv + UVOffset1) + GetColor(uv - UVOffset1));

#ifdef GAMMA_SPACE
return float4(Color, 1);
return Color;
#else
return float4(ApplyDisplayProfile(Color, DISPLAY_PLANE_FORMAT), 1);
return ApplyDisplayProfile(Color, DISPLAY_PLANE_FORMAT);
#endif
}
2 changes: 0 additions & 2 deletions Samples/BulkLoadDemo/Core/Shaders/TemporalBlendCS.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ void main(uint3 DTid : SV_DispatchThreadID, uint GI : SV_GroupIndex, uint3 GTid
uint Idx0 = GTid.x * 2 + GTid.y * kLdsPitch + kLdsPitch + 1;
uint Idx1 = Idx0 + 1;

GroupMemoryBarrierWithGroupSync();

float3 BoxMin, BoxMax;
GetBBoxForPair(Idx0, Idx1, BoxMin, BoxMax);

Expand Down
2 changes: 1 addition & 1 deletion Samples/BulkLoadDemo/Core/Shaders/ToneMappingUtility.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ float3 TM_Reinhard(float3 hdr, float k = 1.0)
// The inverse of Reinhard
float3 ITM_Reinhard(float3 sdr, float k = 1.0)
{
return k * sdr / (k - sdr);
return k * sdr / (1.0 - sdr);
}

//
Expand Down
Loading