Skip to content

Commit 57dc27f

Browse files
committed
[GeometryPool] culling InstanceCount FShade workaround
1 parent a75e649 commit 57dc27f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/Aardvark.Rendering.GL/Runtime/GeometryPool.fs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,12 @@ module CullingShader =
102102
if id < count then
103103
let b = bounds.[id]
104104
let rootId = int (b.Max.W + 0.5f)
105-
105+
let mutable ic = infos.[id]
106106
if isActive.[rootId] <> 0 && CullingInfo.intersectsViewProj viewProjs.[rootId] b then
107-
infos.[id].InstanceCount <- CullingInfo.instanceCount b
107+
ic.InstanceCount <- CullingInfo.instanceCount b
108108
else
109-
infos.[id].InstanceCount <- 0
109+
ic.InstanceCount <- 0
110+
infos.[id] <- ic
110111
}
111112

112113
type UniformScope with
@@ -905,7 +906,7 @@ module GeometryPoolData =
905906

906907
static let cullingCache = System.Collections.Concurrent.ConcurrentDictionary<Context, Lazy<ComputeProgram>>()
907908
static let boundCache = System.Collections.Concurrent.ConcurrentDictionary<Context, Lazy<Program>>()
908-
909+
909910
let initialCapacity = Fun.NextPowerOfTwo initialCapacity
910911
let adjust (call : DrawCallInfo) =
911912
if indexed then
@@ -1820,4 +1821,4 @@ module GeometryPoolInstance =
18201821
let wanted = iface.inputs |> List.map (fun p -> p.paramSemantic) |> Set.ofList
18211822
let (g,u,i) = load wanted
18221823

1823-
ofGeometry iface g u i
1824+
ofGeometry iface g u i

0 commit comments

Comments
 (0)