Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Noah_Zuo · Jun 13, 2017 at 09:39 AM · shaderrenderinghardware

Cannot use unity_ObjectToWorld on the GPU Adreno 505?

Update: For some of our other dev-kit:

Adreno 430: Not work.

Adreno 305: Works fine.


We are currently testing our project on our dev-kits, one of which is Adreno 505.

And it confuses us a lot that whenever we use unity_ObjectToWorld in our fragment shader, there comes an error and the fragment would not be rendered.

We use snapdragon profiler to test our shader, and the glsl is like this:

This is vertex shader converted to glsl:

 #version 300 es
 
 uniform     vec4 hlslcc_mtx4x4unity_ObjectToWorld[4];
 uniform     vec4 hlslcc_mtx4x4unity_MatrixVP[4];
 in highp vec4 in_POSITION0;
 in highp vec2 in_TEXCOORD0;
 out highp vec2 vs_TEXCOORD0;
 vec4 u_xlat0;
 vec4 u_xlat1;
 void main()
 {
     u_xlat0 = in_POSITION0.yyyy * hlslcc_mtx4x4unity_ObjectToWorld[1];
     u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[0] * in_POSITION0.xxxx + u_xlat0;
     u_xlat0 = hlslcc_mtx4x4unity_ObjectToWorld[2] * in_POSITION0.zzzz + u_xlat0;
     u_xlat0 = u_xlat0 + hlslcc_mtx4x4unity_ObjectToWorld[3];
     u_xlat1 = u_xlat0.yyyy * hlslcc_mtx4x4unity_MatrixVP[1];
     u_xlat1 = hlslcc_mtx4x4unity_MatrixVP[0] * u_xlat0.xxxx + u_xlat1;
     u_xlat1 = hlslcc_mtx4x4unity_MatrixVP[2] * u_xlat0.zzzz + u_xlat1;
     gl_Position = hlslcc_mtx4x4unity_MatrixVP[3] * u_xlat0.wwww + u_xlat1;
     vs_TEXCOORD0.xy = in_TEXCOORD0.xy;
     return;
 }
 

This is the fragment shader:

 #version 300 es
 
 precision highp float;
 precision highp int;
 uniform     vec4 hlslcc_mtx4x4unity_ObjectToWorld[4];
 
 layout(location = 0) out mediump vec4 SV_Target0;
 
 void main()
 {
     /////
     // Red: works fine. 
     // Not render: something wrong about hlslcc_mtx4x4unity_ObjectToWorld
     SV_Target0 = hlslcc_mtx4x4unity_ObjectToWorld[2];
     SV_Target0 = vec4(1,0,0,1);
     return;
     //////////
 }


It works fine on Mali GPUs, but it failes to render when it comes to Adreno 505.

How to handle that please?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

98 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why my particle system is rendering behind a standard shader? 0 Answers

How do you return to the default rendering mode after installing the lightweight-scriptable render pipeline? 1 Answer

Oculus rendeing bug 0 Answers

Standard Shader Still Visible through Stencil Shader 0 Answers

COLORMASK & writing to multiple render targets In Deferred doesn't work as expected in DX9 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges