Skip to content

Commit

Permalink
Merge pull request #89 from aardvark-platform/iris_workaround
Browse files Browse the repository at this point in the history
Intel IRIS workaround
  • Loading branch information
haraldsteinlechner authored Nov 2, 2021
2 parents f2ea2d9 + b28775d commit 441c314
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 5.1.18

- disabled multisampling for text outline - fix for https://github.com/aardvark-platform/aardvark.rendering/issues/86

### 5.1.17
- fixed package dependeny to FSharp.Data.Adaptive
- [Vulkan] fixed package dependency to GLSLangSharp
Expand Down
20 changes: 18 additions & 2 deletions src/Aardvark.Rendering.Text/SceneGraph.fs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,14 @@ module Sg =
let pass = scope.RenderPass
let pass = if pass = RenderPass.main then RenderPass.shapes else pass

shapes.RasterizerState.Multisample <- AVal.map2 (fun a f -> not f || a) aa fill

let multisample =
(aa, fill) ||> AVal.map2 (fun a f ->
// @krauthaufen - why always multisampling when outline only?
not f || a
)

shapes.RasterizerState.Multisample <- multisample
shapes.RenderPass <- if pass = RenderPass.main then RenderPass.shapes else pass
shapes.BlendState.Mode <- AVal.constant BlendMode.Blend
shapes.VertexAttributes <- cache.VertexBuffers
Expand Down Expand Up @@ -364,7 +371,15 @@ module Sg =

let pass = scope.RenderPass
let pass = if pass = RenderPass.main then RenderPass.shapes else pass
shapes.RasterizerState.Multisample <- AVal.map2 (fun a f -> not f || a) aa fill


let multisample =
(aa, fill) ||> AVal.map2 (fun a f ->
// @krauthaufen - why always multisampling when outline only?
not f || a
)

shapes.RasterizerState.Multisample <- multisample
shapes.RenderPass <- pass
shapes.BlendState.Mode <- AVal.constant BlendMode.Blend
shapes.VertexAttributes <- cache.VertexBuffers
Expand All @@ -376,6 +391,7 @@ module Sg =
//shapes.WriteBuffers <- Some (Set.ofList [DefaultSemantic.Colors])

let boundary = RenderObject.ofScope scope
boundary.RasterizerState.Multisample <- multisample
boundary.RenderPass <- pass
boundary.BlendState.Mode <- AVal.constant BlendMode.Blend
boundary.VertexAttributes <- cache.VertexBuffers
Expand Down
25 changes: 13 additions & 12 deletions src/Application/Aardvark.Application.Slim/Window.fs
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,25 @@ module private GameWindowIO =

let mousePos() =
try
match ctrl with
| Some ctrl ->
let state = OpenTK.Input.Mouse.GetCursorState()
let p = ctrl.PointToClient(Drawing.Point(state.X, state.Y))
let s = ctrl.ClientSize
match ctrl with
| Some ctrl ->
let state = OpenTK.Input.Mouse.GetCursorState()
let p = ctrl.PointToClient(Drawing.Point(state.X, state.Y))
let s = ctrl.ClientSize

let x = clamp 0 (s.Width-1) p.X
let y = clamp 0 (s.Height-1) p.Y
let x = clamp 0 (s.Width-1) p.X
let y = clamp 0 (s.Height-1) p.Y

PixelPosition(x, y, ctrl.ClientSize.Width, ctrl.ClientSize.Height)
| _ ->
PixelPosition(0,0,0,0)
with e ->
PixelPosition(x, y, ctrl.ClientSize.Width, ctrl.ClientSize.Height)
| _ ->
PixelPosition(0,0,0,0)
with e ->
Log.warn "could not grab mouse position."
lastPos


let onMouseDownHandler = EventHandler<MouseButtonEventArgs>(fun s e -> this.Down(%%e, %e.Button))

let onMouseDownHandler = EventHandler<MouseButtonEventArgs>(fun s e -> this.Down((%%e), (%e.Button)))
let onMouseUpHandler = EventHandler<MouseButtonEventArgs>(fun s e -> this.Up(%%e, %e.Button))
let onMouseMoveHandler = EventHandler<MouseMoveEventArgs>(fun s e -> this.Move %%e)
let onMouseWheelHandler = EventHandler<MouseWheelEventArgs>(fun s e -> this.Scroll (%%e, (float e.Delta * 120.0)))
Expand Down

0 comments on commit 441c314

Please sign in to comment.