From 7c88baa0e75a6ff26bc920cd950efb1374b2bc43 Mon Sep 17 00:00:00 2001 From: turanszkij Date: Mon, 31 Jul 2017 20:37:57 +0200 Subject: [PATCH] minor update in tiled deferred compute shader --- WickedEngine/lightCullingCS.hlsl | 7 +++---- WickedEngine/wiVersion.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/WickedEngine/lightCullingCS.hlsl b/WickedEngine/lightCullingCS.hlsl index 090c20eef..6317fa1db 100644 --- a/WickedEngine/lightCullingCS.hlsl +++ b/WickedEngine/lightCullingCS.hlsl @@ -171,9 +171,9 @@ void main(ComputeShaderInput IN) { // Calculate min & max depth in threadgroup / tile. int2 texCoord = IN.dispatchThreadID.xy; - float fDepth = texture_depth.Load(int3(texCoord, 0)).r; + float depth = texture_depth[texCoord]; - uint uDepth = asuint(fDepth); + uint uDepth = asuint(depth); if (IN.groupIndex == 0) // Avoid contention by other threads in the group. { @@ -253,7 +253,7 @@ void main(ComputeShaderInput IN) // We divide the minmax depth bounds to 32 equal slices // then we mark the occupied depth slices with atomic or from each thread // we do all this in linear (view) space - float realDepthVS = ScreenToView(float4(0, 0, fDepth, 1)).z; + float realDepthVS = ScreenToView(float4(0, 0, depth, 1)).z; const float __depthRangeRecip = 32.0f / (maxDepthVS - minDepthVS); const uint __depthmaskcellindex = max(0, min(32, floor((realDepthVS - minDepthVS) * __depthRangeRecip))); InterlockedOr(uDepthMask, 1 << __depthmaskcellindex); @@ -418,7 +418,6 @@ void main(ComputeShaderInput IN) // Light the pixels: float3 diffuse, specular; - float depth = texture_depth[texCoord]; float4 baseColor = texture_gbuffer0[texCoord]; float4 g1 = texture_gbuffer1[texCoord]; float4 g3 = texture_gbuffer3[texCoord]; diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index cfd9761b7..d02157e3e 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wiVersion // minor features, major updates const int minor = 12; // minor bug fixes, alterations, refactors, updates - const int revision = 2; + const int revision = 3; long GetVersion()