Commit Graph

5430 Commits

Author SHA1 Message Date
Unknown W. Brackets
7fa20d4734 GPU: Download safe size on next create, too.
In some cases, games will create a series of framebufs.  Before, we
weren't downloading them if they were only used once, as intended.
2018-08-25 10:01:43 -07:00
Unknown W. Brackets
3f48e446b6 GPU: Fix texture handling on framebuf detach.
We were never creating/recreating the texture, so we ended up with null.
Caused all sorts of problems.
2018-08-25 09:57:37 -07:00
Unknown W. Brackets
5c01bf61e6 GPU: Apply logic op in more cases.
It has well defined behavior with alpha blending, so let's apply it even
when we're blending.  Fixes #11316.
2018-08-24 21:19:54 -07:00
Unknown W. Brackets
734db3d050 GPU: Refactor logic op simulation for better reuse. 2018-08-24 21:05:27 -07:00
Unknown W. Brackets
44b90f638d SoftGPU: Apply pixel mask for clears.
Turns out it's respected even in clear mode.

Also, confirm logic op and blending interact.
2018-08-24 20:55:49 -07:00
Unknown W. Brackets
cd98c4a266 GLES: Fix direct shader depal on GLES.
Was missing a cast and only worked on some desktop before.
2018-08-18 10:41:59 -07:00
Henrik Rydgård
e34378a1c1 Enable Discord integration for Mac and Linux. 2018-08-18 10:11:15 +02:00
Henrik Rydgård
6f173b9134 Harmonize some VS project settings. 2018-08-14 22:41:39 +02:00
Henrik Rydgård
39eb2b4153
Merge pull request #11298 from unknownbrackets/gles-depal
GLES: Enable shader depal with Vulkan fixes
2018-08-13 07:50:13 +02:00
Unknown W. Brackets
70318fda37 GLES: Enable shader depal with Vulkan fixes. 2018-08-12 19:49:08 -07:00
Unknown W. Brackets
c32ffa1db0 GE Debugger: Rename depth clamp more places.
Was still showing clip enable in disasm.
2018-08-11 16:33:39 -07:00
Unknown W. Brackets
06ad9b829f SoftGPU: Oops, correct rounding to make sense.
Was too hasty in that last commit.
2018-08-09 07:13:42 -07:00
Unknown W. Brackets
31d5c39858 SoftGPU: Fix some minor rounding on viewport cull.
Had some tests failing when on the edge due to this.
2018-08-05 20:07:45 -07:00
Unknown W. Brackets
e22cc7ef6d SoftGPU: Always clip, without special neg z case.
Depth clamping doesn't change whether it clips.  Also, avoid culling when
a vertex is behind the near plane.
2018-08-05 17:47:05 -07:00
Unknown W. Brackets
cd6b1f73c1 SoftGPU: Drop verts only when depth not clamped.
Depth clamping bypasses the 4096x4096 box check.
2018-08-05 17:17:55 -07:00
Unknown W. Brackets
77f0499f7f GPU: Rename clipping flag to depth clamp.
It seems to just to depth clamp.  When depth clamp happens, it affects
clipping a little, but only for vertices that needed clamping.
2018-08-05 17:11:51 -07:00
Unknown W. Brackets
7885a88c0c GPU: Optimize > 0 alpha test using discard rules.
It should be equally unsafe to use src color as dest blend factor, or
use blending with a subtract or min/max equation.
2018-07-29 11:39:06 -07:00
Unknown W. Brackets
78dc07e7a3 Headless: Fix graphics tests for Vulkan/Direct3D.
Otherwise we hang because there's no thread to ever end.
2018-07-29 11:26:04 -07:00
Unknown W. Brackets
fba0de59c1 GPU: Restrict alpha test to zero for dest blend.
We could end up with the wrong blending in other cases, because the
exiting color will get multiplied.

Luckily, this is still the common case.
2018-07-29 11:26:04 -07:00
Henrik Rydgård
a776dce593
Merge pull request #11269 from unknownbrackets/fragtest
Avoid discard when we can blend
2018-07-29 09:49:16 +02:00
Henrik Rydgård
42f4d7b40f OpenGL: Fix bug where we could end up calling glUniformMatrix without a bound program. Found by GL debug callback on NV.
This adds a bit of extra checking that's only enabled in _DEBUG builds.
2018-07-28 11:09:01 +02:00
Unknown W. Brackets
5ccd3ee4dc GPU: Allow skipping discard when write disabled.
Even if we depth test, if we don't write, we can still force alpha to
zero.
2018-07-27 20:16:51 -07:00
Unknown W. Brackets
8e49fa988c GLES: Avoid discard when we can blend.
May improve performance on PowerVR.
2018-07-27 20:06:41 -07:00
Unknown W. Brackets
5ad948df73 Vulkan: Avoid discard when we can blend.
Where possible, replace alpha and color testing with a zero alpha value.

This allows early fragment tests more often, which may help #11227.  It
may also generally help performance on PowerVR devices.
2018-07-27 20:04:36 -07:00
Henrik Rydgård
a589a371e6 Update SPIRV-Cross to a fresher version. 2018-07-16 20:00:45 +02:00
Unknown W. Brackets
82f1b72c4a
Merge pull request #11254 from hrydgard/light-chan-cost
Reduce the estimated transform cost of an additional light from 10 to 7 cycles
2018-07-15 07:42:34 -07:00
Henrik Rydgård
c404214042 Update glslang to latest as of 2016-06-26 2018-07-15 12:30:40 +02:00
Henrik Rydgård
ea1ef9277c Reduce the estimated transform cost of an additional light from 10 to 7 cycles, see #5530. 2018-07-15 12:13:25 +02:00
weihuoya
d9d9b14e53 Don't cut below 2 2018-07-05 15:29:40 +08:00
Unknown W. Brackets
0b245699bb GLES: Specify unsigned shift for Adreno bug.
Adreno 320 devices, and at least 1 Intel device, are complaining that
right shift can't be used within uint/int.

Possibly related to:
https://github.com/KhronosGroup/glslang/issues/1296
2018-06-30 09:50:02 -07:00
Unknown W. Brackets
2a13a66e18 GPU: Use hw tess only for hw transform.
This may be needed if we start using software for points/lines.
2018-06-28 19:47:33 -07:00
Unknown W. Brackets
9bac603976 GPU: Use HW transform for flat spline/bezier.
We can control the provoking vertex here, but it's less likely to matter.
2018-06-28 19:30:20 -07:00
Henrik Rydgård
1517a93d08 Restore the vertexCount to 32-bit, needed in some tesselation situations 2018-06-26 19:49:49 +02:00
xebra
4fab160e19 [spline/bezier]Modify D3D11 hwtess texture buffer to structured shader buffer. 2018-06-27 01:10:36 +09:00
xebra
5536cdd827 [spline/bezier]Fix tex coords. 2018-06-26 01:47:13 +09:00
Unknown W. Brackets
95f270778e Core: Allow toggle between 2 custom speeds.
In addition to virtual keys for each speed separately.
2018-06-23 10:59:18 -07:00
Unknown W. Brackets
e2c217ab29 Core: More consistently use config enums. 2018-06-23 10:59:18 -07:00
Unknown W. Brackets
b4496f1975 Core: Move config enums to separate file.
These are a bit strewn about and there are constants that aren't
consistently used, which just adds confusion.
2018-06-23 10:59:18 -07:00
Henrik Rydgård
a9da0028bb
Merge pull request #11203 from unknownbrackets/savestate
Reset CPU mhz on PPSSPP reset
2018-06-23 08:59:57 +02:00
Unknown W. Brackets
fd8a0612fa SaveState: Initialize some memory that is saved.
At the very least, will help them compress better.  Also good not to leak
random memory.
2018-06-22 21:29:18 -07:00
Unknown W. Brackets
06340bfa9c Vulkan: Workaround Adreno discard bug. (#11197)
This also explicitly enables early fragment tests when possible.  Using
conversative depth still works on Adreno and should allow some depth
optimizations.
2018-06-20 09:05:27 +02:00
Henrik Rydgård
f3ab56e15d
Merge pull request #11193 from unknownbrackets/gles
Android: Allow using OpenGL 4.x with javaGL disabled
2018-06-18 10:58:39 +02:00
Unknown W. Brackets
03edd6129a GLES: Cut down on use of USING_GLES2. 2018-06-17 20:51:34 -07:00
Unknown W. Brackets
bd13f6b906 Vulkan: Workaround stencil upload bug on Adreno.
We write a static depth value, which will be ignored, to force the driver
to support discard.
2018-06-17 17:50:38 -07:00
Unknown W. Brackets
9f4cd3fcdb GLES: Add missing semantics for stencil upload.
Makes #10634 work for GLES properly.
2018-06-17 17:50:38 -07:00
Unknown W. Brackets
f6036195d8 GLES: Cleanup stencil upload w/h handling.
In case a buffer has been resized recently, we want to upload just the
detected drawable area, probably.  Before this was inconsistent depending
on the render resolution.
2018-06-17 17:50:38 -07:00
Henrik Rydgård
da5f0f7f2b
Merge pull request #11186 from unknownbrackets/debugger
Debugger: Add APIs to retrieve render image
2018-06-17 21:53:38 +02:00
Unknown W. Brackets
80312582d1 GPU: Avoid a switch case warning. 2018-06-17 11:32:17 -07:00
Unknown W. Brackets
d1fa9b97a3 GPU: Remove some unused fields. 2018-06-17 11:26:09 -07:00
Unknown W. Brackets
e6917cccf6 Debugger: Add APIs to retrieve render image. 2018-06-16 15:33:02 -07:00
Unknown W. Brackets
a0608d7fc5 Debugger: Allow GPU actions while stepping.
This allows pulling the display/target while paused.  It may also allow
other actions that work outside a display list.
2018-06-16 13:57:45 -07:00
Unknown W. Brackets
469d8a6a41 GPU: Screenshot output in BGRA if that's native.
This is a decent chunk faster.
2018-06-16 13:48:50 -07:00
Unknown W. Brackets
c97023568c thin3d: Fix requesting BGRA buffers.
Should be fine to request BGRA->BGRA.

Also, the reverse flags were wrong/ignored on the format.
2018-06-16 13:31:08 -07:00
Henrik Rydgård
53f0f136ac
Merge pull request #11182 from unknownbrackets/postshader
GLES: Use accurate GLSL ver in postshader convert
2018-06-15 07:22:55 +02:00
Unknown W. Brackets
0d2de36258 GLES: Use accurate GLSL ver in postshader convert. 2018-06-14 20:31:58 -07:00
Henrik Rydgård
e03aeba75e
Merge pull request #11171 from unknownbrackets/debugger
Fix some issues with GE dumps
2018-06-14 10:07:21 +02:00
Unknown W. Brackets
582bc2d60a GE Debugger: Stall less liberally on GE dump exec.
This makes it easier to compare performance and flushing bugs.
2018-06-11 15:14:18 -07:00
Unknown W. Brackets
f7443aaa15 GE Debugger: Use a class for dump execution. 2018-06-11 15:06:40 -07:00
Unknown W. Brackets
ccef997a7a GE Debugger: Fix asserts when reading debug tex.
This is unfortunate, but right now BuildTexture() applies the sampling
settings which happen within a render pass.  So we must have a render
pass.
2018-06-11 14:56:25 -07:00
Unknown W. Brackets
0ed2c03350 GE Debugger: Prevent hang on shutdown.
Since we're blocking the Emu thread, we can't use a hook from the Emu
thread to wake up.

The change to lifecycle callbacks caused this.
2018-06-11 14:54:42 -07:00
Henrik Rydgård
e98ea812f6
Merge pull request #10973 from weihuoya/cullmode
handle cull mode by indices, refer to issue #10172
2018-06-10 20:53:18 +02:00
Unknown W. Brackets
395ac32d63 Debugger: Run memory breakpoints on mobile. 2018-06-06 17:31:56 -07:00
Henrik Rydgård
6bf6490c2f
Merge pull request #11128 from unknownbrackets/gpu-minor
Minor framebuffer code cleanup
2018-06-06 22:28:35 +02:00
Henrik Rydgård
03175b74ef
Merge pull request #10957 from unknownbrackets/depal-bounds2
GPU: Dirty tex when clearing or rendering to self
2018-06-06 22:22:01 +02:00
Henrik Rydgård
f9cfb05895
Merge pull request #10987 from unknownbrackets/debugger-core
Improve debugger threadsafety and consistency
2018-06-06 21:10:14 +02:00
Henrik Rydgård
9f1125ae33
Merge pull request #11078 from unknownbrackets/debugger-spline
GE Debugger: Show bezier/spline in preview
2018-06-06 20:40:10 +02:00
Henrik Rydgård
347721f200
Merge pull request #10981 from unknownbrackets/flat-shade
Use software transform for flat shading and fix colors
2018-06-06 19:05:54 +02:00
Unknown W. Brackets
9aad4dc848 GE Debugger: Cleaned repetition in spline preview. 2018-06-06 05:59:14 -07:00
Unknown W. Brackets
1829902171 GE Debugger: Show bezier/spline in preview.
Ignoring some things about normals and colors since they don't matter.
2018-06-06 05:59:14 -07:00
Unknown W. Brackets
e313a9bf6c Debugger: Lock startup/shutdown for threadsafety.
Otherwise things can get freed while we're trying to inspect them.
2018-06-06 05:58:49 -07:00
Unknown W. Brackets
e9cc1ee463 Debugger: Allow multiple clients more properly.
Otherwise we lose wakeups and hang.
2018-06-06 05:58:49 -07:00
Unknown W. Brackets
28cabd578a Qt Debugger: Remove display list debugger.
Being replaced with WebSocket based debugger.  Was disabled and not
working anyway, and hardcoded some GL so a barrier to Vulkan.
2018-06-06 05:58:10 -07:00
Unknown W. Brackets
4f93b1d136 GLES: Removed unused skip copy code.
Now it was just making the buffer larger for no reason.  Before, it
allowed us to skip the convBuf copy.
2018-06-06 05:56:30 -07:00
Unknown W. Brackets
2f859425a8 GPU: Use unordered_map for tempFBOs. 2018-06-06 05:56:30 -07:00
Unknown W. Brackets
8f354e5312 GPU: Minor framebuffer code cleanup. 2018-06-06 05:56:30 -07:00
Unknown W. Brackets
ad0b8435ca D3D9: Reuse BGRA conversion code.
Also, couldn't have been right to skip it when the pointers equal, not
sure if that case was ever being hit.
2018-06-06 05:56:30 -07:00
Unknown W. Brackets
2ab1552f2d D3D9: Use an unordered_map for offscreen.
Also cleanup.  Mostly just for consistent usage.
2018-06-06 05:56:30 -07:00
Unknown W. Brackets
7c8780bfb6 GPU: Remove some unused code. 2018-06-06 05:56:29 -07:00
Unknown W. Brackets
2606365ba4 GPU: Use software transform for flat shading.
Except on GLES where it works fine with the default provoking index.

This fixes #10969 so that it works everywhere.
2018-06-06 05:53:50 -07:00
Unknown W. Brackets
dca159c47e GPU: Correct sw flat shading color on Vulkan/D3D.
It was only correct on GLES before.  This only fixes software transform.
2018-06-06 05:53:50 -07:00
Unknown W. Brackets
5b62c8afb8 D3D9: Implement flat shading via state. 2018-06-06 05:53:50 -07:00
Unknown W. Brackets
b845278d7d D3D11: Implement flat shading in shader. 2018-06-06 05:53:49 -07:00
Unknown W. Brackets
61fc1cdcfb GPU: Dirty tex when clearing or rendering to self.
This way if we're blitting, we'll re-blit.
2018-06-06 05:52:49 -07:00
Henrik Rydgård
b037efdb55 If there are multiple Vulkan devices, show a setting to allow the user to choose. 2018-06-06 10:20:12 +02:00
zhang wei
f2e3476741 triangles 2018-06-05 10:39:40 +08:00
zhang wei
3380bbb0c6 save cache before clear 2018-06-04 22:00:29 +08:00
weihuoya
9f6922221d fx 2018-06-03 22:50:35 +08:00
weihuoya
d029bbacc7 triangle fan 2018-06-03 22:29:50 +08:00
Unknown W. Brackets
e6af167cd9
Merge pull request #11119 from hrydgard/vk-nulltexture
Never bind a NULL image view in Vulkan, not even through thin3d
2018-06-01 23:53:18 -04:00
Henrik Rydgård
c1d113e0e9 When creating temp framebuffers for download, size them using bufferWidth/Height instead of width/height.
Or maybe we should make sure to only download within the width/height by
adding more clamps at the beginning of ReadFramebufferToMemory but seems
more dangerous.

Plus some minor things.

Should help #11113
2018-06-01 21:16:07 +02:00
Henrik Rydgård
9485b04914 Never bind a NULL image view in Vulkan no matter what. 2018-06-01 18:51:37 +02:00
Henrik Rydgård
30de8194a5
Merge pull request #11111 from weihuoya/gles-int-highp
depal shader use high int precision for opengl es
2018-06-01 08:41:25 +02:00
weihuoya
e01e77e025 fx depal int precision for opengl es 2018-06-01 00:58:44 +08:00
Henrik Rydgård
c964bc4ba2 Fix another of these pesky GL task switching bugs. 2018-05-30 19:29:26 +02:00
Henrik Rydgård
1c17373039 GLES: Properly restore the pointer to the render manager in more places 2018-05-29 23:07:22 +02:00
Henrik Rydgård
79f8388e65
Merge pull request #11088 from unknownbrackets/vulkan-state
Vulkan: Update shaders/state when dirty properly
2018-05-28 08:34:11 +02:00
Unknown W. Brackets
e7d07aff71 Vulkan: Update shaders/state when dirty properly.
Can't have been right before.
2018-05-27 22:28:09 -07:00
Henrik Rydgård
0d6be3a476 GLES: Refresh the draw context in DrawEngineGLES on DeviceRestore. How did we miss this? 2018-05-27 22:25:15 +02:00
Henrik Rydgård
b730d187e8 Add some paranoid checks guided by stack traces from Google Play 2018-05-27 22:12:59 +02:00
Henrik Rydgård
ab65c5210c GLES shader depal fix. Again, this is disabled by default so should not affect anything. 2018-05-14 21:20:51 +02:00