Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,15 @@ jobs:
artifact-out: test-windows-msvc17-avx512
artifact-path: build_regression_tests/tests*.xml build_regression_tests/failed*
artifact-on-failure: true

test-find-ospray:
needs: build-windows-msvc17
uses: intel-innersource/libraries.devops.renderkit.workflows/.github/workflows/windows.yml@main
with:
cmd: |
md buildtut
cd buildtut
$env:ospray_DIR=(Get-ChildItem $env:GITHUB_WORKSPACE\build\install\ospray\lib\cmake\ospray-* | Select-Object -Expand FullName)
cmake ..\apps\ospTutorial\ospTutorialFindospray
cmake --build .
artifact-in: build-windows-msvc17
199 changes: 106 additions & 93 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/ospExamples/GLFWOSPRayWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ GLFWOSPRayWindow::GLFWOSPRayWindow(

glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_TRUE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
#ifdef __APPLE_
#ifdef __APPLE__
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
const char *glslVersion = "#version 150";
Expand Down
1 change: 1 addition & 0 deletions apps/ospTestSuite/test_enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ TEST(Enums, VKLUnstructuredCellType)
ASSERT_EQ(OSP_HEXAHEDRON, VKL_HEXAHEDRON);
ASSERT_EQ(OSP_WEDGE, VKL_WEDGE);
ASSERT_EQ(OSP_PYRAMID, VKL_PYRAMID);
ASSERT_EQ(sizeof(OSPUnstructuredCellType), 1); // must fit in uint8
}

TEST(Enums, VKLAMRMethod)
Expand Down
3 changes: 3 additions & 0 deletions cmake/compiler/msvc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
## SPDX-License-Identifier: Apache-2.0

set(COMMON_CXX_FLAGS "/EHsc /MP /GR /bigobj")
if (MSVC_VERSION GREATER_EQUAL 1914)
string(APPEND COMMON_CXX_FLAGS " /Zc:__cplusplus")
endif()

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${COMMON_CXX_FLAGS} /Ox /fp:fast /Oi /Gy ")
Expand Down
6 changes: 6 additions & 0 deletions cmake/ospray_cmake_config/osprayConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ set_target_properties(ospray::ospray PROPERTIES
set_target_properties(ospray::ospray_module_cpu PROPERTIES
INTERFACE_LINK_LIBRARIES "ospray::ospray;${OPENVKL_LIBRARY};${EMBREE_LIBRARY}")

# https://gitlab.kitware.com/cmake/cmake/-/issues/18837
if (MSVC AND (MSVC_VERSION GREATER_EQUAL 1914))
set_property(TARGET ospray::ospray APPEND PROPERTY
INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>")
endif()

# Reset CMake module path to its state when this script was called.
set(CMAKE_MODULE_PATH ${OSPRAY_CALLERS_CMAKE_MODULE_PATH})

Expand Down
23 changes: 11 additions & 12 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,12 @@ the vertices and data values. Vertex ordering is the same as
`VTK_PYRAMID`: four bottom vertices counterclockwise, then the top
vertex.

To maintain VTK data compatibility, the `index` array may be specified
with cell sizes interleaved with vertex indices in the following format:
$n, id_1, ..., id_n, m, id_1, ..., id_m$. This alternative `index` array
layout can be enabled through the `indexPrefixed` flag (in which case,
the `cell.type` parameter must be omitted).
For backward compatibility with legacy vtkCellArray the `index` array
can also be specified with cell sizes interleaved with vertex indices in
the following format: $n, id_1, ..., id_n, m, id_1, ..., id_m$. This
alternative `index` array layout can be enabled through the
`indexPrefixed` flag (in which case, the `cell.type` parameter must be
omitted).

------------------- ------------------ -------- ---------------------------------------
Type Name Default Description
Expand All @@ -850,9 +851,9 @@ the `cell.type` parameter must be omitted).
vertex array(s)) that form cells

bool indexPrefixed false indicates that the `index` array is
compatible to VTK, where the indices of
each cell are prefixed with the number
of vertices
compatible to legacy vtkCellArray,
where the indices of each cell are
prefixed with the number of vertices
Comment on lines 853 to +856

uint32[] / uint64[] cell.index [data] array of locations (into the
index array), specifying the first index
Expand Down Expand Up @@ -3387,8 +3388,8 @@ The CPU module is implicitly loaded and the `cpu` device is
automatically used if no other options are specified.


GPU (Beta)
---------
GPU
----

To use the GPU for rendering load the `gpu` module and select the `gpu`
device:
Expand Down Expand Up @@ -3441,11 +3442,9 @@ correctly on the GPU device:

- Multiple volumes in the scene
- Clipping
- Motion blur
- Subdivision surfaces
- Progress reporting via `ospGetProgress` or canceling the frame via `ospCancel`
- Picking via `ospPick`
- Adaptive accumulation via `OSP_FB_VARIANCE` and `varianceThreshold`
- Framebuffer channels `OSP_FB_ID_*` (id buffers)
- Experimental support for shared device-only data, works only for
`structuredRegular` volume
Expand Down
2 changes: 1 addition & 1 deletion modules/cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mark_as_advanced(OSPRAY_MODULE_CPU)

cmake_dependent_option(
OSPRAY_MODULE_GPU
"Build the GPU module (beta)"
"Build the GPU module"
OFF
EMBREE_SYCL_SUPPORT
OFF
Expand Down
6 changes: 6 additions & 0 deletions modules/cpu/geometry/Curves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ void Curves::createEmbreeGeometry()
setEmbreeGeometryBuffer(
embreeGeometry, RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE, texcoordData, 1);
}
capData.clear();
if (curveType == OSP_DISJOINT) {
// disable caps to get always open cones/cylinders
capData.resize(numPrimitives(), RTC_CURVE_FLAG_NEIGHBOR_LEFT | RTC_CURVE_FLAG_NEIGHBOR_RIGHT);
setEmbreeGeometryBuffer(embreeGeometry, RTC_BUFFER_TYPE_FLAGS, capData);
}

rtcCommitGeometry(embreeGeometry);
}
Expand Down
1 change: 1 addition & 0 deletions modules/cpu/geometry/Curves.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct OSPRAY_SDK_INTERFACE Curves
Ref<const DataT<vec4f>> tangentData;
Ref<const DataT<vec4f>> colorData;
Ref<const DataT<vec2f>> texcoordData;
std::vector<uint8_t> capData;

RTCGeometryType embreeCurveType{(RTCGeometryType)-1};

Expand Down
3 changes: 1 addition & 2 deletions modules/cpu/geometry/SpheresShared.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ struct Spheres
Data1D sphere;
Data1D texcoord;
Data1D normalData;
float global_radius;
OSPSphereType sphereType;

#ifdef __cplusplus
Spheres() : global_radius(.01f)
Spheres()
{
super.type = GEOMETRY_TYPE_SPHERES;
}
Expand Down
45 changes: 27 additions & 18 deletions modules/cpu/math/sobol.ih
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,30 @@ OSPRAY_BEGIN_ISPC_NAMESPACE
#ifdef OSPRAY_TARGET_SYCL
#include "sobol.inl"
#else
extern const uniform unsigned int Sobol_revMatrices[4 * 32];
extern const uniform unsigned int Sobol_revMatrices[3 * 32];
extern const uniform unsigned int Sobol_matrices[5 * 52];
#endif

// compute component 1 of the Sobol'-sequence (count starting from 0)
// Ahmed, "An Implementation Algorithm of 2D Sobol Sequence Fast, Elegant, and
// Compact", EGSR 2024, https://doi.org/10.2312/sr.20241147
inline uint32 Sobol_revSample1(uint32 v)
{
v ^= v << 16;
v ^= (v & 0x00FF00FFu) << 8;
v ^= (v & 0x0F0F0F0Fu) << 4;
v ^= (v & 0x33333333u) << 2;
v ^= (v & 0x55555555u) << 1;
return reverseBits(v);
}

// compute components 1 and 2 of the Sobol'-sequence (count starting from 0)
inline vec2ui Sobol_revSample2(uint32 revIndex)
{
vec2ui result = make_vec2ui(0);
for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 4) {
if (revIndex & 0x80000000u) {
result.x ^= Sobol_revMatrices[i];
result.y ^= Sobol_revMatrices[i + 1];
}
vec2ui result = make_vec2ui(Sobol_revSample1(revIndex), 0u);
for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 3) {
if (revIndex & 0x80000000u)
result.y ^= Sobol_revMatrices[i];
}

return result;
Expand All @@ -51,12 +62,11 @@ inline vec2ui Sobol_revSample2(uint32 revIndex)
// compute components 1 to 3 of the Sobol'-sequence (count starting from 0)
inline vec3ui Sobol_revSample3(uint32 revIndex)
{
vec3ui result = make_vec3ui(0);
for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 4) {
vec3ui result = make_vec3ui(Sobol_revSample1(revIndex), 0u, 0u);
for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 3) {
if (revIndex & 0x80000000u) {
result.x ^= Sobol_revMatrices[i];
result.y ^= Sobol_revMatrices[i + 1];
result.z ^= Sobol_revMatrices[i + 2];
result.y ^= Sobol_revMatrices[i];
result.z ^= Sobol_revMatrices[i + 1];
}
}

Expand All @@ -66,13 +76,12 @@ inline vec3ui Sobol_revSample3(uint32 revIndex)
// compute components 1 to 4 of the Sobol'-sequence (count starting from 0)
inline vec4ui Sobol_revSample4(uint32 revIndex)
{
vec4ui result = make_vec4ui(0);
for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 4) {
vec4ui result = make_vec4ui(Sobol_revSample1(revIndex), 0u, 0u, 0u);
for (uniform uint32 i = 0; revIndex; revIndex <<= 1, i += 3) {
if (revIndex & 0x80000000u) {
result.x ^= Sobol_revMatrices[i];
result.y ^= Sobol_revMatrices[i + 1];
result.z ^= Sobol_revMatrices[i + 2];
result.w ^= Sobol_revMatrices[i + 3];
result.y ^= Sobol_revMatrices[i];
result.z ^= Sobol_revMatrices[i + 1];
result.w ^= Sobol_revMatrices[i + 2];
}
}

Expand Down
34 changes: 1 addition & 33 deletions modules/cpu/math/sobol.inl
Original file line number Diff line number Diff line change
Expand Up @@ -30,163 +30,131 @@
// http://web.maths.unsw.edu.au/~fkuo/sobol/new-joe-kuo-6.21201

// bit-reversed and interleaved
OSPRAY_GLOBAL const unsigned int Sobol_revMatrices[4 * 32] = {
0x1u,
OSPRAY_GLOBAL const unsigned int Sobol_revMatrices[3 * 32] = {
0x1u,
0x1u,
0x1u,

0x3u,
0x3u,
0x3u,
0x2u,

0x5u,
0x6u,
0x4u,
0x4u,

0xfu,
0x9u,
0xau,
0xdu,

0x11u,
0x17u,
0x1fu,
0x1fu,

0x33u,
0x3au,
0x2eu,
0x3bu,

0x55u,
0x71u,
0x45u,
0x5eu,

0xffu,
0xa3u,
0xc9u,
0xb9u,

0x101u,
0x116u,
0x11bu,
0x15au,

0x303u,
0x339u,
0x2a4u,
0x3f4u,

0x505u,
0x677u,
0x79au,
0x685u,

0xf0fu,
0x9aau,
0xb67u,
0xd0fu,

0x1111u,
0x1601u,
0x101eu,
0x115bu,

0x3333u,
0x3903u,
0x302du,
0x23f6u,

0x5555u,
0x7706u,
0x4041u,
0x4681u,

0xffffu,
0xaa09u,
0xa0c3u,
0xdd02u,

0x10001u,
0x10117u,
0x1f104u,
0x1e144u,

0x30003u,
0x3033au,
0x2e28au,
0x393cdu,

0x50005u,
0x60671u,
0x457dfu,
0x5a6dfu,

0xf000fu,
0x909a3u,
0xc9baeu,
0xb4dbbu,

0x110011u,
0x171616u,
0x11a105u,
0x14401eu,

0x330033u,
0x3a3939u,
0x2a7289u,
0x3cd039u,

0x550055u,
0x717777u,
0x79e7dbu,
0x6df05au,

0xff00ffu,
0xa3aaaau,
0xb6dba4u,
0xdbb0b4u,

0x1010101u,
0x1170001u,
0x100011au,
0x101e145u,

0x3030303u,
0x33a0003u,
0x30002a7u,
0x20393cfu,

0x5050505u,
0x6710006u,
0x400079eu,
0x405a6dbu,

0xf0f0f0fu,
0x9a30009u,
0xa000b6du,
0xd0b4db6u,

0x11111111u,
0x16160017u,
0x1f001001u,
0x1f144001u,

0x33333333u,
0x3939003au,
0x2e003003u,
0x3b3cd002u,

0x55555555u,
0x77770071u,
0x45004004u,
0x5e6df004u,

0xffffffffu,
0xaaaa00a3u,
0xc900a00au,
0xb9dbb00du,
Expand Down
Loading
Loading