https://bugs.winehq.org/show_bug.cgi?id=42587
Bug ID: 42587 Summary: MandelDx11Double doesn't work Needs support for D3D11 double prec. floats in shaders.. Product: Wine Version: 2.2 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: rtfss1@gmail.com Distribution: ---
Created attachment 57512 --> https://bugs.winehq.org/attachment.cgi?id=57512 Mandelbrot D3D11 demo with double precision support
Hi don't know if interested on implementing D3D11 double precision support as it's optional feature and not many (any?) apps/games use it..
Any way long time ago I patched shaders of one of firsts D3D11 compute shader Mandelbrot demos( see Mandel http://users.skynet.be/fquake/) to use double precision floats for calculations..
demo uses high enough zoom by default to show difference if double works or not if using single prec you will see large blocks of same color due to reduced precision.. I attach my patched demo (see MandelDX11double)..
If run: Mandel.exe 1 will run using double precision calculations instead Mandel.exe 0 will force to use single prec and will see big blocks of colors due to reduced precision
Also note initial SM5 double precision supporti don't know if interested on implementing D3D11 double precision support as it's optional feature and not many (any?) apps/games use it..
Any way long time ago I patched shaders of one of firsts D3D11 compute shader Mandelbrot demos( see Mandel http://users.skynet.be/fquake/) to use double precision floats for calculations..
demo uses high enough zoom by default to show difference if double works or not if using single prec you will see large blocks of same color due to reduced precision.. I attach my patched demo (see MandelDX11double)..
If run: Mandel.exe 1 will run using double precision calculations instead Mandel.exe 0 will force to use single prec and will see big blocks of colors due to reduced precision
Also note initial SM5 double precision support includes ops: dadd :https://msdn.microsoft.com/en-us/library/windows/desktop/hh446894(v=vs.85).a... dmax dtof etc.. but complete support came with DX11.1 adding: drcp dfma ddiv (double precision divide): https://msdn.microsoft.com/en-us/library/windows/desktop/hh920925(v=vs.85).a...
at least you can exercise ddiv opcode if change in mandel.hlsl file: b = b*0.5; with: b= b/2.0;
Note code (mandel.cpp) checks doubles supports: g_pd3dDevice->CheckFeatureSupport( D3D11_FEATURE_DOUBLES, &fdDoubleSupport, sizeof(fdDoubleSupport) ); GPUcanDoDoubles = fdDoubleSupport.DoublePrecisionFloatShaderOps;
and Wine currently returns 0; So I modified my local Wine sources to return D3D11_FEATURE_DOUBLES as true and verified running dxcapsviewer I made the changes correctly.. Even so program crashes..
Also note with Wine 2.3 demo crashes due to using native d3dx11_43 instead of incorporated d3dx11_42 and D3DCompiler_42 DLL's so I delete this files in (usr/local/lib/wine) so using included DLLs.. at least this way float demo works. has: dadd :https://msdn.microsoft.com/en-us/library/windows/desktop/hh446894(v=vs.85).a...
Note code (mandel.cpp) checks doubles supports: g_pd3dDevice->CheckFeatureSupport( D3D11_FEATURE_DOUBLES, &fdDoubleSupport, sizeof(fdDoubleSupport) ); GPUcanDoDoubles = fdDoubleSupport.DoublePrecisionFloatShaderOps;
and Wine currently returns 0; So I modified my local Wine sources to return D3D11_FEATURE_DOUBLES as true and verified running dxcapsviewer I made the changes correctly.. Even so program crashes..
Also note with Wine 2.3 demo crashes due to using native d3dx11_43 instead of incorporated d3dx11_42 and D3DCompiler_42 DLL's so I delete this files in (usr/local/lib/wine) so using included DLLs.. at least this way float demo works..