libretro / common-shaders

Collection of commonly used Cg shaders. These shaders are usable by either HLSL and/or Cg runtime compilers. The cg2glsl script will translate most of these into GLSL shaders.
http://www.libretro.com
1.03k stars 250 forks source link

Bilateral blur shader, other blur shaders broken #49

Open bleakassassin opened 9 years ago

bleakassassin commented 9 years ago

The bilateral blur shader is broken. Its errors look like this:

RetroArch [ERROR] : : load_preset : : Failed to load shaders ... RetroArch [WARN] : : gl_set_shader : : [GL]: Failed to set multipass shader. Falling back to stock. RetroArch [ERROR] : : load_program : : CG error: The compile returned an error. RetroArch [ERROR] : : load_program : : Fragment: C:\Program Files\RetroArch\shaders\blurs\bilateral.cg(100) : error C5043: profile requires index expression to be compile-time constant C:\Program Files\RetroArch\shaders\blurs\bilateral.cg(100) : error C5043: profile requires index expression to be compile-time constant C:\Program Files\RetroArch\shaders\blurs\bilateral.cg(100) : error C5043: profile requires index expression to be compile-time constant C:\Program Files\RetroArch\shaders\blurs\bilateral.cg(110) : error C5043: profile requires index expression to be compile-time constant C:\Program Files\RetroArch\shaders\blurs\bilateral.cg(110) : error C5043: profile requires index expression to be compile-time constant C:\Program Files\RetroArch\shaders\blurs\bilateral.cg(110) : error C5043: profile requires index expression to be compile-time constant C:\Program Files\RetroArch\shaders\blurs\bilateral.cg(110) : error C5043: profile requires index expression to be compile-time constant C:\Program Files\RetroArch\shaders\blurs\bilateral.cg(95) : error C5013: profile does not support "for" statements and "for" could not be unrolled. C:\Program Files\RetroArch\shaders\blurs\bilateral.cg(105) : error C5013: profile does not support "for" statements and "for" could not be unrolled.


Many of the other shaders in the "blurs" folder are also broken. The errors they give look like this:

RetroArch [ERROR] : : load_preset : : Failed to load shaders ... RetroArch [WARN] : : gl_set_shader : : [GL]: Failed to set multipass shader. Falling back to stock. RetroArch [ERROR] : : load_program : : CG error: The compile returned an error. RetroArch [ERROR] : : load_program : : Fragment: C:\Program Files\RetroArch\shaders\blurs/.../include/quad-pixel-communication.h(86) : error C3004: function "float ddx(float);" not supported in this profile C:\Program Files\RetroArch\shaders\blurs/.../include/quad-pixel-communication.h(86) : error C3004: function "float ddy(float);" not supported in this profile C:\Program Files\RetroArch\shaders\blurs/.../include/gamma-management.h(419) : error C3004: function "float4 tex2Dlod(sampler2D, float4);" not supported in this profile C:\Program Files\RetroArch\shaders\blurs/.../include/quad-pixel-communication.h(137) : error C3004: function "float3 ddx(float3);" not supported in this profile C:\Program Files\RetroArch\shaders\blurs/.../include/quad-pixel-communication.h(138) : error C3004: function "float3 ddy(float3);" not supported in this profile C:\Program Files\RetroArch\shaders\blurs/.../include/quad-pixel-communication.h(139) : error C3004: function "float3 ddy(float3);" not supported in this profile

hizzlekizzle commented 9 years ago

What kind of GPU do you have? There's a lot of Cg stuff, such as ddx/ddy, that only work on Nvidia cards (and maybe Intel, but definitely not AMD/Ati).

bleakassassin commented 9 years ago

That explains it. I have an AMD card. I don't recall this being explained before.

Is there a way to recreate the shaders in a graphics-vendor-agnostic manner? The bilateral shader is used for a shader preset that recreates the N64's VI Filter, and I wanted to check it out. N64 games are unplayable to me without the filter because of unsightly graphical flaws that show up without it.