suyu/src/video_core
comex d7c532d889 Fixes and workarounds to make UBSan happier on macOS
There are still some other issues not addressed here, but it's a start.

Workarounds for false-positive reports:

- `RasterizerAccelerated`: Put a gigantic array behind a `unique_ptr`,
  because UBSan has a [hardcoded limit](https://stackoverflow.com/questions/64531383/c-runtime-error-using-fsanitize-undefined-object-has-a-possibly-invalid-vp)
  of how big it thinks objects can be, specifically when dealing with
  offset-to-top values used with multiple inheritance.  Hopefully this
  doesn't have a performance impact.

- `QueryCacheBase::QueryCacheBase`: Avoid an operation that UBSan thinks
  is UB even though it at least arguably isn't.  See the link in the
  comment for more information.

Fixes for correct reports:

- `PageTable`, `Memory`: Use `uintptr_t` values instead of pointers to
  avoid UB from pointer overflow (when pointer arithmetic wraps around
  the address space).

- `KScheduler::Reload`: `thread->GetOwnerProcess()` can be `nullptr`;
  avoid calling methods on it in this case.  (The existing code returns
  a garbage reference to a field, which is then passed into
  `LoadWatchpointArray`, and apparently it's never used, so it's
  harmless in practice but still triggers UBSan.)

- `KAutoObject::Close`: This function calls `this->Destroy()`, which
  overwrites the beginning of the object with junk (specifically a free
  list pointer).  Then it calls `this->UnregisterWithKernel()`.  UBSan
  complains about a type mismatch because the vtable has been
  overwritten, and I believe this is indeed UB.  `UnregisterWithKernel`
  also loads `m_kernel` from the 'freed' object, which seems to be
  technically safe (the overwriting doesn't extend as far as that
  field), but seems dubious.  Switch to a `static` method and load
  `m_kernel` in advance.
2023-07-15 12:00:28 -07:00
..
buffer_cache Use spans over guest memory where possible instead of copying data. 2023-07-02 23:09:48 +01:00
control general: fix spelling mistakes 2023-03-12 11:33:01 -04:00
engines Use spans over guest memory where possible instead of copying data. 2023-07-02 23:09:48 +01:00
host1x general: Use ScratchBuffer where possible 2023-06-30 21:49:59 -04:00
host_shaders OpenGL: Add Local Memory warmup shader 2023-06-25 18:43:23 -04:00
macro video_core/macro: Make use of Common::HashValue 2023-03-25 23:52:26 -04:00
renderer_null Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU 2023-06-28 21:32:45 +02:00
renderer_opengl Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU 2023-06-28 21:32:45 +02:00
renderer_vulkan Merge pull request #10479 from GPUCode/format-list 2023-07-02 17:38:21 -04:00
texture_cache Merge pull request #10996 from Kelebek1/readblock_optimisation 2023-07-10 18:54:19 -07:00
textures video_core: Add BCn decoding support 2023-06-27 18:00:09 -07:00
vulkan_common Merge pull request #10994 from liamwhite/ue4-preferred 2023-07-05 09:23:56 -04:00
cache_types.h RasterizerMemory: Add filtering for flushing/invalidation operations. 2023-01-01 16:43:58 -05:00
cdma_pusher.cpp NVDRV: Refactor Host1x 2022-10-06 21:00:52 +02:00
cdma_pusher.h Remove memory allocations in some hot paths 2023-06-22 08:05:10 +01:00
CMakeLists.txt video_core: Add BCn decoding support 2023-06-27 18:00:09 -07:00
compatible_formats.cpp renderer_vulkan: Fix some missing view formats 2023-07-01 16:03:35 +03:00
compatible_formats.h general: Convert source file copyright comments over to SPDX 2022-04-23 05:55:32 -04:00
delayed_destruction_ring.h general: Convert source file copyright comments over to SPDX 2022-04-23 05:55:32 -04:00
dirty_flags.cpp Fix stencil func registers, make clip control equivalent to how it was before, but surely wrong. 2022-10-10 20:59:57 +01:00
dirty_flags.h general: Convert source file copyright comments over to SPDX 2022-04-23 05:55:32 -04:00
dma_pusher.cpp Use spans over guest memory where possible instead of copying data. 2023-07-02 23:09:48 +01:00
dma_pusher.h Remove memory allocations in some hot paths 2023-06-22 08:05:10 +01:00
fence_manager.h Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU 2023-06-28 21:32:45 +02:00
framebuffer_config.h nvnflinger: fix name 2023-03-01 10:39:49 -05:00
fsr.cpp video_core/opengl: Add FSR upscaling filter to the OpenGL renderer 2023-01-26 21:43:33 +01:00
fsr.h video_core/opengl: Add FSR upscaling filter to the OpenGL renderer 2023-01-26 21:43:33 +01:00
gpu.cpp Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU 2023-06-28 21:32:45 +02:00
gpu.h Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU 2023-06-28 21:32:45 +02:00
gpu_thread.cpp Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU 2023-06-28 21:32:45 +02:00
gpu_thread.h gpu_thread: Use bounded queue 2023-03-03 18:20:56 -07:00
invalidation_accumulator.h BufferBase: Don't ignore GPU pages. 2023-01-05 14:00:10 -05:00
memory_manager.cpp Use spans over guest memory where possible instead of copying data. 2023-07-02 23:09:48 +01:00
memory_manager.h Use spans over guest memory where possible instead of copying data. 2023-07-02 23:09:48 +01:00
precompiled_headers.h CMake: Consolidate common PCH headers 2022-11-30 18:30:30 -05:00
pte_kind.h video_core: Implement memory manager page kind 2022-10-17 15:33:29 +08:00
query_cache.h Fixes and workarounds to make UBSan happier on macOS 2023-07-15 12:00:28 -07:00
rasterizer_accelerated.cpp Fixes and workarounds to make UBSan happier on macOS 2023-07-15 12:00:28 -07:00
rasterizer_accelerated.h Fixes and workarounds to make UBSan happier on macOS 2023-07-15 12:00:28 -07:00
rasterizer_download_area.h Address feedback, add CR notice, etc 2023-05-07 23:46:12 +02:00
rasterizer_interface.h Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU 2023-06-28 21:32:45 +02:00
renderer_base.cpp core: frontend: Refactor GraphicsContext to its own module. 2023-06-03 00:05:31 -07:00
renderer_base.h android: renderer_vulkan: Fix crash with surface recreation. 2023-06-03 00:06:07 -07:00
shader_cache.cpp Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU 2023-06-28 21:32:45 +02:00
shader_cache.h Memory Tracking: Optimize tracking to only use atomic writes when contested with the host GPU 2023-06-28 21:32:45 +02:00
shader_environment.cpp Fix code resize to use word size rather than byte size 2023-05-02 23:52:21 +01:00
shader_environment.h Fix code resize to use word size rather than byte size 2023-05-02 23:52:21 +01:00
shader_notify.cpp general: Convert source file copyright comments over to SPDX 2022-04-23 05:55:32 -04:00
shader_notify.h general: Convert source file copyright comments over to SPDX 2022-04-23 05:55:32 -04:00
smaa_area_tex.h video_core: Integrate SMAA 2022-12-08 17:17:45 -05:00
smaa_search_tex.h video_core: Integrate SMAA 2022-12-08 17:17:45 -05:00
surface.cpp video_core: Add BCn decoding support 2023-06-27 18:00:09 -07:00
surface.h video_core: Add BCn decoding support 2023-06-27 18:00:09 -07:00
transform_feedback.cpp Remove memory allocations in some hot paths 2023-06-22 08:05:10 +01:00
transform_feedback.h Remove memory allocations in some hot paths 2023-06-22 08:05:10 +01:00
video_core.cpp memory: rename global memory references to application memory 2023-03-23 20:28:47 -04:00
video_core.h chore: make yuzu REUSE compliant 2022-07-27 12:53:49 +02:00