joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.54k stars 373 forks source link

D3D pixel shaders not working? #2884

Open tatude opened 2 years ago

tatude commented 2 years ago

I've tried several of the D3D pixel shaders (forced and non-forced) with different scaler settings (none, hardware_none etc., forced and non-forced), but none seem to work. I have the latest 0.83.17 release.

This is shown in the log:

LOG: D3D:Pixel shader error:
LOG:  shaders\EGAfilter.fx:
LOG:  Unable to create effect compiler from shaders\EGAfilter.fx
LOG: D3D:Pixel shader output disabled

I think hardware shader model support should not be the issue (I have Intel UHD Graphics 630, which should support shader model 6.4 and DirectX 12.1.

Jkapp76 commented 2 years ago

I had an issue and corrected it by going into the "render" options and setting scaler to = none

tatude commented 2 years ago

I had an issue and corrected it by going into the "render" options and setting scaler to = none

I actually meant scaler instead of shader for the none, harware_none etc. settings that I had tried with the D3D pixel shaders (and now updated the question accordingly). So unfortunately this doesn't solve the case for me.

Could I ask for your entire render, SDL and video configs for having D3D pixel shaders working? Maybe I could figure out my issue that way.

Jkapp76 commented 2 years ago

I usually use the opengl shaders with DOSBox-X. But... I have had some fx shaders work great with Direct3d mode as well. "crt-easymode.tweaked.fx and CRT-simple.D3D.br.fx" work pretty good for me and you can open those fx files in a text editor to customize them. But, many of my fx shaders fail like yours did.

[sdl] fullscreen = true fulldouble = true fullresolution = desktop windowresolution = original windowposition = display = 0 output = opengl videodriver = transparency = 0 maximize = true autolock = true clip_mouse_button = right clip_key_modifier = shift clip_paste_bios = default clip_paste_speed = 30 sensitivity = 50 usesystemcursor = false mouse_emulation = integration mouse_wheel_key = -1 waitonerror = true priority = higher,normal mapperfile = mapper-dosbox-x.map usescancodes = auto titlebar = showbasic = true showdetails = false showmenu = true

[render] frameskip = 0 aspect = false char9 = true euro = -1 doublescan = true scaler = none glshader = crt-easymode pixelshader = crt-easymode.tweaked autofit = true monochrome_pal = green

video settings are default. If I change the video output from opengl to direct3d it will use the fx version of the shader. directx shaders are in a folder named "shaders," which is inside the dosbox folder. Opengl shaders are in a folder named "glshaders."

maron2000 commented 2 years ago

Hi. The shader you mentioned seems to work. Tested on Windows 8.1 Pro 64-bit.

D3D:Shader scale: 0.00
D3D:Pixel shader EGAfilter.fx active

EGAFilter

[SDL]
fullscreen        = false
fulldouble        = false
fullresolution    = desktop
windowresolution  = original
windowposition    = 
display           = 0
output            = default
videodriver       = 
transparency      = 0
maximize          = false
autolock          = false
clip_mouse_button = right
clip_key_modifier = shift
clip_paste_bios   = default
clip_paste_speed  = 30
sensitivity       = 100
usesystemcursor   = false
mouse_emulation   = locked
mouse_wheel_key   = -1
waitonerror       = true
priority          = higher,normal
mapperfile        = mapper-dosbox-x.map
usescancodes      = true
titlebar          = 
showbasic         = true
showdetails       = false
showmenu          = true

[render]
frameskip      = 0
aspect         = false
char9          = true
euro           = -1
doublescan     = true
scaler         = normal2x
glshader       = none
pixelshader    = none
autofit        = true
monochrome_pal = green
joncampbell123 commented 2 years ago

Some of the shader files do nothing on their own but are included by other shader files to compose the final shader.

Also, some GPUs (especially Intel chipsets) cannot run some shaders. The log file / console will say so if the shader did not run or compile.

tatude commented 2 years ago

Thank you everyone for your support! I think what @joncampbell123 said about especially Intel integrated GPUs having issues might be the cause of my problems as well. Will keep investigating but might need to accept that it's just a no for D3D in my case.

Very strange as that GPU is relatively new (as I said, it should support shader model 6.4 and DirectX 12.1) and I have the newest display drivers installed in Windows 10. Also, the OpenGL shaders work fine, although they are of course a different thing.