-
Notifications
You must be signed in to change notification settings - Fork 855
Ps5/raytracing #5262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ps5/raytracing #5262
Conversation
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. HDRP Shader Graph Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outside of the quetion about SystemInfo.supportsRayTracing (which could be done in a next PR), all looks good.
Other question: With this PR, can we trigger test on scriptableRenderPipelinePrivate on PS5 for raytrace?
Also I expect it need to be backport up to 20.3 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to rework a bit the wizard ps5 code as the wizard was centered around the dx12 problem. I'll take it from here @peterjohnlong if you're fine with that. The ps5 related changed are fine (except my question on the max recursion).
++EditorGUI.indentLevel; | ||
EditorGUILayout.PropertyField(serialized.renderPipelineSettings.supportedRayTracingMode, Styles.supportedRayTracingMode); | ||
if (serialized.renderPipelineSettings.supportRayTracing.boolValue && !UnityEngine.SystemInfo.supportsRayTracing) | ||
if (serialized.renderPipelineSettings.supportRayTracing.boolValue && !UnityEngine.SystemInfo.supportsRayTracing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue this is the best way of doing it, let's discuss
bool IsArchitecture64Bits() | ||
=> EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64; | ||
{ | ||
return (EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64) || (EditorUserBuildSettings.activeBuildTarget == BuildTarget.PS5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, not the best way imo
|
||
// WARNING: This define must be kept in sync with the c# code | ||
#if defined(SHADER_API_PSSL) | ||
#define RAYTRACING_MAX_RECURSION 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this one only? RayTracingReflection.raytracing and RaytracingIndirectDiffuse need to have their max recursion force to 1 aswell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anisunity I am fine with you reworking the wizard code. Good point about RaytracingRenderer.raytrace - mainly it was done there as a reaction to some HDRP_DXR tests e.g. 902_Materials_SG_Variants_xxxxx where a third of the screen is testing recursive raytrace, in the case of PS5 I wanted to achieve a consistent result of just the background. I will rethink best way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anisunity I have reverted this change to RayTracingRenderer.raytrace, and added a scripting define in ProjectSettings NO_RAY_RECURSION, and tests to set the max recursion in the shader setup .cs code for this and the other cases
@sebastienlagarde |
@peterjohnlong i'll do a quick pass on the pr later this week to change the wizard, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. But please rename Bobby
|
||
|
||
[InitializeOnLoadMethod] | ||
static void Bobby() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please find a meaningful name :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed Bobby to InitializeEntryList
|
||
internal void ReBuildEntryList() | ||
{ | ||
m_Entries = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed. The line below already replace it. Former will be cleaned later by garbage collection.
Note that alternately if you only nullify it, the list will be rebuild by the lazy constructor anyway in entries
. But in this case the name of this method is not accurate anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the unneeded code
} | ||
} | ||
|
||
Entry[] BuildEntryList() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Optional] I think that you can simplify things a little by removing BuildEntryList() and only keep ReBuildEntryList().
You should be able to make it work with only
internal void ReBuildEntryList() //current BuildEntryList() in your code
{
//compute List<Entry> entryList as below this comment
m_Entries = BuildEntryList();
}
and then entries would become
Entry[] entries
{
get
{
// due to functor, cannot static link directly in an array and need lazy init
if (m_Entries == null)
ReBuildEntryList();
return m_Entries;
}
}
Especially because when cleaning current ReBuildEntryList, it will become a one liner method.
Above is a fix for error logged in the console when user switch platform and Wizard window is open. (@alex-vazquez for awareness. If this PR don't land, we would still need to do this fix. It seams unrelated to current Wizard change and could have been introduced 2 month ago in 31b7b5d) |
…erial/ShaderGraph/HDTarget.cs
Purpose of this PR
The purpose of this PR is to activate HDRP ray tracing functionality for PS5, by enabling compilation of associated shaders and code paths.
Testing status
Tested locally on HDRP_DXR_Tests on the console against reference images https://github.cds.internal.unity3d.com/unity/ScriptableRenderPipelinePrivate/tree/ps5-dxr/ReferenceImages/HDRP_DXR_Tests/PS5/PlayStation5/None
Tested locally on HDRP_DXR_Tests are remain green on DX12.
Currently yamato SRP PS5-DXR test is broken due to unrelated issue.