Skip to content

Commit 1d467c8

Browse files
pastasfutureDeployer User
authored andcommitted
Fix two misc DynamicGI shader warnings. (#89)
1 parent 9bb204f commit 1d467c8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

com.unity.render-pipelines.high-definition/Runtime/Lighting/ProbeVolume/DynamicGI/ProceduralNeighborsMesh.hlsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ VaryingsType VertMeshProcedural(uint vertexID, uint instanceID)
107107
case 1:
108108
color = UnpackEmission(neighborData.emission);
109109
break;
110+
default:
111+
color = 0.0;
112+
break;
110113
}
111114

112115
#ifdef VARYINGS_NEED_POSITION_WS

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPassDynamicGIDataSample.hlsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ void Frag( Varyings varInput,
7575
float requestsPerRow = ceil(_RequestCount / _RequestsPerColumn);
7676
float2 drawSize = float2(requestsPerRow, _RequestsPerColumn) * 2;
7777

78-
int2 texel = floor(input.positionSS.xy);
79-
int2 requestCoord = texel / 2;
78+
uint2 texel = (uint2)(int2)max(0.0, floor(input.positionSS.xy)); // max just for precision - not technically necessary.
79+
uint2 requestCoord = texel >> 1;
8080
int localIdx = requestCoord.y * requestsPerRow + requestCoord.x;
8181

8282
// Silence compiler warning about potentially uninitialized variable.
@@ -87,7 +87,7 @@ void Frag( Varyings varInput,
8787
ExtraDataRequest req = _RequestsInputData[localIdx];
8888

8989
// Modify input with hit data
90-
int2 requestFragment = texel % 2;
90+
uint2 requestFragment = texel & 1u;
9191

9292
float2 uv = req.uv + req.uvDdx * requestFragment.x + req.uvDdy * requestFragment.y;
9393
float3 position = req.position + req.positionDdx * requestFragment.x + req.positionDdy * requestFragment.y;

0 commit comments

Comments
 (0)