Forums - Fragment shader compilation failed on Oculus Quest II

2 posts / 0 new
Last post
Fragment shader compilation failed on Oculus Quest II
eli.bukchin
Join Date: 29 Mar 22
Posts: 1
Posted: Wed, 2022-03-30 04:29

I get an error:
Shader compilation failed for shaderType: 1
Info log: ERROR: 0:1: '' : Unknown char
INTERNAL ERROR: no main() function!
ERROR: 1 compilation errors.  No code generated.

the Unknown character is 0x03

The shader works on win32 platform.

I can't figure out the problem

Shader code:

#version 450
 
layout (location = 0) in vec2 inUV;
layout (location = 0) out vec4 outColor;
 
void main() 
{
    outColor = vec4(inUV.x, inUV.y, 0.0, 1.0);
}
 
shader binary:
0x07230203,0x00010000,0x000d000a,0x00000018,
0x00000000,0x00020011,0x00000001,0x0006000b,
0x00000001,0x4c534c47,0x6474732e,0x3035342e,
0x00000000,0x0003000e,0x00000000,0x00000001,
0x0007000f,0x00000004,0x00000004,0x6e69616d,
0x00000000,0x00000009,0x0000000c,0x00030010,
0x00000004,0x00000007,0x00030003,0x00000002,
0x000001c2,0x000a0004,0x475f4c47,0x4c474f4f,
0x70635f45,0x74735f70,0x5f656c79,0x656e696c,
0x7269645f,0x69746365,0x00006576,0x00080004,
0x475f4c47,0x4c474f4f,0x6e695f45,0x64756c63,
0x69645f65,0x74636572,0x00657669,0x00040005,
0x00000004,0x6e69616d,0x00000000,0x00050005,
0x00000009,0x4374756f,0x726f6c6f,0x00000000,
0x00040005,0x0000000c,0x56556e69,0x00000000,
0x00040047,0x00000009,0x0000001e,0x00000000,
0x00040047,0x0000000c,0x0000001e,0x00000000,
0x00020013,0x00000002,0x00030021,0x00000003,
0x00000002,0x00030016,0x00000006,0x00000020,
0x00040017,0x00000007,0x00000006,0x00000004,
0x00040020,0x00000008,0x00000003,0x00000007,
0x0004003b,0x00000008,0x00000009,0x00000003,
0x00040017,0x0000000a,0x00000006,0x00000002,
0x00040020,0x0000000b,0x00000001,0x0000000a,
0x0004003b,0x0000000b,0x0000000c,0x00000001,
0x00040015,0x0000000d,0x00000020,0x00000000,
0x0004002b,0x0000000d,0x0000000e,0x00000000,
0x00040020,0x0000000f,0x00000001,0x00000006,
0x0004002b,0x0000000d,0x00000012,0x00000001,
0x0004002b,0x00000006,0x00000015,0x00000000,
0x0004002b,0x00000006,0x00000016,0x3f800000,
0x00050036,0x00000002,0x00000004,0x00000000,
0x00000003,0x000200f8,0x00000005,0x00050041,
0x0000000f,0x00000010,0x0000000c,0x0000000e,
0x0004003d,0x00000006,0x00000011,0x00000010,
0x00050041,0x0000000f,0x00000013,0x0000000c,
0x00000012,0x0004003d,0x00000006,0x00000014,
0x00000013,0x00070050,0x00000007,0x00000017,
0x00000011,0x00000014,0x00000015,0x00000016,
0x0003003e,0x00000009,0x00000017,0x000100fd,
0x00010038

 

  • Up0
  • Down0
DuBo
Join Date: 9 Dec 13
Posts: 41
Posted: Thu, 2022-04-21 23:16

I suspect the issue is from "#version 450", which is not correct to OpenGL ES on mobile device.
OpenGL ES 3.2 shading language version is 3.20,

So can you change "#version 450" to "#version 320" or "#version 300"  for a test?
 

Thanks
Bob Du

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.