Author Topic: PhysX Fluidmark uses shaders not compliant with OpenGL 2.0  (Read 2208 times)

0 Members and 1 Guest are viewing this topic.

Dex

  • Associate
  • Posts: 2
PhysX Fluidmark uses shaders not compliant with OpenGL 2.0
« on: September 09, 2008, 02:44:01 PM »
I gave a try to run Fluidmark on intel integrated graphics, which allegedly supports OpenGL 2.0 and what I realized was that it fails because shader implemented in Fluidmark uses simplicit type conversion which is forbidden in GLSL 1.10 (introduced in 1.20), while it does not declare #version 120. Probably nvidia/ati does not check for that, but using it this way looks likes violating the spec:

GLSL 1.10.59 spec says in section 5.9 Expressions
The arithmetic binary operators add (+), subtract (-), multiply (*), and divide (/), that operate on integer and floating-point typed expressions (including vectors and matrices). The two operands must be the same type, or one can be a scalar float and the other a float vector or matrix, or one can be a scalar integer and the other an integer vector.

The part of shader that is doing the implicit conversion:
#define NUM_BLUR_TAPS 12
...
float shadowColor = 0.0;
for (i=0; i<NUM_BLUR_TAPS; i++)
        shadowColor += ...
shadowColor /= NUM_BLUR_TAPS; // <<< error: float type divided by integer const
 

Can you confirm / fix / comment?

Thank you
Dexter






JeGX

  • Global Moderator
  • Capo Crimine
  • *****
  • Posts: 2343
    • oZone3D.Net
Re: PhysX Fluidmark uses shaders not compliant with OpenGL 2.0
« Reply #1 on: September 10, 2008, 08:03:06 AM »
yep you're right, this code is not really legal. But it works on Radeon/GeForce and maybe on S3 Chrome. You can fix it yourself with:
Code: [Select]
shadowColor /= float(NUM_BLUR_TAPS);
Try this fix and let me know.

Dex

  • Associate
  • Posts: 2
Re: PhysX Fluidmark uses shaders not compliant with OpenGL 2.0
« Reply #2 on: September 10, 2008, 02:59:47 PM »
Yep, it works! You could make the change in some next release...
Thanks