Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.7.1 patch updates #148

Merged
merged 5 commits into from
Aug 22, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/anari_sdk_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ jda/remote-device ]
pull_request:
branches: [ main ]
branches: [ main, next_release ]

env:
ANARI_LIBRARY: helide
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

## Establish project

project(anari VERSION 0.7.0 LANGUAGES C CXX)
project(anari VERSION 0.7.1 LANGUAGES C CXX)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
Expand Down
2 changes: 1 addition & 1 deletion cmake/anariConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (@INSTALL_CODE_GEN_SCRIPTS@)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/anari_generate_codegen.cmake)
endif()

if (@INSTALL_VIEWER_LIBRARY@)
if (@INSTALL_VIEWER_LIBRARY@ AND NOT TARGET anari_viewer)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/anari_sdk_fetch_project.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/cmake_project_commands.cmake)
add_subdirectory(
Expand Down
2 changes: 1 addition & 1 deletion libs/helide/HelideDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ int HelideDevice::getProperty(ANARIObject object,
{
if (handleIsDevice(object)) {
std::string_view prop = name;
if (prop == "feature" && type == ANARI_STRING_LIST) {
if (prop == "extension" && type == ANARI_STRING_LIST) {
helium::writeToVoidP(mem, query_extensions());
return 1;
} else if (prop == "helide" && type == ANARI_BOOL) {
Expand Down
10 changes: 9 additions & 1 deletion libs/helide/scene/surface/geometry/Sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,18 @@ void Sphere::commit()
sizeof(float4),
numSpheres);

m_attributeIndex.clear();

if (m_index) {
m_attributeIndex.reserve(m_index->size());

const auto *begin = m_index->beginAs<uint32_t>();
const auto *end = m_index->endAs<uint32_t>();
const auto *vertices = m_vertexPosition->beginAs<float3>();

size_t sphereID = 0;
std::transform(begin, end, vr, [&](uint32_t i) {
m_attributeIndex.push_back(i);
const auto &v = vertices[i];
const float r = radius ? radius[i] : m_globalRadius;
return float4(v.x, v.y, v.z, r);
Expand Down Expand Up @@ -88,7 +93,10 @@ float4 Sphere::getAttributeValue(const Attribute &attr, const Ray &ray) const
if (!attributeArray)
return Geometry::getAttributeValue(attr, ray);

return readAttributeValue(attributeArray, ray.primID);
const auto primID =
m_attributeIndex.empty() ? ray.primID : m_attributeIndex[ray.primID];

return readAttributeValue(attributeArray, primID);
}

void Sphere::cleanup()
Expand Down
1 change: 1 addition & 0 deletions libs/helide/scene/surface/geometry/Sphere.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ struct Sphere : public Geometry
helium::IntrusivePtr<Array1D> m_vertexPosition;
helium::IntrusivePtr<Array1D> m_vertexRadius;
std::array<helium::IntrusivePtr<Array1D>, 5> m_vertexAttributes;
std::vector<uint32_t> m_attributeIndex;
float m_globalRadius{0.f};
};

Expand Down