-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Succesfully create UsdImagingGLEngine in Swift.
* Also add Hydra Storm Renderer plugin. Signed-off-by: furby™ <devs@wabi.foundation>
- Loading branch information
Showing
23 changed files
with
564 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "pxr/pxrns.h" | ||
#include "Arch/defines.h" | ||
|
||
#if defined(ARCH_OS_DARWIN) | ||
# include "HdSt/renderDelegate.h" | ||
# include "Hd/driver.h" | ||
# include "HgiMetal/hgi.h" | ||
|
||
PXR_NAMESPACE_OPEN_SCOPE | ||
|
||
bool HdStRenderDelegate::GetHgiFromMetalDriver(HdDriver *hdDriver) | ||
{ | ||
if (hdDriver->name == HgiTokens->renderDriver && hdDriver->driver.IsHolding<HgiMetal *>()) { | ||
_hgi = hdDriver->driver.UncheckedGet<HgiMetal *>(); | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
PXR_NAMESPACE_CLOSE_SCOPE | ||
|
||
#endif // defined(ARCH_OS_DARWIN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"Plugins": [ | ||
{ | ||
"Info": { | ||
"Types": { | ||
"HdStormRendererPlugin": { | ||
"bases": [ | ||
"HdRendererPlugin" | ||
], | ||
"displayName": "GL", | ||
"priority": 0 | ||
} | ||
} | ||
}, | ||
"LibraryPath": "", | ||
"Name": "HdStorm", | ||
"ResourcePath": "Contents/Resources", | ||
"Root": "../..", | ||
"Type": "library" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef __PXR_IMAGING_PLUGIN_HD_STORM_H__ | ||
#define __PXR_IMAGING_PLUGIN_HD_STORM_H__ | ||
|
||
#include <HdStorm/rendererPlugin.h> | ||
|
||
#endif // __PXR_IMAGING_PLUGIN_HD_STORM_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Copyright 2017 Pixar | ||
// | ||
// Licensed under the terms set forth in the LICENSE.txt file available at | ||
// https://openusd.org/license. | ||
// | ||
#ifndef PXR_IMAGING_PLUGIN_HD_STORM_RENDERER_PLUGIN_H | ||
#define PXR_IMAGING_PLUGIN_HD_STORM_RENDERER_PLUGIN_H | ||
|
||
#include "pxr/pxrns.h" | ||
#include "Hd/rendererPlugin.h" | ||
|
||
PXR_NAMESPACE_OPEN_SCOPE | ||
|
||
class HdStormRendererPlugin final : public HdRendererPlugin | ||
{ | ||
public: | ||
HdStormRendererPlugin() = default; | ||
virtual ~HdStormRendererPlugin() = default; | ||
|
||
virtual HdRenderDelegate *CreateRenderDelegate() override; | ||
virtual HdRenderDelegate *CreateRenderDelegate(HdRenderSettingsMap const &settingsMap) override; | ||
|
||
virtual void DeleteRenderDelegate(HdRenderDelegate *renderDelegate) override; | ||
|
||
virtual bool IsSupported(bool gpuEnabled = true) const override; | ||
|
||
private: | ||
HdStormRendererPlugin(const HdStormRendererPlugin &) = delete; | ||
HdStormRendererPlugin &operator=(const HdStormRendererPlugin &) = delete; | ||
}; | ||
|
||
PXR_NAMESPACE_CLOSE_SCOPE | ||
|
||
#endif // PXR_IMAGING_PLUGIN_HD_STORM_RENDERER_PLUGIN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// Copyright 2017 Pixar | ||
// | ||
// Licensed under the terms set forth in the LICENSE.txt file available at | ||
// https://openusd.org/license. | ||
// | ||
#include "pxr/pxrns.h" | ||
#include "HdStorm/rendererPlugin.h" | ||
|
||
#include "HdSt/renderDelegate.h" | ||
#include "Hd/rendererPluginRegistry.h" | ||
|
||
PXR_NAMESPACE_OPEN_SCOPE | ||
|
||
TF_REGISTRY_FUNCTION(TfType) | ||
{ | ||
HdRendererPluginRegistry::Define<HdStormRendererPlugin>(); | ||
} | ||
|
||
HdRenderDelegate *HdStormRendererPlugin::CreateRenderDelegate() | ||
{ | ||
return new HdStRenderDelegate(); | ||
} | ||
|
||
HdRenderDelegate *HdStormRendererPlugin::CreateRenderDelegate(HdRenderSettingsMap const &settingsMap) | ||
{ | ||
return new HdStRenderDelegate(settingsMap); | ||
} | ||
|
||
void HdStormRendererPlugin::DeleteRenderDelegate(HdRenderDelegate *renderDelegate) | ||
{ | ||
delete renderDelegate; | ||
} | ||
|
||
bool HdStormRendererPlugin::IsSupported(bool gpuEnabled) const | ||
{ | ||
const bool support = gpuEnabled && HdStRenderDelegate::IsSupported(); | ||
if (!support) { | ||
TF_DEBUG(HD_RENDERER_PLUGIN) | ||
.Msg("hdStorm renderer plugin unsupported: %s\n", | ||
gpuEnabled ? "hgi unsupported" : "no gpu"); | ||
} | ||
return support; | ||
} | ||
|
||
PXR_NAMESPACE_CLOSE_SCOPE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* ---------------------------------------------------------------- | ||
* :: : M E T A V E R S E : :: | ||
* ---------------------------------------------------------------- | ||
* Licensed under the terms set forth in the LICENSE.txt file, this | ||
* file is available at https://openusd.org/license. | ||
* | ||
* Copyright (C) 2016 Pixar. | ||
* Copyright (C) 2024 Wabi Foundation. All Rights Reserved. | ||
* ---------------------------------------------------------------- | ||
* . x x x . o o o . x x x . : : : . o x o . : : : . | ||
* ---------------------------------------------------------------- */ | ||
|
||
import Hd | ||
|
||
private extension Hd | ||
{ | ||
/** | ||
* Private struct to hold the static | ||
* data for the Hd library's AOV tokens. */ | ||
struct AovStaticData | ||
{ | ||
static let shared = AovStaticData() | ||
private init() | ||
{} | ||
|
||
let tokens = Pixar.HdAovTokens_StaticTokenType() | ||
} | ||
} | ||
|
||
public extension Hd | ||
{ | ||
/** | ||
* # Hd.AovTokens | ||
* | ||
* ## Overview | ||
* | ||
* Public, client facing api to access | ||
* the static Hd AOV tokens. */ | ||
enum AovTokens: String, CaseIterable | ||
{ | ||
case color | ||
case depth | ||
case depthStencil | ||
case cameraDepth | ||
case primId | ||
case instanceId | ||
case elementId | ||
case edgeId | ||
case pointId | ||
case pEye | ||
case nEye | ||
case patchCoord | ||
case primitiveParam | ||
case normal | ||
case primvars = "primvars:" | ||
case lpe = "lpe:" | ||
case shader = "shader:" | ||
|
||
public var token: Tf.Token | ||
{ | ||
switch self | ||
{ | ||
case .color: AovStaticData.shared.tokens.color | ||
case .depth: AovStaticData.shared.tokens.depth | ||
case .depthStencil: AovStaticData.shared.tokens.depthStencil | ||
case .cameraDepth: AovStaticData.shared.tokens.cameraDepth | ||
case .primId: AovStaticData.shared.tokens.primId | ||
case .instanceId: AovStaticData.shared.tokens.instanceId | ||
case .elementId: AovStaticData.shared.tokens.elementId | ||
case .edgeId: AovStaticData.shared.tokens.edgeId | ||
case .pointId: AovStaticData.shared.tokens.pointId | ||
case .pEye: AovStaticData.shared.tokens.Peye | ||
case .nEye: AovStaticData.shared.tokens.Neye | ||
case .patchCoord: AovStaticData.shared.tokens.patchCoord | ||
case .primitiveParam: AovStaticData.shared.tokens.primitiveParam | ||
case .normal: AovStaticData.shared.tokens.normal | ||
case .primvars: AovStaticData.shared.tokens.primvars | ||
case .lpe: AovStaticData.shared.tokens.lpe | ||
case .shader: AovStaticData.shared.tokens.shader | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.