<feed xmlns='http://www.w3.org/2005/Atom'>
<title>yuzu/src/video_core/rasterizer_accelerated.cpp, branch main</title>
<subtitle>Nintendo Switch emulator</subtitle>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/'/>
<entry>
<title>SMMU: Initial adaptation to video_core.</title>
<updated>2024-01-19T02:12:30+00:00</updated>
<author>
<name>Fernando Sahmkow</name>
<email>fsahmkow27@gmail.com</email>
</author>
<published>2023-12-25T06:32:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=0a2536a0df1f4aea406f2132d3edda0430acc9d1'/>
<id>0a2536a0df1f4aea406f2132d3edda0430acc9d1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "video_core: use interval map for page count tracking"</title>
<updated>2023-12-17T23:59:49+00:00</updated>
<author>
<name>liamwhite</name>
<email>liamwhite@users.noreply.github.com</email>
</author>
<published>2023-12-17T23:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=65e646eeba53fe1067b7d69044ddabaee18d868f'/>
<id>65e646eeba53fe1067b7d69044ddabaee18d868f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>video_core: lock interval map update</title>
<updated>2023-12-15T03:10:21+00:00</updated>
<author>
<name>Liam</name>
<email>byteslice@airmail.cc</email>
</author>
<published>2023-12-15T02:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=2a3f84aaf28cb526121e016a9e6699fce7223407'/>
<id>2a3f84aaf28cb526121e016a9e6699fce7223407</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>video_core: use interval map for page count tracking</title>
<updated>2023-12-15T02:54:36+00:00</updated>
<author>
<name>Liam</name>
<email>byteslice@airmail.cc</email>
</author>
<published>2023-12-12T22:15:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=030e6b3980aa5ce6069041c339d49d21d68ca73b'/>
<id>030e6b3980aa5ce6069041c339d49d21d68ca73b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixes and workarounds to make UBSan happier on macOS</title>
<updated>2023-07-15T19:00:28+00:00</updated>
<author>
<name>comex</name>
<email>comexk@gmail.com</email>
</author>
<published>2023-07-01T22:00:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=d7c532d8894ce806c9af13b8dd3eec975642b348'/>
<id>d7c532d8894ce806c9af13b8dd3eec975642b348</id>
<content type='text'>
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-&gt;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-&gt;Destroy()`, which
  overwrites the beginning of the object with junk (specifically a free
  list pointer).  Then it calls `this-&gt;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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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-&gt;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-&gt;Destroy()`, which
  overwrites the beginning of the object with junk (specifically a free
  list pointer).  Then it calls `this-&gt;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.
</pre>
</div>
</content>
</entry>
<entry>
<title>code: dodge PAGE_SIZE #define</title>
<updated>2022-08-19T23:08:40+00:00</updated>
<author>
<name>Kyle Kienapfel</name>
<email>Docteh@users.noreply.github.com</email>
</author>
<published>2022-08-18T23:28:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=14e9de6678dab47625826006f001d5e94dfb2716'/>
<id>14e9de6678dab47625826006f001d5e94dfb2716</id>
<content type='text'>
Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number
This is great except in yuzu we're using PAGE_SIZE as a variable

Specific example
`static constexpr u64 PAGE_SIZE = u64(1) &lt;&lt; PAGE_BITS;`

PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables.
Simply deleted the underscores, and then added YUZU_ prefix

Might be worth noting that there are multiple uses in different classes/namespaces
This list may not be exhaustive

Core::Memory   12 bits (4096)
QueryCacheBase 12 bits
ShaderCache    14 bits (16384)
TextureCache   20 bits (1048576, or 1MB)

Fixes #8779
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number
This is great except in yuzu we're using PAGE_SIZE as a variable

Specific example
`static constexpr u64 PAGE_SIZE = u64(1) &lt;&lt; PAGE_BITS;`

PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables.
Simply deleted the underscores, and then added YUZU_ prefix

Might be worth noting that there are multiple uses in different classes/namespaces
This list may not be exhaustive

Core::Memory   12 bits (4096)
QueryCacheBase 12 bits
ShaderCache    14 bits (16384)
TextureCache   20 bits (1048576, or 1MB)

Fixes #8779
</pre>
</div>
</content>
</entry>
<entry>
<title>general: Convert source file copyright comments over to SPDX</title>
<updated>2022-04-23T09:55:32+00:00</updated>
<author>
<name>Morph</name>
<email>39850852+Morph1984@users.noreply.github.com</email>
</author>
<published>2022-04-23T08:59:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=99ceb03a1cfcf35968cab589ea188a8c406cda52'/>
<id>99ceb03a1cfcf35968cab589ea188a8c406cda52</id>
<content type='text'>
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
</pre>
</div>
</content>
</entry>
<entry>
<title>rasterizer: Update pages in batches</title>
<updated>2021-06-11T15:27:17+00:00</updated>
<author>
<name>ReinUsesLisp</name>
<email>reinuseslisp@airmail.cc</email>
</author>
<published>2021-06-06T23:58:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=7b0d8bd1fbfd7d8fe4d939cb3b8649a29f61655c'/>
<id>7b0d8bd1fbfd7d8fe4d939cb3b8649a29f61655c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>video_core: rasterizer_cache: Use u16 for cached page count.</title>
<updated>2021-05-27T21:47:24+00:00</updated>
<author>
<name>bunnei</name>
<email>bunneidev@gmail.com</email>
</author>
<published>2021-05-27T21:47:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=4b95b0df973027f4682549b0bd27bf9e05d8155f'/>
<id>4b95b0df973027f4682549b0bd27bf9e05d8155f</id>
<content type='text'>
- Greatly reduces the risk of overflow, at the cost of doubling the size of this array.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Greatly reduces the risk of overflow, at the cost of doubling the size of this array.
</pre>
</div>
</content>
</entry>
<entry>
<title>video_core: rasterizer_accelerated: Fix un/signed mismatch.</title>
<updated>2021-03-13T05:52:49+00:00</updated>
<author>
<name>bunnei</name>
<email>bunneidev@gmail.com</email>
</author>
<published>2021-03-13T05:52:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/yuzu/commit/?id=a9d24b0df36b7e3bb5e8f5e71f3b6a9a2485f44b'/>
<id>a9d24b0df36b7e3bb5e8f5e71f3b6a9a2485f44b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
