Skip to content

Commit 6949228

Browse files
FrancescoC-unityslunityJordanL8sebastienlagardeadrien-de-tocqueville
authored
[Backport 8.x.x] Fixed error Maximum allowed thread group count is 65535 when resolution is very high (#2623)
* [10.x.x] Axf: add normal gradients and all mapping modes (uv, planar, triplanar) #583 * [10.x.x] Axf fix shininess exp to roughness, ssr transparent and alpha test #587 * Update Light-Component.md (#682) * push meta * removed undesired change in AXF * Fix transparent movec scene view #698 * Porting console fixes to staging (#699) * Update HDRP-Camera.md (#706) * Pre warm RT Handle system so that reallocations are reduced. #713 * Update PlanarReflectionProbeCache.cs * Update preview naming in raytrace component #753 * Workaround for GetKernelThreadGroupSizes returning wrong data #760 * Sanitize transparent motion vectors setting #761 * Standard terrain upgrader (#762) * Update Reflection-Probe (#790) * Update Reflection-Probe.md * Update Reflection-Probe.md Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix reflection probe framesettings override #796 * Force post process parent setting to be before child settings #799 * Fixed 1253367 by rebaking probe with missing baked texture. #818 * Fix issue with blocky artifacts when decals affecting metallic are applied on specular color workflow #823 * Fixed blend distance editing (1248931) #838 * Fix API breaking change: Add Public quality to Raytracing volume effect * Fix API breaking change: Add Public quality to Raytracing volume effect - RR * Update HDR information. Also updated format and links. (#853) * Fix message for metal and ao (#859) * d Fix issue with the blue line of prefab modifications for Volume mode #860 * Recompute FOV when generating PixelCoord To WorldSpace View Direction Matrix #865 * Upgrade default legacy terrain to HDRP default TerrainLit (#883) * Editing volumes via script doc (#884) * Added Volumes API doc * Update Volumes-API.md * Changed terminology back to Volume Override * Added terminology disclaimer * Update HDRenderPipeline.cs (#994) * Delete 9713_VirtualTexturing.meta * Fix SSAO with double sided material and normal mode to none #1043 * Fix emissive mesh layer mask behaviour #1062 * Use the wide mode to force the UI drawing on a single line (1251235) #1064 * Fix custom pass after post process buffer #1072 * Fix for area light baked data not updating when changing the gizmo #1075 * Fixed an error when switch area light shape to disk while an emissive… #1112 * Have the PBR Sky not render black when below horizon #1116 * Find the appropriate default frame settings per editor (case 1247631) #1129 * Fix taaFrameIndex and restore TAA tests for XR #534 * fix typo in the Render Pipeline Wizard #1037 * Add light layer on indirect lighting controller #777 * [8.x.x Backport] Fix exposure white flash when enabling SSR (#842) * fix white flash * changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [8.x.x Backport] Fix transparent/opaque motion vector inconsistencies by allowing camera-only transparent motion vectors (#837) * port * changelog * Update HDRenderPipeline.cs Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [8.x.x Backport] Fix depth pyramid issues with dynamic resolution (#847) * Port * changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [Backport 8.x.x] Fixed a serialization issue, preventing quality level parameters to undo/redo and update scene view on change. (#1105) * Fixed a serialization issue, preventing quality level parameters to undo/redo and update scene view on change. * Fixed issue when using Custom * Update changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [Backport 8.x.x] Fixed Look Dev with Light Theme (#1106) * Fixed an issue where opening the look dev window with the light theme would make the window blink and eventually crash unity. # Conflicts: # com.unity.render-pipelines.core/Editor/LookDev/DisplayWindow.cs * Update changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * [Backport 8.x.x] Fixed decal duplication when editing a prefab in context (#1107) * Implemented proper culling for decals when used in prefabs and edited in context. * Compilation fix * Update changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix API breaking change in indirect controller * Fix area light gizmo not updating engine side light v2 #1156 * Add missing ClothObj. * HDRP: Default indirect Lighting controller Layers to Everything to ease the migration * Update HDRenderPipelineResources.asset * Fixed logic of test on presence of HDRP asset that would wrongly trigger (#824) a warning message when not in batch mode. * Rename h to hlsl * Update cas include paths (#1227) * Fix XR single-pass macros in tessellation shaders #1160 * Hdrp/fix hierarchicalbox gizmo symetry and homothety mode ensuring face faces outside #1228 * [8.x.x backport] Fix issues with history sampling and hw dynamic res (#1777) * Fix TAA dynamic res issue * Changelog * [Backport 8.x.x] Fixed an issue where look dev lighting would go black when a new scene is loaded. (#1322) * Fixed an issue where look dev lighting would go black when a new scene is loaded. * Update changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com> * Fix * Changelog Co-authored-by: slunity <37302815+slunity@users.noreply.github.com> Co-authored-by: JordanL8 <lewis.jordan@hotmail.co.uk> Co-authored-by: Sebastien Lagarde <sebastien@unity3d.com> Co-authored-by: Adrien de Tocqueville <adrien.tocqueville@unity3d.com> Co-authored-by: remi-chapelain <57442369+remi-chapelain@users.noreply.github.com> Co-authored-by: fredericv-unity3d <55485372+fredericv-unity3d@users.noreply.github.com> Co-authored-by: Fabien Houlmann <44069206+fabien-unity@users.noreply.github.com> Co-authored-by: Evgenii Golubev <EvgeniiG@users.noreply.github.com> Co-authored-by: JulienIgnace-Unity <julien@unity3d.com> Co-authored-by: Emmanuel Turquin <emmanuel@turquin.org> Co-authored-by: Remi Slysz <40034005+RSlysz@users.noreply.github.com>
1 parent 12de2e3 commit 6949228

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3939
- Fixed Custom Post Processes affecting preview cameras.
4040
- Fixed issue with box light not visible if range is below one and range attenuation is off.
4141
- Fixed serialization issue with matcap scale intensity.
42+
- Fixed error Maximum allowed thread group count is 65535 when resolution is very high.
4243

4344
### Changed
4445
- Remove MSAA debug mode when renderpipeline asset has no MSAA
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#pragma kernel ClearList
22

33
RWStructuredBuffer<uint> _LightListToClear;
4-
int _LightListEntries;
4+
int2 _LightListEntriesAndOffset;
5+
6+
#define _LightListEntries (uint)_LightListEntriesAndOffset.x
7+
#define _LightListOffset (uint)_LightListEntriesAndOffset.y
58

69
[numthreads(64, 1, 1)]
710
void ClearList(uint3 id : SV_DispatchThreadID)
811
{
9-
if (id.x < (uint)_LightListEntries)
10-
_LightListToClear[id.x] = 0;
12+
if ((id.x + _LightListOffset) < (uint)_LightListEntries)
13+
_LightListToClear[id.x + _LightListOffset] = 0;
1114
}

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3124,9 +3124,27 @@ void ClearLightList(HDCamera camera, CommandBuffer cmd, ComputeBuffer bufferToCl
31243124
var kernel = cs.FindKernel("ClearList");
31253125

31263126
cmd.SetComputeBufferParam(cs, kernel, HDShaderIDs._LightListToClear, bufferToClear);
3127-
cmd.SetComputeIntParam(cs, HDShaderIDs._LightListEntries, bufferToClear.count);
3127+
Vector2 countAndOffset = new Vector2Int(bufferToClear.count, 0);
31283128

31293129
int groupSize = 64;
3130+
int totalNumberOfGroupsNeeded = (bufferToClear.count + groupSize - 1) / groupSize;
3131+
3132+
const int maxAllowedGroups = 65535;
3133+
// On higher resolutions we might end up with more than 65535 group which is not allowed, so we need to to have multiple dispatches.
3134+
int i = 0;
3135+
while (totalNumberOfGroupsNeeded > 0)
3136+
{
3137+
countAndOffset.y = maxAllowedGroups * i;
3138+
cmd.SetComputeVectorParam(cs, HDShaderIDs._LightListEntriesAndOffset, countAndOffset);
3139+
3140+
int currGroupCount = Math.Min(maxAllowedGroups, totalNumberOfGroupsNeeded);
3141+
3142+
cmd.DispatchCompute(cs, kernel, currGroupCount, 1, 1);
3143+
3144+
totalNumberOfGroupsNeeded -= currGroupCount;
3145+
i++;
3146+
}
3147+
31303148
cmd.DispatchCompute(cs, kernel, (bufferToClear.count + groupSize - 1) / groupSize, 1, 1);
31313149
}
31323150

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static class HDShaderIDs
175175
public static readonly int g_vLayeredOffsetsBuffer = Shader.PropertyToID("g_vLayeredOffsetsBuffer");
176176

177177
public static readonly int _LightListToClear = Shader.PropertyToID("_LightListToClear");
178-
public static readonly int _LightListEntries = Shader.PropertyToID("_LightListEntries");
178+
public static readonly int _LightListEntriesAndOffset = Shader.PropertyToID("_LightListEntriesAndOffset");
179179

180180
public static readonly int _ViewTilesFlags = Shader.PropertyToID("_ViewTilesFlags");
181181
public static readonly int _MousePixelCoord = Shader.PropertyToID("_MousePixelCoord");

0 commit comments

Comments
 (0)