Align SRP selection with asset refs
This commit is contained in:
@@ -26,11 +26,53 @@ void GraphicsSettingsState::ClearManagedRenderPipelineBridge() {
|
||||
void GraphicsSettingsState::SetConfiguredRenderPipelineAssetDescriptor(
|
||||
const Pipelines::ManagedRenderPipelineAssetDescriptor& descriptor) {
|
||||
m_configuredRenderPipelineAssetDescriptor = descriptor;
|
||||
m_configuredRenderPipelineAssetRef = descriptor.assetRef;
|
||||
if (!descriptor.assetRef.IsValid()) {
|
||||
m_configuredRenderPipelineAssetRef.Reset();
|
||||
}
|
||||
BumpEnvironmentGeneration();
|
||||
}
|
||||
|
||||
void GraphicsSettingsState::SetConfiguredRenderPipelineAssetRef(
|
||||
const Resources::AssetRef& assetRef) {
|
||||
m_configuredRenderPipelineAssetRef = assetRef;
|
||||
m_configuredRenderPipelineAssetDescriptor = {};
|
||||
if (m_configuredRenderPipelineAssetRef.IsValid()) {
|
||||
m_configuredRenderPipelineAssetDescriptor.assetRef =
|
||||
m_configuredRenderPipelineAssetRef;
|
||||
}
|
||||
BumpEnvironmentGeneration();
|
||||
}
|
||||
|
||||
void GraphicsSettingsState::SetConfiguredRenderPipelineAssetSelection(
|
||||
const Resources::AssetRef& assetRef,
|
||||
const Pipelines::ManagedRenderPipelineAssetDescriptor& descriptor) {
|
||||
m_configuredRenderPipelineAssetRef = assetRef;
|
||||
m_configuredRenderPipelineAssetDescriptor = descriptor;
|
||||
if (m_configuredRenderPipelineAssetRef.IsValid()) {
|
||||
m_configuredRenderPipelineAssetDescriptor.assetRef =
|
||||
m_configuredRenderPipelineAssetRef;
|
||||
} else if (descriptor.assetRef.IsValid()) {
|
||||
m_configuredRenderPipelineAssetRef = descriptor.assetRef;
|
||||
}
|
||||
BumpEnvironmentGeneration();
|
||||
}
|
||||
|
||||
void GraphicsSettingsState::UpdateConfiguredRenderPipelineAssetRuntimeDescriptor(
|
||||
const Pipelines::ManagedRenderPipelineAssetDescriptor& descriptor) {
|
||||
m_configuredRenderPipelineAssetDescriptor = descriptor;
|
||||
if (descriptor.assetRef.IsValid()) {
|
||||
m_configuredRenderPipelineAssetRef = descriptor.assetRef;
|
||||
} else if (m_configuredRenderPipelineAssetRef.IsValid()) {
|
||||
m_configuredRenderPipelineAssetDescriptor.assetRef =
|
||||
m_configuredRenderPipelineAssetRef;
|
||||
}
|
||||
BumpEnvironmentGeneration();
|
||||
}
|
||||
|
||||
void GraphicsSettingsState::ClearConfiguredRenderPipelineAssetDescriptor() {
|
||||
m_configuredRenderPipelineAssetDescriptor = {};
|
||||
m_configuredRenderPipelineAssetRef.Reset();
|
||||
BumpEnvironmentGeneration();
|
||||
}
|
||||
|
||||
|
||||
@@ -193,10 +193,36 @@ void SetConfiguredManagedRenderPipelineAssetDescriptor(
|
||||
descriptor);
|
||||
}
|
||||
|
||||
void SetConfiguredManagedRenderPipelineAssetRef(
|
||||
const Resources::AssetRef& assetRef) {
|
||||
GetGraphicsSettingsState().SetConfiguredRenderPipelineAssetRef(
|
||||
assetRef);
|
||||
}
|
||||
|
||||
void SetConfiguredManagedRenderPipelineAssetSelection(
|
||||
const Resources::AssetRef& assetRef,
|
||||
const ManagedRenderPipelineAssetDescriptor& descriptor) {
|
||||
GetGraphicsSettingsState().SetConfiguredRenderPipelineAssetSelection(
|
||||
assetRef,
|
||||
descriptor);
|
||||
}
|
||||
|
||||
void UpdateConfiguredManagedRenderPipelineAssetRuntimeDescriptor(
|
||||
const ManagedRenderPipelineAssetDescriptor& descriptor) {
|
||||
GetGraphicsSettingsState()
|
||||
.UpdateConfiguredRenderPipelineAssetRuntimeDescriptor(
|
||||
descriptor);
|
||||
}
|
||||
|
||||
void ClearConfiguredManagedRenderPipelineAssetDescriptor() {
|
||||
GetGraphicsSettingsState().ClearConfiguredRenderPipelineAssetDescriptor();
|
||||
}
|
||||
|
||||
Resources::AssetRef GetConfiguredManagedRenderPipelineAssetRef() {
|
||||
return GetGraphicsSettingsState()
|
||||
.GetConfiguredRenderPipelineAssetRef();
|
||||
}
|
||||
|
||||
ManagedRenderPipelineAssetDescriptor
|
||||
GetConfiguredManagedRenderPipelineAssetDescriptor() {
|
||||
return GetGraphicsSettingsState()
|
||||
@@ -205,8 +231,13 @@ GetConfiguredManagedRenderPipelineAssetDescriptor() {
|
||||
|
||||
std::shared_ptr<const RenderPipelineAsset>
|
||||
CreateConfiguredManagedRenderPipelineAsset() {
|
||||
const ManagedRenderPipelineAssetDescriptor descriptor =
|
||||
ManagedRenderPipelineAssetDescriptor descriptor =
|
||||
GetGraphicsSettingsState().GetConfiguredRenderPipelineAssetDescriptor();
|
||||
const Resources::AssetRef assetRef =
|
||||
GetGraphicsSettingsState().GetConfiguredRenderPipelineAssetRef();
|
||||
if (assetRef.IsValid()) {
|
||||
descriptor.assetRef = assetRef;
|
||||
}
|
||||
if (descriptor.IsValid()) {
|
||||
return std::make_shared<ManagedScriptableRenderPipelineAsset>(descriptor);
|
||||
}
|
||||
|
||||
@@ -4936,7 +4936,7 @@ MonoObject* InternalCall_Rendering_GetRenderPipelineAsset() {
|
||||
}
|
||||
|
||||
Rendering::GetGraphicsSettingsState()
|
||||
.SetConfiguredRenderPipelineAssetDescriptor(descriptor);
|
||||
.UpdateConfiguredRenderPipelineAssetRuntimeDescriptor(descriptor);
|
||||
}
|
||||
|
||||
return runtime->GetExternalManagedObject(
|
||||
|
||||
Reference in New Issue
Block a user