Skip to content

Commit f046f8c

Browse files
committed
Cleanup ANARI_TYPEFOR_SPECIALIZATION
[PR comments]
1 parent 4f477be commit f046f8c

File tree

6 files changed

+15
-19
lines changed

6 files changed

+15
-19
lines changed

devices/rtx/device/optix_visrtx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ constexpr int ATTRIBUTE_VALUES = 4;
145145
}
146146

147147
VISRTX_ANARI_TYPEFOR_SPECIALIZATION(visrtx::box1, ANARI_FLOAT32_BOX1);
148+
VISRTX_ANARI_TYPEFOR_SPECIALIZATION(visrtx::box2, ANARI_FLOAT32_BOX2);
149+
VISRTX_ANARI_TYPEFOR_SPECIALIZATION(visrtx::box3, ANARI_FLOAT32_BOX3);
148150

149151
namespace visrtx {
150152

devices/rtx/device/spatial_field/NvdbRegularField.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
// anari
3737
#include <anari/anari_cpp/Traits.h>
38-
#include <anari/frontend/anari_enums.h>
38+
#include "utility/AnariTypeHelpers.h"
3939

4040
// nanovdb
4141
#include <nanovdb/NanoVDB.h>
@@ -44,8 +44,6 @@
4444
#include <glm/ext/vector_float3.hpp>
4545
#include <glm/gtx/component_wise.hpp>
4646

47-
VISRTX_ANARI_TYPEFOR_SPECIALIZATION(visrtx::box3, ANARI_FLOAT32_BOX3);
48-
4947
namespace visrtx {
5048

5149
// NvdbRegularField definitions /////////////////////////////////////////

devices/rtx/device/spatial_field/StructuredRegularField.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,18 @@
3333

3434
#include "gpu/gpu_decl.h"
3535
#include "gpu/shadingState.h"
36-
#include "utility/AnariTypeHelpers.h"
3736

3837
// anari
3938
#include <anari/anari_cpp/Traits.h>
40-
#include <anari/frontend/anari_enums.h>
39+
#include "utility/AnariTypeHelpers.h"
40+
4141
// std
4242
#include <algorithm>
4343
#include <limits>
4444
#include <vector>
4545
// glm
4646
#include <glm/gtx/component_wise.hpp>
4747

48-
VISRTX_ANARI_TYPEFOR_SPECIALIZATION(visrtx::box3, ANARI_FLOAT32_BOX3);
49-
5048
namespace visrtx {
5149

5250
// Helper functions ///////////////////////////////////////////////////////////

tsd/src/tsd/core/TSDMath.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,9 @@ using mat4 = float4x4;
138138
namespace math = core::math;
139139

140140
} // namespace tsd
141+
142+
namespace anari {
143+
// box1 is already exposed by helium.
144+
ANARI_TYPEFOR_SPECIALIZATION(tsd::core::math::box2, ANARI_FLOAT32_BOX2);
145+
ANARI_TYPEFOR_SPECIALIZATION(tsd::core::math::box3, ANARI_FLOAT32_BOX3);
146+
} // namespace anari

tsd/src/tsd/core/scene/objects/SpatialField.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
// std
1414
#include <optional>
1515

16-
namespace anari {
17-
ANARI_TYPEFOR_SPECIALIZATION(tsd::math::box3, ANARI_FLOAT32_BOX3);
18-
}
19-
2016
namespace tsd::core {
2117

2218
SpatialField::SpatialField(Token stype) : Object(ANARI_SPATIAL_FIELD, stype)
@@ -44,8 +40,8 @@ SpatialField::SpatialField(Token stype) : Object(ANARI_SPATIAL_FIELD, stype)
4440
addParameter("roi")
4541
.setDescription("ROI box in object space")
4642
.setValue(tsd::math::box3(
47-
tsd::math::float3(-INFINITY, -INFINITY, -INFINITY),
48-
tsd::math::float3(INFINITY, INFINITY, INFINITY)));
43+
tsd::math::float3(-math::inf, -math::inf, -math::inf),
44+
tsd::math::float3(math::inf, math::inf, math::inf)));
4945
} else if (stype == tokens::spatial_field::amr) {
5046
addParameter("gridOrigin")
5147
.setValue(tsd::math::float3(0.f, 0.f, 0.f))
@@ -85,8 +81,8 @@ SpatialField::SpatialField(Token stype) : Object(ANARI_SPATIAL_FIELD, stype)
8581
addParameter("roi")
8682
.setDescription("ROI box in object space")
8783
.setValue(tsd::math::box3(
88-
tsd::math::float3(-INFINITY, -INFINITY, -INFINITY),
89-
tsd::math::float3(INFINITY, INFINITY, INFINITY)));
84+
tsd::math::float3(-math::inf, -math::inf, -math::inf),
85+
tsd::math::float3(math::inf, math::inf, math::inf)));
9086
}
9187
}
9288

tsd/src/tsd/io/importers/import_SILO.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
#endif
2828
#endif
2929

30-
namespace anari {
31-
ANARI_TYPEFOR_SPECIALIZATION(tsd::math::box3, ANARI_FLOAT32_BOX3);
32-
} // namespace anari
33-
3430
namespace tsd::io {
3531

3632
using namespace tsd::core;

0 commit comments

Comments
 (0)