Skip to content
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

[2.5.4] Shader compilation regression error when using OES shader #1227

Closed
delphinius81 opened this issue Jul 7, 2022 · 7 comments
Closed
Assignees
Labels
Android Android platform Bug 🐛 Something isn't working Fixed A fix will be in the next release
Milestone

Comments

@delphinius81
Copy link

delphinius81 commented Jul 7, 2022

Describe the issue
I am seeing a consistent internal shader compiler error when attempting to use the AVProVideo/VR/InsideSphere Unlit (stereo+color) - Android OES ONLY shader on the Pico Neo 3. The error is as follows:

07-06 15:35:21.823 1873 2173 D Unity : Note: Creation of internal variant of shader 'AVProVideo/VR/InsideSphere Unlit (stereo+color) - Android OES ONLY' failed.
07-06 15:35:21.826 1873 2173 I AdrenoGLES-0: Internal compiler error: Error: array indexing out of boundary
07-06 15:35:21.826 1873 2173 I AdrenoGLES-0: Assertion failed: srcME->getIndexInst() != __null && "Array index is missing!"

Unfortunately, the error is not helpful in pinpointing the bad instruction call. As you will see in the attached log, the place where the compiler fails is different for each variant.

The shader compiler error was present when loading the demo 360 video scene using the OES shader, as well as when loading my own 360 video playback scene with a custom OES shader (which references AVProVideo.cgin). I am using the ApplyToMesh component and have set the MediaPlayer to use OES rendering. The UpdateMultipassStereo script is applied to the camera rig and multipass rendering is set.

Video playback is happening, as I can hear audio, however no video appears on the mesh. This is reproducable using a custom video, as well as with a provided demo video.

Your Setup (please complete the following information):

  • Unity version: 2020.3.19
  • AVPro Video version (number and edition (trial/core/ultra/enterprise)): 2.5.4 Core
  • Operating system version: Android
  • Device model: Pico Neo 3
  • Using PicoVR_Unity_SDK_2.8.12_B583 sdk (which is unfortunately no longer available through the pico website)
  • Video specs (resolution, frame-rate, codec, file size): Using the Sample-Local-MP4-Cones-360Stereo video file provided in the AVPro package

To Reproduce

  1. Open the Demo_360Stereo OES scene in the provided unity project and build for Android. The player settings are modified from the default unity settings to match what we require in production.
  2. Deploy to a Pico Neo 3 HMD
  3. Check logcat for shader compilation error and observe no video playback on the mesh

Logs

This was a log when running in our production application. The same shader compilation error is present when running the provided sample project.

logcat_output.txt

Screenshots
If applicable, add screenshots to help explain your problem.

Videos
If applicable, add a copy of your video or the URL

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us unitysupport@renderheads.com

@Chris-RH Chris-RH added the Android Android platform label Jul 7, 2022
@Chris-RH
Copy link
Collaborator

Chris-RH commented Jul 8, 2022

Hi @delphinius81,

  • If you go to AVProVideo.cginc,
  • In this section:

#if defined(SHADERLAB_GLSL)
INLINE HALF4 SampleRGBA(samplerExternalOES tex, FLOAT2 uv)
#else
INLINE HALF4 SampleRGBA(sampler2D tex, FLOAT2 uv)
#endif
{
#if defined(SHADERLAB_GLSL)
#if VERSION < 300
HALF4 rgba = texture2D(tex, uv);
#else
HALF4 rgba = texture(tex, uv);
#endif
#else
HALF4 rgba = tex2D(tex, uv);
#endif
#if defined(APPLY_GAMMA)
rgba.rgb = GammaToLinear(rgba.rgb);
#endif
return rgba;
}

  • There is a line : HALF4 rgba = texture(tex, uv);

  • Can you please try replacing it with:

// HALF4 rgba = texture(tex, uv);
HALF4 rgba = HALF4(0.0, 0.0, 0.0, 1.0);

Please let me know if that has helped

@delphinius81
Copy link
Author

Hi @Chris-RH,

That change works and allows video playback to occur, thanks! Is there an eta on when the full fix will get released?

@Chris-RH
Copy link
Collaborator

Chris-RH commented Jul 8, 2022

Glad that helps :)
It looks like there are a few kinks to iron out, so the team will have another look and hopefully try to get a fixed release out next week, but can't guarantee a date at this point.

@delphinius81
Copy link
Author

Thanks!

@AndrewRH AndrewRH added Bug 🐛 Something isn't working Fixed A fix will be in the next release labels Jul 11, 2022
@AndrewRH AndrewRH added this to the 0-Next Release milestone Jul 11, 2022
@AndrewRH AndrewRH changed the title Shader compilation error when using OES shader [2.5.4] Shader compilation regression error when using OES shader Jul 11, 2022
@AndrewRH
Copy link
Member

Thanks, this error was introduced in version 2.5.4 and seems to be limited to hardware using Adreno GPUs. Appears to be a driver bug. We've working on a workaround which will be released soon. We found some other people commenting on what appears to be the same issue here:

https://stackoverflow.com/questions/40662936/compile-time-failure-when-reading-texels-from-samplerexternaloes
https://bugzilla.mozilla.org/show_bug.cgi?id=1700693

@AndrewRH AndrewRH self-assigned this Jul 11, 2022
@Ste-RH
Copy link
Collaborator

Ste-RH commented Jul 13, 2022

@delphinius81 AVPro Video v2.5.5 has been released. Please do let us know if this version fixes the issue for you.

@Ste-RH Ste-RH modified the milestones: 0-Next Release, 2.5.5 Jul 13, 2022
@Chris-RH
Copy link
Collaborator

Please reopen if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android platform Bug 🐛 Something isn't working Fixed A fix will be in the next release
Projects
None yet
Development

No branches or pull requests

4 participants