Skip to content

Commit 31255e0

Browse files
axolotoEvergreen
authored andcommitted
Graphics/SRP/RPF - [UUM-70492] Render Graph Viewer breaks Camera rendering
Avoid validation as a temp fix.
1 parent d6fffaf commit 31255e0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraph.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ void GenerateCompilerDebugData(ref DebugData debugData)
24612461
}
24622462
else if (resourceType == RenderGraphResourceType.Buffer)
24632463
{
2464-
var bufferDesc = m_Resources.GetBufferResourceDesc(handle);
2464+
var bufferDesc = m_Resources.GetBufferResourceDesc(handle, true);
24652465

24662466
var bufferData = new DebugData.BufferResourceData();
24672467
bufferData.count = bufferDesc.count;

Packages/com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ internal void GetRenderTargetInfo(in ResourceHandle res, out RenderTargetInfo ou
778778
else
779779
{
780780
// Managed by rendergraph, it might not be created yet so we look at the desc to find out
781-
var desc = GetTextureResourceDesc(res);
781+
var desc = GetTextureResourceDesc(res, true); // TODO: remove true, we should throw on invalid desc here
782782
var dim = desc.CalculateFinalDimensions();
783783
outInfo = new RenderTargetInfo();
784784
outInfo.width = dim.x;
@@ -833,11 +833,12 @@ internal TextureResource GetTextureResource(int index)
833833
return m_RenderGraphResources[(int)RenderGraphResourceType.Texture].resourceArray[index] as TextureResource;
834834
}
835835

836-
internal TextureDesc GetTextureResourceDesc(in ResourceHandle handle, bool noThrowOnInvalidDesc=false)
836+
internal TextureDesc GetTextureResourceDesc(in ResourceHandle handle, bool noThrowOnInvalidDesc = false)
837837
{
838838
Debug.Assert(handle.type == RenderGraphResourceType.Texture);
839839
var texture = (m_RenderGraphResources[(int)RenderGraphResourceType.Texture].resourceArray[handle.index] as TextureResource);
840-
if (!texture.validDesc && !noThrowOnInvalidDesc) throw new ArgumentException("The passed in texture handle does not have a valid descriptor. (This is most commonly cause by the handle referencing a built-in texture such as the system back buffer.)", "handle");
840+
if (!texture.validDesc && !noThrowOnInvalidDesc)
841+
throw new ArgumentException("The passed in texture handle does not have a valid descriptor. (This is most commonly cause by the handle referencing a built-in texture such as the system back buffer.)", "handle");
841842
return texture.desc;
842843
}
843844

@@ -934,11 +935,12 @@ internal BufferHandle CreateBuffer(in BufferDesc desc, int transientPassIndex =
934935
return new BufferHandle(newHandle);
935936
}
936937

937-
internal BufferDesc GetBufferResourceDesc(in ResourceHandle handle)
938+
internal BufferDesc GetBufferResourceDesc(in ResourceHandle handle, bool noThrowOnInvalidDesc = false)
938939
{
939940
Debug.Assert(handle.type == RenderGraphResourceType.Buffer);
940941
var buffer = (m_RenderGraphResources[(int)RenderGraphResourceType.Buffer].resourceArray[handle.index] as BufferResource);
941-
if (!buffer.validDesc) throw new ArgumentException("The passed in buffer handle does not have a valid descriptor. (This is most commonly cause by importing the buffer.)", "handle");
942+
if (!buffer.validDesc && !noThrowOnInvalidDesc)
943+
throw new ArgumentException("The passed in buffer handle does not have a valid descriptor. (This is most commonly cause by importing the buffer.)", "handle");
942944
return buffer.desc;
943945
}
944946

0 commit comments

Comments
 (0)