From d33251e3cfdc1e3f139cc29c6fab69f8b1eb827d Mon Sep 17 00:00:00 2001 From: Paul Molodowitch Date: Mon, 29 Jul 2024 01:08:53 -0700 Subject: [PATCH] [hdEmbree] add HDEMBREE_LIGHT_CREATE debug code --- pxr/imaging/plugin/hdEmbree/CMakeLists.txt | 7 ++++--- pxr/imaging/plugin/hdEmbree/debugCodes.cpp | 20 ++++++++++++++++++++ pxr/imaging/plugin/hdEmbree/debugCodes.h | 21 +++++++++++++++++++++ pxr/imaging/plugin/hdEmbree/light.cpp | 2 ++ 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 pxr/imaging/plugin/hdEmbree/debugCodes.cpp create mode 100644 pxr/imaging/plugin/hdEmbree/debugCodes.h diff --git a/pxr/imaging/plugin/hdEmbree/CMakeLists.txt b/pxr/imaging/plugin/hdEmbree/CMakeLists.txt index 86575eeba7..8e4a5d68b8 100644 --- a/pxr/imaging/plugin/hdEmbree/CMakeLists.txt +++ b/pxr/imaging/plugin/hdEmbree/CMakeLists.txt @@ -45,6 +45,10 @@ pxr_plugin(hdEmbree context.h renderParam.h + PRIVATE_CLASSES + debugCodes + implicitSurfaceSceneIndexPlugin + PRIVATE_HEADERS pxrIES/ies.h pxrIES/pxrIES.h @@ -54,9 +58,6 @@ pxr_plugin(hdEmbree pxrIES/ies.cpp pxrIES/pxrIES.cpp - PRIVATE_CLASSES - implicitSurfaceSceneIndexPlugin - RESOURCE_FILES plugInfo.json diff --git a/pxr/imaging/plugin/hdEmbree/debugCodes.cpp b/pxr/imaging/plugin/hdEmbree/debugCodes.cpp new file mode 100644 index 0000000000..e38f776489 --- /dev/null +++ b/pxr/imaging/plugin/hdEmbree/debugCodes.cpp @@ -0,0 +1,20 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#include "pxr/pxr.h" +#include "pxr/imaging/plugin/hdEmbree/debugCodes.h" + +#include "pxr/base/tf/debug.h" +#include "pxr/base/tf/registryManager.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_REGISTRY_FUNCTION(TfDebug) +{ + TF_DEBUG_ENVIRONMENT_SYMBOL(HDEMBREE_LIGHT_CREATE, "Creation of HdEmbree lights"); +} + +PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/debugCodes.h b/pxr/imaging/plugin/hdEmbree/debugCodes.h new file mode 100644 index 0000000000..c65002452b --- /dev/null +++ b/pxr/imaging/plugin/hdEmbree/debugCodes.h @@ -0,0 +1,21 @@ +// +// Copyright 2024 Pixar +// +// Licensed under the terms set forth in the LICENSE.txt file available at +// https://openusd.org/license. +// +#ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_DEBUG_CODES_H +#define PXR_IMAGING_PLUGIN_HD_EMBREE_DEBUG_CODES_H + +#include "pxr/pxr.h" +#include "pxr/base/tf/debug.h" + +PXR_NAMESPACE_OPEN_SCOPE + +TF_DEBUG_CODES( + HDEMBREE_LIGHT_CREATE +); + +PXR_NAMESPACE_CLOSE_SCOPE + +#endif // PXR_IMAGING_PLUGIN_HD_EMBREE_DEBUG_CODES_H diff --git a/pxr/imaging/plugin/hdEmbree/light.cpp b/pxr/imaging/plugin/hdEmbree/light.cpp index dd3bae34ae..d6dd0e6400 100644 --- a/pxr/imaging/plugin/hdEmbree/light.cpp +++ b/pxr/imaging/plugin/hdEmbree/light.cpp @@ -90,6 +90,8 @@ HdEmbree_Light::HdEmbree_Light(SdfPath const& id, TfToken const& lightType) return; } + TF_DEBUG(HDEMBREE_LIGHT_CREATE).Msg("Creating light %s: %s\n", id.GetText(), lightType.GetText()); + // Set the variant to the right type - Sync will fill rest of data if (lightType == HdSprimTypeTokens->cylinderLight) { _lightData.lightVariant = HdEmbree_Cylinder();