Commit Graph

4450 Commits

Author SHA1 Message Date
Brett Lawson
b4be5a705f vulkan: Improved memory barrier semantics.
This commit improves our memory barriers to ensure that
all the correct barriers are put in place when changing
usages of various buffers and images.
2018-12-04 01:32:59 -08:00
Brett Lawson
5bb5c76058 vulkan: Fixed memcache incorrectly refreshing caches.
When a cache was being used by two separate objects, it was
possible for a refresh to not pick up a delayed write from
one of those objects.
2018-12-04 01:32:59 -08:00
Brett Lawson
d32b51483f vulkan: Improved staging buffer management.
This fixes us using the incorrect memory allocation type for
GPU downloads.  It also adds support for creating staging
buffers specifically in GPU memory for GPU<->GPU transfers.
2018-12-04 01:32:58 -08:00
Brett Lawson
91b2fb8e6b vulkan: Fixed illegal use of gl_VertexID and gl_InstanceID. 2018-12-04 01:29:29 -08:00
Brett Lawson
6a77366228 vulkan: Fixed unneeded extra descriptor pool reset. 2018-12-04 01:29:28 -08:00
Brett Lawson
3416555dad vulkan: Fixed issue with some surface samples being set incorrectly.
This caused an issue where surfaces were duplicated in the cache
and unnecessary surface copying was required.
2018-12-04 01:29:28 -08:00
Brett Lawson
71737d4068 vulkan: Improved debug naming for some objects. 2018-12-04 01:29:27 -08:00
Brett Lawson
9f951d7eed vulkan: Fixed surface debug names missing some information. 2018-12-04 01:29:27 -08:00
Brett Lawson
e20322def7 vulkan: Improved handling of shader write masking. 2018-12-04 01:29:26 -08:00
Brett Lawson
a0add01c8d vulkan: Improved viewport handling. 2018-12-04 01:29:26 -08:00
Brett Lawson
aa254a34a7 vulkan: Added handling for missing shader binds.
Some games use shaders that reference textures, samplers and
buffers which are selectively used.  When they invoke the shader
they disable those uses, and don't bind anything, but Vulkan
needs something bound to execute at all.  We bind blank objects
into these slots.
2018-12-04 01:29:25 -08:00
Brett Lawson
b0e700fb62 vulkan: Improve scan-buffer copy semantics.
This fixes an issue where the buffers were not blitted to the
scan-buffers at the correct scaling.  This is closer, though
still not completely accurate.
2018-12-04 01:29:25 -08:00
Brett Lawson
898b792eb6 vulkan: Removed legacy code committed in error. 2018-12-04 01:29:24 -08:00
Brett Lawson
956a69dc1e cafe/gx2: Fixed error causing stencil surfaces to be uncreatable. 2018-12-04 01:29:23 -08:00
Brett Lawson
e336750855 vulkan: Improved handling of culling/polytype/bias state. 2018-12-04 01:29:23 -08:00
Brett Lawson
467878450f common: Added a non-abortive assertion (decaf_check_warn). 2018-12-04 01:29:22 -08:00
Witold Baryluk
615aa2b2c8 vulkan: Check results from AMD Vulkan Memory Allocator
Just convert VkResult into vk::Result using Vulkan-Hpp library.
It will throw exception, if not a success.
Construct a message by using filename and line number.
2018-11-30 13:42:15 -08:00
Witold Baryluk
fceaded081 vulkan: Minor compilation fixes and one possible bug
Do not take address of temporaries.
Use proper casts when casting from Vulkan-Hpp to Vulkan.
Fix use of implicit conversions that make gcc not like it
due to overload ambiguity.
Remove unused bool cast operator, that called non existing
bool operator in other class.

Tested with vulkan 1.1.82 and 1.1.73, and gcc 8.2.
2018-11-30 12:05:30 -08:00
James Benton
c06c760f4c cafe: Add StackFrame class which sets up a stack frame for a HLE function.
This is useful for an rpl_entry which eventually calls into
OSDriver_Register where the LR is used to acquire the caller module handle.
2018-11-28 10:59:58 +00:00
James Benton
d6212c4baa cafe/h264: Fix ffmpeg receiveFrames result code. 2018-11-28 10:58:49 +00:00
James Benton
daa17066f3 Add a H264 decoder implementation based off of ffmpeg.
Also has a fallback fake decoder for when compiled without ffmpeg.
2018-11-26 22:20:21 +00:00
James Benton
5f5c6dc718 common: Fix platform_winapi_string.h include for non-Windows platforms. 2018-11-26 22:39:20 +00:00
James Benton
bca63f10f8 cafe/coreinit: Only call driver init function if it is set. 2018-11-07 12:29:25 +00:00
James Benton
6bec2b4cc1 cafe/gx2: Set GX2InitDepthBufferRegs ARRAY_MODE to surfaceInfo tileMode.
Just in case addrlib decides to change the tile mode.
2018-11-07 11:49:03 +00:00
James Benton
be8e90d7e2 Implement nn::ipc CafeOS client and IOS server and add first ACP services. 2018-11-07 11:47:19 +00:00
James Benton
97670c8bfa common: Add make_filled_array function. 2018-11-07 11:47:19 +00:00
James Benton
6bc79419d0 nn: Add ok(), failed() methods to Result. 2018-11-07 11:47:19 +00:00
James Benton
cddab11ec7 ios/kernel: Fix kernel thread TLS.
Copied the name IpcBufferPool from someone else, it's actually TLS.
2018-11-07 11:47:19 +00:00
James Benton
20ed81228c ios/kernel: Change allocateProcessStatic to use alignof and placement new. 2018-11-07 11:47:19 +00:00
James Benton
827b7d582d ios/kernel: Fix ios_kernel_timer.h 2018-11-07 11:47:19 +00:00
James Benton
192c433642 cafe/coreinit: Fix ipc driver submit event name. 2018-11-07 11:47:19 +00:00
James Benton
89b4ebeb99 cafe/coreinit: Call driverOnInit at startup. 2018-11-07 11:47:19 +00:00
James Benton
b13c00e572 cpu: Fix phys_this. 2018-11-07 11:47:19 +00:00
James Benton
2a585d158d cafe/gx2: Fix unsigned / signed comparison. 2018-11-07 11:47:19 +00:00
James Benton
b77a5e1d60 Add a new tiling library and use it for untiling in gfdtool.
More optimised - copies as much data as it can rather than operating on
single pixels.

And much easier to use than addrlib.
2018-11-07 11:47:19 +00:00
James Benton
5679752759 cafe/gx2: Add support for writing cubemaps to DDS file. 2018-11-07 11:47:19 +00:00
James Benton
0da7d9fabd decaf: Improve logger creation. 2018-11-07 11:47:19 +00:00
Brett Lawson
4c9b203eb5 vulkan: Use an SRGB swap chain rather than RGB.
This is neccessary for many games, which render with an
incorrect gamma otherwise.  This change does however break
other games which are not using SRGB surfaces.  Seeing
things a bit more bright rather than quite a bit darker
is probably for the best.  Must implement gamma correction!
2018-11-05 05:32:23 -08:00
Brett Lawson
f419f88bae vulkan: Allow some invalid sampler XY filters.
NLand appears to bind an illegal sampler.  For now we
will expressely allow it in this case and warn instead
of crashing decaf.
2018-11-05 05:32:23 -08:00
Brett Lawson
4c7665da8a cafe/gx2: Implemented some needed GX2Perf methods. 2018-11-05 05:32:23 -08:00
Brett Lawson
f7ee783bba vulkan: Implement support for Geometry Shaders! 2018-11-05 05:32:23 -08:00
Brett Lawson
046ac84424 spirv: Improved export handling, added support for gl_LayerID. 2018-11-05 05:30:05 -08:00
Brett Lawson
6255961b43 vulkan: Added validation bypass for dual-bound textures.
Sometimes, games will incorrectly bind a color buffer as both
the active framebuffer as well as a texture in that draw.  This
is illegal in Vulkan, but happens nevertheless.
2018-11-05 04:53:14 -08:00
Brett Lawson
201d3b9c7e spirv: Improved vertex attribute fetching.
There are a few changes here.  Mainly related to avoiding
the INT8 type (which is not directly supported yet), as well
as correctly handling packed float types.
2018-11-05 04:51:25 -08:00
Brett Lawson
200739cd3b spirv: Improved applySelMask implementation.
It now will condense down to less instructions or more occasions.
2018-11-05 04:48:42 -08:00
Brett Lawson
b2401b03c2 spirv: Write floats as bitcasted integers.
This is required as sometimes we are not sure if a value is used
as a float or an integer.  In the case of an integer, the storage
and compilation by the drivers could cause the data to change.
2018-11-05 04:48:29 -08:00
Brett Lawson
92a79d5bd0 vulkan: Added some missing needed extensions. 2018-11-05 04:47:19 -08:00
Brett Lawson
e28740a3ad vulkan: A bunch of surface management changes...
-Added better support for 3D and CUBEMAP textures.
-Improved debug naming of surface/surfaceview objects.
-Added regeneration for framebuffers and views on surface update.
When the a surface gets upgraded internally, the framebuffer and
imageview objects still pointed to the old images rather than the
new ones.
2018-11-05 04:46:14 -08:00
Brett Lawson
4b5f20a272 vulkan: Fixed issue with surface swizzles being lost in error.
We were masking away the swizzle from color buffer base addresses
for no apparent reason...
2018-11-05 04:37:49 -08:00
Brett Lawson
c53ccbb947 vulkan: Added support for DISABLED special op.
This removes all color buffers from a draw if the special op
is set to disable color writes.  This is used by depth-only
clears sometimes.
2018-11-05 04:37:24 -08:00