本文整理汇总了C++中HD_TRACE_FUNCTION函数的典型用法代码示例。如果您正苦于以下问题:C++ HD_TRACE_FUNCTION函数的具体用法?C++ HD_TRACE_FUNCTION怎么用?C++ HD_TRACE_FUNCTION使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HD_TRACE_FUNCTION函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HD_TRACE_FUNCTION
void
HdPoints::_UpdateDrawItem(HdDrawItem *drawItem, HdChangeTracker::DirtyBits *dirtyBits)
{
HD_TRACE_FUNCTION();
HD_MALLOC_TAG_FUNCTION();
SdfPath const& id = GetId();
/* VISIBILITY */
_UpdateVisibility(dirtyBits);
/* CONSTANT PRIMVARS, TRANSFORM AND EXTENT */
_PopulateConstantPrimVars(drawItem, dirtyBits);
/* INSTANCE PRIMVARS */
_PopulateInstancePrimVars(drawItem, dirtyBits, InstancePrimVar);
Hd_PointsShaderKey shaderKey;
drawItem->SetGeometricShader(Hd_GeometricShader::Create(shaderKey));
/* PRIMVAR */
if (HdChangeTracker::IsAnyPrimVarDirty(*dirtyBits, id)) {
_PopulateVertexPrimVars(drawItem, dirtyBits);
}
// VertexPrimVar may be null, if there are no points in the prim.
TF_VERIFY(drawItem->GetConstantPrimVarRange());
}
示例2: HD_TRACE_FUNCTION
void
HdxColorCorrectionTask::Sync(HdSceneDelegate* delegate,
HdTaskContext* ctx,
HdDirtyBits* dirtyBits)
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
if ((*dirtyBits) & HdChangeTracker::DirtyParams) {
HdxColorCorrectionTaskParams params;
if (_GetTaskParams(delegate, ¶ms)) {
_framebufferSize = params.framebufferSize;
_colorCorrectionMode = params.colorCorrectionMode;
_displayOCIO = params.displayOCIO;
_viewOCIO = params.viewOCIO;
_colorspaceOCIO = params.colorspaceOCIO;
_looksOCIO = params.looksOCIO;
_lut3dSizeOCIO = params.lut3dSizeOCIO;
// Rebuild shader with new OCIO settings / shader-code.
_shaderProgram.reset();
}
}
*dirtyBits = HdChangeTracker::Clean;
}
示例3: HD_TRACE_FUNCTION
bool
HdSt_TriangulateFaceVaryingComputation::Resolve()
{
if (!TF_VERIFY(_source)) return false;
if (!_source->IsResolved()) return false;
if (!_TryLock()) return false;
HD_TRACE_FUNCTION();
HD_PERF_COUNTER_INCR(HdPerfTokens->triangulateFaceVarying);
VtValue result;
HdMeshUtil meshUtil(_topology, _id);
if(meshUtil.ComputeTriangulatedFaceVaryingPrimvar(
_source->GetData(),
_source->GetNumElements(),
_source->GetGLElementDataType(),
&result)) {
_SetResult(HdBufferSourceSharedPtr(
new HdVtBufferSource(
_source->GetName(),
result)));
} else {
_SetResult(_source);
}
_SetResolved();
return true;
}
示例4: HD_TRACE_FUNCTION
HdDirtyList::~HdDirtyList()
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
HD_PERF_COUNTER_DECR(HdPerfTokens->dirtyLists);
}
示例5: HD_TRACE_FUNCTION
bool
HdMeshTopology::operator==(HdMeshTopology const &other) const {
HD_TRACE_FUNCTION();
return (_topology == other._topology);
}
示例6: HD_TRACE_FUNCTION
bool
HdSt_DrawBatch::_DrawingProgram::CompileShader(
HdStDrawItem const *drawItem,
bool indirect,
HdStResourceRegistrySharedPtr const &resourceRegistry)
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
// glew has to be initialized
if (!glLinkProgram) {
return false;
}
if (!_geometricShader) {
TF_CODING_ERROR("Can not compile a shader without a geometric shader");
return false;
}
// determine binding points and populate metaData
HdBindingRequestVector customBindings;
bool instanceDraw = true;
_GetCustomBindings(&customBindings, &instanceDraw);
// also (surface, renderPass) shaders use their bindings
HdStShaderCodeSharedPtrVector shaders = GetComposedShaders();
TF_FOR_ALL(it, shaders) {
(*it)->AddBindings(&customBindings);
}
示例7: HD_TRACE_FUNCTION
bool
Hd_TriangulateFaceVaryingComputation::Resolve()
{
if (not TF_VERIFY(_source)) return false;
if (not _source->IsResolved()) return false;
if (not _TryLock()) return false;
HD_TRACE_FUNCTION();
HD_PERF_COUNTER_INCR(HdPerfTokens->triangulateFaceVarying);
VtIntArray const &faceVertexCounts = _topology->GetFaceVertexCounts();
VtIntArray const &holeFaces = _topology->GetHoleIndices();
bool flip = (_topology->GetOrientation() != HdTokens->rightHanded);
HdBufferSourceSharedPtr result;
switch (_source->GetGLElementDataType()) {
case GL_FLOAT:
result = _TriangulateFaceVarying<float>(
_source, faceVertexCounts, holeFaces, flip, _id);
break;
case GL_FLOAT_VEC2:
result = _TriangulateFaceVarying<GfVec2f>(
_source, faceVertexCounts, holeFaces, flip, _id);
break;
case GL_FLOAT_VEC3:
result = _TriangulateFaceVarying<GfVec3f>(
_source, faceVertexCounts, holeFaces, flip, _id);
break;
case GL_FLOAT_VEC4:
result = _TriangulateFaceVarying<GfVec4f>(
_source, faceVertexCounts, holeFaces, flip, _id);
break;
case GL_DOUBLE:
result = _TriangulateFaceVarying<double>(
_source, faceVertexCounts, holeFaces, flip, _id);
break;
case GL_DOUBLE_VEC2:
result = _TriangulateFaceVarying<GfVec2d>(
_source, faceVertexCounts, holeFaces, flip, _id);
break;
case GL_DOUBLE_VEC3:
result = _TriangulateFaceVarying<GfVec3d>(
_source, faceVertexCounts, holeFaces, flip, _id);
break;
case GL_DOUBLE_VEC4:
result = _TriangulateFaceVarying<GfVec4d>(
_source, faceVertexCounts, holeFaces, flip, _id);
break;
default:
TF_CODING_ERROR("Unsupported primvar type for triangulation [%s]",
_id.GetText());
result = _source;
break;
}
_SetResult(result);
_SetResolved();
return true;
}
示例8: HD_TRACE_FUNCTION
void
HdRenderIndex::RemoveRprim(SdfPath const& id)
{
HD_TRACE_FUNCTION();
_RprimMap::iterator rit = _rprimMap.find(id);
if (rit == _rprimMap.end())
return;
_RprimInfo &rprimInfo = rit->second;
SdfPath instancerId = rprimInfo.rprim->GetInstancerId();
_rprimIds.Remove(id);
if (!instancerId.IsEmpty()) {
_tracker.InstancerRPrimRemoved(instancerId, id);
}
_tracker.RprimRemoved(id);
// Ask delegate to actually delete the rprim
rprimInfo.rprim->Finalize(_renderDelegate->GetRenderParam());
_renderDelegate->DestroyRprim(rprimInfo.rprim);
rprimInfo.rprim = nullptr;
_rprimMap.erase(rit);
}
示例9: HD_TRACE_FUNCTION
void
Hd_PrimTypeIndex<PrimType>::RemovePrim(const TfToken &typeId,
const SdfPath &primId,
HdChangeTracker &tracker,
HdRenderDelegate *renderDelegate)
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
typename _TypeIndex::iterator typeIt = _index.find(typeId);
if (typeIt ==_index.end()) {
TF_CODING_ERROR("Unsupported prim type: %s", typeId.GetText());
return;
}
_PrimTypeEntry &typeEntry = _entries[typeIt->second];
typename _PrimMap::iterator primIt = typeEntry.primMap.find(primId);
if (primIt == typeEntry.primMap.end()) {
return;
}
_TrackerRemovePrim(tracker, primId);
_PrimInfo &primInfo = primIt->second;
_RenderDelegateDestroyPrim(renderDelegate, primInfo.prim);
primInfo.prim = nullptr;
typeEntry.primMap.erase(primIt);
typeEntry.primIds.Remove(primId);
}
示例10: HD_TRACE_FUNCTION
/* virtual */
std::string
HdSt_FallbackLightingShader::GetSource(TfToken const &shaderStageKey) const
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
return _glslfx->GetSource(shaderStageKey);
}
示例11: HD_TRACE_FUNCTION
void
HdxSelectionTask::_Execute(HdTaskContext* ctx)
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
// Note that selectionTask comes after renderTask.
}
示例12: HD_TRACE_FUNCTION
TfTokenVector const &
HdRenderPass::GetRenderTags()
{
HD_TRACE_FUNCTION();
HF_MALLOC_TAG_FUNCTION();
return _collection.GetRenderTags();
}
示例13: HD_TRACE_FUNCTION
/* virtual */
HdSt_TestLightingShader::ID
HdSt_TestLightingShader::ComputeHash() const
{
HD_TRACE_FUNCTION();
size_t hash = _glslfx->GetHash();
return (ID)hash;
}
示例14: HD_TRACE_FUNCTION
void
HdCommandBuffer::PrepareDraw(HdRenderPassStateSharedPtr const &renderPassState,
HdResourceRegistrySharedPtr const &resourceRegistry)
{
HD_TRACE_FUNCTION();
TF_FOR_ALL(batchIt, _drawBatches) {
(*batchIt)->PrepareDraw(renderPassState, resourceRegistry);
}
示例15: HD_TRACE_FUNCTION
/* static */
void
HdMesh::ConfigureRepr(TfToken const &reprName,
HdMeshReprDesc desc1,
HdMeshReprDesc desc2)
{
HD_TRACE_FUNCTION();
_reprDescConfig.Append(reprName, _MeshReprConfig::DescArray{desc1, desc2});
}