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

HLSL/FX11 modification broke shaders on windows #132

Closed Tatsuya79 closed 6 years ago

Tatsuya79 commented 6 years ago

Many shaders like crt-geom or lcd-grid-v2 aren't working anymore on win7 x64 with an Nvidia card here.

[INFO] [CG]: Loading Cg shader: "shaders/crt/shaders/crt-geom.cg".
[ERROR] CG error: The compile returned an error.
[ERROR] Fragment:
shaders/crt/shaders/crt-geom.cg(88) : error C0000: syntax error, unexpected '(',
 expecting '{' at token "("
shaders/crt/shaders/crt-geom.cg(220) : error C0000: syntax error, unexpected ')'
, expecting "::" at token ")"
shaders/crt/shaders/crt-geom.cg(234) : error C0000: syntax error, unexpected '.'
, expecting "::" at token "."
shaders/crt/shaders/crt-geom.cg(294) : error C0000: syntax error, unexpected '='
, expecting "::" at token "="
shaders/crt/shaders/crt-geom.cg(312) : error C0000: syntax error, unexpected '='
, expecting "::" at token "="
shaders/crt/shaders/crt-geom.cg(320) : error C0000: syntax error, unexpected '='
, expecting "::" at token "="
shaders/crt/shaders/crt-geom.cg(323) : error C0000: syntax error, unexpected '='
, expecting "::" at token "="
shaders/crt/shaders/crt-geom.cg(354) : error C0000: syntax error, unexpected '.'
, expecting "::" at token "."
shaders/crt/shaders/crt-geom.cg(362) : error C0000: syntax error, unexpected "*=
", expecting "::" at token "*="
shaders/crt/shaders/crt-geom.cg(371) : error C0000: syntax error, unexpected "*=
", expecting "::" at token "*="

[ERROR] Failed to load shaders ...
[INFO] [CG]: Destroying programs.
[INFO] [CG]: Vertex profile: gp5vp
[INFO] [CG]: Fragment profile: gp5fp
[INFO] [CG]: Loading stock Cg file.
[INFO] [CG]: Found semantic "POSITION" in prog #24.
[INFO] [CG]: Found semantic "COLOR" in prog #24.
[INFO] [CG]: Found semantic "TEXCOORD0" in prog #24.
[INFO] [CG]: Found semantic "POSITION" in prog #23.
[INFO] [CG]: Found semantic "COLOR" in prog #23.
[INFO] [CG]: Found semantic "TEXCOORD0" in prog #23.
[INFO] [CG]: Found semantic "POSITION" in prog #22.
[INFO] [CG]: Found semantic "COLOR" in prog #22.
[INFO] [CG]: Found semantic "TEXCOORD0" in prog #22.
[WARN] [GL]: Failed to set multipass shader. Falling back to stock.
VelocityRa commented 6 years ago

I recently ported these shaders, I tested them on RetroArch (on Win10, NVidia card) and they work fine for me. The errors suggest that the files with the compatibility macros aren't being included properly. Not sure what's happening. Maybe the issue is indeed on Win7 only for whatever reason. I'm probably wrong but make sure that everything is cloned properly. There should be a compat_includes.inc file in the root of the repo and an include folder with a bunch of files starting with compat_.

Tatsuya79 commented 6 years ago

Oh I killed that, I thought it was some leftover files put there by mistake lol. I see... so the "include" folder and those files need to be packed in when moving those shaders elsewhere now... Tested working, sorry, closing this.