Commit 4ed82565 authored by Aghiles Kheffache's avatar Aghiles Kheffache

Merge branch 'pr/usd-0.19.1-update' into 'master'

Updating the render delegate against the upcoming USD-0.19.1

See merge request !2
parents 80188e86 5b0a690a
......@@ -143,39 +143,21 @@ HdNSICurves::_InitRepr(TfToken const &reprName,
}
}
void
HdNSICurves::_UpdateRepr(HdSceneDelegate *sceneDelegate,
TfToken const &reprName,
HdDirtyBits *dirtyBits)
{
TF_UNUSED(sceneDelegate);
TF_UNUSED(reprName);
TF_UNUSED(dirtyBits);
// NSI doesn't use the HdRepr structure.
}
void
HdNSICurves::Sync(HdSceneDelegate* sceneDelegate,
HdRenderParam* renderParam,
HdDirtyBits* dirtyBits,
TfToken const& reprName,
bool forcedRepr)
TfToken const& reprName)
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
// The repr token is used to look up an HdBasisCurvesReprDesc struct, which
// has drawing settings for this prim to use. Repr opinions can come
// from the render pass's rprim collection or the scene delegate;
// _GetReprName resolves these multiple opinions.
TfToken calculatedReprName = _GetReprName(reprName, forcedRepr);
// XXX: Curveses can have multiple reprs; this is done, for example, when
// the drawstyle specifies different rasterizing modes between front faces
// and back faces. With raytracing, this concept makes less sense, but
// combining semantics of two HdBasisCurvesReprDesc is tricky in the general case.
// For now, HdNSICurves only respects the first desc; this should be fixed.
_BasisCurvesReprConfig::DescArray descs = _GetReprDesc(calculatedReprName);
_BasisCurvesReprConfig::DescArray descs = _GetReprDesc(reprName);
const HdBasisCurvesReprDesc &desc = descs[0];
// Pull top-level NSI state out of the render param.
......
......@@ -112,8 +112,7 @@ public:
virtual void Sync(HdSceneDelegate* sceneDelegate,
HdRenderParam* renderParam,
HdDirtyBits* dirtyBits,
TfToken const& reprName,
bool forcedRepr) override;
TfToken const& reprName) override;
// Inform the scene graph which state needs to be downloaded in the
// first Sync() call: in this case, topology and points data to build
......@@ -121,16 +120,6 @@ public:
virtual HdDirtyBits GetInitialDirtyBitsMask() const override;
protected:
// Update the named repr object for this Rprim. Repr objects are
// created to support specific reprName tokens, and contain a list of
// HdDrawItems to be passed to the renderpass (via the renderpass calling
// HdRenderIndex::GetDrawItems()). Draw items contain prim data to be
// rendered, but HdNSICurves bypasses them for now, so this function is
// a no-op.
virtual void _UpdateRepr(HdSceneDelegate *sceneDelegate,
TfToken const &reprName,
HdDirtyBits *dirtyBits) override;
// This callback from Rprim gives the prim an opportunity to set
// additional dirty bits based on those already set. This is done
// before the dirty bits are passed to the scene delegate, so can be
......
......@@ -150,39 +150,21 @@ HdNSIMesh::_InitRepr(TfToken const &reprName,
}
}
void
HdNSIMesh::_UpdateRepr(HdSceneDelegate *sceneDelegate,
TfToken const &reprName,
HdDirtyBits *dirtyBits)
{
TF_UNUSED(sceneDelegate);
TF_UNUSED(reprName);
TF_UNUSED(dirtyBits);
// NSI doesn't use the HdRepr structure.
}
void
HdNSIMesh::Sync(HdSceneDelegate* sceneDelegate,
HdRenderParam* renderParam,
HdDirtyBits* dirtyBits,
TfToken const& reprName,
bool forcedRepr)
HdRenderParam* renderParam,
HdDirtyBits* dirtyBits,
TfToken const& reprName)
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
// The repr token is used to look up an HdMeshReprDesc struct, which
// has drawing settings for this prim to use. Repr opinions can come
// from the render pass's rprim collection or the scene delegate;
// _GetReprName resolves these multiple opinions.
TfToken calculatedReprName = _GetReprName(reprName, forcedRepr);
// XXX: Meshes can have multiple reprs; this is done, for example, when
// the drawstyle specifies different rasterizing modes between front faces
// and back faces. With raytracing, this concept makes less sense, but
// combining semantics of two HdMeshReprDesc is tricky in the general case.
// For now, HdNSIMesh only respects the first desc; this should be fixed.
_MeshReprConfig::DescArray descs = _GetReprDesc(calculatedReprName);
_MeshReprConfig::DescArray descs = _GetReprDesc(reprName);
const HdMeshReprDesc &desc = descs[0];
// Pull top-level NSI state out of the render param.
......
......@@ -112,8 +112,7 @@ public:
virtual void Sync(HdSceneDelegate* sceneDelegate,
HdRenderParam* renderParam,
HdDirtyBits* dirtyBits,
TfToken const& reprName,
bool forcedRepr) override;
TfToken const& reprName) override;
// Inform the scene graph which state needs to be downloaded in the
// first Sync() call: in this case, topology and points data to build
......@@ -121,16 +120,6 @@ public:
virtual HdDirtyBits GetInitialDirtyBitsMask() const override;
protected:
// Update the named repr object for this Rprim. Repr objects are
// created to support specific reprName tokens, and contain a list of
// HdDrawItems to be passed to the renderpass (via the renderpass calling
// HdRenderIndex::GetDrawItems()). Draw items contain prim data to be
// rendered, but HdNSIMesh bypasses them for now, so this function is
// a no-op.
virtual void _UpdateRepr(HdSceneDelegate *sceneDelegate,
TfToken const &reprName,
HdDirtyBits *dirtyBits) override;
// This callback from Rprim gives the prim an opportunity to set
// additional dirty bits based on those already set. This is done
// before the dirty bits are passed to the scene delegate, so can be
......
......@@ -140,39 +140,21 @@ HdNSIPointCloud::_InitRepr(TfToken const &reprName,
}
}
void
HdNSIPointCloud::_UpdateRepr(HdSceneDelegate *sceneDelegate,
TfToken const &reprName,
HdDirtyBits *dirtyBits)
{
TF_UNUSED(sceneDelegate);
TF_UNUSED(reprName);
TF_UNUSED(dirtyBits);
// NSI doesn't use the HdRepr structure.
}
void
HdNSIPointCloud::Sync(HdSceneDelegate* sceneDelegate,
HdRenderParam* renderParam,
HdDirtyBits* dirtyBits,
TfToken const& reprName,
bool forcedRepr)
HdRenderParam* renderParam,
HdDirtyBits* dirtyBits,
TfToken const& reprName)
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
// The repr token is used to look up an HdPointsReprDesc struct, which
// has drawing settings for this prim to use. Repr opinions can come
// from the render pass's rprim collection or the scene delegate;
// _GetReprName resolves these multiple opinions.
TfToken calculatedReprName = _GetReprName(reprName, forcedRepr);
// XXX: PointCloudes can have multiple reprs; this is done, for example, when
// the drawstyle specifies different rasterizing modes between front faces
// and back faces. With raytracing, this concept makes less sense, but
// combining semantics of two HdPointsReprDesc is tricky in the general case.
// For now, HdNSIPointCloud only respects the first desc; this should be fixed.
_PointsReprConfig::DescArray descs = _GetReprDesc(calculatedReprName);
_PointsReprConfig::DescArray descs = _GetReprDesc(reprName);
const HdPointsReprDesc &desc = descs[0];
// Pull top-level NSI state out of the render param.
......
......@@ -113,8 +113,7 @@ public:
virtual void Sync(HdSceneDelegate* sceneDelegate,
HdRenderParam* renderParam,
HdDirtyBits* dirtyBits,
TfToken const& reprName,
bool forcedRepr) override;
TfToken const& reprName) override;
// Inform the scene graph which state needs to be downloaded in the
// first Sync() call: in this case, topology and points data to build
......@@ -122,16 +121,6 @@ public:
virtual HdDirtyBits GetInitialDirtyBitsMask() const override;
protected:
// Update the named repr object for this Rprim. Repr objects are
// created to support specific reprName tokens, and contain a list of
// HdDrawItems to be passed to the renderpass (via the renderpass calling
// HdRenderIndex::GetDrawItems()). Draw items contain prim data to be
// rendered, but HdNSIPointCloud bypasses them for now, so this function is
// a no-op.
virtual void _UpdateRepr(HdSceneDelegate *sceneDelegate,
TfToken const &reprName,
HdDirtyBits *dirtyBits) override;
// This callback from Rprim gives the prim an opportunity to set
// additional dirty bits based on those already set. This is done
// before the dirty bits are passed to the scene delegate, so can be
......
......@@ -67,11 +67,11 @@ std::mutex HdNSIRenderDelegate::_mutexResourceRegistry;
std::atomic_int HdNSIRenderDelegate::_counterResourceRegistry;
HdResourceRegistrySharedPtr HdNSIRenderDelegate::_resourceRegistry;
static void nsi_error_handler(void *userdata, int level, int code, const char *message)
/*static void nsi_error_handler(void *userdata, int level, int code, const char *message)
{
HdNSIRenderDelegate *rDel = static_cast<HdNSIRenderDelegate *>(userdata);
rDel->HandleNSIError(level, code, message);
}
}*/
/* static */
void
......
......@@ -38,7 +38,7 @@ HdNSIBufferSampler::Sample(int index, void* value,
// TODO: as of USD commit 2fe10266254105431a4434b94a2c507fa13bdb17
// GetNumElements returns a size_t instead of int:
// if (_buffer.GetNumElements() <= (size_t)index ||
if (_buffer.GetNumElements() <= index ||
if (_buffer.GetNumElements() <= static_cast<size_t>(index) ||
_buffer.GetTupleType() != dataType) {
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment