Coder Social home page Coder Social logo

Fragment shader error about drishti HOT 11 OPEN

nsutemire avatar nsutemire commented on July 18, 2024
Fragment shader error

from drishti.

Comments (11)

Wencke1 avatar Wencke1 commented on July 18, 2024 1

Hi everyone,
I found a solution which workes for me.
I use drishdi 2.6.4 now, and this works with my setting without a problem.
Cheers
Wencke

from drishti.

AjayLimaye avatar AjayLimaye commented on July 18, 2024

from drishti.

Wencke1 avatar Wencke1 commented on July 18, 2024

Hi erveryone.
I do have the same problem with the same error code.
I updated the driver but still the same problem. I am running drishti 2.6.5 on a windows 10 PC with a Radeon Pro WX7100 graphics card.
Cheers
Wencke

from drishti.

AjayLimaye avatar AjayLimaye commented on July 18, 2024

from drishti.

Wencke1 avatar Wencke1 commented on July 18, 2024

from drishti.

pavel-perina avatar pavel-perina commented on July 18, 2024

Hi.
Very similar error, I may try to update driver. This one came as with Windows 10 1903.

Radeon RX 570 Series AMD Radeon Graphics Processor (0x67DF)
driver version: 22.19.162.4
driver date: 2017-04-24

OpenGL info:
ATI Technologies Inc.
Radeon RX 570 Series
3.2.13474 Core Profile Forward-Compatible Context 22.19.162.4
-------------Error----------------

Fragment shader failed to compile with the following errors:
ERROR: 0:69: error(#132) Syntax error: ")" parse error
ERROR: error(#273) 1 compilation errors. No code generated

-----------Shader---------------

1 : #extension GL_ARB_texture_rectangle : enable
2 : uniform sampler2D lutTex;
3 : uniform sampler2DRect dragTex;
4 : uniform int gridx;
5 : uniform int gridy;
6 : uniform int gridz;
7 : uniform int ncols;
8 : uniform int llod;
9 : uniform int lgridx;
10 : uniform int lgridy;
11 : uniform int lgridz;
12 : uniform int lncols;
13 : uniform bool opshader;
14 : uniform float tfSet;
15 : void main(void)
16 : {
17 : vec2 tc = gl_TexCoord[0].xy;
18 : int lcol = int(tc.x)/lgridx;
19 : int lrow = int(tc.y)/lgridy;
20 : float x = tc.x - float(lcollgridx);
21 : float y = tc.y - float(lrow
lgridy);
22 : float z = float(lrowlncols + lcol);
23 : vec3 pos = vec3(x,y,z);
24 : bvec3 pless = lessThan(pos, vec3(1.5,1.5,1.5));
25 : bvec3 pgret = greaterThan(pos, vec3(float(lgridx)-2.5,float(lgridy)-2.5,float(lgridz)-2.5));
26 : if (any(pless) || any(pgret))
27 : { gl_FragColor = vec4(0.0,0.0,0.0,0.0); return; }
28 : float xO = x
float(llod);
29 : float yO = yfloat(llod);
30 : float zO = z
float(llod);
31 : int alod = llod-1;
32 : vec4 fcolor = vec4(0.0,0.0,0.0,0.0);
33 : for(int xa=-alod; xa<=alod; xa++)
34 : for(int ya=-alod; ya<=alod; ya++)
35 : for(int za=-alod; za<=alod; za++)
36 : {
37 : float x = xO + xa;
38 : float y = yO + ya;
39 : float z = zO + za;
40 : int row = int(z)/ncols;
41 : int col = int(z) - row*ncols;
42 : row = gridy;
43 : col = gridx;
44 : tc = vec2(float(col)+x, float(row)+y);
45 : vec2 vg;
46 : vg.x = texture2DRect(dragTex, tc.xy).x;
47 : int h0 = int(65535.0
vg.x);
48 : int h1 = h0 / 256;
49 : h0 = int(mod(float(h0),256.0));
50 : float fh0 = float(h0)/256.0;
51 : float fh1 = float(h1)/256.0;
52 : vg.xy = vec2(fh0, fh1);
53 : float val = vg.x;
54 : float grad = vg.y
0.125;
55 : vg.y = tfSet + grad;
56 : if (opshader)
57 : {
58 : float alpha = texture2D(lutTex, vg.xy).a;
59 : fcolor += vec4(val, grad, alpha, 1.0);
60 : }
61 : else
62 : {
63 : vec4 clr = texture2D(lutTex, vg.xy);
64 : clr.rgb = clr.a;
65 : clr.a = step(0.01, clr.a);
66 : fcolor += clr;
67 : }
68 : }
69 : gl_FragColor = fcolor/pow(2.0
(float)alod+1, 3.0);
70 : }
71 :

from drishti.

pavel-perina avatar pavel-perina commented on July 18, 2024

Actually, I guess bug is in (float)alod which should be float(alod) ... and i forgot if shaders allow implicit conversions, maybe there should be 1.0 instead of 1

from drishti.

pavel-perina avatar pavel-perina commented on July 18, 2024

I patched executable to fix the previous error and got another one.
Obviously it was never tested on AMD GPUs.

-------------Error----------------

Fragment shader failed to compile with the following errors:
ERROR: 0:22: error(#160) Cannot convert from: "float" to: "highp int"
ERROR: error(#273) 1 compilation errors. No code generated

-----------Shader---------------

1 : #extension GL_ARB_texture_rectangle : enable
2 : uniform sampler2DRect lightTex;
3 : uniform int gridx;
4 : uniform int gridy;
5 : uniform int gridz;
6 : uniform int ncols;
7 : uniform float llod;
8 : uniform int lgridx;
9 : uniform int lgridy;
10 : uniform int lncols;
11 : void main(void)
12 : {
13 : vec2 tc = gl_TexCoord[0].xy;
14 : int col = int(tc.x)/gridx;
15 : int row = int(tc.y)/gridy;
16 : float x = tc.x - float(colgridx);
17 : float y = tc.y - float(row
gridy);
18 : float z = float(rowncols + col);
19 : float xO = x
float(llod);
20 : float yO = yfloat(llod);
21 : float zO = z
float(llod);
22 : int alod = llod-1;
23 : vec4 fcolor = vec4(0.0,0.0,0.0,0.0);
24 : for(int xa=-alod; xa<=alod; xa++)
25 : for(int ya=-alod; ya<=alod; ya++)
26 : for(int za=-alod; za<=alod; za++)
27 : {
28 : float x = xO + xa;
29 : float y = yO + ya;
30 : float z = zO + za;
31 : int lrow = int(z)/lncols;
32 : int lcol = int(z) - lrow*lncols;
33 : lrow *= lgridy;
34 : lcol = lgridx;
35 : vec2 ltc = vec2(float(lcol)+x, float(lrow)+y);
36 : fcolor += vec4(texture2DRect(lightTex, ltc).rgb, 1.0);
37 : }
38 : gl_FragColor = fcolor/pow(2.0
float(alod)+1, 3.0);
39 : }
40 :

from drishti.

AjayLimaye avatar AjayLimaye commented on July 18, 2024

from drishti.

pavel-perina avatar pavel-perina commented on July 18, 2024

from drishti.

AjayLimaye avatar AjayLimaye commented on July 18, 2024

from drishti.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.