Skip to content

Commit

Permalink
fix: fix padding for StructuredLight
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Sep 23, 2024
1 parent 0af4896 commit b0f78b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
7 changes: 6 additions & 1 deletion features/Light Limit Fix/Shaders/LightLimitFix/Common.hlsli
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef __LLF_COMMON_DEPENDENCY_HLSL__
#define __LLF_COMMON_DEPENDENCY_HLSL__

#define NUMTHREAD_X 16
#define NUMTHREAD_Y 16
Expand All @@ -24,4 +26,7 @@ struct StructuredLight
float radius;
float4 positionWS[2];
float4 positionVS[2];
};
float pad0[4];
};

#endif //__LLF_COMMON_DEPENDENCY_HLSL__
19 changes: 2 additions & 17 deletions features/Light Limit Fix/Shaders/LightLimitFix/LightLimitFix.hlsli
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
struct LightGrid
{
uint offset;
uint lightCount;
float pad0[2];
};

struct StructuredLight
{
float3 color;
float radius;
float4 positionWS[2];
float4 positionVS[2];
float pad0[4];
};

#include "LightLimitFix\Common.hlsli"
struct StrictLightData
{
StructuredLight StrictLights[15];
Expand All @@ -33,7 +18,7 @@ namespace LightLimitFix
bool GetClusterIndex(in float2 uv, in float z, out uint clusterIndex)
{
const uint3 clusterSize = lightLimitFixSettings.ClusterSize.xyz;

clusterIndex = 0;
if (z < strictLights[0].LightsNear || z > strictLights[0].LightsFar)
return false;

Expand Down

0 comments on commit b0f78b0

Please sign in to comment.