Skip to content

Fix wrong format for contact shadows and shadow atlas default textures - #5912

Merged
sebastienlagarde merged 5 commits into
hd/bugfixfrom
HDRP/fix-api-warnings
Oct 12, 2021
Merged

sebastienlagarde merged 5 commits into
hd/bugfixfrom
HDRP/fix-api-warnings

Conversation

@FrancescoC-unity

@FrancescoC-unity FrancescoC-unity commented Oct 5, 2021 •

Copy link
Copy Markdown
Contributor

Fix for https://fogbugz.unity3d.com/f/cases/1355108/

  • other D3D validation layers errors because default textures set when a shadow atlas is not rendered to were not shadow textures and those are not compatible with shadow samplers leading to a lot of validation errors.

What did I test: I checked with D3D validation layer, I had the warnings before but not after.
FOR QA: Could you try the original repro on Mac?

@github-actions

ghost commented Oct 5, 2021

Copy link
Copy Markdown

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.
Link to Yamato: https://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

HDRP
/jobDefinition/.yamato%2Fall-hdrp.yml%23HDRP_trunk
With changes to HDRP packages, you should also run
/jobDefinition/.yamato%252Fall-lightmapper.yml%2523PR_LightMapper_trunk

SRP Core
You could run ABV on your branch before merging your PR, but it will start A LOT of jobs. Please be responsible about it and run it only when you feel the PR is ready:
/jobDefinition/.yamato%252F_abv.yml%2523all_project_ci_trunk
Be aware that any modifications to the Core package impacts everyone in the Graphics repo so please discuss the PR with your lead.

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.

@github-actions github-actions Bot added the SRP label Oct 5, 2021
@github-actions

ghost commented Oct 5, 2021

Copy link
Copy Markdown

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page).
See the PR template for more information.
Thank you!

cmd.SetGlobalTexture(HDShaderIDs._ScreenSpaceShadowsTexture, buffers.screenspaceShadowBuffer);
}

static void BindDefaultTexturesLightingBuffers(RenderGraphDefaultResources defaultResources, CommandBuffer cmd)

ghost Oct 5, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm a fan of binding everything globally when the plan is to remove all globals like this.
Can't we just return the proper default texture from the right passes as we do some other places?

ghost Oct 5, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This just mirrors the others that are bound globally (see a bit above in the file), the problem is that the set global and all the passes producing the outputs are skipped during debug.

The passes already return the right default it is just that they are never run :D

ghost Oct 5, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I'll take a deeper look when I actually do the thing.

if (m_CurrentDebugDisplaySettings.data.materialDebugSettings.debugViewMaterialCommonValue == Attributes.MaterialSharedProperty.Alpha)
RenderShadows(m_RenderGraph, hdCamera, cullingResults, ref shadowResult);
else
HDShadowManager.BindDefaultShadowGlobalResources(m_RenderGraph);

ghost Oct 6, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For awareness, we added this extra coverage here (scene lighting disabled caused more validation errors).

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues were found. What's tested:

  • Reproduced the issue on master
  • After switching to PR, the issue is gone (Mac)
  • Opened HDRP template and verified contact shadows still work (Mac)
  • Opened Amalienborg palace (PC) to upgrade a project that already uses cached and realtime shadows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants