You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is worth a significant amount of (CPU) perf whenever we have a Lib_Texture_Scroll or Lib_Texture_Mottle call, because libultraship has to regenerate the texture cache after it is invalidated.
For Lib_Texture_Scroll, I believe invalidating the texture argument is probably correct. Easiest to check at the beginning of the Corneria level, look for the clouds in the Arwing cockpit canopy (clouds should scroll by on the canopy).
For Lib_Texture_Mottle this is not clear, invalidating the dst argument is normally correct, but sometimes this is not a texture uploaded to the RDP, eg. in fox_hud.c : HUD_Texture_Warp. This causes the invalidate to fail with resource not loaded; if that error is ignored, the invalidate fails and causes the texture not to be invalidated, generating graphical errors because the texture is updated on the CPU (Starship) side but not on the GPU (RDP/libultraship) side.
It also turns out that the 64x64 Venom cloud texture is actually uploaded to the RDP as two 64x32 textures, and adding an implied invalidation to Lib_Texture_Mottle only invalidates one of those, despite operating on a 64x64 texture. It is not simple to find all cases where:
a texture is mottled, and
the same texture is split and uploaded separately to the RDP
...so I have added an explicit texture cache invalidate for the second (half of the) texture as a workaround. But perhaps a more elegant solution has the code track texture sizes, and implicitly do all necessary invalidations based on the texture size regardless of how it's uploaded to the RDP. This depends on how closely Starship wants to stay to the decompilation.
I have no PR currently, because I don't have a good way to verify that I'm not breaking anything:
In the code, Lib_Texture_Mottle is used for Corneria, Aquas, Zoness* (water texture), Solar, System Map* (Venom). For the ones without *, I haven't figured out how the mottle is being used visually, eg. I can't see a difference.
Lib_Texture_Scroll is everywhere, eg. in Corneria* ("good luck!" and canopy clouds texture in intro).
The text was updated successfully, but these errors were encountered:
Note, marked as
in the code
This is worth a significant amount of (CPU) perf whenever we have a
Lib_Texture_Scroll
orLib_Texture_Mottle
call, because libultraship has to regenerate the texture cache after it is invalidated.For
Lib_Texture_Scroll
, I believe invalidating thetexture
argument is probably correct. Easiest to check at the beginning of the Corneria level, look for the clouds in the Arwing cockpit canopy (clouds should scroll by on the canopy).For
Lib_Texture_Mottle
this is not clear, invalidating thedst
argument is normally correct, but sometimes this is not a texture uploaded to the RDP, eg. infox_hud.c : HUD_Texture_Warp
. This causes the invalidate to fail with resource not loaded; if that error is ignored, the invalidate fails and causes the texture not to be invalidated, generating graphical errors because the texture is updated on the CPU (Starship) side but not on the GPU (RDP/libultraship) side.It also turns out that the 64x64 Venom cloud texture is actually uploaded to the RDP as two 64x32 textures, and adding an implied invalidation to
Lib_Texture_Mottle
only invalidates one of those, despite operating on a 64x64 texture. It is not simple to find all cases where:...so I have added an explicit texture cache invalidate for the second (half of the) texture as a workaround. But perhaps a more elegant solution has the code track texture sizes, and implicitly do all necessary invalidations based on the texture size regardless of how it's uploaded to the RDP. This depends on how closely Starship wants to stay to the decompilation.
I have no PR currently, because I don't have a good way to verify that I'm not breaking anything:
Lib_Texture_Mottle
is used for Corneria, Aquas, Zoness* (water texture), Solar, System Map* (Venom). For the ones without *, I haven't figured out how the mottle is being used visually, eg. I can't see a difference.Lib_Texture_Scroll
is everywhere, eg. in Corneria* ("good luck!" and canopy clouds texture in intro).The text was updated successfully, but these errors were encountered: