add usd-21-11-win64_py39

This commit is contained in:
Sébastien Albert committed 2021-12-07 17:43:55 +01:00
1 parent 41d23e71ba
commit ba5e1f7e67
15684 files changed
+3069957

No files matched your search

@@ -0,0 +1,135 @@
//
// Copyright 2020 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef EXTRAS_IMAGING_EXAMPLES_HD_TINY_MESH_H
#define EXTRAS_IMAGING_EXAMPLES_HD_TINY_MESH_H
#include "pxr/pxr.h"
#include "pxr/imaging/hd/mesh.h"
PXR_NAMESPACE_OPEN_SCOPE
/// \class HdTinyMesh
///
/// This class is an example of a Hydra Rprim, or renderable object, and it
/// gets created on a call to HdRenderIndex::InsertRprim() with a type of
/// HdPrimTypeTokens->mesh.
///
/// The prim object's main function is to bridge the scene description and the
/// renderable representation. The Hydra image generation algorithm will call
/// HdRenderIndex::SyncAll() before any drawing; this, in turn, will call
/// Sync() for each mesh with new data.
///
/// Sync() is passed a set of dirtyBits, indicating which scene buffers are
/// dirty. It uses these to pull all of the new scene data and constructs
/// updated geometry objects.
///
/// An rprim's state is lazily populated in Sync(); matching this, Finalize()
/// can do the heavy work of releasing state (such as handles into the top-level
/// scene), so that object population and existence aren't tied to each other.
///
class HdTinyMesh final : public HdMesh
{
public:
HF_MALLOC_TAG_NEW("new HdTinyMesh");
/// HdTinyMesh constructor.
/// \param id The scene-graph path to this mesh.
HdTinyMesh(SdfPath const& id);
/// HdTinyMesh destructor.
~HdTinyMesh() override = default;
/// Inform the scene graph which state needs to be downloaded in the
/// first Sync() call: in this case, topology and points data to build
/// the geometry object in the scene graph.
/// \return The initial dirty state this mesh wants to query.
HdDirtyBits GetInitialDirtyBitsMask() const override;
/// Pull invalidated scene data and prepare/update the renderable
/// representation.
///
/// This function is told which scene data to pull through the
/// dirtyBits parameter. The first time it's called, dirtyBits comes
/// from _GetInitialDirtyBits(), which provides initial dirty state,
/// but after that it's driven by invalidation tracking in the scene
/// delegate.
///
/// The contract for this function is that the prim can only pull on scene
/// delegate buffers that are marked dirty. Scene delegates can and do
/// implement just-in-time data schemes that mean that pulling on clean
/// data will be at best incorrect, and at worst a crash.
///
/// This function is called in parallel from worker threads, so it needs
/// to be threadsafe; calls into HdSceneDelegate are ok.
///
/// Reprs are used by hydra for controlling per-item draw settings like
/// flat/smooth shaded, wireframe, refined, etc.
/// \param sceneDelegate The data source for this geometry item.
/// \param renderParam State.
/// \param dirtyBits A specifier for which scene data has changed.
/// \param reprToken A specifier for which representation to draw with.
///
void Sync(
HdSceneDelegate* sceneDelegate,
HdRenderParam* renderParam,
HdDirtyBits* dirtyBits,
TfToken const &reprToken) override;
protected:
// Initialize the given representation of this Rprim.
// This is called prior to syncing the prim, the first time the repr
// is used.
//
// reprToken is the name of the repr to initalize.
//
// dirtyBits is an in/out value. It is initialized to the dirty bits
// from the change tracker. InitRepr can then set additional dirty bits
// if additional data is required from the scene delegate when this
// repr is synced. InitRepr occurs before dirty bit propagation.
//
// See HdRprim::InitRepr()
void _InitRepr(
TfToken const &reprToken,
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
// used to communicate that extra information is needed by the prim to
// process the changes.
//
// The return value is the new set of dirty bits, which replaces the bits
// passed in.
//
// See HdRprim::PropagateRprimDirtyBits()
HdDirtyBits _PropagateDirtyBits(HdDirtyBits bits) const override;
// This class does not support copying.
HdTinyMesh(const HdTinyMesh&) = delete;
HdTinyMesh &operator =(const HdTinyMesh&) = delete;
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif // EXTRAS_IMAGING_EXAMPLES_HD_TINY_MESH_H
@@ -0,0 +1,106 @@
//
// Copyright 2020 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef EXTRAS_IMAGING_EXAMPLES_HD_TINY_RENDER_DELEGATE_H
#define EXTRAS_IMAGING_EXAMPLES_HD_TINY_RENDER_DELEGATE_H
#include "pxr/pxr.h"
#include "pxr/imaging/hd/renderDelegate.h"
#include "pxr/imaging/hd/resourceRegistry.h"
#include "pxr/base/tf/staticTokens.h"
PXR_NAMESPACE_OPEN_SCOPE
///
/// \class HdTinyRenderDelegate
///
/// Render delegates provide renderer-specific functionality to the render
/// index, the main hydra state management structure. The render index uses
/// the render delegate to create and delete scene primitives, which include
/// geometry and also non-drawable objects. The render delegate is also
/// responsible for creating renderpasses, which know how to draw this
/// renderer's scene primitives.
///
class HdTinyRenderDelegate final : public HdRenderDelegate
{
public:
/// Render delegate constructor.
HdTinyRenderDelegate();
/// Render delegate constructor.
HdTinyRenderDelegate(HdRenderSettingsMap const& settingsMap);
/// Render delegate destructor.
virtual ~HdTinyRenderDelegate();
/// Supported types
const TfTokenVector &GetSupportedRprimTypes() const override;
const TfTokenVector &GetSupportedSprimTypes() const override;
const TfTokenVector &GetSupportedBprimTypes() const override;
// Basic value to return from the RD
HdResourceRegistrySharedPtr GetResourceRegistry() const override;
// Prims
HdRenderPassSharedPtr CreateRenderPass(
HdRenderIndex *index,
HdRprimCollection const& collection) override;
HdInstancer *CreateInstancer(HdSceneDelegate *delegate,
SdfPath const& id) override;
void DestroyInstancer(HdInstancer *instancer) override;
HdRprim *CreateRprim(TfToken const& typeId,
SdfPath const& rprimId) override;
void DestroyRprim(HdRprim *rPrim) override;
HdSprim *CreateSprim(TfToken const& typeId,
SdfPath const& sprimId) override;
HdSprim *CreateFallbackSprim(TfToken const& typeId) override;
void DestroySprim(HdSprim *sprim) override;
HdBprim *CreateBprim(TfToken const& typeId,
SdfPath const& bprimId) override;
HdBprim *CreateFallbackBprim(TfToken const& typeId) override;
void DestroyBprim(HdBprim *bprim) override;
void CommitResources(HdChangeTracker *tracker) override;
HdRenderParam *GetRenderParam() const override;
private:
static const TfTokenVector SUPPORTED_RPRIM_TYPES;
static const TfTokenVector SUPPORTED_SPRIM_TYPES;
static const TfTokenVector SUPPORTED_BPRIM_TYPES;
void _Initialize();
HdResourceRegistrySharedPtr _resourceRegistry;
// This class does not support copying.
HdTinyRenderDelegate(const HdTinyRenderDelegate &) = delete;
HdTinyRenderDelegate &operator =(const HdTinyRenderDelegate &) = delete;
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif // EXTRAS_IMAGING_EXAMPLES_HD_TINY_RENDER_DELEGATE_H
@@ -0,0 +1,64 @@
//
// Copyright 2020 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef EXTRAS_IMAGING_EXAMPLES_HD_TINY_RENDER_PASS_H
#define EXTRAS_IMAGING_EXAMPLES_HD_TINY_RENDER_PASS_H
#include "pxr/pxr.h"
#include "pxr/imaging/hd/renderPass.h"
PXR_NAMESPACE_OPEN_SCOPE
/// \class HdTinyRenderPass
///
/// HdRenderPass represents a single render iteration, rendering a view of the
/// scene (the HdRprimCollection) for a specific viewer (the camera/viewport
/// parameters in HdRenderPassState) to the current draw target.
///
class HdTinyRenderPass final : public HdRenderPass
{
public:
/// Renderpass constructor.
/// \param index The render index containing scene data to render.
/// \param collection The initial rprim collection for this renderpass.
HdTinyRenderPass(HdRenderIndex *index,
HdRprimCollection const &collection);
/// Renderpass destructor.
virtual ~HdTinyRenderPass();
protected:
/// Draw the scene with the bound renderpass state.
/// \param renderPassState Input parameters (including viewer parameters)
/// for this renderpass.
/// \param renderTags Which rendertags should be drawn this pass.
void _Execute(
HdRenderPassStateSharedPtr const& renderPassState,
TfTokenVector const &renderTags) override;
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif // EXTRAS_IMAGING_EXAMPLES_HD_TINY_RENDER_PASS_H
@@ -0,0 +1,73 @@
//
// Copyright 2020 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef EXTRAS_IMAGING_EXAMPLES_HD_TINY_RENDERER_PLUGIN_H
#define EXTRAS_IMAGING_EXAMPLES_HD_TINY_RENDERER_PLUGIN_H
#include "pxr/pxr.h"
#include "pxr/imaging/hd/rendererPlugin.h"
PXR_NAMESPACE_OPEN_SCOPE
///
/// \class HdTinyRendererPlugin
///
/// A registered child of HdRendererPlugin, this is the class that gets
/// loaded when a Hydra application asks to draw with a certain renderer.
/// It supports rendering via creation/destruction of renderer-specific
/// classes. The render delegate is the Hydra-facing entrypoint into the
/// renderer; it's responsible for creating specialized implementations of Hydra
/// prims (which translate scene data into drawable representations) and Hydra
/// renderpasses (which draw the scene to the framebuffer).
///
class HdTinyRendererPlugin final : public HdRendererPlugin
{
public:
HdTinyRendererPlugin() = default;
virtual ~HdTinyRendererPlugin() = default;
/// Construct a new render delegate of type HdTinyRenderDelegate.
virtual HdRenderDelegate *CreateRenderDelegate() override;
/// Construct a new render delegate of type HdTinyRenderDelegate.
virtual HdRenderDelegate *CreateRenderDelegate(
HdRenderSettingsMap const& settingsMap) override;
/// Destroy a render delegate created by this class's CreateRenderDelegate.
/// \param renderDelegate The render delegate to delete.
virtual void DeleteRenderDelegate(
HdRenderDelegate *renderDelegate) override;
/// Checks to see if the plugin is supported on the running system.
virtual bool IsSupported() const override;
private:
// This class does not support copying.
HdTinyRendererPlugin(const HdTinyRendererPlugin&) = delete;
HdTinyRendererPlugin &operator =(const HdTinyRendererPlugin&) = delete;
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif // EXTRAS_IMAGING_EXAMPLES_HD_TINY_RENDERER_PLUGIN_H