devMiyax
Posts: 1
Joined: Sun Mar 01, 2020 11:20 am

texelFetch does not have enough precision.

Sun Mar 01, 2020 11:54 am

I have shader code following

Code: Select all

"  vec4 txindex = texelFetch( s_texture, ivec2(int(v_texcoord.x),int(v_texcoord.y)) ,0 );\n"
"  vec4 txcol = texelFetch( s_color,  ivec2( ( int(txindex.g*65280.0) | int(txindex.r*255.0)) ,0 )  , 0 );\n"
it seems txindex does not have enough precision, the seccond texelFetch retuns bad color.
This code works fine on Snapdragon and Tegra X1. Is there anyone know how can manage this issue?

Entire code is here.
https://github.com/devmiyax/yabause/blo ... shaderes.c

Thanks in advance.

Daniel Gessel
Posts: 121
Joined: Sun Dec 03, 2017 1:47 am
Location: Boston area, MA, US
Contact: Website Twitter

Re: texelFetch does not have enough precision.

Sun Mar 01, 2020 9:54 pm

Have you tried specifying highp? Which pi is this on, pi4 or other?

Notthesameman
Posts: 12
Joined: Mon Mar 09, 2020 9:46 pm

Re: texelFetch does not have enough precision.

Mon Mar 09, 2020 10:05 pm

This is happening on the pi4

Daniel Gessel
Posts: 121
Joined: Sun Dec 03, 2017 1:47 am
Location: Boston area, MA, US
Contact: Website Twitter

Re: texelFetch does not have enough precision.

Mon Mar 09, 2020 11:29 pm

Rumor is the VC6 in the Pi4 has support for f16 at double rate, so it may default to that lower precision unless you specify highp. I haven’t tested with the latest drivers so I’m not sure.

Notthesameman
Posts: 12
Joined: Mon Mar 09, 2020 9:46 pm

Re: texelFetch does not have enough precision.

Tue Mar 10, 2020 12:09 am

okay, here again, it seems that this is what we got so precision highp is set at that, the code is here

Code: Select all

#if defined(_OGLES3_)
"#version 300 es \n"
"precision highp float;\n"
"precision highp int;\n"
#else
"#version 330 \n"
#endif
they asked me to post back here maybe something else is giving this error

dankcushions
Posts: 27
Joined: Sat Jun 13, 2015 10:40 am

Re: texelFetch does not have enough precision.

Mon Apr 06, 2020 2:30 pm

Info in the previous post had been updated (since it was an edit, I'm not sure if subscribers would see it)

Notthesameman
Posts: 12
Joined: Mon Mar 09, 2020 9:46 pm

Re: texelFetch does not have enough precision.

Mon Apr 06, 2020 2:44 pm

dankcushions wrote:
Mon Apr 06, 2020 2:30 pm
Info in the previous post had been updated (since it was an edit, I'm not sure if subscribers would see it)
how do we know if they read it, i been on theses fourms but not to sure how they work, the last post i edited was cos i felt that the info was not good enough and i been waiting for about a month, so he might of not seen it like you said, do we need to create a new post?

Return to “OpenGLES”