Trying native switch port, glsl problem

Linux geeks and Mac OS hipsters unite! A board for discussion of Supermodel on non-Windows platforms.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Trying native switch port, glsl problem

Postby r4dius » Wed Oct 12, 2022 4:26 pm

Hi,
I'm trying to port on switch for "fun", I've got it compiled but when executing on switch I get shader errors like :

[Info] OpenGL information:
[Info] Vendor : nouveau
[Info] Renderer : NV120
[Info] Version : OpenGL ES 3.2 Mesa 20.1.0-rc3
[Info] Shading Language Version : OpenGL ES GLSL ES 3.20
[Info] Maximum Vertex Array Size: 3000 vertices
[Info] Maximum Texture Size : 16384 texels
[Info] Maximum Vertex Attributes: 16
[Info] Maximum Vertex Uniforms : 16384
[Info] Maximum Texture Img Units: 32
[Info]
[Error] Vertex shader failed to compile. Your OpenGL driver said:
0:3(10): error: GLSL 1.20 is not supported. Supported versions are: 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES

I have 0 knowledge with opengl and even less with shaders, do you guys think there's any compatibility way to get it running or does this need to rebuild all shaders code ?

Thanks
r4dius
 
Posts: 2
Joined: Sun Dec 31, 2017 8:30 am

Re: Trying native switch port, glsl problem

Postby Ian » Fri Oct 21, 2022 8:49 am

Don't quote me on this because I've never written any OpenGL ES. But last time I looked OpenGL ES is basically the same as regular opengl. But slightly cut down, so they've removed a bunch of functions/functionality.

The shaders are failing for the simple reason you are trying to compile regular opengl shaders with opengl es.
All opengl shaders must start with a version declaration which starts like this

#version 120

opengl es is the same

but they need es after the version, so ..

#define opengl 320 es

But beyond that, i don't think there is much you'll have to change to get things working. I'd either try porting the triangle renderer (default new3d engine) or the legacy engine.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Trying native switch port, glsl problem

Postby r4dius » Sun Nov 13, 2022 8:04 am

Thanks for the reply,
I've been testing changing the version and changing some deprecated stuff but still have to replace complex parts of the opengl,
as for the new3d render there's still some use of shaders in shaders2d.h which is initialized for both renderers
and it contains at least one of the blocking opengl stuff "gl_MultiTexCoord0" which doesn't exist in gl ES and I can't find any example of how it's replaced :oops:
r4dius
 
Posts: 2
Joined: Sun Dec 31, 2017 8:30 am

Re: Trying native switch port, glsl problem

Postby Ian » Mon Nov 14, 2022 4:52 pm

glVertexAttribPointer would be a direct replacement.
Been looking it might be possible to get the new renderer working with gles 3 2. I wonder how fast the hw is.
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am


Return to Alternative Fashion

Who is online

Users browsing this forum: No registered users and 1 guest