From 92da4f3aab339f4ac58f8e4a29f44cbcbb7d9fad Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 6 Aug 2024 15:19:32 +0200 Subject: [PATCH] [Text] Use FramebufferLayout as surface cache key --- src/Aardvark.Rendering.GL/Runtime/Runtime.fs | 4 ---- src/Aardvark.Rendering.Text/Font.fs | 12 ++++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Aardvark.Rendering.GL/Runtime/Runtime.fs b/src/Aardvark.Rendering.GL/Runtime/Runtime.fs index 9a7d66c5..6d3f41de 100644 --- a/src/Aardvark.Rendering.GL/Runtime/Runtime.fs +++ b/src/Aardvark.Rendering.GL/Runtime/Runtime.fs @@ -385,11 +385,7 @@ type Runtime(debug : IDebugConfig) = member x.PrepareBuffer (b : IBuffer, [] storage : BufferStorage) = ctx.CreateBuffer(b, storage) member x.PrepareEffect (signature : IFramebufferSignature, effect : FShade.Effect, topology : IndexedGeometryMode) : IBackendSurface = Operators.using ctx.ResourceLock (fun d -> - if signature.LayerCount > 1 then - Log.warn("[PrepareSurface] Using Triangle topology.") - let _, program = ctx.CreateProgram(signature, Surface.Effect effect, topology) - AVal.force program :> IBackendSurface ) diff --git a/src/Aardvark.Rendering.Text/Font.fs b/src/Aardvark.Rendering.Text/Font.fs index 0bc5804d..fc054edf 100644 --- a/src/Aardvark.Rendering.Text/Font.fs +++ b/src/Aardvark.Rendering.Text/Font.fs @@ -100,9 +100,9 @@ type ShapeCache(r : IRuntime) = let ranges = ConcurrentDictionary() - let surfaceCache = ConcurrentDictionary>() - let boundarySurfaceCache = ConcurrentDictionary>() - let billboardSurfaceCache = ConcurrentDictionary>() + let surfaceCache = ConcurrentDictionary>() + let boundarySurfaceCache = ConcurrentDictionary>() + let billboardSurfaceCache = ConcurrentDictionary>() let pathShader = @@ -154,7 +154,7 @@ type ShapeCache(r : IRuntime) = ] let surface (s : IFramebufferSignature) = - surfaceCache.GetOrAdd(s, fun s -> + surfaceCache.GetOrAdd(s.Layout, fun _ -> lazy ( r.PrepareEffect( s, [ @@ -166,7 +166,7 @@ type ShapeCache(r : IRuntime) = ).Value let boundarySurface (s : IFramebufferSignature) = - boundarySurfaceCache.GetOrAdd(s, fun s -> + boundarySurfaceCache.GetOrAdd(s.Layout, fun _ -> lazy ( r.PrepareEffect( s, [ @@ -178,7 +178,7 @@ type ShapeCache(r : IRuntime) = ).Value let billboardSurface (s : IFramebufferSignature) = - billboardSurfaceCache.GetOrAdd(s, fun s -> + billboardSurfaceCache.GetOrAdd(s.Layout, fun _ -> lazy ( r.PrepareEffect( s, [