Commit graph

9517 commits

Author SHA1 Message Date
bunnei
032e4c4ca3 gl_rasterizer: Skip zero addr/sized regions on flush/invalidate. 2019-03-16 22:03:19 -04:00
bunnei
2392e146b0
Merge pull request #2244 from bunnei/gpu-mem-refactor
video_core: Refactor to use MemoryManager interface for all memory access.
2019-03-16 21:59:45 -04:00
bunnei
bf41132aa9
Merge pull request #2243 from bunnei/mem-simplify-cache
memory: Simplify rasterizer cache operations.
2019-03-16 21:59:30 -04:00
bunnei
059465d496
Merge pull request #2129 from FernandoS27/cntpct
Correct CNTPCT from using CPU Cycles to using Clock Cycles
2019-03-16 21:58:59 -04:00
Lioncash
64444ff481 ipc_helpers: Allow pushing and popping floating-point values
Certain values that are passed through the IPC buffer are actually
floating point values, not solely integral values.
2019-03-16 14:05:03 -04:00
Lioncash
f71c598907 common/thread_queue_list: Remove unnecessary dependency on boost
We really don't need to pull in several headers of boost related
machinery just to perform the erase-remove idiom (particularly with
C++20 around the corner, which adds universal container std::erase and
std::erase_if, which we can just use instead).

With this, we don't need to link in anything boost-related into common.
2019-03-16 05:01:39 -04:00
Lioncash
99f982dce2 kernel/thread: Actually remove the definition of ExitCurrentThread()
This was intended to be removed in
51d7f6bffc, but I guess I forgot to
actually save the file like a dingus.
2019-03-16 00:51:44 -04:00
bunnei
bdf2da4ee8
Merge pull request #2242 from lioncash/thread-fn
kernel/thread: Remove WaitCurrentThread_Sleep() and ExitCurrentThread()
2019-03-16 00:43:09 -04:00
bunnei
10118c71e0 memory: Simplify rasterizer cache operations. 2019-03-16 00:41:08 -04:00
bunnei
574e89d924 video_core: Refactor to use MemoryManager interface for all memory access.
# Conflicts:
#	src/video_core/engines/kepler_memory.cpp
#	src/video_core/engines/maxwell_3d.cpp
#	src/video_core/morton.cpp
#	src/video_core/morton.h
#	src/video_core/renderer_opengl/gl_global_cache.cpp
#	src/video_core/renderer_opengl/gl_global_cache.h
#	src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
2019-03-16 00:38:48 -04:00
bunnei
47b622825c
Merge pull request #2237 from bunnei/cache-host-addr
gpu: Use host address for caching instead of guest address.
2019-03-16 00:05:24 -04:00
Lioncash
51d7f6bffc kernel/thread: Move thread exiting logic from ExitCurrentThread to svcExitThread
Puts the operation on global state in the same places as the rest of the
svc calls.
2019-03-15 23:58:37 -04:00
Lioncash
c892cf01fa kernel/thread: Migrate WaitCurrentThread_Sleep into the Thread interface
Rather than make a global accessor for this sort of thing. We can make
it a part of the thread interface itself. This allows getting rid of a
hidden global accessor in the kernel code.
2019-03-15 23:58:31 -04:00
Lioncash
db47d7e471 kernel/thread: Expand documentation of nominal_priority and current_priority
Aims to disambiguate why each priority instance exists a little bit.
While we're at it, also add an explanatory comment to UpdatePriority().
2019-03-15 23:02:14 -04:00
Lioncash
e0d1f11968 kernel/thread: Make bracing consistent within UpdatePriority() 2019-03-15 23:02:10 -04:00
Lioncash
39483b92b7 kernel/thread: Amend condition within UpdatePriority()
This condition was checking against the nominal thread priority, whereas
the kernel itself checks against the current priority instead. We were
also assigning the nominal priority, when we should be assigning
current_priority, which takes priority inheritance into account.

This can lead to the incorrect priority being assigned to a thread.

Given we recursively update the relevant threads, we don't need to go
through the whole mutex waiter list. This matches what the kernel does
as well (only accessing the first entry within the waiting list).
2019-03-15 23:01:43 -04:00
Lioncash
0b78cfcc53 kernel/thread: Maintain priority ordering of added mutex waiting threads
The kernel keeps the internal waiting list ordered by priority. This is
trivial to do with std::find_if followed by an insertion.
2019-03-15 23:01:39 -04:00
bunnei
06ac6460d3
Merge pull request #2048 from FearlessTobi/port-3924
Port citra-emu/citra#3924: "citra_qt: Settings (configuration) rework"
2019-03-15 22:23:38 -04:00
liushuyu
59f16f2e02 frontend: qt: fix a freeze where if you click on entry in the game list too fast, citra will hang 2019-03-15 16:10:21 +01:00
bunnei
2eaf6c41a4 gpu: Use host address for caching instead of guest address. 2019-03-14 22:34:42 -04:00
bunnei
84d3cdf7d7
Merge pull request #2233 from ReinUsesLisp/morton-cleanup
video_core/morton: Miscellaneous changes
2019-03-14 21:23:12 -04:00
bunnei
6788ebffc8
Merge pull request #2229 from ReinUsesLisp/vk-sampler-cache
vk_sampler_cache: Implement a sampler cache
2019-03-14 21:22:34 -04:00
Lioncash
d71cad6ed0 core/hle/kernel/mutex: Remove usages of global system accessors
Removes the use of global system accessors, and instead uses the
explicit interface provided.
2019-03-14 20:55:52 -04:00
Lioncash
555cd26ec2 core/hle/kernel: Make Mutex a per-process class.
Makes it an instantiable class like it is in the actual kernel. This
will also allow removing reliance on global accessors in a following
change, now that we can encapsulate a reference to the system instance
in the class.
2019-03-14 20:55:52 -04:00
bunnei
2d9546848e
Merge pull request #2230 from lioncash/global
kernel/process: Remove use of global system accessors
2019-03-14 20:42:46 -04:00
bunnei
8bd17aa044
Merge pull request #2216 from ReinUsesLisp/rasterizer-system
gl_rasterizer: Use system instance passed from argument
2019-03-14 16:37:05 -04:00
bunnei
4e6c667586
Merge pull request #2227 from lioncash/override
renderer_opengl/gl_global_cache: Add missing override specifiers
2019-03-13 17:05:49 -04:00
ReinUsesLisp
ffe2e50458 video_core/morton: Use enum to describe MortonCopyPixels128 mode 2019-03-13 16:35:21 -03:00
ReinUsesLisp
6ed6129b4f video_core/morton: Remove unused parameter in MortonSwizzle 2019-03-13 16:35:10 -03:00
ReinUsesLisp
9030a8259f video_core/morton: Remove clang-format off when it's not needed 2019-03-13 16:16:45 -03:00
ReinUsesLisp
fdf76a25ab video_core/morton: Remove unused functions 2019-03-13 16:15:54 -03:00
bunnei
e7850a7f11
Merge pull request #2226 from lioncash/private
kernel/server_port: Make data members private
2019-03-13 14:44:21 -04:00
bunnei
c1ea6a39a0
Merge pull request #2223 from lioncash/error
core/hle/result: Tidy up the base error code result header.
2019-03-13 14:43:14 -04:00
bunnei
0a923b4ab3
Merge pull request #2187 from FearlessTobi/port-sdl-things
Port various Citra changes to input_common, including deadzone support
2019-03-13 11:46:57 -04:00
bunnei
e8a21f5276
Merge pull request #2166 from lioncash/vi-init-service
service/vi: Unstub GetDisplayService
2019-03-13 10:01:54 -04:00
ReinUsesLisp
a63295a872 video_core/texture: Fix up sampler lod bias 2019-03-13 00:45:54 -03:00
Mat M
a3734d7e31
vk_sampler_cache: Use operator== instead of memcmp
Co-Authored-By: ReinUsesLisp <reinuseslisp@airmail.cc>
2019-03-12 21:05:36 -03:00
ReinUsesLisp
aa59d77c3b vk_sampler_cache: Implement a sampler cache 2019-03-12 20:20:57 -03:00
Lioncash
6eddb60db0 kernel/process: Remove use of global system accessors
Now that we pass in a reference to the system instance, we can utilize
it to eliminate the global accessors in Process-related code.
2019-03-12 19:03:28 -04:00
bunnei
3bfd199497
Merge pull request #2211 from lioncash/arbiter
kernel: Make the address arbiter instance per-process
2019-03-12 17:54:48 -04:00
bunnei
0f6dd7b64e
Merge pull request #2222 from lioncash/cstr
service/service: Remove unncessary calls to c_str()
2019-03-12 17:54:20 -04:00
ReinUsesLisp
8ebeb9ade2 video_core/texture: Add a raw representation of TSCEntry 2019-03-12 16:56:29 -03:00
bunnei
2ad44a453f
Merge pull request #2215 from ReinUsesLisp/samplers
gl_rasterizer: Encapsulate sampler queries into methods
2019-03-12 13:10:53 -04:00
Lioncash
3350c0a779 renderer_opengl/gl_global_cache: Replace indexing for assignment with insert_or_assign
The previous code had some minor issues with it, really not a big deal,
but amending it is basically 'free', so I figured, "why not?".

With the standard container maps, when:

map[key] = thing;

is done, this can cause potentially undesirable behavior in certain
scenarios. In particular, if there's no value associated with the key,
then the map constructs a default initialized instance of the value
type.

In this case, since it's a std::shared_ptr (as a type alias) that is
the value type, this will construct a std::shared_pointer, and then
assign over it (with objects that are quite large, or actively heap
allocate this can be extremely undesirable).

We also make the function take the region by value, as we can avoid a
copy (and by extension with std::shared_ptr, a copy causes an atomic
reference count increment), in certain scenarios when ownership isn't a
concern (i.e. when ReserveGlobalRegion is called with an rvalue
reference, then no copy at all occurs). So, it's more-or-less a "free"
gain without many downsides.
2019-03-11 12:20:35 -04:00
Lioncash
1070c020db renderer_opengl/gl_global_cache: Append missing override specifiers
Two of the functions here are overridden functions, so we can append
these specifiers to make it explicit.
2019-03-11 12:02:30 -04:00
Lioncash
aa44eb639b kernel/server_port: Make data members private
With this, all kernel objects finally have all of their data members
behind an interface, making it nicer to reason about interactions with
other code (as external code no longer has the freedom to totally alter
internals and potentially messing up invariants).
2019-03-11 10:41:05 -04:00
Lioncash
7ad3d4e49c hwopus: Leverage multistream API for decoding regular Opus packets
After doing a little more reading up on the Opus codec, it turns out
that the multistream API that is part of libopus can handle regular
packets. Regular packets are just a degenerate case of multistream Opus
packets, and all that's necessary is to pass the number of streams as 1
and  provide a basic channel mapping, then everything works fine for
that case.

This allows us to get rid of the need to use both APIs in the future
when implementing multistream variants in a follow-up PR, greatly
simplifying the code that needs to be written.
2019-03-11 07:06:18 -04:00
ReinUsesLisp
a6c048920e gl_rasterizer: Use system instance passed from argument 2019-03-11 03:17:21 -03:00
Lioncash
0c28ab92e6 core/hle/result: Remove now-unnecessary manually defined copy assignment operator
Previously this was required, as BitField wasn't trivially copyable.
BitField has since been made trivially copyable, so now this isn't
required anymore.
2019-03-10 18:34:20 -04:00
Lioncash
3f602dde0f core/hle/result: Amend error in comment description for ResultCode
Gets rid of another holdover from Citra, and describes the OS on the
Switch instead.
2019-03-10 18:29:31 -04:00
Lioncash
f7ec0bcfc2 core/hle/result: Remove now-unused constructor for ResultCode
Now that the final stray ErrorDescription member was relocated, we can
finally remove it and its relevant constructor in the ResultCode union.
2019-03-10 18:26:12 -04:00
Lioncash
d870cc5ad7 core/hle/result: Relocate IPC error code to ipc_helpers
Relocates the error code to where it's most related, similar to how all
the other error codes are. Previously we were including a non-generic
error in the main result code header.
2019-03-10 18:23:42 -04:00
Lioncash
8603f0f9b1 service/service: Remove unncessary calls to c_str()
These can just be passed regularly, now that we use fmt instead of our
old logging system.

While we're at it, make the parameters to MakeFunctionString
std::string_views.
2019-03-10 18:00:57 -04:00
bunnei
0aa824b12f
Merge pull request #2207 from lioncash/hwopus
service/audio/hwopus: Move decoder state to its own class
2019-03-10 17:32:39 -04:00
bunnei
037d9bdde3
Merge pull request #2193 from lioncash/global
kernel/scheduler: Pass in system instance in constructor
2019-03-10 17:29:01 -04:00
bunnei
633ce92908
Merge pull request #2147 from ReinUsesLisp/texture-clean
shader_ir: Remove "extras" from the MetaTexture
2019-03-10 17:28:36 -04:00
bunnei
4a84921b31
Merge pull request #2143 from ReinUsesLisp/texview
gl_rasterizer_cache: Create texture views for array discrepancies
2019-03-10 17:27:49 -04:00
bunnei
add8b1df68
Merge pull request #2220 from lioncash/cubeb
audio_core/cubeb_sink: Convert _MSC_VER ifdefs to _WIN32
2019-03-10 17:26:20 -04:00
Mat M
0ea2771889
Merge pull request #2217 from ReinUsesLisp/rasterizer-logger
gl_rasterizer: Minor logger changes
2019-03-10 03:16:00 -04:00
Mat M
9ae680c639
Merge pull request #2219 from Hexagon12/log-settings
core/settings: Log more setting values
2019-03-10 03:15:01 -04:00
Lioncash
4a4e87e971 audio_core/cubeb_sink: Convert _MSC_VER ifdefs to _WIN32
This behavior also needs to be visible for MinGW builds as well.
2019-03-09 18:06:23 -05:00
Hexagon12
e6f652ae12 clang fix 2019-03-09 16:42:56 +02:00
Hexagon12
6ce8de4b5f Log 2 new setting values 2019-03-09 14:58:15 +02:00
ReinUsesLisp
a0be7b3b92 gl_rasterizer: Encapsulate sampler queries into methods 2019-03-09 04:35:57 -03:00
ReinUsesLisp
45ef421b6b yuzu_cmd/config: Replace C casts with static_cast 2019-03-09 03:59:23 -03:00
ReinUsesLisp
fedef7bda3 yuzu_cmd/config: Silent implicit cast warning 2019-03-09 03:58:20 -03:00
ReinUsesLisp
6ee0ba64c8 gl_rasterizer: Minor logger changes 2019-03-09 03:34:49 -03:00
bunnei
9909d40530
Merge pull request #2210 from lioncash/optional
kernel/hle_ipc: Convert std::shared_ptr IPC header instances to std::optional
2019-03-08 16:35:57 -05:00
bunnei
160fc63c72
Merge pull request #2209 from lioncash/reorder
video_core/gpu_thread: Silence a -Wreorder warning
2019-03-08 12:04:26 -05:00
bunnei
78c803b4f3
Merge pull request #2208 from lioncash/gpu
video_core/gpu: Make GPU's destructor virtual
2019-03-08 12:03:58 -05:00
bunnei
1143923cdd
Merge pull request #2191 from ReinUsesLisp/maxwell-to-vk
maxwell_to_vk: Initial implementation
2019-03-08 11:51:08 -05:00
ReinUsesLisp
e7ac5a6adf dma_pusher: Store command_list_header by copy
Instead of holding a reference that will get invalidated by
dma_pushbuffer.pop(), hold it as a copy. This doesn't have any
performance cost since CommandListHeader is 8 bytes long.
2019-03-08 04:06:54 -03:00
Lioncash
fbb82e61e3 kernel/hle_ipc: Convert std::shared_ptr IPC header instances to std::optional
There's no real need to use a shared lifetime here, since we don't
actually expose them to anything else. This is also kind of an
unnecessary use of the heap given the objects themselves are so small;
small enough, in fact that changing over to optionals actually reduces
the overall size of the HLERequestContext struct (818 bytes to 808
bytes).
2019-03-07 23:34:37 -05:00
Lioncash
8e510d5afa kernel: Make the address arbiter instance per-process
Now that we have the address arbiter extracted to its own class, we can
fix an innaccuracy with the kernel. Said inaccuracy being that there
isn't only one address arbiter. Each process instance contains its own
AddressArbiter instance in the actual kernel.

This fixes that and gets rid of another long-standing issue that could
arise when attempting to create more than one process.
2019-03-07 23:27:51 -05:00
Lioncash
b7f331afa3 kernel/svc: Move address arbiter signaling behind a unified API function
Similar to how WaitForAddress was isolated to its own function, we can
also move the necessary conditional checking into the address arbiter
class itself, allowing us to hide the implementation details of it from
public use.
2019-03-07 23:27:47 -05:00
Lioncash
0209de123b kernel/svc: Move address arbiter waiting behind a unified API function
Rather than let the service call itself work out which function is the
proper one to call, we can make that a behavior of the arbiter itself,
so we don't need to directly expose those implementation details.
2019-03-07 23:27:20 -05:00
bunnei
d26ee6e01e
Merge pull request #2195 from lioncash/shared-global
kernel/shared_memory: Get rid of the use of global accessor functions within Create()
2019-03-07 17:26:11 -05:00
Lioncash
e99a148628 common/bit_field: Make BitField trivially copyable
This makes the class much more flexible and doesn't make performing
copies with classes that contain a bitfield member a pain.

Given BitField instances are only intended to be used within unions, the
fact the full storage value would be copied isn't a big concern (only
sizeof(union_type) would be copied anyways).

While we're at it, provide defaulted move constructors for consistency.
2019-03-07 17:05:44 -05:00
Lioncash
c2d4c8b95e video_core/gpu_thread: Remove unimplemented WaitForIdle function prototype
This function didn't have a definition, so we can remove it to prevent
accidentally attempting to use it.
2019-03-07 16:08:52 -05:00
Lioncash
48a461a629 video_core/gpu_thread: Amend constructor initializer list order
Moves the data members to satisfy the order they're declared as in the
constructor initializer list.

Silences a -Wreorder warning.
2019-03-07 16:05:49 -05:00
Lioncash
24e2e601d5 video_core/gpu: Make GPU's destructor virtual
Because of the recent separation of GPU functionality into sync/async
variants, we need to mark the destructor virtual to provide proper
destruction behavior, given we use the base class within the System
class.

Prior to this, it was undefined behavior whether or not the destructor
in the derived classes would ever execute.
2019-03-07 15:59:45 -05:00
bunnei
3b63a46ca4
Merge pull request #2196 from DarkLordZach/web-applet-esc
web_browser: Add shortcut to Enter key to exit applet
2019-03-07 15:32:32 -05:00
bunnei
c63a0e88b7
Merge pull request #2202 from lioncash/port-priv
kernel/client_session, kernel/server_session: Make data members private
2019-03-07 15:31:26 -05:00
bunnei
1a4d733ec7
Merge pull request #2205 from FearlessTobi/docked-undocked-hotkey
yuzu: add a hotkey to switch between undocked and docked mode
2019-03-07 11:33:24 -05:00
zhupengfei
39e895c5ff citra_qt: Settings (configuration) rework 2019-03-07 16:55:50 +01:00
bunnei
d9e9e71aec
Merge pull request #2206 from lioncash/audio-stop
service/audio/audout_u: Only actually stop the audio stream in StopAudioOut if the stream is playing
2019-03-07 10:47:59 -05:00
bunnei
4f352833a5
Merge pull request #2055 from bunnei/gpu-thread
Asynchronous GPU command processing
2019-03-07 10:41:53 -05:00
Lioncash
d03ae881fd service/audio/hwopus: Move decoder state to its own class
Moves the non-multistream specific state to its own class. This will be
necessary to support the multistream variants of opus decoding.
2019-03-07 07:47:09 -05:00
Lioncash
960057cba0 service/audio/hwopus: Provide a name for the second word of OpusPacketHeader
This indicates the entropy coder's final range.
2019-03-07 05:48:35 -05:00
Lioncash
d41d85766f service/audio/hwopus: Move Opus packet header out of the IHardwareOpusDecoderManager
This will be utilized by more than just that class in the future. This
also renames it from OpusHeader to OpusPacketHeader to be more specific
about what kind of header it is.
2019-03-07 05:37:08 -05:00
Lioncash
3293877456 service/audio/hwopus: Enclose internals in an anonymous namespace
Makes it impossible to violate the ODR, as well as providing a place for
future changes.
2019-03-07 05:32:42 -05:00
Lioncash
64e7524f36 service/audio/audout_u: Only actually stop the audio stream in StopAudioOut if the stream is playing
The service itself only does further actions if the stream is playing.
If the stream is already stopped, then it just exits successfully.
2019-03-07 03:39:01 -05:00
bunnei
076c76f4e4
Merge pull request #2149 from ReinUsesLisp/decoders-style
gl_rasterizer_cache: Move format conversion functions to their own file
2019-03-06 21:56:20 -05:00
bunnei
ed0bdcc638
Merge pull request #2197 from lioncash/include
core/hle/ipc: Remove unnecessary includes
2019-03-06 21:55:16 -05:00
bunnei
84ad81ee67 gpu_thread: Fix deadlock with threading idle state check. 2019-03-06 21:48:57 -05:00
bunnei
63aa08acbe gpu_thread: (HACK) Ignore flush on FlushAndInvalidateRegion. 2019-03-06 21:48:57 -05:00
bunnei
3f1b4fb23a gpu: Always flush. 2019-03-06 21:48:57 -05:00
bunnei
aaa373585c gpu: Refactor a/synchronous implementations into their own classes. 2019-03-06 21:48:57 -05:00
bunnei
7b574f406b gpu: Move command processing to another thread. 2019-03-06 21:48:57 -05:00
bunnei
65651078e5 bootmanager: Ensure that we have a context for shader loading. 2019-03-06 21:48:56 -05:00