Skip to content

Commit

Permalink
Image: Fix possible unaligned movaps
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Feb 14, 2025
1 parent 6802f77 commit bceadad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion scripts/check_regression_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ def check_regression_test(baselinedir, testdir, name):

def check_regression_tests(baselinedir, testdir):
gamedirs = glob.glob(baselinedir + "/*", recursive=False)

gamedirs.sort(key=lambda x: os.path.basename(x))

success = 0
failure = 0

Expand Down
1 change: 1 addition & 0 deletions scripts/run_regression_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def run_regression_tests(runner, gamedirs, destdir, dump_interval, frames, paral
for gamedir in gamedirs:
paths += glob.glob(os.path.realpath(gamedir) + "/*.*", recursive=True)
gamepaths = list(filter(is_game_path, paths))
gamepaths.sort(key=lambda x: os.path.basename(x))

try:
if not os.path.isdir(destdir):
Expand Down
2 changes: 2 additions & 0 deletions src/duckstation-regtest/regtest_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,8 @@ std::string RegTestHost::GetFrameDumpPath(u32 frame)

int main(int argc, char* argv[])
{
CrashHandler::Install(&Bus::CleanupMemoryMap);

Error startup_error;
if (!System::PerformEarlyHardwareChecks(&startup_error) || !System::ProcessStartup(&startup_error))
{
Expand Down
7 changes: 2 additions & 5 deletions src/util/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ class Image
ALWAYS_INLINE ImageFormat GetFormat() const { return m_format; }
ALWAYS_INLINE const u8* GetPixels() const { return std::assume_aligned<VECTOR_ALIGNMENT>(m_pixels.get()); }
ALWAYS_INLINE u8* GetPixels() { return std::assume_aligned<VECTOR_ALIGNMENT>(m_pixels.get()); }
ALWAYS_INLINE const u8* GetRowPixels(u32 y) const
{
return std::assume_aligned<VECTOR_ALIGNMENT>(&m_pixels[y * m_pitch]);
}
ALWAYS_INLINE u8* GetRowPixels(u32 y) { return std::assume_aligned<VECTOR_ALIGNMENT>(&m_pixels[y * m_pitch]); }
ALWAYS_INLINE const u8* GetRowPixels(u32 y) const { return &m_pixels[y * m_pitch]; }
ALWAYS_INLINE u8* GetRowPixels(u32 y) { return &m_pixels[y * m_pitch]; }

u32 GetBlocksWide() const;
u32 GetBlocksHigh() const;
Expand Down

0 comments on commit bceadad

Please sign in to comment.