summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-04-28{maxwell_3d,buffer_cache}: Implement memory barriers using 3D registersReinUsesLisp5-3/+34
Drop MemoryBarrier from the buffer cache and use Maxwell3D's register WaitForIdle. To implement this on OpenGL we just call glMemoryBarrier with the necessary bits. Vulkan lacks this synchronization primitive, so we set an event and immediately wait for it. This is not a pretty solution, but it's what Vulkan can do without submitting the current command buffer to the queue (which ends up being more expensive on the CPU).
2020-04-25vk_rasterizer: Pack texceptions and color formats on invalid formatsReinUsesLisp2-5/+19
Sometimes for unknown reasons NVN games can bind a render target format of 0. This may be a yuzu bug. With the commits before this the formats were specified without being "packed", assuming all formats and texceptions will be written like in the color_attachments vector. To address this issue, iterate all render targets and pack them as they are valid. This way they will match color_attachments. - Fixes validation errors and graphical issues on Breath of the Wild.
2020-04-24Fix -Werror=conversion error.Markus Wick1-1/+1
2020-04-23vk_rasterizer: Fix framebuffer creation validation errorsReinUsesLisp1-2/+4
Framebuffer creation was ignoring the number of color attachments.
2020-04-23vk_pipeline_cache: Unify pipeline cache keys into a single operationReinUsesLisp5-47/+59
This allows us to call Common::CityHash and std::memcmp only once for GraphicsPipelineCacheKey. While we are at it, do the same for compute.
2020-04-23vk_renderpass_cache: Pack renderpass cache key to 12 bytesReinUsesLisp4-84/+59
2020-04-23vk_pipeline_cache: Fix unintentional memcpy into optionalReinUsesLisp1-2/+4
The intention behind this was to assign a float to from an uint32_t, but it was unintentionally being copied directly into the std::optional. Copy to a temporary and assign that temporary to std::optional. This can be replaced with std::bit_cast<float> once we are in C++20.
2020-04-22Async GPU: Correct flushing behavior to be similar to old async GPU behavior.Fernando Sahmkow1-0/+4
2020-04-22ShaderCache/PipelineCache: Cache null shaders.Fernando Sahmkow2-4/+15
2020-04-22Address Feedback.Fernando Sahmkow3-3/+3
2020-04-22vk_fence_manager: Initial implementationReinUsesLisp6-12/+219
2020-04-22OpenGL: Guarantee writes to Buffers.Fernando Sahmkow1-2/+0
2020-04-22GPU: Implement Flush Requests for Async mode.Fernando Sahmkow1-0/+4
2020-04-22FenceManager: Manage syncpoints and rename fences to semaphores.Fernando Sahmkow2-3/+16
2020-04-22Rasterizer: Document SignalFence & ReleaseFences and setup skeletons on Vulkan.Fernando Sahmkow2-0/+27
2020-04-22ThreadManager: Sync async reads on accurate gpu.Fernando Sahmkow2-0/+5
2020-04-22BufferCache: Implement OnCPUWrite and SyncGuestHostFernando Sahmkow1-2/+2
2020-04-22GPU: Refactor synchronization on Async GPUFernando Sahmkow2-0/+16
2020-04-22vk_memory_manager: Remove unified memory model flagReinUsesLisp5-35/+6
All drivers (even Intel) seem to have a device local memory type that is not host visible. Remove this flag so all devices follow the same path. This fixes a crash when trying to map to host device local memory on integrated devices.
2020-04-22vk_rasterizer: Add lazy default buffer maker and use it for empty buffersReinUsesLisp3-4/+40
Introduce a default buffer getter that lazily constructs an empty buffer. This is intended to match OpenGL's buffer 0. Use this for disabled vertex and uniform buffers. While we are at it, include vertex buffer usages for staging buffers to silence validation errors.
2020-04-22gl_rasterizer: Fix buffers without sizeReinUsesLisp1-3/+3
On NVN buffers can be enabled but have no size. According to deko3d and the behavior we see in Animal Crossing: New Horizons these buffers get the special address of 0x1000 and limit themselves to 0xfff. Implement buffers without a size by binding a null buffer to OpenGL without a side. https://github.com/devkitPro/deko3d/blob/1d1930beea093b5a663419e93b0649719a3ca5da/source/maxwell/gpu_3d_vbo.cpp#L62-L63
2020-04-20Initialize quad_indexed_pass before uint8_passAmit Prakash Ambasta1-1/+1
Fixes Werror=reorder in gcc
2020-04-19renderer_vulkan: assume X11 if not Windows/macOS after bf1d66b7c074Jan Beich1-3/+3
Render.Vulkan <Error> video_core/renderer_vulkan/renderer_vulkan.cpp:CreateInstance:131: Presentation not supported on this platform Render.Vulkan <Error> video_core/renderer_vulkan/renderer_vulkan.cpp:CreateSurface:378: Presentation not supported on this platform Core <Critical> core/core.cpp:Load:199: Failed to initialize system (Error 5)!
2020-04-19vulkan/wrapper: Sort physical devicesReinUsesLisp1-1/+20
Sort discrete GPUs over the rest, Nvidia over AMD, AMD over Intel, Intel over the rest. This gives us a somewhat consistent order when Optimus is removed (renderdoc does this when it's attached). This can break the configuration of users with an Intel GPU that manually remove Optimus on yuzu. That said, it's a very unlikely to happen.
2020-04-19fixed_pipeline_state: Hash and compare the whole structureReinUsesLisp2-105/+9
Pad FixedPipelineState's size to 384 bytes to be a multiple of 16. Compare the whole struct with std::memcmp and hash with CityHash. Using CityHash instead of a naive hash should reduce the number of collisions. Improve used type traits to ensure this operation is safe. With these changes the improvements to the hashable pipeline state are: Optimized structure Hash: 89 ns Comparison: 103 ns Construction*: 164 ns Struct size: 384 bytes Original structure Hash: 148 ns Equal: 174 ns Construction*: 281 ns Size: 1384 bytes * Attribute state initialization is not measured These measures are averages taken with std::chrono::high_accuracy_clock on MSVC shipped on Visual Studio 16.6.0 Preview 2.1.
2020-04-19fixed_pipeline_state: Pack blending stateReinUsesLisp3-98/+227
Reduce FixedPipelineState's size to 364 bytes.
2020-04-19fixed_pipeline_state: Pack rasterizer stateReinUsesLisp4-163/+155
Reduce FixedPipelineState's size to 600 bytes.
2020-04-19fixed_pipeline_state: Pack depth stencil stateReinUsesLisp3-97/+140
Reduce FixedPipelineState's size to 632 bytes.
2020-04-19fixed_pipeline_state: Pack attribute stateReinUsesLisp5-100/+84
Reduce FixedPipelineState's size from 1384 to 664 bytes
2020-04-17vk_stream_buffer: Fix out of memory on boot on recent Nvidia driversReinUsesLisp2-33/+48
Nvidia recently introduced a new memory type for data streaming (awesome!), but yuzu was assuming that all heaps had enough memory for the assumed stream buffer size (256 MiB). This worked fine on AMD but Nvidia's new memory heap was smaller than 256 MiB. This commit changes this assumption and allocates a bit less than the size of the preferred heap, with a maximum of 256 MiB (to avoid allocating all system memory on integrated devices). - Fixes a crash on NVIDIA 450.82.0.0
2020-04-17vk_compute_pass: Implement indexed quadsReinUsesLisp5-12/+280
Implement indexed quads (GL_QUADS used with glDrawElements*) with a compute pass conversion. The compute shader converts from uint8/uint16/uint32 indices to uint32. The format is passed through push constants to avoid having different variants of the same shader. - Used by Fast RMX - Used by Xenoblade Chronicles 2 (it still has graphical due to synchronization issues on Vulkan)
2020-04-16buffer_cache: Return handles instead of pointer to handlesReinUsesLisp7-51/+42
The original idea of returning pointers is that handles can be moved. The problem is that the implementation didn't take that in mind and made everything harder to work with. This commit drops pointer to handles and returns the handles themselves. While it is still true that handles can be invalidated, this way we get an old handle instead of a dangling pointer. This problem can be solved in the future with sparse buffers.
2020-04-16video_core: Amend doxygen comment referencesLioncash1-1/+1
Fixes broken documentation references.
2020-04-15maxwell_to_vk: Add uint16 vertex formatsReinUsesLisp1-0/+8
2020-04-15maxwell_to_vk: Add missing breaksReinUsesLisp1-0/+2
Avoid invalid fallbacks.
2020-04-15vk_blit_screen: Initialize all members in VkPipelineViewportStateCreateInfoReinUsesLisp1-0/+2
When the dynamic state is specified, pViewports and pScissors are ignored, quoting the specification: pViewports is a pointer to an array of VkViewport structures, defining the viewport transforms. If the viewport state is dynamic, this member is ignored. That said, AMD's proprietary driver itself seem to read it regardless of what the specification says.
2020-04-14vk_rasterizer: Default to 1 viewports with a size of 0ReinUsesLisp1-3/+6
Silence validation layer errors.
2020-04-14renderer_vulkan: Integrate Nvidia Nsight Aftermath on WindowsReinUsesLisp8-19/+344
Adds optional support for Nsight Aftermath. It is enabled through ENABLE_NSIGHT_AFTERMATH in cmake. A path to the SDK has to be provided by the environment variable NSIGHT_AFTERMATH_SDK. Nsight Aftermath allows an application to generate "minidumps" of the GPU state when a device loss happens. By analysing these on Nsight we can know what a game was doing and why it triggered a device loss. The dump is generated inside %APPDATA%\yuzu\log\gpucrash and this directory is deleted every time a new instance is initialized with Nsight enabled. To enable it on yuzu there has a to be a driver and device capable of running Nsight Aftermath on Vulkan. That means only Turing based GPUs on the latest stable driver, beta drivers won't work for now. It is manually enabled in Configuration>Debug>Enable Graphics Debugging because when using all debugging capabilities there is a runtime cost.
2020-04-13renderer_vulkan: Remove Nvidia checkpointsReinUsesLisp4-34/+0
2020-04-13renderer_vulkan: Catch device losses in more placesReinUsesLisp3-21/+29
2020-04-11texture_cache: Remove preserve_contentsReinUsesLisp1-2/+2
preserve_contents was always true. We can't assume we don't have to preserve clears because scissored and color masked clears exist. This removes preserve_contents and assumes it as true at all times.
2020-04-11renderer_vulkan: Drop Vulkan-HppReinUsesLisp50-2271/+2881
2020-04-09VkRasterizer: Eliminate Legacy code.Fernando Sahmkow1-1/+0
2020-04-08Memory: Address Feedback.Fernando Sahmkow1-2/+2
2020-04-07yuzu: Drop SDL2 and Qt frontend Vulkan requirementsReinUsesLisp5-105/+238
Create Vulkan instances and surfaces from the Vulkan backend.
2020-04-07renderer_vulkan: Query device names from the backendReinUsesLisp3-0/+73
2020-04-06Shader/Pipeline Cache: Use VAddr instead of physical memory for addressing.Fernando Sahmkow3-26/+22
2020-04-06Query Cache: Use VAddr instead of physical memory for adressing.Fernando Sahmkow1-2/+2
2020-04-06Buffer Cache: Use vAddr instead of physical memory.Fernando Sahmkow3-8/+8
2020-04-06Texture Cache: Use vAddr instead of physical memory for caching.Fernando Sahmkow1-4/+3
2020-04-06GPU: Setup Flush/Invalidate to use VAddr instead of CacheAddrFernando Sahmkow2-13/+21
2020-04-06shader_decode: SULD.D implement bits64 and reverse shader ir init method to removed shader stage.namkazy1-1/+1
2020-04-06shader/memory: Implement RED.E.ADDReinUsesLisp1-25/+40
Implements a reduction operation. It's an atomic operation that doesn't return a value. This commit introduces another primitive because some shading languages might have a primitive for reduction operations.
2020-04-05clang-formatNguyen Dac Nam1-2/+1
2020-04-05add shader stage when init shader irnamkazy1-1/+2
2020-04-02shader_decompiler: Remove FragCoord.w hack and change IPA implementationReinUsesLisp1-10/+7
Credits go to gdkchan and Ryujinx. The pull request used for this can be found here: https://github.com/Ryujinx/Ryujinx/pull/1082 yuzu was already using the header for interpolation, but it was missing the FragCoord.w multiplication described in the linked pull request. This commit finally removes the FragCoord.w == 1.0f hack from the shader decompiler. While we are at it, this commit renames some enumerations to match Nvidia's documentation (linked below) and fixes component declaration order in the shader program header (z and w were swapped). https://github.com/NVIDIA/open-gpu-doc/blob/master/Shader-Program-Header/Shader-Program-Header.html
2020-04-01vk_device: Add missing ASTC queriesReinUsesLisp1-14/+29
2020-04-01video_core: Use native ASTC when availableReinUsesLisp2-19/+17
2020-04-01renderer_vulkan/wrapper: Add vkEnumerateInstanceExtensionProperties wrapperReinUsesLisp2-0/+17
2020-04-01renderer_vulkan/wrapper: Add command buffer handleReinUsesLisp1-0/+192
2020-04-01renderer_vulkan/wrapper: Add physical device handleReinUsesLisp2-0/+123
2020-04-01renderer_vulkan/wrapper: Add device handleReinUsesLisp2-0/+277
2020-04-01renderer_vulkan/wrapper: Add swapchain handleReinUsesLisp2-0/+15
2020-04-01renderer_vulkan/wrapper: Add fence handleReinUsesLisp1-0/+17
2020-04-01renderer_vulkan/wrapper: Add device memory handleReinUsesLisp1-0/+15
2020-04-01renderer_vulkan/wrapper: Add pool handlesReinUsesLisp2-0/+47
2020-04-01renderer_vulkan/wrapper: Add buffer and image handlesReinUsesLisp2-0/+24
2020-04-01renderer_vulkan/wrapper: Add queue handleReinUsesLisp2-0/+36
2020-04-01renderer_vulkan/wrapper: Add instance handleReinUsesLisp2-0/+87
2020-03-30vk_decompiler: add atomic op and handler function.Nguyen Dac Nam1-6/+25
2020-03-28renderer_vulkan/wrapper: Address feedbackReinUsesLisp1-3/+24
2020-03-27renderer_vulkan/wrapper: Add owning handlesReinUsesLisp1-0/+18
2020-03-27renderer_vulkan/wrapper: Add pool allocations owning templated classReinUsesLisp1-0/+81
2020-03-27renderer_vulkan/wrapper: Add owning handle templated classReinUsesLisp1-0/+144
2020-03-27renderer_vulkan/wrapper: Add destroy and free overload setReinUsesLisp2-0/+133
2020-03-27renderer_vulkan/wrapper: Add dispatch table and loadersReinUsesLisp2-0/+283
2020-03-27renderer_vulkan/wrapper: Add exception classReinUsesLisp2-0/+34
2020-03-27renderer_vulkan/wrapper: Add ToString function for VkResultReinUsesLisp2-0/+90
2020-03-27renderer_vulkan/wrapper: Add Vulakn wrapper and a span helperReinUsesLisp1-0/+83
The intention behind a Vulkan wrapper is to drop Vulkan-Hpp. The issues with Vulkan-Hpp are: - Regular breaks of the API. - Copy constructors that do the same as the aggregates (fixed recently) - External dynamic dispatch that is hard to remove - Alias KHR handles with non-KHR handles making it impossible to use smart handles on Vulkan 1.0 instances with extensions that were included on Vulkan 1.1. - Dynamic dispatchers silently change size depending on preprocessor definitions. Different files will have different dispatch definitions, generating all kinds of hard to debug memory issues. In other words, Vulkan-Hpp is not "production ready" for our needs and this wrapper aims to replace it without losing RAII and exception safety.
2020-03-27maxwell_to_vk: implement signedscaled vertex formatsDan1-0/+20
2020-03-25Frontend/GPU: Refactor context managementJames Rowe2-2/+3
Changes the GraphicsContext to be managed by the GPU core. This eliminates the need for the frontends to fool around with tricky MakeCurrent/DoneCurrent calls that are dependent on the settings (such as async gpu option). This also refactors out the need to use QWidget::fromWindowContainer as that caused issues with focus and input handling. Now we use a regular QWidget and just access the native windowHandle() directly. Another change is removing the debug tool setting in FrameMailbox. Instead of trying to block the frontend until a new frame is ready, the core will now take over presentation and draw directly to the window if the renderer detects that its hooked by NSight or RenderDoc Lastly, since it was in the way, I removed ScopeAcquireWindowContext and replaced it with a simple subclass in GraphicsContext that achieves the same result
2020-03-19vk_texture_cache: Silence misc warningsReinUsesLisp1-3/+3
2020-03-19vk_staging_buffer_pool: Silence unused constant warningReinUsesLisp1-1/+1
2020-03-19vk_rasterizer: Remove unused variableReinUsesLisp1-2/+0
2020-03-19vk_pipeline_cache: Remove unused variableReinUsesLisp1-1/+0
2020-03-19maxwell_to_vk: Sielence -Wswitch warningReinUsesLisp1-0/+2
2020-03-15maxwell_to_vk: Implement RG32 and RGB32 integer vertex formatsReinUsesLisp1-0/+4
2020-03-15vk_rasterizer: Implement layered clearsReinUsesLisp1-2/+2
2020-03-15vk_shader_decompiler: fix linux buildmakigumo1-1/+1
2020-03-15vk_rasterizer: Fix vertex range assertReinUsesLisp1-1/+1
End can be equal to start in CalculateVertexArraysSize. This is quite common when the vertex size is zero.
2020-03-15vk_rasterizer: Reimplement clears with vkCmdClearAttachmentsReinUsesLisp4-45/+53
2020-03-14DirtyFlags: relax need to set render_targets as dirty Fernando Sahmkow1-2/+0
The texture cache already takes care of setting a render target to dirty when invalidated.
2020-03-13vk/gl_shader_decompiler: Silence assertion on computeReinUsesLisp1-3/+6
2020-03-13vk_shader_decompiler: Fix default varying regressionReinUsesLisp1-2/+6
2020-03-13vk_shader_decompiler: Fix implicit type conversionRodrigo Locatti1-1/+1
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-03-13vk_rasterizer: Implement transform feedback binding zeroReinUsesLisp2-0/+46
2020-03-13vk_shader_decompiler: Add XFB decorations to generic varyingsReinUsesLisp1-16/+89
2020-03-13vk_device: Enable VK_EXT_transform_feedback when availableReinUsesLisp2-7/+40
2020-03-13vk_device: Shrink formatless capability name sizeReinUsesLisp3-26/+23
2020-03-13vk_shader_decompiler: Use registry for specializationReinUsesLisp4-31/+37
2020-03-13fix formattingmakigumo1-1/+1
2020-03-13maxwell_to_vk: add vertex format eA2B10G10R10UnormPack32makigumo1-1/+3
2020-03-13video_core: Implement RGBA16_SNORMReinUsesLisp2-0/+2
Implement RGBA16_SNORM with the current API. Nothing special here.
2020-03-09video_core: Rename "const buffer locker" to "registry"ReinUsesLisp2-4/+4
2020-03-08vk_reasterizer: fix mistype on SetupGraphicsImagesNguyen Dac Nam1-1/+1
This should use Maxwell3D engine. Fixed some GPU error on Kirby and maybe other games.
2020-03-06vk_rasterizer: Support disabled uniform buffersReinUsesLisp2-1/+9
2020-03-06maxwell_to_vk: Remove Storage capability for A1B5G5R5UReinUsesLisp1-1/+1
2020-02-28dirty_flags: Deduplicate code between OpenGL and VulkanReinUsesLisp1-39/+2
2020-02-28vk_rasterizer: Pass Maxwell registers to dynamic updatesReinUsesLisp2-26/+21
2020-02-28state_tracker: Remove type traits with named structuresReinUsesLisp2-10/+12
2020-02-28vk_state_tracker: Implement dirty flags for stencil propertiesReinUsesLisp3-0/+21
2020-02-28vk_state_tracker: Implement dirty flags for depth boundsReinUsesLisp3-0/+14
2020-02-28vk_state_tracker: Implement dirty flags for blend constantsReinUsesLisp3-0/+14
2020-02-28vk_state_tracker: Implement dirty flags for depth biasReinUsesLisp3-0/+17
2020-02-28vk_state_tracker: Implement dirty flags for scissorsReinUsesLisp3-0/+14
2020-02-28vk_state_tracker: Initial implementationReinUsesLisp9-52/+196
Add support for render targets and viewports.
2020-02-28maxwell_3d: Flatten cull and front face registersReinUsesLisp4-21/+20
2020-02-28gl_rasterizer: Remove dirty flagsReinUsesLisp2-32/+1
2020-02-26vk_swapchain: Silence TOCTOU race conditionReinUsesLisp1-9/+12
It's possible that the window is resized from the moment we ask for its size to the moment a swapchain is created, causing validation issues. To workaround this Vulkan issue request the capabilities again just before creating the swapchain, making the race condition less likely.
2020-02-26frontend: qt: bootmanager: Vulkan: Restore support for VK backend.bunnei2-9/+14
2020-02-24vk_shader_decompiler: Implement indexed texturesReinUsesLisp6-54/+99
Implement accessing textures through an index. It uses the same interface as OpenGL, the main difference is that Vulkan bindings are forced to be arrayed (the binding index doesn't change for stacked textures in SPIR-V).
2020-02-24video_core: Implement more scaler attribute formatsReinUsesLisp2-4/+16
While changing this, fix assert in vk_shader_decompiler. We now know scaled formats are expected to be float in shaders attributes.
2020-02-21vk_device: remove left over from other branchNguyen Dac Nam1-1/+0
2020-02-20clang-formatNguyen Dac Nam1-1/+1
2020-02-20shader_decompiler: only add StorageImageReadWithoutFormat when availableNguyen Dac Nam1-1/+4
2020-02-19shader_decompiler: add check in case of device not support ShaderStorageImageReadWithoutFormatNguyen Dac Nam1-0/+4
2020-02-19vk_device: setup shaderStorageImageReadWithoutFormatNguyen Dac Nam1-0/+5
2020-02-19vk_device: add check for shaderStorageImageReadWithoutFormatNguyen Dac Nam1-0/+7
2020-02-19vk_shader: add Capability StorageImageReadWithoutFormatNguyen Dac Nam1-0/+1
2020-02-19vk_shader: Implement function ImageLoad (Used by Kirby Start Allies)Nguyen Dac Nam1-2/+6
Please enter the commit message for your changes. Lines starting
2020-02-18fixups mistake auto commit.Nguyen Dac Nam1-9/+0
2020-02-18Update code structureNguyen Dac Nam1-0/+7
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-02-18add vertex UnsignedInt size RGBANguyen Dac Nam1-0/+2
2020-02-18add eBc2SrgbBlock to formatsNguyen Dac Nam1-0/+1
2020-02-18vulkan: add DXT23_SRGBNguyen Dac Nam1-1/+1
2020-02-18renderer_vulkan: Add the rest of case for TryConvertBorderColorNguyen Dac Nam1-3/+10
2020-02-16texture_cache: Implement layered framebuffer attachmentsReinUsesLisp3-10/+21
Layered framebuffer attachments is a feature that allows applications to write attach layered textures to a single attachment. What layer the fragments are written to is decided from the shader using gl_Layer.
2020-02-16vk_shader_decompiler: Implement Layer output attributeReinUsesLisp1-6/+30
SPIR-V's Layer is GLSL's gl_Layer. It lets the application choose from a shader stage (vertex, tessellation or geometry) which framebuffer layer write the output fragments to.
2020-02-15texture: Implement R32IReinUsesLisp2-0/+2
2020-02-14maxwell_3d: Unify draw methodsReinUsesLisp2-14/+1
Pass instanced state of a draw invocation as an argument instead of having two separate virtual methods.
2020-02-14vk_query_cache: Implement generic query cache on VulkanReinUsesLisp7-3/+283
2020-02-14vk_shader_decompiler: Fix vertex id and instance idReinUsesLisp1-4/+13
Vulkan's VertexIndex and InstanceIndex don't match with hardware. This is because Nvidia implements gl_VertexID and gl_InstanceID. The math that relates these is: gl_VertexIndex = gl_BaseVertex + gl_VertexID gl_InstanceIndex = gl_InstanceIndex + gl_InstanceID To emulate it using what Vulkan's SPIR-V offers (the *Index variants) this commit substracts gl_Base* from gl_*Index to obtain the OpenGL and hardware's equivalent.
2020-02-04vk_rasterizer: Use noexcept variants of std::bitsetReinUsesLisp1-4/+5
Removes bounds checking from "texceptions" instances.
2020-01-29yuzu: Implement Vulkan frontendReinUsesLisp1-0/+265
Adds a Qt and SDL2 frontend for Vulkan. It also finishes the missing bits on Vulkan initialization.
2020-01-29settings: Add settings for graphics backendReinUsesLisp1-2/+4
2020-01-26shader/memory: Implement ATOM.ADDReinUsesLisp1-33/+33
ATOM operates atomically on global memory. For now only add ATOM.ADD since that's what was found in commercial games. This asserts for ATOM.ADD.S32 (handling the others as unimplemented), although ATOM.ADD.U32 shouldn't be any different. This change forces us to change the default type on SPIR-V storage buffers from float to uint. We could also alias the buffers, but it's simpler for now to just use uint. While we are at it, abstract the code to avoid repetition.
2020-01-25Shader_IR: Address feedback.Fernando Sahmkow1-2/+3
2020-01-24Shader_IR: Correct Custom Variable assignment.Fernando Sahmkow1-0/+2
2020-01-24Shader_IR: Implement Injectable Custom Variables to the IR.Fernando Sahmkow1-0/+16
2020-01-24vk_shader_decompiler: Disable default values on unwritten render targetsReinUsesLisp3-19/+16
Some games like The Legend of Zelda: Breath of the Wild assign render targets without writing them from the fragment shader. This generates Vulkan validation errors, so silence these I previously introduced a commit to set "vec4(0, 0, 0, 1)" for these attachments. The problem is that this is not what games expect. This commit reverts that change.
2020-01-20vk_blit_screen: Address feedbackReinUsesLisp4-22/+25
2020-01-20vk_blit_screen: Initial implementationReinUsesLisp2-0/+743
This abstraction takes care of presenting accelerated and non-accelerated or "framebuffer" images to the Vulkan swapchain.
2020-01-19vk_shader_decompiler: Implement UAtomicAdd (ATOMS) on SPIR-VReinUsesLisp1-3/+11
Also updates sirit to include atomic instructions.
2020-01-18vk_graphics_pipeline: Set front facing properlyReinUsesLisp1-2/+1
Front face was being forced to a certain value when cull face is disabled. Set a default value on initialization and drop the forcefully set front facing value with culling disabled.
2020-01-18vk_rasterizer: Address feedbackReinUsesLisp2-25/+32
2020-01-17vk_rasterizer: Implement Vulkan's rasterizerReinUsesLisp2-1/+1385
This abstraction is Vulkan's equivalent to OpenGL's rasterizer. It takes care of joining all parts of the backend and rendering accordingly on demand.
2020-01-17renderer_vulkan: Add header as placeholderReinUsesLisp1-0/+72
2020-01-16vk_texture_cache: Address feedbackReinUsesLisp2-22/+8
2020-01-16shader/memory: Implement ATOMS.ADD.U32ReinUsesLisp1-0/+7
2020-01-16vk_texture_cache: Fix typo in commentaryRodrigo Locatti1-1/+1
Co-Authored-By: MysticExile <30736337+MysticExile@users.noreply.github.com>
2020-01-14vk_texture_cache: Implement generic texture cache on VulkanReinUsesLisp3-0/+729
It currently ignores PBO linearizations since these should be dropped as soon as possible on OpenGL.
2020-01-11vk_compute_pass: Address feedbackRodrigo Locatti1-0/+2
Comment hardcoded SPIR-V modules.
2020-01-10maxwell_to_vk: Implement GL_CLAMP hacking Nvidia's driverReinUsesLisp3-6/+11
Nvidia's driver defaults invalid enumerations to GL_CLAMP. Vulkan doesn't expose GL_CLAMP through its API, but we can hack it on Nvidia's driver using the internal driver defaults.
2020-01-08vk_compute_pass: Add compute passes to emulate missing Vulkan featuresReinUsesLisp2-0/+414
This currently only supports quad arrays and u8 indices. In the future we can remove quad arrays with a table written from the CPU, but this was used to bootstrap the other passes helpers and it was left in the code. The blob code is generated from the "shaders/" directory. Read the instructions there to know how to generate the SPIR-V.
2020-01-08vk_shader_util: Add helper to build SPIR-V shadersReinUsesLisp2-0/+51
2020-01-07vk_pipeline_cache: Initial implementationReinUsesLisp2-1/+460
Given a pipeline key, this cache returns a pipeline abstraction (for graphics or compute).
2020-01-07vk_graphics_pipeline: Initial implementationReinUsesLisp3-0/+393
This abstractio represents the state of the 3D engine at a given draw. Instead of changing individual bits of the pipeline how it's done in APIs like D3D11, OpenGL and NVN; on Vulkan we are forced to put everything together into a single, immutable object. It takes advantage of the few dynamic states Vulkan offers.
2020-01-07vk_compute_pipeline: Initial implementationReinUsesLisp3-0/+217
This abstraction represents a Vulkan compute pipeline.
2020-01-07vk_pipeline_cache: Add file and define descriptor update template fillerReinUsesLisp2-0/+65
This function allows us to share code between compute and graphics pipelines compilation.
2020-01-07fixed_pipeline_state: Add depth clampReinUsesLisp2-10/+18
2020-01-07vk_rasterizer: Add placeholderReinUsesLisp1-0/+13
2020-01-06vk_renderpass_cache: Initial implementationReinUsesLisp2-0/+197
The renderpass cache is used to avoid creating renderpasses on each draw. The hashed structure is not currently optimized.
2020-01-06vk_update_descriptor: Initial implementationReinUsesLisp2-0/+143
The update descriptor is used to store in flat memory a large chunk of staging data used to update descriptor sets through templates. It provides a push interface to easily insert descriptors following the current pipeline. The order used in the descriptor update template has to be implicitly followed. We can catch bugs here using validation layers.
2020-01-06vk_stream_buffer/vk_buffer_cache: Avoid halting and use generic cacheReinUsesLisp4-62/+340
The stream buffer before this commit once it was full (no more bytes to write before looping) waiting for all previous operations to finish. This was a temporary solution and had a noticeable performance penalty in performance (from what a profiler showed). To avoid this mark with fences usages of the stream buffer and once it loops wait for them to be signaled. On average this will never wait. Each fence knows where its usage finishes, resulting in a non-paged stream buffer. On the other side, the buffer cache is reimplemented using the generic buffer cache. It makes use of the staging buffer pool and the new stream buffer.
2020-01-06vk_memory_manager: Misc changesReinUsesLisp2-88/+142
* Allocate memory in discrete exponentially increasing chunks until the 128 MiB threshold. Allocations larger thant that increase linearly by 256 MiB (depending on the required size). This allows to use small allocations for small resources. * Move memory maps to a RAII abstraction. To optimize for debugging tools (like RenderDoc) users will map/unmap on usage. If this ever becomes a noticeable overhead (from my profiling it doesn't) we can transparently move to persistent memory maps without harming the API, getting optimal performance for both gameplay and debugging. * Improve messages on exceptional situations. * Fix typos "requeriments" -> "requirements". * Small style changes.
2020-01-06vk_buffer_cache: Temporarily remove buffer cacheReinUsesLisp2-226/+0
This is intended for a follow up commit to avoid circular dependencies.
2020-01-04Shader_IR: Address FeedbackFernando Sahmkow1-14/+4
2020-01-03Update src/video_core/renderer_vulkan/vk_descriptor_pool.cppRodrigo Locatti1-1/+1
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-01-01vk_descriptor_pool: Initial implementationReinUsesLisp2-0/+145
Create a large descriptor pool where we allocate all our descriptors from. It has to be wide enough to support any pipeline, hence its large numbers. If the descritor pool is filled, we allocate more memory at that moment. This way we can take advantage of permissive drivers like Nvidia's that allocate more descriptors than what the spec requires.
2019-12-30Shader_IR: add the ability to amend code in the shader ir.Fernando Sahmkow1-0/+18
This commit introduces a mechanism by which shader IR code can be amended and extended. This useful for track algorithms where certain information can derived from before the track such as indexes to array samplers.
2019-12-30vk_image: Avoid unnecesary equalsRodrigo Locatti1-1/+1
2019-12-29vk_staging_buffer_pool: Initialize last epoch to zeroRodrigo Locatti1-1/+1
2019-12-25vk_staging_buffer_pool: Add a staging pool for temporary operationsReinUsesLisp2-0/+210
The job of this abstraction is to provide staging buffers for temporary operations. Think of image uploads or buffer uploads to device memory. It automatically deletes unused buffers.
2019-12-25vk_image: Add an image object abstractionReinUsesLisp2-0/+190
This object's job is to contain an image and manage its transitions. Since Nvidia hardware doesn't know what a transition is but Vulkan requires them anyway, we have to state track image subresources individually. To avoid the overhead of tracking each subresource in images with many subresources (think of cubemap arrays with several mipmaps), this commit tracks when subresources have diverged. As long as this doesn't happen we can check the state of the first subresource (that will be shared with all subresources) and update accordingly. Image transitions are deferred to the scheduler command buffer.
2019-12-24fixed_pipeline_state: Define symetric operator!= and mark as noexceptReinUsesLisp2-40/+92
Marks as noexcept Hash, operator== and operator!= for consistency.
2019-12-23fixed_pipeline_state: Define structure and loadersReinUsesLisp2-0/+526
The intention behind this hasheable structure is to describe the state of fixed function pipeline state that gets compiled to a single graphics pipeline state object. This is all dynamic state in OpenGL but Vulkan wants it in an immutable state, even if hardware can edit it freely. In this commit the structure is defined in an optimized state (it uses booleans, has paddings and many data entries that can be packed to single integers). This is intentional as an initial implementation that is easier to debug, implement and review. It will be optimized in later stages, or it might change if Vulkan gets more dynamic states.
2019-12-21vk_shader_decompiler: Use Visit instead of reimplementing itReinUsesLisp1-23/+1
ExprCondCode visit implements the generic Visit. Use this instead of that one. As an intended side effect this fixes unwritten memory usages in cases when a negation of a condition code is used.
2019-12-19vk_resource_manager: Add entry to VKFence to test its usageReinUsesLisp1-0/+8
2019-12-19vk_reosurce_manager: Add assert for releasing fencesReinUsesLisp1-0/+1
Notify the programmer when a request to release a fence is invalid because the fence is already free.
2019-12-19vk_resource_manager: Implement VKFenceWatch move constructorReinUsesLisp2-0/+32
This allows us to put VKFenceWatch inside a std::vector without storing it in heap. On move we have to signal the fences where the new protected resource is, adding some overhead.
2019-12-19vk_device: Add entry to catch device lossesReinUsesLisp3-1/+40
VK_NV_device_diagnostic_checkpoints allows us to push data to a Vulkan queue and then query it even after a device loss. This allows us to push the current pipeline object and see what was the call that killed the device.
2019-12-19vk_shader_decompiler: Fix full decompilationReinUsesLisp1-3/+5
When full decompilation was enabled, labels were not being inserted and instructions were misused. Fix these bugs.
2019-12-19vk_shader_decompiler: Skip NDC correction when it is nativeReinUsesLisp2-1/+2
Avoid changing gl_Position when the NDC used by the game is [0, 1] (Vulkan's native).
2019-12-19vk_shader_decompiler: Normalize output fragment attachmentsReinUsesLisp2-12/+12
Some games write from fragment shaders to an unexistant framebuffer attachment or they don't write to one when it exists in the framebuffer. Fix this by skipping writes or adding zeroes.
2019-12-19vk_device: Add query for RGBA8UintReinUsesLisp1-0/+1
2019-12-19vk_shader_decompiler: Update sirit and implement Texture AOFFIReinUsesLisp1-22/+30
2019-12-16renderer_vulkan/shader: Add helper GLSL shadersReinUsesLisp4-0/+122
These shaders are used to specify code that is not dynamically generated in the Vulkan backend. Instead of packing it inside the build system, it's manually built and copied to the C++ file to avoid adding unnecessary build time dependencies. quad_array should be dropped in the future since it can be emulated with a memory pool generated from the CPU.
2019-12-13maxwell_to_vk: Improve image format table and add more formatsReinUsesLisp2-89/+127
A1B5G5R5 uses A1R5G5B5. This is flipped with image view swizzles; flushing is still not properly implemented on Vulkan for this particular format.
2019-12-13maxwell_to_vk: Implement more vertex formatsReinUsesLisp1-7/+81
2019-12-13maxwell_to_vk: Implement more primitive topologiesReinUsesLisp2-2/+11
Add an extra argument to query device capabilities in the future. The intention behind this is to use native quads, quad strips, line loops and polygons if these are released for Vulkan.
2019-12-13maxwell_to_vk: Approach GL_CLAMP closer to the GL specReinUsesLisp3-9/+17
The OpenGL spec defines GL_CLAMP's formula similarly to CLAMP_TO_EDGE and CLAMP_TO_BORDER depending on the filter mode used. It doesn't exactly behave like this, but it's the closest we can get with what Vulkan offers without emulating it by injecting shader code.
2019-12-13maxwell_to_vk: Use VK_EXT_index_type_uint8 when availableReinUsesLisp2-4/+7
2019-12-13vk_scheduler: Delegate commands to a worker thread and state trackReinUsesLisp2-37/+311
Introduce a worker thread approach for delegating Vulkan work derived from dxvk's approach. https://github.com/doitsujin/dxvk Now that the scheduler is what handles all Vulkan work related to command streaming, store state tracking in itself. This way we can know when to reupload Vulkan dynamic state to the queue (since this one is invalidated between command buffers unlike NVN). We can also store the renderpass state and graphics pipeline bound to avoid redundant binds and renderpass begins/ends.
2019-12-10shader: Implement MEMBAR.GLReinUsesLisp1-0/+14
Implement using memoryBarrier in GLSL and OpMemoryBarrier on SPIR-V.
2019-12-10vk_shader_decompiler: Fix build issues on old gcc versionsReinUsesLisp1-2/+3
2019-12-10vk_shader_decompiler: Reduce YNegate's severityReinUsesLisp1-1/+1
2019-12-10shader_ir/other: Implement S2R InvocationIdReinUsesLisp1-0/+1
2019-12-10vk_shader_decompiler: Misc changesReinUsesLisp2-697/+1648
Update Sirit and its usage in vk_shader_decompiler. Highlights: - Implement tessellation shaders - Implement geometry shaders - Implement some missing features - Use native half float instructions when available.
2019-12-09vk_device: Misc changesReinUsesLisp2-117/+276
- Setup more features and requirements. - Improve logging for missing features. - Collect telemetry parameters. - Add queries for more image formats. - Query push constants limits. - Optionally enable some extensions.
2019-12-09externals: Update Vulkan-HeadersReinUsesLisp2-2/+14
2019-12-07vk_swapchain: Add support for swapping sRGBReinUsesLisp2-24/+31
We don't know until the game is running if it's using an sRGB color space or not. Add support for hot-swapping swapchain surface formats.
2019-11-27core/memory: Migrate over GetPointer()Lioncash1-3/+3
With all of the interfaces ready for migration, it's trivial to migrate over GetPointer().
2019-11-27core: Prepare various classes for memory read/write migrationLioncash2-2/+9
Amends a few interfaces to be able to handle the migration over to the new Memory class by passing the class by reference as a function parameter where necessary. Notably, within the filesystem services, this eliminates two ReadBlock() calls by using the helper functions of HLERequestContext to do that for us.
2019-11-23video_core: Unify ProgramType and ShaderStage into ShaderTypeReinUsesLisp4-22/+25
2019-11-14texture_cache: Drop abstracted ComponentTypeReinUsesLisp2-74/+71
Abstracted ComponentType was not being used in a meaningful way. This commit drops its usage. There is one place where it was being used to test compatibility between two cached surfaces, but this one is implied in the pixel format. Removing the component type test doesn't change the behaviour.
2019-11-14Shader_IR: Implement TXD instruction.Fernando Sahmkow1-0/+6
2019-11-14Shader_IR: Implement FLO instruction.Fernando Sahmkow1-0/+2
2019-11-08shader_ir/warp: Implement FSWZADDReinUsesLisp1-0/+6
2019-11-08gl_shader_decompiler: Reimplement shuffles with platform agnostic intrinsicsReinUsesLisp1-40/+3
2019-10-25Shader_IR: Implement Fast BRX and allow multi-branches in the CFG.Fernando Sahmkow1-0/+7
2019-10-18vk_shader_decompiler: Mark operator() function parameters as const referencesLioncash1-21/+23
These parameters aren't actually modified in any way, so they can be made const references.
2019-10-16vk_shader_decompiler: Resolve fallthrough within ExprDecompiler's ExprCondCode operator()Lioncash1-0/+3
This would previously result in NeverExecute and UnusedIndex being treated as regular predicates.
2019-10-05Shader_Ir: Address Feedback and clang format.Fernando Sahmkow1-25/+18
2019-10-05vk_shader_decompiler: Correct Branches inside conditionals.Fernando Sahmkow1-1/+11
2019-10-05vk_shader_decompiler: Clean code and be const correct.Fernando Sahmkow1-7/+5
2019-10-05vk_shader_compiler: Don't enclose branches with if(true) to avoid crashing AMDFernando Sahmkow1-16/+33
2019-10-05vk_shader_compiler: Correct SPIR-V AST DecompilingFernando Sahmkow1-4/+11
2019-10-05Shader_IR: allow else derivation to be optional.Fernando Sahmkow1-2/+4
2019-10-05vk_shader_compiler: Implement the decompiler in SPIR-VFernando Sahmkow1-22/+276
2019-09-22video_core: Implement RGBX16F PixelFormatFearlessTobi1-0/+1
2019-09-21gl_shader_decompiler: Use uint for images and fix SUATOMReinUsesLisp1-12/+0
In the process remove implementation of SUATOM.MIN and SUATOM.MAX as these require a distinction between U32 and S32. These have to be implemented with imageCompSwap loop.
2019-09-21shader/image: Implement SULD and remove irrelevant codeReinUsesLisp1-0/+7
* Implement SULD as float. * Remove conditional declaration of GL_ARB_shader_viewport_layer_array.
2019-09-17shader_ir/warp: Implement SHFLReinUsesLisp1-0/+50
2019-09-13vk_device: Add miscellaneous features and minor style changesReinUsesLisp3-111/+258
* Increase minimum Vulkan requirements * Require VK_EXT_vertex_attribute_divisor * Require depthClamp, samplerAnisotropy and largePoints features * Search and expose VK_KHR_uniform_buffer_standard_layout * Search and expose VK_EXT_index_type_uint8 * Search and expose native float16 arithmetics * Track current driver with VK_KHR_driver_properties * Query and expose SSBO alignment * Query more image formats * Improve logging overall * Minor style changes * Minor rephrasing of commentaries
2019-09-11shader/image: Implement SUATOM and fix SUSTReinUsesLisp1-0/+42
2019-08-21shader_ir: Implement VOTEReinUsesLisp1-0/+25
Implement VOTE using Nvidia's intrinsics. Documentation about these can be found here https://developer.nvidia.com/reading-between-threads-shader-intrinsics Instead of using portable ARB instructions I opted to use Nvidia intrinsics because these are the closest we have to how Tegra X1 hardware renders. To stub VOTE on non-Nvidia drivers (including nouveau) this commit simulates a GPU with a warp size of one, returning what is meaningful for the instruction being emulated: * anyThreadNV(value) -> value * allThreadsNV(value) -> value * allThreadsEqualNV(value) -> true ballotARB, also known as "uint64_t(activeThreadsNV())", emits VOTE.ANY Rd, PT, PT; on nouveau's compiler. This doesn't match exactly to Nvidia's code VOTE.ALL Rd, PT, PT; Which is emulated with activeThreadsNV() by this commit. In theory this shouldn't really matter since .ANY, .ALL and .EQ affect the predicates (set to PT on those cases) and not the registers.
2019-07-20Shader_Ir: Implement F16 Variants of F2F, F2I, I2F.Fernando Sahmkow1-0/+18
This commit takes care of implementing the F16 Variants of the conversion instructions and makes sure conversions are done.
2019-07-20shader/half_set_predicate: Fix HSETP2 implementationReinUsesLisp1-13/+4
2019-07-09shader_ir: Implement BRX & BRA.CCFernando Sahmkow1-0/+9
2019-07-08gl_shader_decompiler: Implement gl_ViewportIndex and gl_Layer in vertex shadersReinUsesLisp1-8/+6
This commit implements gl_ViewportIndex and gl_Layer in vertex and geometry shaders. In the case it's used in a vertex shader, it requires ARB_shader_viewport_layer_array. This extension is available on AMD and Nvidia devices (mesa and proprietary drivers), but not available on Intel on any platform. At the moment of writing this description I don't know if this is a hardware limitation or a driver limitation. In the case that ARB_shader_viewport_layer_array is not available, writes to these registers on a vertex shader are ignored, with the appropriate logging.
2019-07-07vk_sampler_cache: Remove unused includesLioncash1-3/+0
These are no longer used within this header, so they can be removed.
2019-07-07video_core: Add missing override specifiersLioncash1-2/+2
2019-07-07vk_scheduler: Drop execution context in favor of viewsReinUsesLisp6-50/+60
Instead of passing by copy an execution context through out the whole Vulkan call hierarchy, use a command buffer view and fence view approach. This internally dereferences the command buffer or fence forcing the user to be unable to use an outdated version of it on normal usage. It is still possible to keep store an outdated if it is casted to VKFence& or vk::CommandBuffer. While changing this file, add an extra parameter for Flush and Finish to allow releasing the fence from this calls.
2019-06-21shader: Decode SUST and implement backing image functionalityReinUsesLisp1-0/+7
2019-06-07shader: Split SSY and PBK stackReinUsesLisp1-12/+37
Hardware testing revealed that SSY and PBK push to a different stack, allowing code like this: SSY label1; PBK label2; SYNC; label1: PBK; label2: EXIT;
2019-06-06shader: Use shared_ptr to store nodes and move initialization to fileReinUsesLisp1-25/+25
Instead of having a vector of unique_ptr stored in a vector and returning star pointers to this, use shared_ptr. While changing initialization code, move it to a separate file when possible. This is a first step to allow code analysis and node generation beyond the ShaderIR class.
2019-05-30maxwell_to_gl: Use GL_CLAMP to emulate Clamp wrap modeReinUsesLisp1-1/+1
2019-05-26vk_device: Let formats array type be deducedReinUsesLisp1-33/+33
2019-05-26vk_shader_decompiler: Misc fixesReinUsesLisp2-45/+67
Fix missing OpSelectionMerge instruction. This caused devices loses on most hardware, Intel didn't care. Fix [-1;1] -> [0;1] depth conversions. Conditionally use VK_EXT_scalar_block_layout. This allows us to use non-std140 layouts on UBOs. Update external Vulkan headers.
2019-05-26vk_device: Enable features when available and misc changesReinUsesLisp2-43/+151
Keeps track of native ASTC support, VK_EXT_scalar_block_layout availability and SSBO range. Check for independentBlend and vertexPipelineStorageAndAtomics as a required feature. Always enable it. Use vk::to_string format to log Vulkan enums. Style changes.
2019-05-20shader: Implement S2R Tid{XYZ} and CtaId{XYZ}ReinUsesLisp1-0/+18
2019-05-10renderer_vulkan/vk_shader_decompiler: Remove unused variable from DeclareInternalFlags()Lioncash1-1/+0
2019-05-03shader: Remove unused AbufNode Ipa modeReinUsesLisp1-4/+3
2019-04-21Rasterizer Cache: Use a temporal storage for Surfaces loading/flushing.Fernando Sahmkow1-1/+0
This PR should heavily reduce memory usage since temporal buffers are no longer stored per Surface but instead managed by the Rasterizer Cache.
2019-04-20RasterizerCache Redesign: Flush Fernando Sahmkow1-2/+4
flushing is now responsability of children caches instead of the cache object. This change will allow the specific cache to pass extra parameters on flushing and will allow more flexibility.
2019-04-18video_core: Silent -Wswitch warningsReinUsesLisp1-4/+6
2019-04-16vk_shader_decompiler: Add missing operationsReinUsesLisp1-0/+7
2019-04-16shader_ir/decode: Fix half float pre-operations and remove MetaHalfArithmeticReinUsesLisp1-5/+7
Operations done before the main half float operation (like HAdd) were managing a packed value instead of the unpacked one. Adding an unpacked operation allows us to drop the per-operand MetaHalfArithmetic entry, simplifying the code overall.
2019-04-16shader_ir/decode: Implement half float saturationReinUsesLisp1-0/+6
2019-04-14shader_ir: Implement STG, keep track of global memory usage and flushReinUsesLisp1-6/+8
2019-04-10vk_shader_decompiler: Implement flow primitivesReinUsesLisp1-5/+82
2019-04-10vk_shader_decompiler: Implement most common texture primitivesReinUsesLisp1-8/+65
2019-04-10vk_shader_decompiler: Implement texture decompilation helper functionsReinUsesLisp1-0/+32
2019-04-10vk_shader_decompiler: Implement Assign and LogicalAssignReinUsesLisp1-2/+64
2019-04-10vk_shader_decompiler: Implement non-OperationCode visitsReinUsesLisp1-7/+129
2019-04-10vk_shader_decompiler: Implement OperationCode decompilation interfaceReinUsesLisp1-1/+411
2019-04-10vk_shader_decompiler: Implement VisitReinUsesLisp1-1/+50
2019-04-10vk_shader_decompiler: Implement labels tree and flowReinUsesLisp1-0/+71
2019-04-10vk_shader_decompiler: Implement declarationsReinUsesLisp1-3/+457
2019-04-10vk_shader_decompiler: Declare and stub interface for a SPIR-V decompilerReinUsesLisp2-0/+125
2019-04-06video_core/engines: Remove unnecessary inclusions where applicableLioncash1-0/+1
Replaces header inclusions with forward declarations where applicable and also removes unused headers within the cpp file. This reduces a few more dependencies on core/memory.h
2019-04-02video_core: Abstract vk_sampler_cache into a templated classReinUsesLisp2-58/+18
2019-03-29vk_swapchain: Implement a swapchain managerReinUsesLisp2-0/+302
2019-03-27video_core: Amend constructor initializer list order where applicableLioncash1-2/+2
Specifies the members in the same order that initialization would take place in. This also silences -Wreorder warnings.
2019-03-27video_core: Add missing override specifiersLioncash2-2/+2
Ensures that the signatures will always match with the base class. Also silences a few compilation warnings.
2019-03-21gpu: Move GPUVAddr definition to common_types.bunnei2-4/+2
2019-03-15gpu: Use host address for caching instead of guest address.bunnei2-17/+41
2019-03-13vk_sampler_cache: Use operator== instead of memcmpMat M1-1/+1
Co-Authored-By: ReinUsesLisp <reinuseslisp@airmail.cc>
2019-03-13vk_sampler_cache: Implement a sampler cacheReinUsesLisp2-0/+137
2019-03-06video_core/engines: Remove unnecessary includesLioncash1-1/+1
Removes a few unnecessary dependencies on core-related machinery, such as the core.h and memory.h, which reduces the amount of rebuilding necessary if those files change. This also uncovered some indirect dependencies within other source files. This also fixes those.
2019-03-04maxwell_to_vk: Initial implementationReinUsesLisp3-3/+551
2019-03-02vk_buffer_cache: Fix clang-formatReinUsesLisp1-3/+3
2019-03-01vk_buffer_cache: Implement a buffer cacheReinUsesLisp2-0/+203
This buffer cache is just like OpenGL's buffer cache with some minor style changes. It uses VKStreamBuffer.
2019-02-27vk_memory_manager: Reorder constructor initializer list in terms of member declaration orderLioncash1-1/+1
Reorders members in the order that they would actually be initialized in. Silences a -Wreorder warning.
2019-02-26vk_stream_buffer: Remove copy code pathReinUsesLisp2-53/+18
2019-02-24vk_stream_buffer: Implement a stream bufferReinUsesLisp2-0/+197
This manages two kinds of streaming buffers: one for unified memory models and one for dedicated GPUs. The first one skips the copy from the staging buffer to the real buffer, since it creates an unified buffer. This implementation waits for all fences to finish their operation before "invalidating". This is suboptimal since it should allocate another buffer or start searching from the beginning. There is room for improvement here. This could also handle AMD's "pinned" memory (a heap with 256 MiB) that seems to be designed for buffer streaming.
2019-02-24vk_resource_manager: Minor VKFenceWatch changesReinUsesLisp2-7/+7
2019-02-24vk_memory_manager: Fixup commit interval allocationReinUsesLisp1-2/+1
VKMemoryCommitImpl was using as the end of its interval "begin + end". That ended up wasting memory.
2019-02-22vk_scheduler: Implement a schedulerReinUsesLisp2-0/+129
The scheduler abstracts command buffer and fence management with an interface that's able to do OpenGL-like operations on Vulkan command buffers. It returns by value a command buffer and fence that have to be used for subsequent operations until Flush or Finish is executed, after that the current execution context (the pair of command buffers and fences) gets invalidated a new one must be fetched. Thankfully validation layers will quickly detect if this is skipped throwing an error due to modifications to a sent command buffer.
2019-02-19vk_memory_manager: Implement memory managerReinUsesLisp2-0/+340
A memory manager object handles the memory allocations for a device. It allocates chunks of Vulkan memory objects and then suballocates.
2019-02-14vk_resource_manager: Implement a command buffer pool with VKFencedPoolReinUsesLisp2-1/+59
2019-02-14vk_resource_manager: Add VKFencedPool interfaceReinUsesLisp2-0/+83
Handles a pool of resources protected by fences. Manages resource overflow allocating more resources. This class is intended to be used through inheritance.
2019-02-14vk_resource_manager: Implement VKResourceManager and fence allocatorReinUsesLisp2-0/+85
CommitFence iterates a pool of fences until one is found. If all fences are being used at the same time, allocate more.
2019-02-14vk_resource_manager: Implement VKFenceWatchReinUsesLisp2-0/+68
A fence watch is used to keep track of the usage of a fence and protect a resource or set of resources without having to inherit from their handlers.
2019-02-14vk_resource_manager: Implement VKFenceReinUsesLisp2-0/+131
Fences take ownership of objects, protecting them from GPU-side or driver-side concurrent access. They must be commited from the resource manager. Their usage flow is: commit the fence from the resource manager, protect resources with it and use them, send the fence to an execution queue and Wait for it if needed and then call Release. Used resources will automatically be signaled when they are free to be reused.
2019-02-14vk_resource_manager: Add VKResource interfaceReinUsesLisp2-0/+40
VKResource is an interface that gets signaled by a fence when it is free to be reused.
2019-02-13vk_device: Abstract device handling into a classReinUsesLisp2-0/+347
VKDevice contains all the data required to manage and initialize a physical device. Its intention is to be passed across Vulkan objects to query device-specific data (for example the logical device and the dispatch loader).
2019-02-12renderer_vulkan: Add declarations fileReinUsesLisp1-0/+45
This file is intended to be included instead of vulkan/vulkan.hpp. It includes declarations of unique handlers using a dynamic dispatcher instead of a static one (which would require linking to a Vulkan library).