From eae328dc192fdeb69f315e0085fdc74353df3848 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sun, 26 Jan 2025 15:46:40 -0700 Subject: [PATCH] nv2a: Move [un]swizzle_rect to swizzle.h --- hw/xbox/nv2a/pgraph/swizzle.c | 22 ---------------------- hw/xbox/nv2a/pgraph/swizzle.h | 14 ++++++++++---- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/hw/xbox/nv2a/pgraph/swizzle.c b/hw/xbox/nv2a/pgraph/swizzle.c index ccfe3d6912..1bdecd41f5 100644 --- a/hw/xbox/nv2a/pgraph/swizzle.c +++ b/hw/xbox/nv2a/pgraph/swizzle.c @@ -148,25 +148,3 @@ void unswizzle_box( off_z = (off_z - mask_z) & mask_z; } } - -void unswizzle_rect( - const uint8_t *src_buf, - unsigned int width, - unsigned int height, - uint8_t *dst_buf, - unsigned int pitch, - unsigned int bytes_per_pixel) -{ - unswizzle_box(src_buf, width, height, 1, dst_buf, pitch, 0, bytes_per_pixel); -} - -void swizzle_rect( - const uint8_t *src_buf, - unsigned int width, - unsigned int height, - uint8_t *dst_buf, - unsigned int pitch, - unsigned int bytes_per_pixel) -{ - swizzle_box(src_buf, width, height, 1, dst_buf, pitch, 0, bytes_per_pixel); -} diff --git a/hw/xbox/nv2a/pgraph/swizzle.h b/hw/xbox/nv2a/pgraph/swizzle.h index 78ff0740a4..d851d03562 100644 --- a/hw/xbox/nv2a/pgraph/swizzle.h +++ b/hw/xbox/nv2a/pgraph/swizzle.h @@ -43,20 +43,26 @@ void unswizzle_box( unsigned int slice_pitch, unsigned int bytes_per_pixel); -void unswizzle_rect( +static inline void unswizzle_rect( const uint8_t *src_buf, unsigned int width, unsigned int height, uint8_t *dst_buf, unsigned int pitch, - unsigned int bytes_per_pixel); + unsigned int bytes_per_pixel) +{ + unswizzle_box(src_buf, width, height, 1, dst_buf, pitch, 0, bytes_per_pixel); +} -void swizzle_rect( +static inline void swizzle_rect( const uint8_t *src_buf, unsigned int width, unsigned int height, uint8_t *dst_buf, unsigned int pitch, - unsigned int bytes_per_pixel); + unsigned int bytes_per_pixel) +{ + swizzle_box(src_buf, width, height, 1, dst_buf, pitch, 0, bytes_per_pixel); +} #endif