Commit Graph

789 Commits (414a87a4f4570344140d77a7985b4d118b754341)

Author SHA1 Message Date
Lioncash 414a87a4f4 video_core: Resolve more variable shadowing scenarios pt.2
Migrates the video core code closer to enabling variable shadowing
warnings as errors.

This primarily sorts out shadowing occurrences within the Vulkan code.
4 years ago
Lioncash edd8208779 node: Mark member functions as [[nodiscard]] where applicable
Prevents logic bugs from accidentally ignoring the return value.
4 years ago
Lioncash 7cf34c3637 node: Eliminate variable shadowing 4 years ago
Rodrigo Locatti fbda5e9ec9
Merge pull request #3681 from lioncash/component
decoder/image: Fix incorrect G24R8 component sizes in GetComponentSize()
4 years ago
Lioncash 01db5cf203 async_shaders: emplace threads into the worker thread vector
Same behavior, but constructs the threads in place instead of moving
them.
4 years ago
Lioncash ba3916fc67 async_shaders: Simplify implementation of GetCompletedWork()
This is equivalent to moving all the contents and then clearing the
vector. This avoids a redundant allocation.
4 years ago
Lioncash 3fcc98e11a async_shaders: Simplify moving data into the pending queue 4 years ago
Lioncash 5b441fa25d async_shaders: std::move data within QueueVulkanShader()
Same behavior, but avoids redundant copies.

While we're at it, we can simplify the pushing of the parameters into
the pending queue.
4 years ago
bunnei a111a9ae2c
Merge pull request #4854 from ReinUsesLisp/cube-array-shadow
shader: Partially implement texture cube array shadow
5 years ago
bunnei 1089d76736
Merge pull request #4865 from ameerj/async-threadcount
async_shaders: Increase Async worker thread count for >8 thread cpus
5 years ago
ameerj 3620206136 async_shaders: Increase Async worker thread count for 8+ thread cpus
Adds 1 async worker thread for every 2 available threads above 8
5 years ago
ReinUsesLisp 657771bdcb shader: Partially implement texture cube array shadow
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[].
5 years ago
ReinUsesLisp 44b552be71 shader/arithmetic: Implement FCMP immediate + register variant
Trivially add the encoding for this.
5 years ago
ReinUsesLisp dffaffaac1 shader/texture: Implement CUBE texture type for TMML and fix arrays
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.
5 years ago
bunnei 442096298e
Merge pull request #4703 from lioncash/desig7
shader/registry: Make use of designated initializers where applicable
5 years ago
bunnei 2634e3c6eb
Merge pull request #4711 from lioncash/move5
arithmetic_integer_immediate: Make use of std::move where applicable
5 years ago
Lioncash e3a615a616 arithmetic_integer_immediate: Make use of std::move where applicable
Same behavior, minus any redundant atomic reference count increments and
decrements.
5 years ago
bunnei d66b897a6d
Merge pull request #4674 from ReinUsesLisp/timeline-semaphores
renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphore
5 years ago
Lioncash 77532ebde3 shader/registry: Silence a -Wshadow warning 5 years ago
Lioncash cd6f4f7eed shader/registry: Remove unnecessary namespace qualifiers
Using statements already make these unnecessary.
5 years ago
Lioncash ffeb4ef83e shader/registry: Make use of designated initializers where applicable
Same behavior, less repetition.
5 years ago
Lioncash 0dc6967ff1 control_flow: emplace elements in place within TryQuery()
Places data structures where they'll eventually be moved to to avoid
needing to even move them in the first place.
5 years ago
Lioncash fcd0145eb5 control_flow: Make use of std::move in InsertBranch()
Avoids unnecessary atomic increments and decrements.
5 years ago
Lioncash ff45c39578 General: Make use of std::nullopt where applicable
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.
5 years ago
ReinUsesLisp 58b0ae84b5 renderer_vulkan: Make unconditional use of VK_KHR_timeline_semaphore
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.
5 years ago
Rodrigo Locatti 31461589c5
Merge pull request #4672 from lioncash/narrowing
decoder/texture: Eliminate narrowing conversion in GetTldCode()
5 years ago
Lioncash 4944d48ee8 decode/image: Eliminate switch fallthrough in DecodeImage()
Fortunately this didn't result in any issues, given the block that code
was falling through to would immediately break.
5 years ago
Lioncash ffc66f089d decoder/texture: Eliminate narrowing conversion in GetTldCode()
The assignment was previously truncating a u64 value to a bool.
5 years ago
ReinUsesLisp eb914b6c50 video_core: Enforce -Werror=switch
This forces us to fix all -Wswitch warnings in video_core.
5 years ago
ReinUsesLisp 9e87193725 video_core: Remove all Core::System references in renderer
Now that the GPU is initialized when video backends are initialized,
it's no longer needed to query components once the game is running: it
can be done when yuzu is booting.

This allows us to pass components between constructors and in the
process remove all Core::System references in the video backend.
5 years ago
bunnei 39319f09d8
Merge pull request #4575 from lioncash/async
async_shaders: Mark getters as const member functions
5 years ago
bunnei 9864da7d43
Merge pull request #4524 from lioncash/memory-log
shader/memory: Amend UNIMPLEMENTED_IF_MSG without a message
5 years ago
Lioncash bafef3d1c9 async_shaders: Mark getters as const member functions
While we're at it, we can also mark them as nodiscard.
5 years ago
David cbaf1bc711
Merge pull request #4443 from ameerj/vk-async-shaders
vulkan_renderer: Async shader/graphics pipeline compilation
5 years ago
ameerj fde8102a41 Remove unneeded newlines, optional Registry in shader params
Addressing feedback from Rodrigo
5 years ago
Ameer J f49ffdd648 Morph: Update worker allocation comment
Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
5 years ago
ameerj 1b829fbd7a move thread 1/4 count computation into allocate workers method 5 years ago
ameerj 31a76410e8 Address feedback, add shader compile notifier, update setting text 5 years ago
ameerj c02464f64e Vk Async Worker directly emplace in cache 5 years ago
ameerj 4539073ce1 Address feedback. Bruteforce delete duplicates 5 years ago
ameerj 6ac97405df Vk Async pipeline compilation 5 years ago
Lioncash dcc5562cd5 shader/memory: Amend UNIMPLEMENTED_IF_MSG without a message
We need to provide a message for this variant of the macro, so we can
simply log out the type being used.
5 years ago
Lioncash 6b13d08822 async_shaders: Resolve -Wpessimizing-move warning
Prevents pessimization of the move constructor (which thankfully didn't
actually happen in practice here, given std::thread isn't copyable).
5 years ago
Lioncash b724a4d90c General: Tidy up clang-format warnings part 2 5 years ago
bunnei f650cf8a9a
Merge pull request #4391 from lioncash/nrvo
video_core: Allow copy elision to take place where applicable
5 years ago
Rodrigo Locatti 9ea9a60e17
Merge pull request #4361 from ReinUsesLisp/lane-id
decode/other: Implement S2R.LaneId
5 years ago
Lioncash 6adc824d9d video_core: Allow copy elision to take place where applicable
Removes const from some variables that are returned from functions, as
this allows the move assignment/constructors to execute for them.
5 years ago
bunnei 3d13d7f48f
Merge pull request #4324 from ReinUsesLisp/formats
video_core: Fix, add and rename pixel formats
5 years ago
David Marcec 967307d3be Fix style issues 5 years ago
David Marcec 85b591f6f0 Remove duplicate config 5 years ago