<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dolphin/Source/Core/VideoCommon/VertexLoaderARM64.cpp, branch master</title>
<subtitle>GameCube and Wii emulator</subtitle>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/'/>
<entry>
<title>Cache normals in addition to binormals and tangents</title>
<updated>2024-10-12T17:32:41+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2024-09-25T06:46:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=937bb2aa2e12b635ba328af8de7c9a5d5963d084'/>
<id>937bb2aa2e12b635ba328af8de7c9a5d5963d084</id>
<content type='text'>
Fixes LIT (https://bugs.dolphin-emu.org/issues/13635). The text does not include normals, but has lighting enabled. With the previous default of (0, 0, 0), lighting was always black (as dot(X, (0, 0, 0)) is always 0). It seems like the normal from the map in the background (0, 0, 1) is re-used.

LIT also has the vertex color enabled while vertex color is not specified, the same as SMS's debug cubes; the default MissingColorValue GameINI value of solid white seems to work correctly in this case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes LIT (https://bugs.dolphin-emu.org/issues/13635). The text does not include normals, but has lighting enabled. With the previous default of (0, 0, 0), lighting was always black (as dot(X, (0, 0, 0)) is always 0). It seems like the normal from the map in the background (0, 0, 1) is re-used.

LIT also has the vertex color enabled while vertex color is not specified, the same as SMS's debug cubes; the default MissingColorValue GameINI value of solid white seems to work correctly in this case.
</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>JitArm64: Use enum class for LogicalImm size parameter</title>
<updated>2023-12-16T15:48:26+00:00</updated>
<author>
<name>JosJuice</name>
<email>josjuice@gmail.com</email>
</author>
<published>2023-12-16T12:27:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=e0eb4ef5bcc3dff262ddf594810c5743e5f2ea73'/>
<id>e0eb4ef5bcc3dff262ddf594810c5743e5f2ea73</id>
<content type='text'>
This should prevent issues like the one fixed in the previous commit
from happening again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This should prevent issues like the one fixed in the previous commit
from happening again.
</pre>
</div>
</content>
</entry>
<entry>
<title>Jit64: Recompile asm routines on cache clear</title>
<updated>2023-10-31T18:43:49+00:00</updated>
<author>
<name>JosJuice</name>
<email>josjuice@gmail.com</email>
</author>
<published>2023-09-30T15:32:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=899d61bc7dd093393aafcd88c4f072ff879228a7'/>
<id>899d61bc7dd093393aafcd88c4f072ff879228a7</id>
<content type='text'>
This is needed so that the checks added in the previous commit will be
reevaluated if the value of m_enable_dcache changes.

JitArm64 was already recompiling its asm routines on cache clear by
necessity. It doesn't have the same setup as Jit64 where the asm
routines are in a separate region, so clearing the JitArm64 cache
results in the asm routines being cleared too.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is needed so that the checks added in the previous commit will be
reevaluated if the value of m_enable_dcache changes.

JitArm64 was already recompiling its asm routines on cache clear by
necessity. It doesn't have the same setup as Jit64 where the asm
routines are in a separate region, so clearing the JitArm64 cache
results in the asm routines being cleared too.
</pre>
</div>
</content>
</entry>
<entry>
<title>VertexLoader: Add more info to m_vertex_size == m_src_ofs assertion</title>
<updated>2023-02-13T04:10:38+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2023-02-13T03:47:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=cc411c4e415025d7bfe5c5be41b914850d39f2a1'/>
<id>cc411c4e415025d7bfe5c5be41b914850d39f2a1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>VertexLoaderARM64: Fix direct normal+tangent+binormal with index3 set</title>
<updated>2022-09-19T06:33:24+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2022-07-05T02:20:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=d80201a57f6433bf660be2a1aecd60b97ddb6599'/>
<id>d80201a57f6433bf660be2a1aecd60b97ddb6599</id>
<content type='text'>
Fixes https://bugs.dolphin-emu.org/issues/12952
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes https://bugs.dolphin-emu.org/issues/12952
</pre>
</div>
</content>
</entry>
<entry>
<title>VertexLoaderARM64: Specify the register to use as a parameter to ReadVertex</title>
<updated>2022-09-19T06:33:24+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2022-07-15T20:22:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=f148de161f3126d2b328d5c022acb04379f1da1f'/>
<id>f148de161f3126d2b328d5c022acb04379f1da1f</id>
<content type='text'>
This also means that both a register and a vertex are always specified, though right now if the register is scratch1_reg the offset is always 0.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This also means that both a register and a vertex are always specified, though right now if the register is scratch1_reg the offset is always 0.
</pre>
</div>
</content>
</entry>
<entry>
<title>VertexLoaderARM64: Merge GetAddressImm into GetVertexAddr</title>
<updated>2022-09-19T06:33:24+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2022-07-15T20:02:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=ad644d5e92a45aa2313f382374a5b6dcfe61abf8'/>
<id>ad644d5e92a45aa2313f382374a5b6dcfe61abf8</id>
<content type='text'>
This way it more closely matches VertexLoaderX64, and is in general easier to understand.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This way it more closely matches VertexLoaderX64, and is in general easier to understand.
</pre>
</div>
</content>
</entry>
<entry>
<title>VertexLoaderARM64: Always use unscaled load/store instructions</title>
<updated>2022-09-19T06:33:24+00:00</updated>
<author>
<name>Pokechu22</name>
<email>Pokechu022@gmail.com</email>
</author>
<published>2022-07-15T03:02:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dog6.net/dolphin/commit/?id=9a290c3d501acaf3eb4c3dceafec821d5a644fad'/>
<id>9a290c3d501acaf3eb4c3dceafec821d5a644fad</id>
<content type='text'>
The source and destination offsets will always be less than 255, so we can get rid of a lot of the complexity by doing this.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The source and destination offsets will always be less than 255, so we can get rid of a lot of the complexity by doing this.
</pre>
</div>
</content>
</entry>
</feed>
