Commit graph

5222 commits

Author SHA1 Message Date
Brett Lawson
52402297f7 vulkan: Added blit optimization for surface updating.
This attempts to optimize image usage such that we will fetch
new data out of our local surface cache using a blit rather
than requiring the data to be written to/from the backing
memory cache buffers first.
2018-11-05 04:23:44 -08:00
Brett Lawson
55932680f3 vulkan: Use range combiner when reading surface data.
This allows us to avoid copying slices which we already have the
latest data available for (we previously would copy the whole
range if even a single slice was out of date).
2018-11-05 04:23:43 -08:00
Brett Lawson
1d88a18d5a vulkan: Added support for compatible surface consolidation.
Specifically, this allows games which use varying slices
of a Surface to have one backing image in vulkan, rather
than multiple images.  If we see an image with depth 9
after previously having a compatible image with depth 3,
we upgrade the existing image rather than generating a
whole new surface.
2018-11-05 04:23:43 -08:00
Brett Lawson
c3fec4a7b1 vulkan: Added unique identifier to surface debug names.
Previously it was impossible to tell the difference between
two variants of the same surface in the Vulkan debugging
tools without digging deep into the allocated memory.
2018-11-05 04:23:42 -08:00
Brett Lawson
44e67b503e vulkan: Fix slice selection for 3D textures. 2018-11-05 04:23:42 -08:00
Brett Lawson
4352bcfd7f vulkan: Better unified memory/surface management.
This also adds support for surface slice selection when
rendering to a color buffer and sampling from a texture.
2018-11-05 04:23:41 -08:00
Brett Lawson
8e2e9bbda5 vulkan: Fixed incorrect information in a comment. 2018-11-05 04:23:41 -08:00
Brett Lawson
13f6ad0e94 spirv: Centralized generic shader prolog generation. 2018-11-05 04:23:40 -08:00
Brett Lawson
dca65ed043 vulkan: Improved descriptor set management.
This is primarily to allow us to fully reset descriptors.
This is important as the validation layers were getting
confused about which resources were used in each frame.
2018-11-05 04:23:40 -08:00
Brett Lawson
cc8cedc87e vulkan: Fixed corruption in staging buffer management.
This one was quite challenging to find.  It only appears when
lots of staging buffers are used, and causes memory to be
read/written strangely incorrectly.
2018-11-05 04:23:39 -08:00
Brett Lawson
3655aef9ff vulkan: Fixed hashing not playing nicely with murmur. 2018-11-05 04:23:39 -08:00
Brett Lawson
91720da92a vulkan: Added support for geometry shader based RECTLIST rendering. 2018-11-05 04:23:38 -08:00
Brett Lawson
6e8bc62f2c vulkan: Added support for sampling UINT textures. 2018-11-05 04:23:38 -08:00
Brett Lawson
87fcc7fe72 vulkan: Added support for additional surface tile modes. 2018-11-05 04:23:37 -08:00
Brett Lawson
ce6d6860d6 vulkan: Added faked support for MSAA surface types.
Note that we don't actually back these surfaces with host-side
MSAA surfaces, but rather pretend like we are providing them.
2018-11-05 04:23:37 -08:00
Brett Lawson
de70d1256e vulkan: Fix some minor surface format inconsistencies. 2018-11-05 04:23:36 -08:00
Brett Lawson
3a259c5c44 vulkan: Remove unused utility function getSurfaceFormat. 2018-11-05 04:23:36 -08:00
Brett Lawson
47955fd976 cafe/gx2: Implement some modes of GX2SetSpecialState 2018-11-05 04:23:35 -08:00
Brett Lawson
2c4639a13f vulkan: Added support for viewport control registers. 2018-11-05 04:23:35 -08:00
James Benton
7013c1d353 cafe/gx2: Rewrite GX2Init{Color,Depth}BufferRegs. 2018-11-05 04:23:34 -08:00
Brett Lawson
bb250c9c71 spirv: Implemented support for the LD instruction. 2018-11-05 04:23:34 -08:00
Brett Lawson
37d1201c5b vulkan: Move tiling alignment into the Driver.
This is required to ensure that surfaces that behave the same
actually get grouped together.  Rather than accidentally
splitting them.
2018-11-05 04:23:33 -08:00
Brett Lawson
681058f089 gpu: Fix ringbuffer wakes getting lost sometimes. 2018-11-05 04:23:33 -08:00
Brett Lawson
f042fb6193 vulkan: Added names to vulkan objects for easier debugging. 2018-10-30 04:35:22 -07:00
Brett Lawson
99524a4cf4 vulkan: Fixed memory writes not happening on retire.
They were instead being written as soon as we processed
the buffer, which could confuse games into using resources
while the GPU still technically owns them.
2018-10-26 04:54:57 -07:00
Brett Lawson
b174ced840 spirv: Fixed minor code-smell in generator. 2018-10-26 04:54:57 -07:00
Brett Lawson
92035e13e0 vulkan: Improved surface manager and unified memory system. 2018-10-26 04:54:57 -07:00
Brett Lawson
3ad6ab5ba1 libgpu: Fixed surface tiler incorrectly handling multiple slices. 2018-10-26 04:54:57 -07:00
Brett Lawson
88cadad0c4 common: Added support for randomized data hashes. 2018-10-26 04:54:57 -07:00
Brett Lawson
0dfc0ac2b5 libgpu: Added configuration to generate debuggable shaders.
For SPIRV decompilation, it is required that we use VertexIndex
rather than VertexId as VertexId is GLSL-only.  This does cause
a behaviour change, but is rarely relevant.
2018-10-26 04:54:57 -07:00
Brett Lawson
e2c98a07ab spirv: Fixed errors causing GET_TEXTURE_INFO to fail to compile. 2018-10-26 04:54:56 -07:00
Brett Lawson
c8b00fcd4e spirv: Correctly cast types being sent for masked writes. 2018-10-26 04:54:56 -07:00
Brett Lawson
1da2a520af spirv: Fixed texture constant offsets for array images.
You cannot use constant offset with the array levels.
2018-10-26 04:54:55 -07:00
Brett Lawson
cdab63f4b2 spirv: Fix vertex shader texture fetches.
We previously did not force LOD zero when in a shader
which is not capable of implicit LOD.
2018-10-26 04:54:55 -07:00
Brett Lawson
cfedd9783b vulkan: Fix issue with swapchains being rendered before ready.
We need to wait at least a single frame after a swap chain
is created before we start returning it to the rendering
engine at the top level.
2018-10-26 04:54:54 -07:00
Brett Lawson
5e23f159f0 vulkan: Handle register synchronization requests.
This is required for pm4 capture to work appropriately.
2018-10-26 04:54:54 -07:00
Brett Lawson
1deec7dd99 spirv: Fix bug with ELSE blocks in nested if groups. 2018-10-26 04:54:53 -07:00
Brett Lawson
79930b0a6f vulkan: Refactor surface management to handle varying widths.
Multiple surfaces with the same pitch but different widths are
all compatible with each other.  It is necessary to ensure that
they are managed together.
2018-10-26 04:54:53 -07:00
Brett Lawson
1e86f9f07c vulkan: Fixed issue with incorrect surface transition.
When initializing the swap chain buffers, we inadvertently
were keeping the surface in general layout when clearing
instead of making it a destination first.
2018-10-26 04:54:52 -07:00
Brett Lawson
d59384c9cd vulkan: Fixed issue pointer to an out-of-scope object. 2018-10-26 04:54:52 -07:00
Brett Lawson
94815177b1 spirv: Added support for outputting computed z. 2018-10-26 04:54:51 -07:00
Brett Lawson
0250cebafc decafsdl: Use a separate vulkan queue for the driver.
Usage of a singular queue from two places requires external
synchronization.  It's far more prudent to just run the driver
in a separate queue context instead and let the driver work
it out.
2018-10-26 04:54:51 -07:00
Brett Lawson
b7895f90ba vulkan: Added support for disabling z-clipping. 2018-10-26 04:54:50 -07:00
Brett Lawson
6cdcb0d267 spirv: Implemented support for front facing variable. 2018-10-26 04:54:50 -07:00
Brett Lawson
25e22f1615 decafsdl: Updated vulkan to use VulkanHPP dynamic loader.
We previously manually fetched non-standard functions and invoked
them using the standard CPP API.  This method is far nicer.
2018-10-26 04:54:49 -07:00
Brett Lawson
2cb048c68c spirv: Implemented MOVA_INT instruction. 2018-10-26 04:54:49 -07:00
Brett Lawson
fbbc316faa decafsdl: Fixed incorrect descriptor pool setup.
This broke on newer versions of the Vulkan SDKs validators.
These did not fail on the driver as the driver seems to emulate
these objects on the CPU, but it is technically an error still.
2018-10-26 04:54:49 -07:00
Brett Lawson
6a3033ce79 vulkan: Improved handling of disabled shader stages. 2018-10-26 04:54:48 -07:00
Brett Lawson
1908688c92 gpu: Added handling of COPY_DW command.
This required implementing special handling for some register
cases where the register is actually read from memory at draw
time.
2018-10-26 04:54:48 -07:00
Brett Lawson
7232741631 vulkan: Added detection of stream-out draws. 2018-10-26 04:54:47 -07:00