提交 1b160afe 编写于 作者: M Matt Pharr

Remove PBRT_CPU_GPU qualifier from various methods that do not actually need it.

上级 c5b87a4b
......@@ -30,7 +30,7 @@ class BSSRDF : public TaggedPointer<TabulatedBSSRDF> {
PBRT_CPU_GPU inline pstd::optional<BSSRDFProbeSegment> SampleSp(Float u1,
Point2f u2) const;
PBRT_CPU_GPU inline BSSRDFSample ProbeIntersectionToSample(
inline BSSRDFSample ProbeIntersectionToSample(
const SubsurfaceInteraction &si, ScratchBuffer &scratchBuffer) const;
};
......
......@@ -51,15 +51,15 @@ class Material
std::string ToString() const;
template <typename TextureEvaluator>
PBRT_CPU_GPU inline BSDF GetBSDF(TextureEvaluator texEval, MaterialEvalContext ctx,
SampledWavelengths &lambda,
ScratchBuffer &buf) const;
inline BSDF GetBSDF(TextureEvaluator texEval, MaterialEvalContext ctx,
SampledWavelengths &lambda,
ScratchBuffer &buf) const;
template <typename TextureEvaluator>
PBRT_CPU_GPU inline BSSRDF GetBSSRDF(TextureEvaluator texEval,
MaterialEvalContext ctx,
SampledWavelengths &lambda,
ScratchBuffer &buf) const;
inline BSSRDF GetBSSRDF(TextureEvaluator texEval,
MaterialEvalContext ctx,
SampledWavelengths &lambda,
ScratchBuffer &buf) const;
template <typename TextureEvaluator>
PBRT_CPU_GPU inline bool CanEvaluateTextures(TextureEvaluator texEval) const;
......
......@@ -111,7 +111,6 @@ class Medium : public TaggedPointer<HomogeneousMedium, UniformGridMedium, CloudM
MediumProperties SamplePoint(Point3f p, const SampledWavelengths &lambda) const;
// Medium Public Methods
PBRT_CPU_GPU
RayMajorantIterator SampleRay(Ray ray, Float tMax, const SampledWavelengths &lambda,
ScratchBuffer &buf) const;
};
......
......@@ -300,7 +300,7 @@ inline BSSRDFSample BSSRDF::ProbeIntersectionToSample(
BxDF *bxdf = (BxDF *)scratchBuffer.Alloc(sizeof(BxDF), alignof(BxDF));
return ptr->ProbeIntersectionToSample(si, bxdf);
};
return Dispatch(pits);
return DispatchCPU(pits);
}
} // namespace pbrt
......
......@@ -240,10 +240,8 @@ class SurfaceInteraction : public Interaction {
RayDifferential SpawnRay(const RayDifferential &rayi, const BSDF &bsdf, Vector3f wi,
int /*BxDFFlags*/ flags, Float eta) const;
PBRT_CPU_GPU
BSDF GetBSDF(const RayDifferential &ray, SampledWavelengths &lambda, Camera camera,
ScratchBuffer &scratchBuffer, Sampler sampler);
PBRT_CPU_GPU
BSSRDF GetBSSRDF(const RayDifferential &ray, SampledWavelengths &lambda,
Camera camera, ScratchBuffer &scratchBuffer);
......
......@@ -823,7 +823,7 @@ inline RayMajorantIterator Medium::SampleRay(Ray ray, Float tMax,
medium->SampleRay(ray, tMax, lambda, iter);
return iter;
};
return Dispatch(sample);
return DispatchCPU(sample);
}
} // namespace pbrt
......
......@@ -97,7 +97,6 @@ class alignas(PBRT_L1_CACHE_LINE_SIZE) ScratchBuffer {
return *this;
}
PBRT_CPU_GPU
void *Alloc(size_t size, size_t align) {
if ((offset % align) != 0)
offset += align - (offset % align);
......@@ -108,13 +107,13 @@ class alignas(PBRT_L1_CACHE_LINE_SIZE) ScratchBuffer {
}
template <typename T, typename... Args>
PBRT_CPU_GPU typename AllocationTraits<T>::SingleObject Alloc(Args &&...args) {
typename AllocationTraits<T>::SingleObject Alloc(Args &&...args) {
T *p = (T *)Alloc(sizeof(T), alignof(T));
return new (p) T(std::forward<Args>(args)...);
}
template <typename T>
PBRT_CPU_GPU typename AllocationTraits<T>::Array Alloc(size_t n = 1) {
typename AllocationTraits<T>::Array Alloc(size_t n = 1) {
using ElementType = typename std::remove_extent_t<T>;
ElementType *ret =
(ElementType *)Alloc(n * sizeof(ElementType), alignof(ElementType));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册