Skip to content

Commit

Permalink
Pass field parameter by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
szellmann committed Nov 1, 2024
1 parent b250976 commit dce161c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DeviceCopyableObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ inline bool sampleField(const SpatialField &sf, vec3 P, float &value) {
}

VSNRAY_FUNC
inline bool sampleGradient(SpatialField sf, vec3 P, float3 &value) {
inline bool sampleGradient(const SpatialField &sf, vec3 P, float3 &value) {
float x0=0, x1=0, y0=0, y1=0, z0=0, z1=0;
bool b0 = sampleField(sf, P+float3{sf.baseDT, 0.f, 0.f}, x1);
bool b1 = sampleField(sf, P-float3{sf.baseDT, 0.f, 0.f}, x0);
Expand Down

0 comments on commit dce161c

Please sign in to comment.