<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dolphin/Source/Core/VideoBackends/Software, branch 2409</title>
<subtitle>GameCube and Wii emulator</subtitle>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/'/>
<entry>
<title>VideoCommon: Use GetSpanForAddress safely in texture decoding</title>
<updated>2024-04-20T16:31:08+00:00</updated>
<author>
<name>JosJuice</name>
<email>josjuice@gmail.com</email>
</author>
<published>2024-04-13T16:29:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=3cfa233b63dfcd734be2dd0ae4bd0d3e98109df6'/>
<id>3cfa233b63dfcd734be2dd0ae4bd0d3e98109df6</id>
<content type='text'>
Now only VertexLoader remains... But that one might be tricky.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now only VertexLoader remains... But that one might be tricky.
</pre>
</div>
</content>
</entry>
<entry>
<title>Memmap: Replace GetPointer with GetSpanForAddress</title>
<updated>2024-04-20T16:31:08+00:00</updated>
<author>
<name>JosJuice</name>
<email>josjuice@gmail.com</email>
</author>
<published>2024-04-13T10:08:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=5c9bb80638ec05b32eaa129a8c763ac6bb3a5cb4'/>
<id>5c9bb80638ec05b32eaa129a8c763ac6bb3a5cb4</id>
<content type='text'>
To ensure memory safety, callers of GetPointer have to perform a bounds
check. But how is this bounds check supposed to be performed?
GetPointerForRange contained one implementation of a bounds check, but
it was cumbersome, and it also isn't obvious why it's correct.

To make doing the right thing easier, this commit changes GetPointer to
return a span that tells the caller how many bytes it's allowed to
access.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To ensure memory safety, callers of GetPointer have to perform a bounds
check. But how is this bounds check supposed to be performed?
GetPointerForRange contained one implementation of a bounds check, but
it was cumbersome, and it also isn't obvious why it's correct.

To make doing the right thing easier, this commit changes GetPointer to
return a span that tells the caller how many bytes it's allowed to
access.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix out of bounds accesses for invalid vertex component formats</title>
<updated>2024-04-04T19:50:34+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2024-04-02T04:37:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=a3951dc2d72ebb6f240d592fdbb348137130ce49'/>
<id>a3951dc2d72ebb6f240d592fdbb348137130ce49</id>
<content type='text'>
On all platforms, this would result in out of bounds accesses when getting the component sizes (which uses stuff from VertexLoader_Position.h/VertexLoader_TextCoord.h/VertexLoader_Normal.h). On platforms other than x64 and ARM64, this would also be out of bounds accesses when getting function pointers for the non-JIT vertex loader (in VertexLoader_Position.cpp etc.). Usually both of these would get data from other entries in the same multi-dimensional array, but the last few entries would be truly out of bounds. This does mean that an out of bounds function pointer can be called on platforms that don't have a JIT vertex loader, but it is limited to invalid component formats with values 5/6/7 due to the size of the bitfield the formats come from, so it seems unlikely that this could be exploited in practice.

This issue affects a few games; Def Jam: Fight for New York (https://bugs.dolphin-emu.org/issues/12719) and Fifa Street are known to be affected.

I have not done any hardware testing for this PR specifically, though I *think* I previously determined that at least a value of 5 behaves the same as float (4). That's what I implemented in any case. I did previously determine that both Def Jam: Fight for New York and Fifa Street use an invalid normal format, but don't actually have lighting enabled when that normal vector is used, so it doesn't change rendering in practice.

The color component format also has two invalid values, but VertexLoader_Color.h/.cpp do check for those invalid ones and return a default value instead of doing an out of bounds access.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On all platforms, this would result in out of bounds accesses when getting the component sizes (which uses stuff from VertexLoader_Position.h/VertexLoader_TextCoord.h/VertexLoader_Normal.h). On platforms other than x64 and ARM64, this would also be out of bounds accesses when getting function pointers for the non-JIT vertex loader (in VertexLoader_Position.cpp etc.). Usually both of these would get data from other entries in the same multi-dimensional array, but the last few entries would be truly out of bounds. This does mean that an out of bounds function pointer can be called on platforms that don't have a JIT vertex loader, but it is limited to invalid component formats with values 5/6/7 due to the size of the bitfield the formats come from, so it seems unlikely that this could be exploited in practice.

This issue affects a few games; Def Jam: Fight for New York (https://bugs.dolphin-emu.org/issues/12719) and Fifa Street are known to be affected.

I have not done any hardware testing for this PR specifically, though I *think* I previously determined that at least a value of 5 behaves the same as float (4). That's what I implemented in any case. I did previously determine that both Def Jam: Fight for New York and Fifa Street use an invalid normal format, but don't actually have lighting enabled when that normal vector is used, so it doesn't change rendering in practice.

The color component format also has two invalid values, but VertexLoader_Color.h/.cpp do check for those invalid ones and return a default value instead of doing an out of bounds access.
</pre>
</div>
</content>
</entry>
<entry>
<title>Software/SWGfx: Default destructor in cpp file</title>
<updated>2023-12-13T01:33:43+00:00</updated>
<author>
<name>Lioncash</name>
<email>mai.iam2048@gmail.com</email>
</author>
<published>2023-12-13T01:33:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=e06480a8ab61e67813fb698a162aabc867a20d78'/>
<id>e06480a8ab61e67813fb698a162aabc867a20d78</id>
<content type='text'>
Fixes a build failure with clang 17.

The destructor needs to be in the cpp file, since we have a forward
declared std::unique_ptr type as part of the class. So technically the
default inline destructor could invoke without seeing the full data type
definition.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes a build failure with clang 17.

The destructor needs to be in the cpp file, since we have a forward
declared std::unique_ptr type as part of the class. So technically the
default inline destructor could invoke without seeing the full data type
definition.
</pre>
</div>
</content>
</entry>
<entry>
<title>VideoCommon: Use std::span for BoundingBox::Write()</title>
<updated>2023-12-09T21:33:21+00:00</updated>
<author>
<name>Lioncash</name>
<email>mai.iam2048@gmail.com</email>
</author>
<published>2023-12-09T19:54:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=5f6c76af51bd41508c38c153bd471f9a6e7ee663'/>
<id>5f6c76af51bd41508c38c153bd471f9a6e7ee663</id>
<content type='text'>
Crosses off a lingering TODO.

Also amends a few nearby cases where a u32 cast was being repromoted to
size_t.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Crosses off a lingering TODO.

Also amends a few nearby cases where a u32 cast was being repromoted to
size_t.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix out of bound write in EfbCopy::ClearEfb</title>
<updated>2023-12-09T01:15:42+00:00</updated>
<author>
<name>timetravelthree</name>
<email>dantexor@protonmail.com</email>
</author>
<published>2023-12-08T18:51:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=3b8737d2d7172ae62ae9135e4c9942dde1f47d13'/>
<id>3b8737d2d7172ae62ae9135e4c9942dde1f47d13</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename bpmem.copyMipMapStrideChannels to bpmem.copyDestStride</title>
<updated>2023-11-12T07:32:14+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2023-10-30T00:54:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=6bad17b1706940afd616cfc07f3b8c3997bbb515'/>
<id>6bad17b1706940afd616cfc07f3b8c3997bbb515</id>
<content type='text'>
As far as I can tell, it has nothing to do with the mipmap/half_scale functionality, but does change based on the width of the destination texture (and the destination texture is half the width if half_scale is set). The comment that was there (which dates back to the initial megacommit) seems to not have accounted for the width aspect; it was first used as an actual stride in bbbe898839467c312c31456334540c20fedc7be3 (the first commit that used it at all).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As far as I can tell, it has nothing to do with the mipmap/half_scale functionality, but does change based on the width of the destination texture (and the destination texture is half the width if half_scale is set). The comment that was there (which dates back to the initial megacommit) seems to not have accounted for the width aspect; it was first used as an actual stride in bbbe898839467c312c31456334540c20fedc7be3 (the first commit that used it at all).
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #11699 from Pokechu22/gl-check-maximum-samples</title>
<updated>2023-06-09T13:07:07+00:00</updated>
<author>
<name>Admiral H. Curtiss</name>
<email>pikachu025@gmail.com</email>
</author>
<published>2023-06-09T13:07:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=8f51a9d2d8a88993167cd1c3b8d447bee1ca6407'/>
<id>8f51a9d2d8a88993167cd1c3b8d447bee1ca6407</id>
<content type='text'>
OpenGL: Check the list of supported AA modes instead of hardcoding</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
OpenGL: Check the list of supported AA modes instead of hardcoding</pre>
</div>
</content>
</entry>
<entry>
<title>VideoCommon: Pass WindowSystemInfo to InitBackendInfo</title>
<updated>2023-06-09T05:07:39+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2023-03-26T00:16:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=c63f0f37cd84d627dd40ace3205c689efc068ac0'/>
<id>c63f0f37cd84d627dd40ace3205c689efc068ac0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>VideoBackends: add support to allow rendering to multiple output textures</title>
<updated>2023-06-03T19:52:31+00:00</updated>
<author>
<name>iwubcode</name>
<email>iwubcode@users.noreply.github.com</email>
</author>
<published>2023-05-29T01:59:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=834f8f7b5cb9b5d9e437c7a3935bfdcc236c422a'/>
<id>834f8f7b5cb9b5d9e437c7a3935bfdcc236c422a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
