Commit Graph

2709 Commits

Author SHA1 Message Date
Jonathan Li f8787ca6b9 gsdx: Fix variable initialisation issue
Class member variables are initialised in order of declaration in the
class definition. Move native_buffer to the top of the class definition
to avoid initialising m_width and m_height to random values.
2017-06-05 01:12:41 +01:00
Akash 23fa0657a7 GSdx-HW: Move scaling code to separate subroutine
Move the custom resolution scaling code to a separate subroutine and
allow future RT buffer resize calls when the buffer size isn't enough.

(Example: when a game's CRTC/Framebuffer size changes. The older code
didn't consider such cases)
2017-06-04 17:10:25 +02:00
Akash a04d9fa388 GSdx-HW: Revamp buffer size calculation
Added a more robust buffer size calculation mechanism for custom
resolutions. Improves performance in higher resolutions for games
which don't need a big buffer. There's a great boost in performance
at GS limited scenarios.

I don't even feel there's a need for the large framebuffer option right
now, For future - I plan on making the large framebuffer enabled version
as the default as the overhead is there only at situations when it's
necessary. Until then keeping the original code just to be on the safe
side in case any issue pops up.
2017-06-04 17:10:25 +02:00
Akash 266c114c1e GSdx-OGL: Extend ICO workaround to PAL videomode 2017-06-03 14:52:42 +02:00
Jonathan Li 11ed4de0aa gsdx: windows: Port xz dump readback
Also modernize and std:: a bit while I'm at it.
2017-06-03 14:52:01 +02:00
Jonathan Li 742b0edaa8 gsdx: Fix GS dump readback EOF handling
An EOF only occurs after attempting to read past the end of the file.
Account for this correctly, which fixes a potential infinite loop when
reading back an xz compressed GS dump.
2017-06-03 14:52:01 +02:00
Jonathan Li a6ed698fca unix: Remove LZMA_SUPPORTED define 2017-06-03 14:52:01 +02:00
Jonathan Li 3912f3330f windows: Link GSdx to liblzma (xz) 2017-06-03 14:52:01 +02:00
Jonathan Li 97d99632a6 gsdx: Use std::vector for xz dump output buffer
By default, Windows has a 1MB stack size limit per thread, so array
cannot be used...
2017-06-03 14:52:01 +02:00
Akash 49840bb621 GSdx: Implement SYNCV register bitfields
Add the bitfield structure of the undocumented SYNCV register,
potentially might be useful in proper height determination of the output
circuit for some weird games which still get it wrong but still haven't
figured out how it might be useful. Maybe some sort of black magic
formula with the vertical synchronization values?

The differential phase value seems to closely resemble the display
height value of the video modes (480 for NTSC, 576 for PAL) but after
some investigating into the differential phase, I have no clue on how
they might be even related. Hopefully the mystery will be unveiled in
the near future.
2017-05-24 13:44:52 +02:00
Gregory Hainaut 802f1029e9 gsdx: dump gsdump in xz format directly
Reduce disk space. Easy to share.

It would be nice to port the code to Windows.
libzma code was taken from https://git.tukaani.org/xz.git

Note: only short dumps are supported so far. Big dump will freeze the interface during the compression.
Or will suck all the RAM.
Note2: a multithreaded encoder would badly impact the compression ratio

Thanks to Turtleli for all review comments
2017-05-21 23:45:35 +02:00
Gregory Hainaut 53b2fdf31c linux: requires liblzma (xz) to build GSdx 2017-05-21 23:45:35 +02:00
Gregory Hainaut 5c7d9d08e2 gsdx: defer init of GSUtil global object
Close #1935
2017-05-21 14:39:22 +02:00
Gregory Hainaut 9cb8c70434 gsdx linux: port to latest GTK3 API
* replace gtk_table by gtk_grid
  => it still misses some paddings
* Use 3.22 monitor API to query screen size
  => need to be tested
* directly add scrolled windows into a container without bothering with
  the viewport.

Code compile fine but wasn't tested.

v2: disable the code until I (or someone) get a chance to test and fix it.
2017-05-13 10:39:06 +02:00
Gregory Hainaut b15ab1b1cf gsdx: use = default instead of trivial constructor/destructor
reported by clang-tidy
2017-05-13 10:38:35 +02:00
Gregory Hainaut 595ad99a5b Cmake: what should have been the previous commit 2017-05-12 19:38:51 +02:00
Gregory Hainaut 05763b3669 cmake: better gcc + gsdx integration
Only set fabi-version on older GCC (5.0 and below)
Disable broken optimization for GCC7+ (until we find a better solution)
2017-05-11 23:14:06 +02:00
Gregory Hainaut ec63b04719 gsdx: only print once OpenGL status message
All credits go to @lightningterror

Fix #1882
2017-05-11 22:35:31 +02:00
Akash 984fcfda2e Counters: Update videomode enum with proper prefix
Thanks to @colepcsx2 (https://github.com/PCSX2/pcsx2/pull/1896#commitcomment-21858717) for pointing it out!

I also updated the prefix in the inferior video mode detection of GSdx, I'm not even sure why we need the videomode info on the plugin side, might be useful someday.
2017-05-11 11:23:10 +02:00
Akash 7a3239cba0 GSDX: Remove redundant parenthesis from combobox text
The third parameter of the GSSetting constructor already encloses the
text in parenthesis, so the right bracket here just messed up things.
2017-05-07 19:31:37 +01:00
Akash 5f449151a1 GSDX: Add missing grayouts to Shadeboost options
The shadeboost options text (Contrast, Brightness, Saturation) were not
grayed out when shadeboost was disabled, it was sort of inconsistent
compared to the behavior of external shader, so added grayouts to them
when shadeboost is disabled.

Also changed "OpenGL Very Advanced Custom Settings" to "OpenGL Advanced
Settings", the verbosity didn't help much in my opinion.
2017-05-07 19:31:37 +01:00
Gregory Hainaut dc00af8829 psx|spu2x|gsdx: shift negative value is undefined in C standard
Instead does the negation after the shift

v2: assert shift <= 15 in clamp_mix
2017-04-30 21:20:23 +02:00
Gregory Hainaut d9e43b5d8d gsdx egl: rewrite the EGL implementation
Split code in 2 parts
* Base class (GSWndEGL) that implement the core EGL and GL context
* Derived class (GSWndEGL_X11/GSWndEGL_WL) that implement the backend to handle native resources

Note: Most backend code is only useful for GSopen1/PS1 mode. GSopen2 only requires
the AttachNativeWindow implementation

Code is based around EGL_EXT_platform extension that allow to select the platform at runtime.
Note: I think the extension was integrated in EGL 1.5

The X11 backend was mostly converted to XCB
The wayland backend is only a placeholder for future code

I don't know if MS windows is/could be supported with EGL_EXT_platform API

Code validated on Mesa. Proprietary drivers aren't yet tested.
2017-04-30 14:04:24 +02:00
Jonathan Li a3b3b4f657 gsdx: Fix uptr size on Windows x64 build 2017-04-29 23:22:02 +01:00
Gregory Hainaut 413d1828eb gsdx: call XInitThread on Linux dump replay 2017-04-29 13:05:28 +02:00
Gregory Hainaut 41990a6402 cmake: create the macro add_custom_glib_res to handle resources 2017-04-28 11:27:19 +02:00
lightningterror 303564fd70 GSdx: Move/add GT4 CRC
Moved a CRC hack to Aggressive that can cause or fix VRAM and RAM spikes.
This way people can switch between each config if they experience problems with either.
Varies on userconfig , game version and maybe hardware.

Added missing CRC game version for GT4 pal.

Note: The issue might be the same on GT3 and GTConcept , the code might
need to be removed for those games as well.
2017-04-27 17:46:58 +02:00
Gregory Hainaut bb35261aca gsdx: don't request a depth buffer on the window
Code directly uses depth buffer attached to a frame buffer
2017-04-23 10:59:33 +02:00
Gregory Hainaut 2155f65478 gsdx: fix EGL build 2017-04-23 10:59:33 +02:00
FlatOutPS2 47c2f0a289 GSdx: Remove Dirge Of Cerberus CRC hack
Hack was used to remove garbage data rectangles from popping up on screen when objects and characters were added to or removed from the world.
This issue is now being handled by OI_DoubleHalfClear in GSRendererHW.cpp, so the hack is no longe necessary and has been removed.
2017-04-21 11:13:27 +02:00
FlatOutPS2 7392f52184 GSdx: Move Resident Evil 4 and The Getaway series CRC hacks
Moves Resident Evil 4 hack to Aggressive level as it is no longer
required to fix any issues, but does offer a decent speed boost.

Moves The Getaway & The Getaway Black Monday CRC hack to Full level, as the issue can be resolved
when using the OpenGL Hardware renderer.
2017-04-21 11:13:27 +02:00
Gregory Hainaut 688f05ff26 gsdx sw: always enable the gs memory wrapping emulation 2017-04-21 10:53:05 +02:00
Gregory Hainaut 24eb1627e5 gsdx: add GStempdir wrapper to get a tempory directory
Allow to use Linux compatible code for OpenCL
2017-04-12 18:39:11 +02:00
Gregory Hainaut 2b30e7880e gsdx: add GSmkdir for windows based on CreateDirectory
v2: use nullptr
2017-04-12 18:39:11 +02:00
Gregory Hainaut 2d0a61fc8d gsdx ogl: use load resource to load shader
* Windows behavior must be checked
* remove glsl_source.h

v2: fix missing include
Big thanks to Turtleli

v3:
fix indentation in gsdx-res.xml
add dependency in cmake
remove old res/glsl/fxaa.fx symlink
add tfx.cl for OpenCL support on Linux

v4, v5
fix cmake indentation
2017-04-12 18:09:06 +02:00
Gregory Hainaut 38c4f5b6e7 gsdx: always NULL terminate resources on Windows
It is done automatically on Linux. Strings are much
better with this NULL char ;)

All credits go to turtleli

v2: increase resize instead of push_back NULL char
2017-04-12 18:09:06 +02:00
Gregory Hainaut ebae8b65f8 gsdx linux: implement GSdxApp::LoadResource based on g_resource
v2: use early return to reduce code/branch complexity
v3: use nullptr
2017-04-12 18:09:06 +02:00
Gregory Hainaut 1cbade511d gsdx: use vector of char as shader container
It will avoid various char cast on Linux.

v2:
remove cast on windows file and std prefix shader vector
v3:
forget to remove some char cast
2017-04-12 18:09:06 +02:00
Gregory Hainaut e91194994f gsdx ogl: remove useless glx/egl context print 2017-04-09 12:59:08 +02:00
Gregory Hainaut dad4ab1980 gsdx ogl: Deleted objects are automatically unbound/unmapped 2017-04-08 14:40:54 +02:00
Gregory Hainaut 12d2c6be56 gsdx linux gui: align gui with wndows (tooltip + checkbox)
add checkboxes for the 2 "new" hacks
    Wrap gs memory & merge postprocessing sprite

add tooltip for OpenGL options

v2: based on turtleli feedback
use gtk_scrolled_window_set_propagate_natural_height on GTK 3.22+
use the nicer GTK_CHECK_VERSION macro
2017-04-07 23:06:29 +02:00
Gregory Hainaut 83d83b9add gsdx linux gui: reduce height on/for small screen
* Remove the logo
* add a scroll on the osd panel
2017-04-07 23:06:29 +02:00
lightningterror 820919c0a9 GSdx ogl sw: Move GL_ARB_copy_image to optional
Move GL_ARB_copy_image to optional for OpenGL SW render.
It will allow Ivy Bridge to work with OpenGL SW as it's not required.

Sandy Bridge is not yet tested , would be nice if someone could test.
2017-04-06 18:14:59 +02:00
Gregory Hainaut ad63c13cd1 gsdx sw: Update comment on the GCC bug
Add link to bugzilla. Bug will be fixed in GCC7

Close #1881
2017-04-04 19:04:21 +02:00
Gregory Hainaut 5b91dc45e0 gsdx ogl: reduce requirement for SW renderer
Clip Control is only used for the HW renderer.

It will help Nvidia DX10 GPU on Windows. Potentially old AMD GPU too.
Unfortunately Ivy bridge still misses texture copy

Note on Linux, you can use the free Mesa driver.

Otherwise, it is time to save money for a future upgrade :)
2017-04-04 18:37:26 +02:00
Gregory Hainaut df32564bef gsdx: workaround AVX2 generated code by GCC
See commit for the full details.

v2: use a direct access to the union field instead of extract32
It gives us both optimal and working code.
2017-04-01 14:05:40 +02:00
FlatOutPS2 82405982f7 GSdx: Add merge sprite hack to GSdx hacks dialog
Adds merge sprite hack to GSDx hacks dialog

And ports merge sprite hack to Direct3D renderers.
Special thanks to my keyboards Ctrl, c and v buttons for all their hard
work in porting this hack.
2017-04-01 11:16:25 +02:00
FlatOutPS2 557b672232 GSdx: Unscale Point and Line Direct3D11 port
Ports the "Unscale Point and Line" hack to the Direct3D11 Hardware renderer.

And enables the "Unscale Point and Line" hack for Custom Resolutions with Direct3D11 and OpenGL.
2017-04-01 11:16:25 +02:00
FlatOutPS2 117c249595 GSdx: Add Windows GUI for split texture filtering option
Adds Windows GUI elements of the split texture filtering options.

Bilinear Texture Filtering is moved to the top section of the main GSdx window,
and Trilinear Filtering is moved to Hacks.
2017-04-01 11:16:25 +02:00
FlatOutPS2 cb0a430aa4 GSdx: Shader & OSD window update
Adds Texture Filtering Of Display option to the Shader dialog window Windows UI.

Updates the layouts of the Shader and OSD dialog windows to more closely resemble the Linux GUI.
2017-04-01 11:16:25 +02:00