Skip to content

Commit

Permalink
Upgrade to Embree 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
gonsolo committed Mar 9, 2024
1 parent f78ba05 commit e6623a2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
name: "gonzales",
dependencies: [
"SWCompression",
"embree3",
"embree4",
"openImageIOBridge",
"cuda",
"cudaBridge",
Expand All @@ -35,7 +35,7 @@ let package = Package(
dependencies: ["cuda"],
swiftSettings: [.interoperabilityMode(.Cxx)]
),
.systemLibrary(name: "embree3"),
.systemLibrary(name: "embree4"),
.systemLibrary(name: "openimageio", pkgConfig: "OpenImageIO"),
.systemLibrary(name: "cuda", pkgConfig: "cuda-12.3"),
.systemLibrary(name: "ptex", pkgConfig: "ptex"),
Expand Down
1 change: 0 additions & 1 deletion Sources/embree3/embree3.h

This file was deleted.

5 changes: 0 additions & 5 deletions Sources/embree3/module.modulemap

This file was deleted.

1 change: 1 addition & 0 deletions Sources/embree4/embree4.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <embree4/rtcore.h>
5 changes: 5 additions & 0 deletions Sources/embree4/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module embree4 {
umbrella header "embree4.h"
link "embree4"
}

11 changes: 4 additions & 7 deletions Sources/gonzales/Accelerators/Embree.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Foundation
import embree3
import embree4

// swift-format-ignore: AlwaysUseLowerCamelCase
@_silgen_name("_swift_stdlib_immortalize")
Expand Down Expand Up @@ -139,14 +139,11 @@ final class EmbreeAccelerator: EmbreeBase {
v: 0,
primID: 0,
geomID: rtcInvalidGeometryId,
instID: rtcInvalidGeometryId)
instID: rtcInvalidGeometryId,
instPrimID: 0)

//_unsafePerformance {
var rayhit = RTCRayHit(ray: rtcRay, hit: rtcHit)
var context = RTCIntersectContext()
rtcInitIntersectContext(&context)
rtcIntersect1(rtcScene, &context, &rayhit)
//}
rtcIntersect1(rtcScene, &rayhit, nil)

guard rayhit.hit.geomID != rtcInvalidGeometryId else {
return empty(#line)
Expand Down

0 comments on commit e6623a2

Please sign in to comment.