Commit Graph

350 Commits

Author SHA1 Message Date
KrossX df307bed02 GSdx-d3d: Add macro to support ScalingFactor in shaders. 2018-10-19 11:36:23 +02:00
lightningterror b360c07253 glsl, fx: Update point sampler comment. 2018-10-09 09:07:45 +02:00
KrossX 5719c6c3c0 glsl: remove signed int cast side (masks and offsets are unsigned to begin with.
Issue #2617
2018-10-04 20:47:03 +02:00
KrossX 2d094cbc3b tfx.fs: Remove whitespaces. 2018-10-03 15:21:46 +02:00
KrossX 9d562a454b GSdx: Limit Wrap negative UV when PS_FST is 0 only. 2018-10-03 15:21:46 +02:00
KrossX 629d2bd425 GSdx: Wrap negative UV on region repeat wrap mode.
Makes UV coord be on the range [0, SIZE) before applying mask and
offset. This fixes Xenosaga's hair for example, which has negative UV
coords.
2018-10-01 22:38:22 +02:00
KrossX e90c87a8ef GSdx-d3d: Keep fract in [0;1] range port from OpenGL.
Fixes texture flickering in Oni on d3d11.

Commit:
a8968257db
2018-09-28 02:33:58 +02:00
lightningterror 728fa2c1a4 GSdx-d3d: tfx.fx correct texture shuffle shaders.
Some values were incorrect, now I'm no expert but looking at the code
and behavior seemed a bit wrong compared to gl.

Improves d3d rendering on Sonic Unleashed, the purple screen is gone
matching it with gl visuals.
2018-09-17 14:26:08 +02:00
lightningterror f40c1de919 GSdx: GPU accelerate 8 bits texture conversion port from OpenGL to Direct3D11.
Commit:
d29e375f72

Only native res is supported currently, but it's still great progress.
Someone needs to port the ScalingFactor to D3D from commit:
6121677aa1

Credits to KrossX for porting the shader.
2018-09-13 19:56:59 +02:00
Jonathan Li e4dd0069ca gsdx:windows: Don't refer to D3D10
Direct3D11 is used even if the user's GPU only supports Direct3D feature
level 10.0.
2018-08-29 00:48:16 +01:00
lightningterror 122f730608 glsl: Replace leftover tabs with spaces in shaderboost.
I believe all glsl files are cleaned up now.
2018-08-27 14:01:25 +02:00
lightningterror 1aeec47b30 glsl: Replace leftover tabs with spaces in tfx_fs. 2018-08-22 20:12:53 +02:00
lightningterror d7cdbf6f27 Gsdx: Point Sampler changes.
Re add point sampler to OpenGL. Fixes graphical issues when
Allow 8-bit textures is enabled on AMD gpus.
Issue: https://forums.pcsx2.net/Thread-GSDX-Hardware-mode-Bug-Report-Allow-8-bit-Texture

Adjust the code to be easier to read, and execute the gl code only on amd - suggested by Gregory.

Remove useless ATI_SUCKS define in tfx shader.It wasn't used anywhere outside of the shader.
2018-08-22 20:12:53 +02:00
lightningterror 6eb385fd9b GSdx-d3d: s/sample_4a/sample_4_index/ 2018-08-21 13:56:06 +02:00
lightningterror 188a1f1416 GSdx-d3d: Drop an useless min in FS - port from GL.
Commit: a1957a685d

GPU will clamp color anyway. It reduces the number of instruction of 25%
(4->3).
2018-08-21 13:56:06 +02:00
lightningterror 6ef793545d GSdx:Port better support of palette from GL to D3D10/11.
Port from commit b0af54d3

Fixes shadows in Star Ocean 3.

Note: It works properly on native res only just like on GL.
Upscaling will cause some issues.

Only Direct3D10/11 supports it, D3D9 doesn't support integer operations
so we can't reuse the code.
2018-05-30 14:47:06 +02:00
Jonathan Li 8f6a3d9fe8 gsdx: remove DirectCompute backend
It hasn't been accessible since OpenCL was added, and it was barely
updated since it was introduced.
2018-05-06 02:01:22 +01:00
Gregory Hainaut c5d35d434c glsl: reduce geometry shader complexity
output 1 strip of 2 triangles instead of 2 strips of 1 triangle.

Potentially it would reduce the geometry shader overhead. And it
might avoid a middle line in sprite in some AMD GPU/driver/OS
bad combination
2017-07-12 22:04:03 +02:00
Gregory Hainaut 38010432ee gsdx ogl: handle float integral coordinate for depth sampling
Fix depth effect regression on Nemo (issue #1979)
2017-07-12 22:03:47 +02:00
Jonathan Li 45ac69a1f6 gsdx:d3d11: Fix sprite geometry shader
Sprites always use flat shading.

Fixes #1980
2017-07-02 22:54:36 +01: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
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 975441dfe9 GSdx: Direct3D port of HPO special/V2
Adds a port of the new Half-pixel Offset options for the Direct3D
Hardware renderers.
2017-04-01 11:16:25 +02:00
Jonathan Li ba94643f0f gsdx:linux: Fix missing logo on some Linux distros
The pixdata format loader has been removed from recent versions of
gdk2-pixbuf, so the logo doesn't load. Avoid preprocessing the data and
leave the logo as an embedded bitmap file.
2017-03-30 17:45:49 +01:00
np511 e5e601eb75 Use GResources API instead of deprecated inline 2017-01-29 09:06:22 -05:00
Gregory Hainaut 61a7c747e1 gsdx-ogl: alternate implementation of half pixel offset
The previous implementation of HPO adds an offset on vertex position. It
doesn't always work beside it moves the rendering window.

The new implementation will add a texture offset so that instead to sample
the middle of the GS texel, we will sample the middle of the real texture texel.

It must be manually enabled with
* UserHacks_HalfPixelOffset_New = 1 (keep a small offset as intended by GS effect)
* UserHacks_HalfPixelOffset_New = 2 (no offset)

v2: always apply a 0.5 offset in case of float coordinates (Tales of Abyss)
Might break other games but few of them uses float coordinates to read
back the target
2016-11-29 17:22:02 +01:00
Gregory Hainaut c2229e3c0b gsdx-ogl: add a texture offset uniform parameter to vertex shader
It would be used for a new implementation of the half pixel offset hack

Hopefully it doesn't badly impact the perf on low end iGPU
2016-11-29 17:22:02 +01:00
Gregory Hainaut e80ca0fa92 gsdx ogl: of course some driver don't work with GL_ARB_enhanced_layouts
Windows and (AMD or Intel)
2016-10-23 12:48:23 +02:00
Gregory Hainaut 8fdf973e66 gsdx glsl: add basic support of GL_ARB_enhanced_layouts (GL4.4)
Hardcode location of interface to the location 0. If I understand the
spec correctly (unlikely), variable in interface will get successive
location.

Goal is to reduce driver work. Instead to compute some location based on
name matching approach (and silly validation), the driver can now use
static allocation.

Tests on future Mesa 13 are welcome
2016-10-19 23:03:39 +02:00
Gregory Hainaut 317a464278 gsdx shader: RGB => YUV conversion
Required for write feedback emulation
2016-10-14 18:13:20 +02:00
Jason Brown 6ef5607d99 gsdx shader: add a shader to render text for OSD
Gregory: code extracted from the OSD PR to reduce conflict
2016-10-14 18:13:20 +02:00
Jason Brown d84d30fe87 gsdx: Add color component to OGL shaders 2016-10-14 18:13:20 +02:00
Gregory Hainaut 7ea0e90678 gsdx mipmap:ogl: extend shader to support trilinear filtering 2016-10-13 20:16:38 +02:00
Gregory Hainaut c2b67ccb78 gsdx ogl: implement an alternate shader for Jak Shadows
The game sets the framebuffer as an input texture. So I did the same for
openGL. Code is protected with a CRC. It is working because the game want to sample
pixels.

For the record, I tested it GTA too, it doesn't work as expected because
the game will resize the framebuffer to a smaller one. So you don't have
the guarantee that pixel will be read before a data write.

Note: it requires at least accurate blending set on basic

Note: I need CRC of all Jak games that suffers of this issue. Thanks you :)
2016-09-08 23:58:13 +02:00
Gregory Hainaut e4337b6631 glsl2h: add input files in the header
Close #1404
2016-08-28 16:31:35 +02:00
Gregory Hainaut 5a1cb00a07 Merge pull request #1517 from FlatOutPS2/DX
Gsdx alpha test improvement DX
2016-08-25 09:25:19 +02:00
Gregory Hainaut 1fb2c66a21 gsdx ogl: Unscale line
Line thickness will be increased to N pixels (N is the upscaling factor).

Code will also be enabled by UserHacks_unscale_point_line = 1
2016-08-22 18:18:12 +02:00
Gregory Hainaut 018895067b gsdx ogl: restore code to unscale point
enabled by UserHacks_unscale_point_line = 1

Point will be transformed into a NxN square sprite. (N is the upscaling factor)
2016-08-22 18:18:12 +02:00
FlatOutPS2 c5cd716c20 Gsdx alpha test improvement DX
Port for the DX renderers of the alpha test improvement for OGL created by gregory38.
2016-08-19 15:59:54 +02:00
Gregory Hainaut 74822d6ba3 gsdx ogl: rework atst handling
* Move the rounding operation in the constant buffer
* Merge less with less equal. And merge greater with greater equal

Need test
2016-08-10 11:30:11 +02:00
Gregory Hainaut 8c4d8cfdca glsl: avoid an unset warning 2016-06-09 18:27:58 +02:00
Gregory Hainaut 2b00447a43 glsl: optimize the number of active constant buffer
Increase the performance on the free driver (Nouveau)

Currently the driver validates all UBO when only 1 is updated. It
is clearly a bad idea to put all UBO in a single common headers.
2016-06-05 16:45:11 +02:00
Gregory Hainaut 5d49a6b685 gsdx ogl: replace 4 VS shader variation by an AND mask
Perf will be roughly the same. However there is a single VS for all
the HW emulation.
2016-06-01 09:29:56 +02:00
Gregory Hainaut 959abe64f8 gsdx ogl: implement wildhack on the CPU
Speed impact is likely small and the plan is only to keep a single Vertex Shader
2016-06-01 09:29:56 +02:00
Gregory Hainaut 564bf8a089 gsdx ogl: terminator 3 supports sampling from the depth 2016-05-30 19:39:52 +02:00
Gregory Hainaut fb26254fbb gsdx ogl: implement a more generic HLE shader for terminator 3
Hopefully without regression for others games
2016-05-29 10:13:43 +02:00
Gregory Hainaut f7ddd488e1 gsdx ogl: Extend uniform buffer with channel parameter
Instead to use the standard ps ubo which is used every draw call.
I reused a barely used buffer to reduce the extra cost of the upload
2016-05-29 10:13:43 +02:00
Gregory Hainaut a7ba779ba8 gsdx ogl: another HLE channel effect for terminator 3
Same as before but with a different fbmask value (I don't know why but
I have the feeling that I might need the others value too)
2016-05-20 19:55:39 +02:00
Gregory Hainaut 1c21ea955c gsdx ogl: HLE channel effect for terminator 3
Unfortunately I think the game uses another similar effects
2016-05-20 19:45:20 +02:00
Gregory Hainaut d41613c46a gsdx ogl: add a Tales of Abyss HLE shader
Again fast and efficient but it relies on CRC

v2: forget to update the precompiled shader...
2016-05-07 22:46:41 +02:00