Skip to content

Commit

Permalink
fixed MappedBuffer count initialization;
Browse files Browse the repository at this point in the history
added GL.Check to RenderTask.Run;
removed obsolete SupressRuntimeStats switch;
  • Loading branch information
luithefirst committed Feb 2, 2017
1 parent e344033 commit 020abad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/Aardvark.Rendering.GL/Core/Config.fs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ module RuntimeConfig =
/// If true, no OpenGL queries take place, i.e. no primitive counting etc.
let mutable SupressGLTimers = false

/// If true, no frame statistics is accumulated for render tasks
let mutable SupressRuntimeStats = false

let mutable SupressSparseBuffers = false

[<AutoOpen>]
Expand Down
9 changes: 7 additions & 2 deletions src/Aardvark.Rendering.GL/Resources/MappedBuffer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,14 @@ type MappedIndirectBuffer(ctx : Context, indexed : bool) =
static let sd = sizeof<DrawCallInfo> |> nativeint
let buffer = ctx.CreateMappedBuffer()

let mutable capacity = 0
let count : nativeptr<int> = NativePtr.alloc 1
let createCount() =
let ptr = NativePtr.alloc 1
NativePtr.write ptr 0
ptr

let mutable capacity = 0
let count : nativeptr<int> = createCount()

let convert =
if indexed then
fun (info : DrawCallInfo) ->
Expand Down
2 changes: 1 addition & 1 deletion src/Aardvark.Rendering.GL/Runtime/RenderTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ module RenderTasks =
beforeRender.OnNext()
NativePtr.write runtimeStats V2i.Zero
let stats = x.Perform(t, fbo)

GL.Check "RenderTask.Run"
afterRender.OnNext()
let rt = NativePtr.read runtimeStats
t.AddDrawCalls(rt.X, rt.Y)
Expand Down

0 comments on commit 020abad

Please sign in to comment.