aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/shader
AgeCommit message (Collapse)Author
2021-07-22shader: Remove old shader managementReinUsesLisp
2021-02-15Review 1Kelebek1
2021-02-15Implement texture offset support for TexelFetch and TextureGather and add ↵Kelebek1
offsets for Tlds Formatting
2021-02-14yuzu: Various frontend improvements to avoid crashes and improve experience ↵bunnei
on Linux.
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp
Reimplement the buffer cache using cached bindings and page level granularity for modification tracking. This also drops the usage of shared pointers and virtual functions from the cache. - Bindings are cached, allowing to skip work when the game changes few bits between draws. - OpenGL Assembly shaders no longer copy when a region has been modified from the GPU to emulate constant buffers, instead GL_EXT_memory_object is used to alias sub-buffers within the same allocation. - OpenGL Assembly shaders stream constant buffer data using glProgramBufferParametersIuivNV, from NV_parameter_buffer_object. In theory this should save one hash table resolve inside the driver compared to glBufferSubData. - A new OpenGL stream buffer is implemented based on fences for drivers that are not Nvidia's proprietary, due to their low performance on partial glBufferSubData calls synchronized with 3D rendering (that some games use a lot). - Most optimizations are shared between APIs now, allowing Vulkan to cache more bindings than before, skipping unnecesarry work. This commit adds the necessary infrastructure to use Vulkan object from OpenGL. Overall, it improves performance and fixes some bugs present on the old cache. There are still some edge cases hit by some games that harm performance on some vendors, this are planned to be fixed in later commits.
2021-01-25Revert "Start of Integer flags implementation"ReinUsesLisp
This reverts #4713. The implementation in that PR is not accurate. It does not reflect the behavior seen in hardware.
2021-01-24video_core: Silence -Wmissing-field-initializers warningsReinUsesLisp
2021-01-23shader_ir: Fix comment typoLevi Behunin
2021-01-10Merge remote-tracking branch 'upstream/master' into int-flagsLevi
2021-01-04renderer_vulkan: Move device abstraction to vulkan_commonReinUsesLisp
2021-01-03renderer_vulkan: Rename VKDevice to DeviceReinUsesLisp
The "VK" prefix predates the "Vulkan" namespace. It was carried around the codebase for consistency. "VKDevice" currently is a bad alias with "VkDevice" (only an upcase character of difference) that can cause confusion. Rename all instances of it.
2020-12-30half_set: Resolve -Wmaybe-uninitialized warningsLioncash
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp
The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
2020-12-07Merge pull request #5164 from lioncash/containsRodrigo Locatti
video_core: Make use of ordered container contains() where applicable
2020-12-07video_core: Make use of ordered container contains() where applicableLioncash
With C++20, we can use the more concise contains() member function instead of comparing the result of the find() call with the end iterator.
2020-12-07ast: Improve string concat readability in operator()Lioncash
Provides an in-place format string to make it more pleasant to read.
2020-12-07Merge pull request #5159 from lioncash/move-amendRodrigo Locatti
shader_ir: std::move node within DeclareAmend()
2020-12-07shader_ir: std::move node within DeclareAmend()Lioncash
Same behavior, but elides an unnecessary atomic reference count increment and decrement.
2020-12-07video_core: Remove unnecessary enum class casting in logging messagesLioncash
fmt now automatically prints the numeric value of an enum class member by default, so we don't need to use casts any more. Reduces the line noise a bit.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.3Lioncash
Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors.
2020-12-05video_core: Resolve more variable shadowing scenarios pt.2Lioncash
Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
2020-12-03node: Mark member functions as [[nodiscard]] where applicableLioncash
Prevents logic bugs from accidentally ignoring the return value.
2020-12-03node: Eliminate variable shadowingLioncash
2020-11-24Merge pull request #3681 from lioncash/componentRodrigo Locatti
decoder/image: Fix incorrect G24R8 component sizes in GetComponentSize()
2020-11-20async_shaders: emplace threads into the worker thread vectorLioncash
Same behavior, but constructs the threads in place instead of moving them.
2020-11-20async_shaders: Simplify implementation of GetCompletedWork()Lioncash
This is equivalent to moving all the contents and then clearing the vector. This avoids a redundant allocation.
2020-11-20async_shaders: Simplify moving data into the pending queueLioncash
2020-11-20async_shaders: std::move data within QueueVulkanShader()Lioncash
Same behavior, but avoids redundant copies. While we're at it, we can simplify the pushing of the parameters into the pending queue.
2020-11-05Merge pull request #4854 from ReinUsesLisp/cube-array-shadowbunnei
shader: Partially implement texture cube array shadow
2020-11-01Merge pull request #4865 from ameerj/async-threadcountbunnei
async_shaders: Increase Async worker thread count for >8 thread cpus
2020-10-29async_shaders: Increase Async worker thread count for 8+ thread cpusameerj
Adds 1 async worker thread for every 2 available threads above 8
2020-10-28shader: Partially implement texture cube array shadowReinUsesLisp
This implements texture cube arrays with shadow comparisons but doesn't fix the asserts related to it. Fixes out of bounds reads on swizzle constructors and makes them use bounds checked ::at instead of the unsafe operator[].
2020-10-28shader/arithmetic: Implement FCMP immediate + register variantReinUsesLisp
Trivially add the encoding for this.
2020-10-07shader/texture: Implement CUBE texture type for TMML and fix arraysReinUsesLisp
TMML takes an array argument that has no known meaning, this one appears as the first component in gpr8 followed by s, t and r. Skip this component when arrays are being used. Also implement CUBE texture types. - Used by Pikmin 3: Deluxe Demo.
2020-09-26Merge pull request #4703 from lioncash/desig7bunnei
shader/registry: Make use of designated initializers where applicable
2020-09-24More forgetting... duhLevi Behunin
2020-09-24Merge pull request #4711 from lioncash/move5bunnei
arithmetic_integer_immediate: Make use of std::move where applicable
2020-09-24Forgot to apply suggestion here as wellLevi Behunin
2020-09-24Address CommentsLevi Behunin
2020-09-24Start of Integer flags implementationLevi Behunin
2020-09-24arithmetic_integer_immediate: Make use of std::move where applicableLioncash
Same behavior, minus any redundant atomic reference count increments and decrements.
2020-09-23Merge pull request #4674 from ReinUsesLisp/timeline-semaphoresbunnei
renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphore
2020-09-23shader/registry: Silence a -Wshadow warningLioncash
2020-09-23shader/registry: Remove unnecessary namespace qualifiersLioncash
Using statements already make these unnecessary.
2020-09-23shader/registry: Make use of designated initializers where applicableLioncash
Same behavior, less repetition.
2020-09-22control_flow: emplace elements in place within TryQuery()Lioncash
Places data structures where they'll eventually be moved to to avoid needing to even move them in the first place.
2020-09-22control_flow: Make use of std::move in InsertBranch()Lioncash
Avoids unnecessary atomic increments and decrements.
2020-09-22General: Make use of std::nullopt where applicableLioncash
Allows some implementations to avoid completely zeroing out the internal buffer of the optional, and instead only set the validity byte within the structure. This also makes it consistent how we return empty optionals.
2020-09-19renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphoreReinUsesLisp
This reworks how host<->device synchronization works on the Vulkan backend. Instead of "protecting" resources with a fence and signalling these as free when the fence is known to be signalled by the host GPU, use timeline semaphores. Vulkan timeline semaphores allow use to work on a subset of D3D12 fences. As far as we are concerned, timeline semaphores are a value set by the host or the device that can be waited by either of them. Taking advantange of this, we can have a monolithically increasing atomic value for each submission to the graphics queue. Instead of protecting resources with a fence, we simply store the current logical tick (the atomic value stored in CPU memory). When we want to know if a resource is free, it can be compared to the current GPU tick. This greatly simplifies resource management code and the free status of resources should have less false negatives. To workaround bugs in validation layers, when these are attached there's a thread waiting for timeline semaphores.
2020-09-17Merge pull request #4672 from lioncash/narrowingRodrigo Locatti
decoder/texture: Eliminate narrowing conversion in GetTldCode()