aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
AgeCommit message (Collapse)Author
2020-01-26shader/memory: Implement ATOM.ADDReinUsesLisp
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-24vk_shader_decompiler: Disable default values on unwritten render targetsReinUsesLisp
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-20Merge pull request #3330 from ReinUsesLisp/vk-blit-screenFernando Sahmkow
vk_blit_screen: Initial implementation
2020-01-20vk_blit_screen: Address feedbackReinUsesLisp
2020-01-20Merge pull request #3328 from ReinUsesLisp/vulkan-atomsbunnei
vk_shader_decompiler: Implement UAtomicAdd (ATOMS) on SPIR-V
2020-01-19Merge pull request #3322 from ReinUsesLisp/vk-front-facebunnei
vk_graphics_pipeline: Set front facing properly
2020-01-19vk_blit_screen: Initial implementationReinUsesLisp
This abstraction takes care of presenting accelerated and non-accelerated or "framebuffer" images to the Vulkan swapchain.
2020-01-19Merge pull request #3313 from ReinUsesLisp/vk-rasterizerbunnei
vk_rasterizer: Implement Vulkan's rasterizer
2020-01-19vk_shader_decompiler: Implement UAtomicAdd (ATOMS) on SPIR-VReinUsesLisp
Also updates sirit to include atomic instructions.
2020-01-18vk_graphics_pipeline: Set front facing properlyReinUsesLisp
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-18Merge pull request #3312 from ReinUsesLisp/atoms-u32bunnei
shader/memory: Implement ATOMS.ADD.U32
2020-01-17vk_rasterizer: Address feedbackReinUsesLisp
2020-01-16vk_rasterizer: Implement Vulkan's rasterizerReinUsesLisp
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-16renderer_vulkan: Add header as placeholderReinUsesLisp
2020-01-16Merge pull request #3300 from ReinUsesLisp/vk-texture-cachebunnei
vk_texture_cache: Implement generic texture cache on Vulkan
2020-01-16vk_texture_cache: Address feedbackReinUsesLisp
2020-01-16shader/memory: Implement ATOMS.ADD.U32ReinUsesLisp
2020-01-16vk_texture_cache: Fix typo in commentaryRodrigo Locatti
Co-Authored-By: MysticExile <30736337+MysticExile@users.noreply.github.com>
2020-01-13Merge pull request #3290 from ReinUsesLisp/gl-clampbunnei
maxwell_to_vk: Implement GL_CLAMP hacking Nvidia's driver
2020-01-13vk_texture_cache: Implement generic texture cache on VulkanReinUsesLisp
It currently ignores PBO linearizations since these should be dropped as soon as possible on OpenGL.
2020-01-10vk_compute_pass: Address feedbackRodrigo Locatti
Comment hardcoded SPIR-V modules.
2020-01-10maxwell_to_vk: Implement GL_CLAMP hacking Nvidia's driverReinUsesLisp
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 featuresReinUsesLisp
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 shadersReinUsesLisp
2020-01-06vk_pipeline_cache: Initial implementationReinUsesLisp
Given a pipeline key, this cache returns a pipeline abstraction (for graphics or compute).
2020-01-06vk_graphics_pipeline: Initial implementationReinUsesLisp
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-06vk_compute_pipeline: Initial implementationReinUsesLisp
This abstraction represents a Vulkan compute pipeline.
2020-01-06vk_pipeline_cache: Add file and define descriptor update template fillerReinUsesLisp
This function allows us to share code between compute and graphics pipelines compilation.
2020-01-06fixed_pipeline_state: Add depth clampReinUsesLisp
2020-01-06vk_rasterizer: Add placeholderReinUsesLisp
2020-01-06Merge pull request #3276 from ReinUsesLisp/pipeline-reqsbunnei
vk_update_descriptor/vk_renderpass_cache: Add pipeline cache dependencies
2020-01-06vk_renderpass_cache: Initial implementationReinUsesLisp
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 implementationReinUsesLisp
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 cacheReinUsesLisp
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 changesReinUsesLisp
* 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 cacheReinUsesLisp
This is intended for a follow up commit to avoid circular dependencies.
2020-01-05Merge pull request #3264 from ReinUsesLisp/vk-descriptor-poolFernando Sahmkow
vk_descriptor_pool: Initial implementation
2020-01-04Merge pull request #3258 from FernandoS27/shader-amendbunnei
Shader_IR: add the ability to amend code in the shader ir.
2020-01-04Shader_IR: Address FeedbackFernando Sahmkow
2020-01-03Update src/video_core/renderer_vulkan/vk_descriptor_pool.cppRodrigo Locatti
Co-Authored-By: Mat M. <mathew1800@gmail.com>
2020-01-01vk_descriptor_pool: Initial implementationReinUsesLisp
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 Sahmkow
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-30Merge pull request #3248 from ReinUsesLisp/vk-imageFernando Sahmkow
vk_image: Add an image object abstraction
2019-12-30vk_image: Avoid unnecesary equalsRodrigo Locatti
2019-12-29vk_staging_buffer_pool: Initialize last epoch to zeroRodrigo Locatti
2019-12-25vk_staging_buffer_pool: Add a staging pool for temporary operationsReinUsesLisp
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 abstractionReinUsesLisp
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 noexceptReinUsesLisp
Marks as noexcept Hash, operator== and operator!= for consistency.
2019-12-22fixed_pipeline_state: Define structure and loadersReinUsesLisp
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-22Merge pull request #3238 from ReinUsesLisp/vk-resource-managerbunnei
vk_resource_manager: Catch device losses and other changes