Skip to content

Conversation

rjonaitis
Copy link
Contributor

@rjonaitis rjonaitis commented Apr 20, 2021


Purpose of this PR

Fix case: https://fogbugz.unity3d.com/f/cases/1327076/
The depth of field shader has pragma target 3.5. Devices with Adreno 3XX gpus report SystemInfo.graphicsShaderLevel is 35, but due to buggy drivers we have disabled instancing support on them. That causes the depth of field check for SystemInfo.graphicsShaderLevel to pass, but loading the shader fails due to lack of instancing support.


Testing status

Manual testing on Nexus5/Adreno330


Comments to reviewers

Notes for the reviewers you have assigned.

@rjonaitis rjonaitis marked this pull request as ready for review April 21, 2021 07:00
@rjonaitis rjonaitis requested review from a team as code owners April 21, 2021 07:00
@erikabar erikabar requested a review from a team April 21, 2021 08:01
@evelinastaniulyte evelinastaniulyte requested review from evelinastaniulyte and removed request for a team April 22, 2021 07:36
Copy link
Contributor

@phi-lira phi-lira left a comment

Choose a reason for hiding this comment

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

I don't the fix but if this fixes the issue LGTM.

Comment on lines +369 to +371
// Adreno 3xx SystemInfo.graphicsShaderLevel is 35, but instancing support is disabled due to buggy drivers.
// DOF shader uses #pragma target 3.5 which adds requirement for instancing support, thus marking the shader unsupported on those devices.
var dofMaterial = m_DepthOfField.mode.value == DepthOfFieldMode.Gaussian ? m_Materials.gaussianDepthOfField : m_Materials.bokehDepthOfField;
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont' understand how the material returns null for Adreno 3xx here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the shader is not supported, it returns null. That's a result of an older identical issue fix 9157ee7

Copy link

@evelinastaniulyte evelinastaniulyte left a comment

Choose a reason for hiding this comment

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

The bug: https://fogbugz.unity3d.com/f/cases/1327076/ is verified as fixed. Depth of field in not initialised on Adreno 3xx devices.
Tested Adreno 3xx devices:

  • VLNQA00104, Lge Nexus 5 (Nexus 5), Android 6.0.1, CPU: Snapdragon 800 MSM8974, GPU: Adreno (TM) 330
  • VLNQA00111, Samsung Galaxy J5(2016) (SM-J510FN), Android 7.1.1, CPU: Snapdragon 410 MSM8916, GPU: Adreno (TM) 306

Also checked some other devices additionally. The Depth of Field is initialised as expected:

  • VLNQA00340, Samsung Galaxy Note20 Ultra 5G (SM-N986B), Android 10, CPU: Exynos 990, GPU: Mali-G77
  • VLNQA00280, Samsung Galaxy S10+ USA, CPU: Snapdragon 855 SM8150, GPU: Adreno 650, Android: 9
  • VLNQA00287, Motorola moto g(7) power (moto g(7) power), Android 9, CPU: Snapdragon 625 MSM8953, GPU: Adreno (TM) 506

@rjonaitis rjonaitis merged commit 1509d2d into master Apr 23, 2021
@rjonaitis rjonaitis deleted the mobile/fix-depthOfField-on-Adreno3XX branch April 23, 2021 10:38
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.

4 participants