<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dolphin/Source/Core/VideoCommon/VertexLoader_Position.cpp, branch master</title>
<subtitle>GameCube and Wii emulator</subtitle>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/'/>
<entry>
<title>Replace some [[maybe_unused]] annotations with commented names</title>
<updated>2026-05-04T00:09:59+00:00</updated>
<author>
<name>Dentomologist</name>
<email>dentomologist@gmail.com</email>
</author>
<published>2026-05-04T00:09:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=34646cb9a90eb0ef7fa489f76753184359e7aa15'/>
<id>34646cb9a90eb0ef7fa489f76753184359e7aa15</id>
<content type='text'>
Remove the [[maybe_unused]] annotation from various parameters that are
unconditionally unused and comment out their names instead. This makes
it unambiguous that the variables are unused, while making the remaining
[[maybe_unused]] annotations more reliable indicators that those
variables are in fact used in some contexts.

These parameters are mostly in overridden functions where the override
doesn't need that particular variable.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove the [[maybe_unused]] annotation from various parameters that are
unconditionally unused and comment out their names instead. This makes
it unambiguous that the variables are unused, while making the remaining
[[maybe_unused]] annotations more reliable indicators that those
variables are in fact used in some contexts.

These parameters are mostly in overridden functions where the override
doesn't need that particular variable.
</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>VertexLoader: Don't write position_cache if vertex is skipped</title>
<updated>2023-01-13T23:38:00+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2023-01-13T00:35:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=3910bdd68b227bbf62c9822d173879e4dee3ccb3'/>
<id>3910bdd68b227bbf62c9822d173879e4dee3ccb3</id>
<content type='text'>
This is the behavior in the x64 and ARM64 vertex loaders. I don't know if it makes sense (the whole skipped vertex system seems jank, but several games behave incorrectly without it).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the behavior in the x64 and ARM64 vertex loaders. I don't know if it makes sense (the whole skipped vertex system seems jank, but several games behave incorrectly without it).
</pre>
</div>
</content>
</entry>
<entry>
<title>VertexLoader: Eliminate use of DataReader</title>
<updated>2022-11-23T01:17:11+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2022-11-23T00:54:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=0bcd3c79bb4bbd90fb1f8d02adb26198690709fb'/>
<id>0bcd3c79bb4bbd90fb1f8d02adb26198690709fb</id>
<content type='text'>
DataReader is generally jank - it has a start and end pointer, but the end pointer is generally not used, and all of the vertex loaders mostly bypassed it anyways.

Wrapper code (the vertex loaer test, as well as Fifo.cpp and OpcodeDecoding.cpp) still uses it, as does the software vertex loader (which is not a subclass of VertexLoader). These can probably be eliminated later.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
DataReader is generally jank - it has a start and end pointer, but the end pointer is generally not used, and all of the vertex loaders mostly bypassed it anyways.

Wrapper code (the vertex loaer test, as well as Fifo.cpp and OpcodeDecoding.cpp) still uses it, as does the software vertex loader (which is not a subclass of VertexLoader). These can probably be eliminated later.
</pre>
</div>
</content>
</entry>
<entry>
<title>VertexLoader: Remove "too many initializer values" workaround functions</title>
<updated>2022-10-25T22:29:09+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2022-10-11T22:41:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=581a575042c76f6b88509f6b57d14ae6d10081c4'/>
<id>581a575042c76f6b88509f6b57d14ae6d10081c4</id>
<content type='text'>
I originally added these in 2b1d1038a6acf0acf75b03ca93c85de6fe6cdf18, for both the TPipelineFunction and the size. The size was moved into the header in fdcd2b7d009cece6ad090143ce954aed713bb11c (making the size functions obsolete), but it seems that the functions themselves are no longer needed now.

I think I didn't use this approach before because it would have required ComponentFormatTable and ComponentCountRow to be templated, which would end up resulting in lines that were too long and thus wrapped in awkward places. (I *think* they didn't get inferred properly.) Now that we only need TPipelineFunction, the templating is not needed, and this ends up being a more readable version of the version with the wrapper functions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I originally added these in 2b1d1038a6acf0acf75b03ca93c85de6fe6cdf18, for both the TPipelineFunction and the size. The size was moved into the header in fdcd2b7d009cece6ad090143ce954aed713bb11c (making the size functions obsolete), but it seems that the functions themselves are no longer needed now.

I think I didn't use this approach before because it would have required ComponentFormatTable and ComponentCountRow to be templated, which would end up resulting in lines that were too long and thus wrapped in awkward places. (I *think* they didn't get inferred properly.) Now that we only need TPipelineFunction, the templating is not needed, and this ends up being a more readable version of the version with the wrapper functions.
</pre>
</div>
</content>
</entry>
<entry>
<title>VertexLoader: Inline GetSize</title>
<updated>2022-09-15T10:50:15+00:00</updated>
<author>
<name>Robin Kertels</name>
<email>robin.kertels@gmail.com</email>
</author>
<published>2022-09-14T21:58:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=fdcd2b7d009cece6ad090143ce954aed713bb11c'/>
<id>fdcd2b7d009cece6ad090143ce954aed713bb11c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>VertexLoader: Convert count register to remaining register</title>
<updated>2022-04-22T23:54:38+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2022-04-14T19:01:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=39b2854b981aadec1576254ad5e4d91dc21c9709'/>
<id>39b2854b981aadec1576254ad5e4d91dc21c9709</id>
<content type='text'>
This more accurately represents what's going on, and also ends at 0 instead of 1, making some indexing operations easier.  This also changes it so that position_matrix_index_cache actually starts from index 0 instead of index 1.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This more accurately represents what's going on, and also ends at 0 instead of 1, making some indexing operations easier.  This also changes it so that position_matrix_index_cache actually starts from index 0 instead of index 1.
</pre>
</div>
</content>
</entry>
<entry>
<title>Create and use CPArray enum class</title>
<updated>2021-12-18T20:51:56+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2021-06-20T20:47:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=1914087998bc296208355dc4b1b2553430b081b2'/>
<id>1914087998bc296208355dc4b1b2553430b081b2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>VertexLoader: Convert to EnumMap</title>
<updated>2021-12-18T20:51:55+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2021-04-25T23:04:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=2b1d1038a6acf0acf75b03ca93c85de6fe6cdf18'/>
<id>2b1d1038a6acf0acf75b03ca93c85de6fe6cdf18</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>treewide: convert GPLv2+ license info to SPDX tags</title>
<updated>2021-07-05T02:35:56+00:00</updated>
<author>
<name>Pierre Bourdon</name>
<email>delroth@gmail.com</email>
</author>
<published>2021-07-05T01:22:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=e149ad4f0a9874f354221a7fc76d8f1841e47808'/>
<id>e149ad4f0a9874f354221a7fc76d8f1841e47808</id>
<content type='text'>
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
</pre>
</div>
</content>
</entry>
</feed>
